at master 4.7 kB view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -i python3 -p python3 3import pathlib 4 5OK_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', 19} 20 21OK_MISSING_BY_PACKAGE = { 22 "angelfish": { 23 "Qt6Feedback", # we don't have it 24 }, 25 "attica": { 26 "Python3", # only used for license checks 27 }, 28 "discover": { 29 "ApkQt", # we don't have APK (duh) 30 "rpm-ostree-1", # we don't have rpm-ostree (duh) 31 "Snapd", # we don't have snaps and probably never will 32 "packagekitqt6", # intentionally disabled 33 }, 34 "elisa": { 35 "UPNPQT", # upstream says it's broken 36 }, 37 "extra-cmake-modules": { 38 "Sphinx", # only used for docs, bloats closure size 39 "QCollectionGenerator" 40 }, 41 "gwenview": { 42 "Tiff", # duplicate? 43 }, 44 "kio-extras-kf5": { 45 "KDSoapWSDiscoveryClient", # actually vendored on KF5 version 46 }, 47 "kitinerary": { 48 "OsmTools", # used for map data updates, we use prebuilt 49 }, 50 "kosmindoormap": { 51 "OsmTools", # same 52 "Protobuf", 53 }, 54 "kpty": { 55 "UTEMPTER", # we don't have it and it probably wouldn't work anyway 56 }, 57 "kpublictransport": { 58 "OsmTools", # same 59 "PolyClipping", 60 "Protobuf", 61 }, 62 "krfb": { 63 "Qt6XkbCommonSupport", # not real 64 }, 65 "ksystemstats": { 66 "Libcap", # used to call setcap at build time and nothing else 67 }, 68 "kuserfeedback": { 69 "Qt6Svg", # all used for backend console stuff we don't ship 70 "QmlLint", 71 "Qt6Charts", 72 "FLEX", 73 "BISON", 74 "Php", 75 "PhpUnit", 76 }, 77 "kwin": { 78 "display-info", # newer versions identify as libdisplay-info 79 "Libcap", # used to call setcap at build time and nothing else 80 }, 81 "kwin-x11": { 82 "Libcap", # used to call setcap at build time and nothing else 83 }, 84 "libksysguard": { 85 "Libcap", # used to call setcap at build time and nothing else 86 }, 87 "mlt": { 88 "Qt5", # intentionally disabled 89 "SWIG", 90 }, 91 "plasma-desktop": { 92 "scim", # upstream is dead, not packaged in Nixpkgs 93 "KAccounts6", # dead upstream 94 "AccountsQt6", # dead upstream 95 "signon-oauth2plugin", # dead upstream 96 }, 97 "plasma-dialer": { 98 "KTactileFeedback", # dead? 99 }, 100 "poppler-qt6": { 101 "gobject-introspection-1.0", # we don't actually want to build the GTK variant 102 "gdk-pixbuf-2.0", 103 "gtk+-3.0", 104 }, 105 "powerdevil": { 106 "DDCUtil", # cursed, intentionally disabled 107 "Libcap", # used to call setcap at build time and nothing else 108 }, 109 "print-manager": { 110 "PackageKitQt6", # used for auto-installing drivers which does not work for obvious reasons 111 }, 112 "pulseaudio-qt": { 113 "Qt6Qml", # tests only 114 "Qt6Quick", 115 }, 116 "skladnik": { 117 "POVRay", # too expensive to rerender all the assets 118 }, 119 "syntax-highlighting": { 120 "XercesC", # only used for extra validation at build time 121 } 122} 123 124def main(): 125 here = pathlib.Path(__file__).parent.parent.parent.parent 126 logs = (here / "logs").glob("*.log") 127 128 for log in sorted(logs): 129 pname = log.stem 130 131 missing = [] 132 is_in_block = False 133 with log.open(errors="replace") as fd: 134 for line in fd: 135 line = line.strip() 136 if line.startswith("-- No package '"): 137 package = line.removeprefix("-- No package '").removesuffix("' found") 138 missing.append(package) 139 if line == "-- The following OPTIONAL packages have not been found:" or line == "-- The following RECOMMENDED packages have not been found:": 140 is_in_block = True 141 elif line.startswith("--") and is_in_block: 142 is_in_block = False 143 elif line.startswith("*") and is_in_block: 144 package = line.removeprefix("* ") 145 missing.append(package) 146 147 missing = { 148 package 149 for package in missing 150 if not any(package.startswith(i) for i in OK_MISSING | OK_MISSING_BY_PACKAGE.get(pname, set())) 151 } 152 153 if missing: 154 print(pname + ":") 155 for line in missing: 156 print(" -", line) 157 print() 158 159if __name__ == '__main__': 160 main()