11 dependencies = (lib.importJSON ../generated/dependencies.json).dependencies;
12 projectInfo = lib.importJSON ../generated/projects.json;
14 licenseInfo = lib.importJSON ../generated/licenses.json;
16 (lib.mapAttrs' (_: v: {
17 name = v.spdxId or "unknown";
21 # https://community.kde.org/Policies/Licensing_Policy
22 "LicenseRef-KDE-Accepted-GPL" = lib.licenses.gpl3Plus;
23 "LicenseRef-KFQF-Accepted-GPL" = lib.licenses.gpl3Plus;
24 "LicenseRef-KDE-Accepted-LGPL" = lib.licenses.lgpl3Plus;
26 # https://sjfonts.sourceforge.net/
27 "LicenseRef-SJFonts" = lib.licenses.gpl2Plus;
29 # https://invent.kde.org/education/kiten/-/blob/master/LICENSES/LicenseRef-EDRDG.txt
30 "LicenseRef-EDRDG" = lib.licenses.cc-by-sa-30;
32 # https://invent.kde.org/kdevelop/kdevelop/-/blob/master/LICENSES/LicenseRef-MIT-KDevelop-Ideal.txt
33 "LicenseRef-MIT-KDevelop-Ideal" = lib.licenses.mit;
37 fullName = "FSF All Permissive License";
42 fullName = "FSF Unlimited License (with License Retention)";
46 spdxId = "W3C-20150513";
47 fullName = "W3C Software Notice and Document License (2015-05-13)";
50 "LGPL" = lib.licenses.lgpl2Plus;
52 # Technically not exact
53 "bzip2-1.0.6" = lib.licenses.bsdOriginal;
56 "ICS" = lib.licenses.isc;
57 "BSD-3-clause" = lib.licenses.bsd3;
59 # These are only relevant to Qt commercial users
60 "Qt-Commercial-exception-1.0" = null;
61 "LicenseRef-Qt-Commercial" = null;
62 "LicenseRef-Qt-Commercial-exception-1.0" = null;
65 "Qt-GPL-exception-1.0" = null;
66 "LicenseRef-Qt-LGPL-exception-1.0" = null;
67 "Qt-LGPL-exception-1.1" = null;
68 "LicenseRef-Qt-exception" = null;
69 "GCC-exception-3.1" = null;
70 "Bison-exception-2.2" = null;
71 "Font-exception-2.0" = null;
75 moveDevHook = makeSetupHook { name = "kf6-move-dev-hook"; } ./move-dev-hook.sh;
79 version ? self.sources.${pname}.version,
80 src ? self.sources.${pname},
81 extraBuildInputs ? [ ],
82 extraNativeBuildInputs ? [ ],
83 extraPropagatedBuildInputs ? [ ],
84 extraCmakeFlags ? [ ],
85 excludeDependencies ? [ ],
89 depNames = dependencies.${pname} or [ ];
90 filteredDepNames = builtins.filter (dep: !(builtins.elem dep excludeDependencies)) depNames;
92 # FIXME(later): this is wrong for cross, some of these things really need to go into nativeBuildInputs,
93 # but cross is currently very broken anyway, so we can figure this out later.
94 deps = map (dep: self.${dep}) filteredDepNames;
99 pretty = lib.generators.toPretty { };
100 duplicates = builtins.filter (dep: (builtins.elem (lib.getName dep) filteredDepNames)) attrValue;
102 if duplicates != [ ] then
103 lib.warn "Duplicate dependencies in ${attrName} of package ${pname}: ${pretty duplicates}"
107 traceAllDuplicateDeps = lib.flip lib.pipe [
108 (traceDuplicateDeps "extraBuildInputs" extraBuildInputs)
109 (traceDuplicateDeps "extraPropagatedBuildInputs" extraPropagatedBuildInputs)
121 nativeBuildInputs = [
125 ] ++ extraNativeBuildInputs;
126 buildInputs = [ qt6.qtbase ] ++ extraBuildInputs;
128 # FIXME: figure out what to propagate here
129 propagatedBuildInputs = deps ++ extraPropagatedBuildInputs;
133 cmakeFlags = [ "-DQT_MAJOR_VERSION=6" ] ++ extraCmakeFlags;
135 separateDebugInfo = true;
137 env.LANG = "C.UTF-8";
140 cleanArgs = builtins.removeAttrs args [
142 "extraNativeBuildInputs"
143 "extraPropagatedBuildInputs"
145 "excludeDependencies"
150 description = projectInfo.${pname}.description;
151 homepage = "https://invent.kde.org/${projectInfo.${pname}.repo_path}";
152 license = lib.filter (l: l != null) (map (l: licensesBySpdxId.${l}) licenseInfo.${pname});
153 maintainers = lib.teams.qt-kde.members;
154 # Platforms are currently limited to what upstream tests in CI, but can be extended if there's interest.
155 platforms = lib.platforms.linux ++ lib.platforms.freebsd;
156 } // (args.meta or { });
158 pos = builtins.unsafeGetAttrPos "pname" args;
160 traceAllDuplicateDeps (stdenv.mkDerivation (defaultArgs // cleanArgs // { inherit meta pos; }))