9 dependencies = (lib.importJSON ../generated/dependencies.json).dependencies;
10 projectInfo = lib.importJSON ../generated/projects.json;
12 licenseInfo = lib.importJSON ../generated/licenses.json;
14 (lib.mapAttrs' (_: v: {
15 name = v.spdxId or "unknown";
20 # https://community.kde.org/Policies/Licensing_Policy
21 "LicenseRef-KDE-Accepted-GPL" = lib.licenses.gpl3Plus;
22 "LicenseRef-KFQF-Accepted-GPL" = lib.licenses.gpl3Plus;
23 "LicenseRef-KDE-Accepted-LGPL" = lib.licenses.lgpl3Plus;
25 # https://sjfonts.sourceforge.net/
26 "LicenseRef-SJFonts" = lib.licenses.gpl2Plus;
28 # https://invent.kde.org/education/kiten/-/blob/master/LICENSES/LicenseRef-EDRDG.txt
29 "LicenseRef-EDRDG" = lib.licenses.cc-by-sa-30;
31 # https://invent.kde.org/kdevelop/kdevelop/-/blob/master/LICENSES/LicenseRef-MIT-KDevelop-Ideal.txt
32 "LicenseRef-MIT-KDevelop-Ideal" = lib.licenses.mit;
36 fullName = "FSF All Permissive License";
41 fullName = "FSF Unlimited License (with License Retention)";
45 spdxId = "W3C-20150513";
46 fullName = "W3C Software Notice and Document License (2015-05-13)";
49 # Technically not exact
50 "bzip2-1.0.6" = lib.licenses.bsdOriginal;
53 "ICS" = lib.licenses.isc;
55 # These are only relevant to Qt commercial users
56 "Qt-Commercial-exception-1.0" = null;
57 "LicenseRef-Qt-Commercial" = null;
58 "LicenseRef-Qt-Commercial-exception-1.0" = null;
61 "Qt-GPL-exception-1.0" = null;
62 "LicenseRef-Qt-LGPL-exception-1.0" = null;
63 "Qt-LGPL-exception-1.1" = null;
64 "LicenseRef-Qt-exception" = null;
65 "GCC-exception-3.1" = null;
66 "Bison-exception-2.2" = null;
67 "Font-exception-2.0" = null;
71 moveDevHook = makeSetupHook {name = "kf6-move-dev-hook";} ./move-dev-hook.sh;
75 version ? self.sources.${pname}.version,
76 src ? self.sources.${pname},
77 extraBuildInputs ? [],
78 extraNativeBuildInputs ? [],
79 extraPropagatedBuildInputs ? [],
81 excludeDependencies ? [],
84 depNames = dependencies.${pname} or [];
85 filteredDepNames = builtins.filter (dep: !(builtins.elem dep excludeDependencies)) depNames;
87 # FIXME(later): this is wrong for cross, some of these things really need to go into nativeBuildInputs,
88 # but cross is currently very broken anyway, so we can figure this out later.
89 deps = map (dep: self.${dep}) filteredDepNames;
94 outputs = ["out" "dev" "devtools"];
96 nativeBuildInputs = [cmake qt6.wrapQtAppsHook moveDevHook] ++ extraNativeBuildInputs;
97 buildInputs = [qt6.qtbase] ++ extraBuildInputs;
99 # FIXME: figure out what to propagate here
100 propagatedBuildInputs = deps ++ extraPropagatedBuildInputs;
104 cmakeFlags = ["-DQT_MAJOR_VERSION=6"] ++ extraCmakeFlags;
106 separateDebugInfo = true;
108 env.LANG = "C.UTF-8";
111 cleanArgs = builtins.removeAttrs args [
113 "extraNativeBuildInputs"
114 "extraPropagatedBuildInputs"
116 "excludeDependencies"
121 description = projectInfo.${pname}.description;
122 homepage = "https://invent.kde.org/${projectInfo.${pname}.repo_path}";
123 license = lib.filter (l: l != null) (map (l: licensesBySpdxId.${l}) licenseInfo.${pname});
124 maintainers = lib.teams.qt-kde.members;
125 # Platforms are currently limited to what upstream tests in CI, but can be extended if there's interest.
126 platforms = lib.platforms.linux ++ lib.platforms.freebsd;
127 } // (args.meta or { });
129 pos = builtins.unsafeGetAttrPos "pname" args;
131 stdenv.mkDerivation (defaultArgs // cleanArgs // { inherit meta pos; })