k3s: format with nixfmt-rfc-style
[NixPkgs.git] / maintainers / scripts / kde / collect-missing-deps.py
blobf3943338b57fbe26bd6b9d6a6624fe79b4b968a0
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i python3 -p python3
3 import pathlib
5 OK_MISSING = {
6 # we don't use precompiled QML
7 'Qt6QuickCompiler',
8 'Qt6QmlCompilerPlusPrivate',
9 # usually used for version numbers
10 'Git',
11 # useless by itself, will warn if something else is not found
12 'PkgConfig',
13 # license verification
14 'ReuseTool',
15 # dev only
16 'ClangFormat',
17 # doesn't exist
18 'Qt6X11Extras',
21 OK_MISSING_BY_PACKAGE = {
22 "angelfish": {
23 "Qt6Feedback", # we don't have it
25 "attica": {
26 "Python3", # only used for license checks
28 "discover": {
29 "rpm-ostree-1", # we don't have rpm-ostree (duh)
30 "Snapd", # we don't have snaps and probably never will
32 "elisa": {
33 "UPNPQT", # upstream says it's broken
35 "extra-cmake-modules": {
36 "Sphinx", # only used for docs, bloats closure size
37 "QCollectionGenerator"
39 "kio-extras-kf5": {
40 "KDSoapWSDiscoveryClient", # actually vendored on KF5 version
42 "kitinerary": {
43 "OsmTools", # used for map data updates, we use prebuilt
45 "kosmindoormap": {
46 "OsmTools", # same
47 "Protobuf",
49 "kpty": {
50 "UTEMPTER", # we don't have it and it probably wouldn't work anyway
52 "kpublictransport": {
53 "OsmTools", # same
54 "PolyClipping",
55 "Protobuf",
57 "krfb": {
58 "Qt6XkbCommonSupport", # not real
60 "kuserfeedback": {
61 "Qt6Svg", # all used for backend console stuff we don't ship
62 "QmlLint",
63 "Qt6Charts",
64 "FLEX",
65 "BISON",
66 "Php",
67 "PhpUnit",
69 "kwin": {
70 "display-info", # newer versions identify as libdisplay-info
72 "mlt": {
73 "Qt5", # intentionally disabled
74 "SWIG",
76 "plasma-desktop": {
77 "scim", # upstream is dead, not packaged in Nixpkgs
79 "powerdevil": {
80 "DDCUtil", # cursed, intentionally disabled
82 "pulseaudio-qt": {
83 "Qt6Qml", # tests only
84 "Qt6Quick",
86 "syntax-highlighting": {
87 "XercesC", # only used for extra validation at build time
91 def main():
92 here = pathlib.Path(__file__).parent.parent.parent.parent
93 logs = (here / "logs").glob("*.log")
95 for log in sorted(logs):
96 pname = log.stem
98 missing = []
99 is_in_block = False
100 with log.open(errors="replace") as fd:
101 for line in fd:
102 line = line.strip()
103 if line.startswith("-- No package '"):
104 package = line.removeprefix("-- No package '").removesuffix("' found")
105 missing.append(package)
106 if line == "-- The following OPTIONAL packages have not been found:" or line == "-- The following RECOMMENDED packages have not been found:":
107 is_in_block = True
108 elif line.startswith("--") and is_in_block:
109 is_in_block = False
110 elif line.startswith("*") and is_in_block:
111 package = line.removeprefix("* ")
112 missing.append(package)
114 missing = {
115 package
116 for package in missing
117 if not any(package.startswith(i) for i in OK_MISSING | OK_MISSING_BY_PACKAGE.get(pname, set()))
120 if missing:
121 print(pname + ":")
122 for line in missing:
123 print(" -", line)
124 print()
126 if __name__ == '__main__':
127 main()