Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plasma 6 #286522

Merged
merged 24 commits into from
Feb 28, 2024
Merged

Plasma 6 #286522

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a06fbd0
kcolorpicker, kimageannotator: update, add Qt6 support
K900 Feb 28, 2024
f922d82
ksnip: fix build with versioned kImageAnnotator
K900 Feb 28, 2024
416c918
gwenview: fix build with versioned kImageAnnotator
K900 Feb 28, 2024
65ae5aa
accounts-qt, signond: add Qt6 support
K900 Feb 22, 2024
5dee2fe
xdg-utils-cxx: init at 1.0.1
K900 Feb 5, 2024
ff30345
libappimage: init at 1.0.4-5
K900 Feb 5, 2024
59aa3af
sddm: separate wrapping from building
K900 Feb 6, 2024
2248bdf
nixos/sddm: add extraPackages option
K900 Feb 6, 2024
3a52750
maintainers/scripts: add kde2nix tooling
K900 Feb 5, 2024
ea6f016
CODEOWNERS: add ownership for KDE stuff
K900 Feb 5, 2024
86a94a4
.editorconfig: ignore autogenerated KDE stuff
K900 Feb 5, 2024
fc40d63
pkgs/kde: init at 6.0.0 / 24.02.0, the JSON bits
K900 Feb 5, 2024
ce77225
pkgs/kde: init at 6.0.0 / 24.02.0, the Nix bits
K900 Feb 5, 2024
606c879
syncthingtray: support building with qt6
K900 Feb 12, 2024
8be79e5
nixos/pam/kwallet: rename option, allow setting package
K900 Feb 6, 2024
3f650b5
nixos/plasma6: init
K900 Feb 5, 2024
16f9637
nixos/tests: add plasma6
K900 Feb 5, 2024
ad1b1e8
nixos/gnupg: check for plasma 6
K900 Feb 9, 2024
7b74d9a
sddm: 0.20.0-unstable -> 0.21.0
K900 Feb 26, 2024
2614e40
sddm: add Wayland to the wrapper if enabled
K900 Feb 26, 2024
7d93928
nixos/release: add Plasma 6 ISO variant
K900 Feb 27, 2024
30c4a4b
kdePackages.itinerary: hack to fix build for now
K900 Feb 28, 2024
4cbb0ad
maintainers/scripts/kde/collect-logs: rewrite in Nu
K900 Feb 28, 2024
6a71118
nixos/doc: release note for Plasma 6
K900 Feb 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,7 @@ charset = unset
[lib/tests/*.plist]
indent_style = tab
insert_final_newline = unset

[pkgs/kde/generated/**]
insert_final_newline = unset
end_of_line = unset
K900 marked this conversation as resolved.
Show resolved Hide resolved
17 changes: 12 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,18 @@ pkgs/development/python-modules/buildcatrust/ @ajs124 @lukegb @mweinelt
# Licenses
/lib/licenses.nix @alyssais

# Qt / KDE
/pkgs/applications/kde @ttuegel
/pkgs/desktops/plasma-5 @ttuegel
/pkgs/development/libraries/kde-frameworks @ttuegel
/pkgs/development/libraries/qt-5 @ttuegel
# Qt
/pkgs/development/libraries/qt-5 @NixOS/qt-kde
K900 marked this conversation as resolved.
Show resolved Hide resolved
/pkgs/development/libraries/qt-6 @NixOS/qt-kde

# KDE / Plasma 5
/pkgs/applications/kde @NixOS/qt-kde
/pkgs/desktops/plasma-5 @NixOS/qt-kde
/pkgs/development/libraries/kde-frameworks @NixOS/qt-kde

# KDE / Plasma 6
/pkgs/kde @NixOS/qt-kde
/maintainers/scripts/kde @NixOS/qt-kde

# PostgreSQL and related stuff
/pkgs/servers/sql/postgresql @thoughtpolice @marsam
Expand Down
31 changes: 31 additions & 0 deletions maintainers/scripts/kde/collect-licenses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p gnutar jq reuse
set -eu
cd "$(dirname "$(readlink -f "$0")")"/../../..

TMPDIR=$(mktemp -d)
trap 'rm -rf $TMPDIR' EXIT

echo "# Prebuilding sources..."
nix-build -A kdePackages.sources --no-link || true

echo "# Evaluating sources..."
declare -A sources
eval "$(nix-instantiate --eval -A kdePackages.sources --json --strict | jq 'to_entries[] | "sources[" + .key + "]=" + .value' -r)"

echo "# Collecting licenses..."
for k in "${!sources[@]}"; do
echo "- Processing $k..."

if [ ! -f "${sources[$k]}" ]; then
echo "Not found!"
continue
fi

mkdir "$TMPDIR/$k"
tar -C "$TMPDIR/$k" -xf "${sources[$k]}"

(cd "$TMPDIR/$k"; reuse lint --json) | jq --arg name "$k" '{$name: .summary.used_licenses | sort}' -c > "$TMPDIR/$k.json"
done

jq -s 'add' -S "$TMPDIR"/*.json > pkgs/kde/generated/licenses.json
11 changes: 11 additions & 0 deletions maintainers/scripts/kde/collect-logs.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env nix-shell
#!nix-shell -i nu -p nushell
cd $"($env.FILE_PWD)/../../.."

mkdir logs
nix-env -qaP -f . -A kdePackages --json --out-path | from json | values | par-each { |it|
echo $"Processing ($it.pname)..."
if "outputs" in $it {
nix-store --read-log $it.outputs.out | save -f $"logs/($it.pname).log"
}
}
36 changes: 36 additions & 0 deletions maintainers/scripts/kde/collect-metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages(ps: [ ps.click ps.pyyaml ])"
import pathlib

import click

import utils

@click.command
@click.argument(
"repo-metadata",
type=click.Path(
exists=True,
file_okay=False,
resolve_path=True,
path_type=pathlib.Path,
),
)
@click.option(
"--nixpkgs",
type=click.Path(
exists=True,
file_okay=False,
resolve_path=True,
writable=True,
path_type=pathlib.Path,
),
default=pathlib.Path(__file__).parent.parent.parent.parent
)
def main(repo_metadata: pathlib.Path, nixpkgs: pathlib.Path):
metadata = utils.KDERepoMetadata.from_repo_metadata_checkout(repo_metadata)
out_dir = nixpkgs / "pkgs/kde/generated"
metadata.write_json(out_dir)

if __name__ == "__main__":
main() # type: ignore
127 changes: 127 additions & 0 deletions maintainers/scripts/kde/collect-missing-deps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p python3
import pathlib

OK_MISSING = {
# we don't use precompiled QML
'Qt6QuickCompiler',
'Qt6QmlCompilerPlusPrivate',
# usually used for version numbers
'Git',
# useless by itself, will warn if something else is not found
'PkgConfig',
# license verification
'ReuseTool',
# dev only
'ClangFormat',
# doesn't exist
'Qt6X11Extras',
}

OK_MISSING_BY_PACKAGE = {
"angelfish": {
"Qt6Feedback", # we don't have it
},
"attica": {
"Python3", # only used for license checks
},
"discover": {
"rpm-ostree-1", # we don't have rpm-ostree (duh)
"Snapd", # we don't have snaps and probably never will
},
"elisa": {
"UPNPQT", # upstream says it's broken
},
"extra-cmake-modules": {
"Sphinx", # only used for docs, bloats closure size
"QCollectionGenerator"
},
"kio-extras-kf5": {
"KDSoapWSDiscoveryClient", # actually vendored on KF5 version
},
"kitinerary": {
"OsmTools", # used for map data updates, we use prebuilt
},
"kosmindoormap": {
"OsmTools", # same
"Protobuf",
},
"kpty": {
"UTEMPTER", # we don't have it and it probably wouldn't work anyway
},
"kpublictransport": {
"OsmTools", # same
"PolyClipping",
"Protobuf",
},
"krfb": {
"Qt6XkbCommonSupport", # not real
},
"kuserfeedback": {
"Qt6Svg", # all used for backend console stuff we don't ship
"QmlLint",
"Qt6Charts",
"FLEX",
"BISON",
"Php",
"PhpUnit",
},
"kwin": {
"display-info", # newer versions identify as libdisplay-info
},
"mlt": {
"Qt5", # intentionally disabled
"SWIG",
},
"plasma-desktop": {
"scim", # upstream is dead, not packaged in Nixpkgs
},
"powerdevil": {
"DDCUtil", # cursed, intentionally disabled
},
"pulseaudio-qt": {
"Qt6Qml", # tests only
"Qt6Quick",
},
"syntax-highlighting": {
"XercesC", # only used for extra validation at build time
}
}

def main():
here = pathlib.Path(__file__).parent.parent.parent.parent
logs = (here / "logs").glob("*.log")

for log in sorted(logs):
pname = log.stem

missing = []
is_in_block = False
with log.open(errors="replace") as fd:
for line in fd:
line = line.strip()
if line.startswith("-- No package '"):
package = line.removeprefix("-- No package '").removesuffix("' found")
missing.append(package)
if line == "-- The following OPTIONAL packages have not been found:" or line == "-- The following RECOMMENDED packages have not been found:":
is_in_block = True
elif line.startswith("--") and is_in_block:
is_in_block = False
elif line.startswith("*") and is_in_block:
package = line.removeprefix("* ")
missing.append(package)

missing = {
package
for package in missing
if not any(package.startswith(i) for i in OK_MISSING | OK_MISSING_BY_PACKAGE.get(pname, set()))
}

if missing:
print(pname + ":")
for line in missing:
print(" -", line)
print()

if __name__ == '__main__':
main()
113 changes: 113 additions & 0 deletions maintainers/scripts/kde/generate-sources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages(ps: [ ps.beautifulsoup4 ps.click ps.httpx ps.jinja2 ps.pyyaml ])
import base64
import binascii
import json
import pathlib
from urllib.parse import urlparse

import bs4
import click
import httpx
import jinja2
K900 marked this conversation as resolved.
Show resolved Hide resolved

import utils


LEAF_TEMPLATE = jinja2.Template('''
{mkKdeDerivation}:
mkKdeDerivation {
pname = "{{ pname }}";
}
'''.strip())

ROOT_TEMPLATE = jinja2.Template('''
{callPackage}: {
{%- for p in packages %}
{{ p }} = callPackage ./{{ p }} {};
{%- endfor %}
}
'''.strip());

def to_sri(hash):
raw = binascii.unhexlify(hash)
b64 = base64.b64encode(raw).decode()
return f"sha256-{b64}"


@click.command
@click.argument(
"set",
type=click.Choice(["frameworks", "gear", "plasma"]),
required=True
)
@click.argument(
"version",
type=str,
required=True
)
@click.option(
"--nixpkgs",
type=click.Path(
exists=True,
file_okay=False,
resolve_path=True,
writable=True,
path_type=pathlib.Path,
),
default=pathlib.Path(__file__).parent.parent.parent.parent
)
def main(set: str, version: str, nixpkgs: pathlib.Path):
root_dir = nixpkgs / "pkgs/kde"
set_dir = root_dir / set
generated_dir = root_dir / "generated"
metadata = utils.KDERepoMetadata.from_json(generated_dir)

set_url = {
"frameworks": "kf",
"gear": "releases",
"plasma": "plasma",
}[set]

sources = httpx.get(f"https://kde.org/info/sources/source-{set_url}-{version}.html")
sources.raise_for_status()
bs = bs4.BeautifulSoup(sources.text, features="html.parser")

results = {}
for item in bs.select("tr")[1:]:
link = item.select_one("td:nth-child(1) a")
assert link

hash = item.select_one("td:nth-child(3) tt")
assert hash

project_name, version = link.text.rsplit("-", maxsplit=1)
if project_name not in metadata.projects_by_name:
print(f"Warning: unknown tarball: {project_name}")

results[project_name] = {
"version": version,
"url": "mirror://kde" + urlparse(link.attrs["href"]).path,
"hash": to_sri(hash.text)
}

pkg_dir = set_dir / project_name
pkg_file = pkg_dir / "default.nix"
if not pkg_file.exists():
print(f"Generated new package: {set}/{project_name}")
pkg_dir.mkdir(parents=True, exist_ok=True)
with pkg_file.open("w") as fd:
fd.write(LEAF_TEMPLATE.render(pname=project_name) + "\n")

set_dir.mkdir(parents=True, exist_ok=True)
with (set_dir / "default.nix").open("w") as fd:
fd.write(ROOT_TEMPLATE.render(packages=results.keys()) + "\n")

sources_dir = generated_dir / "sources"
sources_dir.mkdir(parents=True, exist_ok=True)
with (sources_dir / f"{set}.json").open("w") as fd:
json.dump(results, fd, indent=2)


if __name__ == "__main__":
main() # type: ignore
Loading
Loading