2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, src
|
|
|
|
, patches ? [ ]
|
|
|
|
, version
|
|
|
|
, coreutils
|
|
|
|
, bison
|
|
|
|
, flex
|
|
|
|
, gdb
|
|
|
|
, gperf
|
|
|
|
, lndir
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, which
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, ccache
|
|
|
|
, xmlstarlet
|
|
|
|
, libproxy
|
|
|
|
, xorg
|
|
|
|
, zstd
|
|
|
|
, double-conversion
|
|
|
|
, util-linux
|
|
|
|
, systemd
|
2023-01-11 07:51:40 +00:00
|
|
|
, systemdSupport ? stdenv.isLinux
|
2022-06-16 17:23:12 +00:00
|
|
|
, libb2
|
|
|
|
, md4c
|
|
|
|
, mtdev
|
|
|
|
, lksctp-tools
|
|
|
|
, libselinux
|
|
|
|
, libsepol
|
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, libthai
|
|
|
|
, libdrm
|
|
|
|
, libdatrie
|
|
|
|
, lttng-ust
|
|
|
|
, libepoxy
|
|
|
|
, libiconv
|
|
|
|
, dbus
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, glib
|
|
|
|
, harfbuzz
|
|
|
|
, icu
|
|
|
|
, libX11
|
|
|
|
, libXcomposite
|
|
|
|
, libXext
|
|
|
|
, libXi
|
|
|
|
, libXrender
|
|
|
|
, libinput
|
|
|
|
, libjpeg
|
|
|
|
, libpng
|
|
|
|
, libxcb
|
|
|
|
, libxkbcommon
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, openssl
|
|
|
|
, pcre
|
|
|
|
, pcre2
|
|
|
|
, sqlite
|
|
|
|
, udev
|
|
|
|
, xcbutil
|
|
|
|
, xcbutilimage
|
|
|
|
, xcbutilkeysyms
|
|
|
|
, xcbutilrenderutil
|
|
|
|
, xcbutilwm
|
|
|
|
, zlib
|
|
|
|
, at-spi2-core
|
|
|
|
, unixODBC
|
|
|
|
, unixODBCDrivers
|
2022-12-17 10:02:37 +00:00
|
|
|
# darwin
|
|
|
|
, xcbuild
|
|
|
|
, AGL
|
|
|
|
, AVFoundation
|
|
|
|
, AppKit
|
|
|
|
, GSS
|
|
|
|
, MetalKit
|
2022-06-16 17:23:12 +00:00
|
|
|
# optional dependencies
|
|
|
|
, cups
|
|
|
|
, libmysqlclient
|
|
|
|
, postgresql
|
|
|
|
, withGtk3 ? false
|
|
|
|
, dconf
|
|
|
|
, gtk3
|
|
|
|
# options
|
2022-12-17 10:02:37 +00:00
|
|
|
, libGLSupported ? stdenv.isLinux
|
2022-06-16 17:23:12 +00:00
|
|
|
, libGL
|
|
|
|
, debug ? false
|
|
|
|
, developerBuild ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
debugSymbols = debug || developerBuild;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "qtbase";
|
|
|
|
|
|
|
|
inherit src version;
|
|
|
|
|
|
|
|
debug = debugSymbols;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
libxml2
|
|
|
|
libxslt
|
|
|
|
openssl
|
|
|
|
sqlite
|
|
|
|
zlib
|
|
|
|
unixODBC
|
|
|
|
# Text rendering
|
|
|
|
harfbuzz
|
|
|
|
icu
|
|
|
|
# Image formats
|
|
|
|
libjpeg
|
|
|
|
libpng
|
|
|
|
pcre2
|
|
|
|
pcre
|
|
|
|
libproxy
|
|
|
|
zstd
|
|
|
|
double-conversion
|
|
|
|
libb2
|
|
|
|
md4c
|
2022-12-17 10:02:37 +00:00
|
|
|
dbus
|
|
|
|
glib
|
|
|
|
# unixODBC drivers
|
|
|
|
unixODBCDrivers.psql
|
|
|
|
unixODBCDrivers.sqlite
|
|
|
|
unixODBCDrivers.mariadb
|
2023-01-11 07:51:40 +00:00
|
|
|
] ++ lib.optionals systemdSupport [
|
2022-12-17 10:02:37 +00:00
|
|
|
systemd
|
2023-01-20 10:41:00 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
util-linux
|
2022-06-16 17:23:12 +00:00
|
|
|
mtdev
|
|
|
|
lksctp-tools
|
|
|
|
libselinux
|
|
|
|
libsepol
|
|
|
|
lttng-ust
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
|
|
|
libthai
|
|
|
|
libdrm
|
|
|
|
libdatrie
|
|
|
|
udev
|
|
|
|
# Text rendering
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
# X11 libs
|
|
|
|
libX11
|
|
|
|
libXcomposite
|
|
|
|
libXext
|
|
|
|
libXi
|
|
|
|
libXrender
|
|
|
|
libxcb
|
|
|
|
libxkbcommon
|
|
|
|
xcbutil
|
|
|
|
xcbutilimage
|
|
|
|
xcbutilkeysyms
|
|
|
|
xcbutilrenderutil
|
|
|
|
xcbutilwm
|
|
|
|
xorg.libXdmcp
|
|
|
|
xorg.libXtst
|
|
|
|
xorg.xcbutilcursor
|
|
|
|
libepoxy
|
2022-12-17 10:02:37 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
AGL
|
|
|
|
AVFoundation
|
|
|
|
AppKit
|
|
|
|
GSS
|
|
|
|
MetalKit
|
|
|
|
] ++ lib.optional libGLSupported libGL;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
python3
|
|
|
|
at-spi2-core
|
2022-12-17 10:02:37 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
2022-06-16 17:23:12 +00:00
|
|
|
libinput
|
2022-12-17 10:02:37 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
|
|
|
|
AppKit
|
2022-06-16 17:23:12 +00:00
|
|
|
]
|
|
|
|
++ lib.optional withGtk3 gtk3
|
|
|
|
++ lib.optional developerBuild gdb
|
|
|
|
++ lib.optional (cups != null) cups
|
|
|
|
++ lib.optional (libmysqlclient != null) libmysqlclient
|
|
|
|
++ lib.optional (postgresql != null) postgresql;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which cmake xmlstarlet ninja ];
|
|
|
|
|
|
|
|
propagatedNativeBuildInputs = [ lndir ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
inherit patches;
|
|
|
|
|
|
|
|
# https://bugreports.qt.io/browse/QTBUG-97568
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/corelib/CMakeLists.txt --replace /bin/ls ${coreutils}/bin/ls
|
2022-12-17 10:02:37 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace cmake/QtAutoDetect.cmake --replace "/usr/bin/xcrun" "${xcbuild}/bin/xcrun"
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
|
|
|
|
fix_qt_module_paths = ../hooks/fix-qt-module-paths.sh;
|
|
|
|
preHook = ''
|
|
|
|
. "$fix_qt_builtin_paths"
|
|
|
|
. "$fix_qt_module_paths"
|
|
|
|
. ${../hooks/move-qt-dev-tools.sh}
|
|
|
|
. ${../hooks/fix-qmake-libtool.sh}
|
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
qtPluginPrefix = "lib/qt-6/plugins";
|
|
|
|
qtQmlPrefix = "lib/qt-6/qml";
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DINSTALL_PLUGINSDIR=${qtPluginPrefix}"
|
|
|
|
"-DINSTALL_QMLDIR=${qtQmlPrefix}"
|
|
|
|
"-DQT_FEATURE_libproxy=ON"
|
|
|
|
"-DQT_FEATURE_system_sqlite=ON"
|
|
|
|
"-DQT_FEATURE_openssl_linked=ON"
|
2022-12-17 10:02:37 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
|
|
|
"-DQT_FEATURE_sctp=ON"
|
2023-01-11 07:51:40 +00:00
|
|
|
"-DQT_FEATURE_journald=${if systemdSupport then "ON" else "OFF"}"
|
2022-12-17 10:02:37 +00:00
|
|
|
"-DQT_FEATURE_vulkan=ON"
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-02-09 11:40:11 +00:00
|
|
|
# error: 'path' is unavailable: introduced in macOS 10.15
|
|
|
|
"-DQT_FEATURE_cxx17_filesystem=OFF"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
NIX_LDFLAGS = toString (lib.optionals stdenv.isDarwin [
|
|
|
|
# Undefined symbols for architecture arm64: "___gss_c_nt_hostbased_service_oid_desc"
|
|
|
|
"-framework GSS"
|
|
|
|
]);
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-10-21 18:38:19 +00:00
|
|
|
moveToOutput "mkspecs" "$dev"
|
|
|
|
'';
|
|
|
|
|
|
|
|
devTools = [
|
|
|
|
"libexec/moc"
|
|
|
|
"libexec/rcc"
|
|
|
|
"libexec/syncqt.pl"
|
|
|
|
"libexec/qlalr"
|
|
|
|
"libexec/ensure_pro_file.cmake"
|
|
|
|
"libexec/cmake_automoc_parser"
|
|
|
|
"libexec/qvkgen"
|
|
|
|
"libexec/tracegen"
|
|
|
|
"libexec/uic"
|
|
|
|
"bin/fixqt4headers.pl"
|
|
|
|
"bin/moc"
|
|
|
|
"bin/qdbuscpp2xml"
|
|
|
|
"bin/qdbusxml2cpp"
|
|
|
|
"bin/qlalr"
|
|
|
|
"bin/qmake"
|
2023-02-02 18:25:31 +00:00
|
|
|
"bin/qmake6"
|
|
|
|
"bin/qt-cmake"
|
|
|
|
"bin/qt-cmake-private"
|
|
|
|
"bin/qt-cmake-private-install.cmake"
|
|
|
|
"bin/qt-cmake-standalone-test"
|
2022-10-21 18:38:19 +00:00
|
|
|
"bin/rcc"
|
|
|
|
"bin/syncqt.pl"
|
|
|
|
"bin/uic"
|
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# Don't retain build-time dependencies like gdb.
|
|
|
|
sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
|
|
|
|
fixQtModulePaths "''${!outputDev}/mkspecs/modules"
|
|
|
|
fixQtBuiltinPaths "''${!outputDev}" '*.pr?'
|
|
|
|
|
|
|
|
# Move development tools to $dev
|
|
|
|
moveQtDevTools
|
|
|
|
moveToOutput libexec "$dev"
|
|
|
|
|
|
|
|
# fixup .pc file (where to find 'moc' etc.)
|
2023-01-20 10:41:00 +00:00
|
|
|
if [ -f "$dev/lib/pkgconfig/Qt6Core.pc" ]; then
|
|
|
|
sed -i "$dev/lib/pkgconfig/Qt6Core.pc" \
|
2023-02-02 18:25:31 +00:00
|
|
|
-e "/^bindir=/ c bindir=$dev/bin" \
|
|
|
|
-e "/^libexecdir=/ c libexecdir=$dev/libexec"
|
2023-01-20 10:41:00 +00:00
|
|
|
fi
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
patchShebangs $out $dev
|
2023-01-20 10:41:00 +00:00
|
|
|
|
|
|
|
# QTEST_ASSERT and other macros keeps runtime reference to qtbase.dev
|
|
|
|
if [ -f "$dev/include/QtTest/qtestassert.h" ]; then
|
|
|
|
substituteInPlace "$dev/include/QtTest/qtestassert.h" --replace "__FILE__" "__BASE_FILE__"
|
|
|
|
fi
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = debugSymbols;
|
|
|
|
|
|
|
|
setupHook = ../hooks/qtbase-setup-hook.sh;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://www.qt.io/";
|
|
|
|
description = "A cross-platform application framework for C++";
|
2022-11-21 17:40:18 +00:00
|
|
|
license = with licenses; [ fdl13Plus gpl2Plus lgpl21Plus lgpl3Plus ];
|
2022-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ milahu nickcao LunNova ];
|
2022-12-17 10:02:37 +00:00
|
|
|
platforms = platforms.unix;
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|