2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPackages
|
|
|
|
, mkDerivation
|
|
|
|
, perl
|
|
|
|
, qmake
|
|
|
|
, patches
|
|
|
|
, srcs
|
|
|
|
, pkgsHostTarget
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let inherit (lib) licenses maintainers platforms; in
|
|
|
|
|
|
|
|
args:
|
|
|
|
|
|
|
|
let
|
2021-05-28 09:39:13 +00:00
|
|
|
inherit (args) pname;
|
2021-05-20 23:08:51 +00:00
|
|
|
version = args.version or srcs.${pname}.version;
|
|
|
|
src = args.src or srcs.${pname}.src;
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
mkDerivation (args // {
|
2021-05-20 23:08:51 +00:00
|
|
|
inherit pname version src;
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = (args.patches or []) ++ (patches.${pname} or []);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeBuildInputs =
|
|
|
|
(args.nativeBuildInputs or []) ++ [
|
|
|
|
perl qmake
|
|
|
|
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
|
|
pkgsHostTarget.qt5.qtbase.dev
|
|
|
|
];
|
|
|
|
propagatedBuildInputs =
|
|
|
|
(lib.warnIf (args ? qtInputs) "qt5.qtModule's qtInputs argument is deprecated" args.qtInputs or []) ++
|
|
|
|
(args.propagatedBuildInputs or []);
|
|
|
|
} // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
|
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ] ++ (args.depsBuildBuild or []);
|
|
|
|
} // {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = args.outputs or [ "out" "dev" ];
|
|
|
|
setOutputFlags = args.setOutputFlags or false;
|
|
|
|
|
|
|
|
preHook = ''
|
|
|
|
. ${./hooks/move-qt-dev-tools.sh}
|
|
|
|
. ${./hooks/fix-qt-builtin-paths.sh}
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
${args.preConfigure or ""}
|
|
|
|
|
|
|
|
fixQtBuiltinPaths . '*.pr?'
|
2021-12-06 16:07:01 +00:00
|
|
|
'' + lib.optionalString (builtins.compareVersions "5.15.0" version <= 0)
|
|
|
|
# Note: We use ${version%%-*} to remove any tag from the end of the version
|
|
|
|
# string. Version tags are added by Nixpkgs maintainers and not reflected in
|
|
|
|
# the source version.
|
|
|
|
''
|
|
|
|
if [[ -z "$dontCheckQtModuleVersion" ]] \
|
|
|
|
&& grep -q '^MODULE_VERSION' .qmake.conf 2>/dev/null \
|
|
|
|
&& ! grep -q -F "''${version%%-*}" .qmake.conf 2>/dev/null
|
|
|
|
then
|
|
|
|
echo >&2 "error: could not find version ''${version%%-*} in .qmake.conf"
|
|
|
|
echo >&2 "hint: check .qmake.conf and update the package version in Nixpkgs"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -z "$dontSyncQt" && -f sync.profile ]]; then
|
|
|
|
syncqt.pl -version "''${version%%-*}"
|
|
|
|
fi
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
dontWrapQtApps = args.dontWrapQtApps or true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postFixup = ''
|
|
|
|
if [ -d "''${!outputDev}/lib/pkgconfig" ]; then
|
|
|
|
find "''${!outputDev}/lib/pkgconfig" -name '*.pc' | while read pc; do
|
|
|
|
sed -i "$pc" \
|
|
|
|
-e "/^prefix=/ c prefix=''${!outputLib}" \
|
|
|
|
-e "/^exec_prefix=/ c exec_prefix=''${!outputBin}" \
|
|
|
|
-e "/^includedir=/ c includedir=''${!outputDev}/include"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
moveQtDevTools
|
|
|
|
|
|
|
|
${args.postFixup or ""}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2022-01-03 16:56:52 +00:00
|
|
|
homepage = "https://www.qt.io";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A cross-platform application framework for C++";
|
2022-11-21 17:40:18 +00:00
|
|
|
license = with licenses; [ fdl13Plus gpl2Plus lgpl21Plus lgpl3Plus ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
} // (args.meta or {});
|
|
|
|
})
|