From 73e915563950dc682aa2f7a47b9abd138a660d06 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Mon, 19 Feb 2024 21:35:44 -0500 Subject: [PATCH] qt6: replace stdenv.is* with stdenv.hostPlatform.is* --- pkgs/development/libraries/qt-6/default.nix | 6 ++--- .../libraries/qt-6/modules/qtbase.nix | 22 +++++++++---------- .../libraries/qt-6/modules/qtconnectivity.nix | 4 ++-- .../libraries/qt-6/modules/qtmultimedia.nix | 10 ++++----- .../qt-6/modules/qtquick3dphysics.nix | 2 +- .../libraries/qt-6/modules/qtserialport.nix | 2 +- .../libraries/qt-6/modules/qtspeech.nix | 4 ++-- .../libraries/qt-6/modules/qttools.nix | 2 +- .../libraries/qt-6/modules/qtwebengine.nix | 18 +++++++-------- .../libraries/qt-6/modules/qtwebview.nix | 4 ++-- pkgs/development/libraries/qt-6/qtModule.nix | 2 +- 11 files changed, 38 insertions(+), 38 deletions(-) diff --git a/pkgs/development/libraries/qt-6/default.nix b/pkgs/development/libraries/qt-6/default.nix index 3f1cf19c29abf..8acc044894bca 100644 --- a/pkgs/development/libraries/qt-6/default.nix +++ b/pkgs/development/libraries/qt-6/default.nix @@ -32,7 +32,7 @@ let callPackage = self.newScope ({ inherit (self) qtModule; inherit srcs python3; - stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; + stdenv = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; }); in { @@ -109,7 +109,7 @@ let qtwebengine qtwebsockets qtwebview - ] ++ lib.optionals (!stdenv.isDarwin) [ qtwayland libglvnd ])) { }; + ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ qtwayland libglvnd ])) { }; qt3d = callPackage ./modules/qt3d.nix { }; qt5compat = callPackage ./modules/qt5compat.nix { }; @@ -163,7 +163,7 @@ let MediaAccessibility MediaPlayer MetalKit Network OpenDirectory Quartz ReplayKit SecurityInterface Vision; qtModule = callPackage ({ qtModule }: qtModule.override { - stdenv = if stdenv.isDarwin + stdenv = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv { darwinMinVersion = "10.13"; darwinSdkVersion = "11.0"; } else stdenv; }) { }; diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index 4b541ca6fec2a..26fdeceda61fb 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -21,7 +21,7 @@ , double-conversion , util-linux , systemd -, systemdSupport ? stdenv.isLinux +, systemdSupport ? stdenv.hostPlatform.isLinux , libb2 , md4c , mtdev @@ -87,7 +87,7 @@ , dconf , gtk3 # options -, libGLSupported ? stdenv.isLinux +, libGLSupported ? stdenv.hostPlatform.isLinux , libGL , debug ? false , developerBuild ? false @@ -132,7 +132,7 @@ stdenv.mkDerivation rec { unixODBCDrivers.mariadb ] ++ lib.optionals systemdSupport [ systemd - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux mtdev lksctp-tools @@ -165,7 +165,7 @@ stdenv.mkDerivation rec { xorg.libXtst xorg.xcbutilcursor libepoxy - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ AGL AVFoundation AppKit @@ -178,9 +178,9 @@ stdenv.mkDerivation rec { buildInputs = [ at-spi2-core - ] ++ lib.optionals (!stdenv.isDarwin) [ + ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ libinput - ] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ AppKit CoreBluetooth ] @@ -191,7 +191,7 @@ stdenv.mkDerivation rec { ++ lib.optional (postgresql != null) postgresql; nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which cmake xmlstarlet ninja ] - ++ lib.optionals stdenv.isDarwin [ moveBuildTree ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; propagatedNativeBuildInputs = [ lndir ]; @@ -204,7 +204,7 @@ stdenv.mkDerivation rec { # https://bugreports.qt.io/browse/QTBUG-97568 postPatch = '' substituteInPlace src/corelib/CMakeLists.txt --replace-fail "/bin/ls" "${coreutils}/bin/ls" - '' + lib.optionalString stdenv.isDarwin '' + '' + lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace cmake/QtPublicAppleHelpers.cmake --replace-fail "/usr/bin/xcrun" "${xcbuild}/bin/xcrun" ''; @@ -225,16 +225,16 @@ stdenv.mkDerivation rec { "-DQT_FEATURE_libproxy=ON" "-DQT_FEATURE_system_sqlite=ON" "-DQT_FEATURE_openssl_linked=ON" - ] ++ lib.optionals (!stdenv.isDarwin) [ + ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "-DQT_FEATURE_sctp=ON" "-DQT_FEATURE_journald=${if systemdSupport then "ON" else "OFF"}" "-DQT_FEATURE_vulkan=ON" - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ # error: 'path' is unavailable: introduced in macOS 10.15 "-DQT_FEATURE_cxx17_filesystem=OFF" ] ++ lib.optional (qttranslations != null) "-DINSTALL_TRANSLATIONSDIR=${qttranslations}/translations"; - env.NIX_LDFLAGS = toString (lib.optionals stdenv.isDarwin [ + env.NIX_LDFLAGS = toString (lib.optionals stdenv.hostPlatform.isDarwin [ # Undefined symbols for architecture arm64: "___gss_c_nt_hostbased_service_oid_desc" "-framework GSS" ]); diff --git a/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix b/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix index 46d8f925beb0a..126920dd50516 100644 --- a/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix +++ b/pkgs/development/libraries/qt-6/modules/qtconnectivity.nix @@ -12,11 +12,11 @@ qtModule { pname = "qtconnectivity"; nativeBuildInputs = [ pkg-config ]; - buildInputs = lib.optionals stdenv.isLinux [ bluez ]; + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ bluez ]; propagatedBuildInputs = [ qtbase qtdeclarative - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ IOBluetooth PCSC ]; diff --git a/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix index f77fdac059ce6..5c9a0e58a82c9 100644 --- a/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix +++ b/pkgs/development/libraries/qt-6/modules/qtmultimedia.nix @@ -28,15 +28,15 @@ qtModule { pname = "qtmultimedia"; nativeBuildInputs = [ pkg-config ]; buildInputs = [ libunwind orc ffmpeg_6 ] - ++ lib.optionals stdenv.isLinux [ libpulseaudio elfutils alsa-lib wayland libXrandr libva ]; + ++ lib.optionals stdenv.hostPlatform.isLinux [ libpulseaudio elfutils alsa-lib wayland libXrandr libva ]; propagatedBuildInputs = [ qtbase qtdeclarative qtsvg qtshadertools qtquick3d ] - ++ lib.optionals stdenv.isLinux [ gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi ] - ++ lib.optionals stdenv.isDarwin [ VideoToolbox ]; + ++ lib.optionals stdenv.hostPlatform.isLinux [ gstreamer gst-plugins-base gst-plugins-good gst-libav gst-vaapi ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ VideoToolbox ]; cmakeFlags = [ "-DENABLE_DYNAMIC_RESOLVE_VAAPI_SYMBOLS=0" ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin + env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-include AudioToolbox/AudioToolbox.h"; - NIX_LDFLAGS = lib.optionalString stdenv.isDarwin + NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework AudioToolbox"; } diff --git a/pkgs/development/libraries/qt-6/modules/qtquick3dphysics.nix b/pkgs/development/libraries/qt-6/modules/qtquick3dphysics.nix index 05d121cd9b78c..92d676f7c8e2e 100644 --- a/pkgs/development/libraries/qt-6/modules/qtquick3dphysics.nix +++ b/pkgs/development/libraries/qt-6/modules/qtquick3dphysics.nix @@ -8,6 +8,6 @@ qtModule { pname = "qtquick3dphysics"; propagatedBuildInputs = [ qtbase qtquick3d ]; - env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) + env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) "-faligned-allocation"; } diff --git a/pkgs/development/libraries/qt-6/modules/qtserialport.nix b/pkgs/development/libraries/qt-6/modules/qtserialport.nix index 27b9eb9c1915a..00f668ef5631d 100644 --- a/pkgs/development/libraries/qt-6/modules/qtserialport.nix +++ b/pkgs/development/libraries/qt-6/modules/qtserialport.nix @@ -9,5 +9,5 @@ qtModule { pname = "qtserialport"; nativeBuildInputs = [ pkg-config ]; - propagatedBuildInputs = [ qtbase ] ++ lib.optionals stdenv.isLinux [ udev ]; + propagatedBuildInputs = [ qtbase ] ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ]; } diff --git a/pkgs/development/libraries/qt-6/modules/qtspeech.nix b/pkgs/development/libraries/qt-6/modules/qtspeech.nix index 77c08fa91951a..15672de8b9806 100644 --- a/pkgs/development/libraries/qt-6/modules/qtspeech.nix +++ b/pkgs/development/libraries/qt-6/modules/qtspeech.nix @@ -13,7 +13,7 @@ qtModule { pname = "qtspeech"; nativeBuildInputs = [ pkg-config ]; - buildInputs = lib.optionals stdenv.isLinux [ flite alsa-lib speechd ]; + buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ flite alsa-lib speechd ]; propagatedBuildInputs = [ qtbase qtmultimedia ] - ++ lib.optionals stdenv.isDarwin [ Cocoa ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ]; } diff --git a/pkgs/development/libraries/qt-6/modules/qttools.nix b/pkgs/development/libraries/qt-6/modules/qttools.nix index a1aa1026e57b3..f13500d65464f 100644 --- a/pkgs/development/libraries/qt-6/modules/qttools.nix +++ b/pkgs/development/libraries/qt-6/modules/qttools.nix @@ -16,7 +16,7 @@ qtModule { llvmPackages.llvm ]; propagatedBuildInputs = [ qtbase qtdeclarative ] - ++ lib.optionals stdenv.isDarwin [ cups ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ cups ]; patches = [ ../patches/qttools-paths.patch ]; diff --git a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix index 64b5b9738caa6..f07aeefa0be00 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebengine.nix @@ -105,9 +105,9 @@ qtModule { which gn nodejs - ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ autoSignDarwinBinariesHook - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ bootstrap_cmds cctools xcbuild @@ -158,14 +158,14 @@ qtModule { --replace "QLibraryInfo::path(QLibraryInfo::TranslationsPath)" "\"$out/translations\"" \ --replace "QLibraryInfo::path(QLibraryInfo::LibraryExecutablesPath)" "\"$out/libexec\"" '' - + lib.optionalString stdenv.isLinux '' + + lib.optionalString stdenv.hostPlatform.isLinux '' sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \ src/3rdparty/chromium/device/udev_linux/udev?_loader.cc sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \ src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc '' - + lib.optionalString stdenv.isDarwin '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' substituteInPlace configure.cmake src/gn/CMakeLists.txt \ --replace "AppleClang" "Clang" substituteInPlace cmake/Functions.cmake \ @@ -190,7 +190,7 @@ qtModule { # "-DQT_FEATURE_webengine_native_spellchecker=ON" "-DQT_FEATURE_webengine_sanitizer=ON" "-DQT_FEATURE_webengine_kerberos=ON" - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ "-DQT_FEATURE_webengine_system_libxml=ON" "-DQT_FEATURE_webengine_webrtc_pipewire=ON" @@ -199,7 +199,7 @@ qtModule { "-DQT_FEATURE_webengine_system_icu=ON" ] ++ lib.optionals enableProprietaryCodecs [ "-DQT_FEATURE_webengine_proprietary_codecs=ON" - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinSdkVersion}" ]; @@ -232,7 +232,7 @@ qtModule { libevent ffmpeg_4 - ] ++ lib.optionals stdenv.isLinux [ + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ dbus zlib minizip @@ -275,7 +275,7 @@ qtModule { libkrb5 mesa - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ AGL AVFoundation Accelerate @@ -302,7 +302,7 @@ qtModule { buildInputs = [ cups - ] ++ lib.optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libpm sandbox ]; diff --git a/pkgs/development/libraries/qt-6/modules/qtwebview.nix b/pkgs/development/libraries/qt-6/modules/qtwebview.nix index e8ebea932f039..dfc2da1df555a 100644 --- a/pkgs/development/libraries/qt-6/modules/qtwebview.nix +++ b/pkgs/development/libraries/qt-6/modules/qtwebview.nix @@ -9,6 +9,6 @@ qtModule { pname = "qtwebview"; propagatedBuildInputs = [ qtdeclarative ] - ++ lib.optionals (!stdenv.isDarwin) [ qtwebengine ] - ++ lib.optionals stdenv.isDarwin [ WebKit ]; + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ qtwebengine ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ WebKit ]; } diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index 5434be84fa595..eb85f9d606cc2 100644 --- a/pkgs/development/libraries/qt-6/qtModule.nix +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation (args // { buildInputs = args.buildInputs or [ ]; nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cmake ninja perl ] - ++ lib.optionals stdenv.isDarwin [ moveBuildTree ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; propagatedBuildInputs = (lib.warnIf (args ? qtInputs) "qt6.qtModule's qtInputs argument is deprecated" args.qtInputs or []) ++ (args.propagatedBuildInputs or []);