diff --git a/pkgs/applications/audio/faustPhysicalModeling/default.nix b/pkgs/applications/audio/faustPhysicalModeling/default.nix index f55cee957c77..6f827cea9564 100644 --- a/pkgs/applications/audio/faustPhysicalModeling/default.nix +++ b/pkgs/applications/audio/faustPhysicalModeling/default.nix @@ -1,13 +1,13 @@ { stdenv, lib, fetchFromGitHub, faust2jaqt, faust2lv2 }: stdenv.mkDerivation rec { pname = "faustPhysicalModeling"; - version = "2.20.2"; + version = "2.30.5"; src = fetchFromGitHub { owner = "grame-cncm"; repo = "faust"; rev = version; - sha256 = "1mm93ba26b7q69hvabzalg30dh8pl858nj4m2bb57pznnp09lq9a"; + sha256 = "sha256-hfpMeUhv6FC9lnPCfdWnAFCaKiteplyrS/o3Lf7cQY4="; }; buildInputs = [ faust2jaqt faust2lv2 ]; diff --git a/pkgs/applications/blockchains/exodus/default.nix b/pkgs/applications/blockchains/exodus/default.nix index 08eeac760c0f..442683946244 100644 --- a/pkgs/applications/blockchains/exodus/default.nix +++ b/pkgs/applications/blockchains/exodus/default.nix @@ -4,11 +4,11 @@ cups, vivaldi-ffmpeg-codecs, libpulseaudio, at-spi2-core, libxkbcommon, mesa }: stdenv.mkDerivation rec { pname = "exodus"; - version = "21.1.29"; + version = "21.5.25"; src = fetchurl { url = "https://downloads.exodus.io/releases/${pname}-linux-x64-${version}.zip"; - sha256 = "sha256-Qdiyjutzt8r1tIfcW7/AtSuOpf1Un5TeHoeZx5uQthM="; + sha256 = "sha256-2EIElhQGA0UprPF2pdIfYM9SWYIteD+kH+rupjxCiz4="; }; sourceRoot = "."; diff --git a/pkgs/applications/misc/gpxsee/default.nix b/pkgs/applications/misc/gpxsee/default.nix index a2280e8bb012..0803fadc2a41 100644 --- a/pkgs/applications/misc/gpxsee/default.nix +++ b/pkgs/applications/misc/gpxsee/default.nix @@ -2,13 +2,13 @@ mkDerivation rec { pname = "gpxsee"; - version = "9.2"; + version = "9.3"; src = fetchFromGitHub { owner = "tumic0"; repo = "GPXSee"; rev = version; - sha256 = "sha256-pU02Eaq6tB7X6EPOo8YAyryJRbSV3KebQv8VELxXaBw="; + sha256 = "sha256-h/OWYzZkouhTC7j8HIOt94DHwNyhbkYGoy3wUYrh0O8="; }; patches = (substituteAll { diff --git a/pkgs/applications/version-management/git-and-tools/git-chglog/default.nix b/pkgs/applications/version-management/git-and-tools/git-chglog/default.nix index 8ec57f2e69e8..19de4b28bfea 100644 --- a/pkgs/applications/version-management/git-and-tools/git-chglog/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git-chglog/default.nix @@ -2,16 +2,16 @@ buildGoModule rec { pname = "git-chglog"; - version = "0.14.2"; + version = "0.15.0"; src = fetchFromGitHub { owner = "git-chglog"; repo = "git-chglog"; rev = "v${version}"; - sha256 = "124bqywkj37gv61fswgrg528bf3rjqms1664x22lkn0sqh22zyv1"; + sha256 = "sha256-BiTnPCgymfpPxuy0i8u7JbpbEBeaSIJaikjwsPSA3qc="; }; - vendorSha256 = "09zjypmcc3ra7sw81q1pbbrlpxxp4k00p1cfkrrih8wvb25z89h5"; + vendorSha256 = "sha256-jIq+oacyT71m78iMZwWOBsBVAY/WxgyH9zRr8GiMGTU="; buildFlagsArray = [ "-ldflags= -s -w -X=main.Version=v${version}" ]; diff --git a/pkgs/development/libraries/aspell/default.nix b/pkgs/development/libraries/aspell/default.nix index 01acced98f6f..777bad1e5a53 100644 --- a/pkgs/development/libraries/aspell/default.nix +++ b/pkgs/development/libraries/aspell/default.nix @@ -23,7 +23,14 @@ stdenv.mkDerivation rec { sha256 = "1wi60ankalmh8ds7nplz434jd7j94gdvbahdwsr539rlad8pxdzr"; }; - patches = lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch; + patches = [ + (fetchpatch { + # objstack: assert that the alloc size will fit within a chunk + name = "CVE-2019-25051.patch"; + url = "https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a.patch"; + sha256 = "03z259xrk41x3j190gaprf3mqysyfgh3a04rjmch3h625vj95x39"; + }) + ] ++ lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch; postPatch = '' patch interfaces/cc/aspell.h < ${./clang.patch} diff --git a/pkgs/development/libraries/at-spi2-core/default.nix b/pkgs/development/libraries/at-spi2-core/default.nix index 515c60c985a7..8413ae597f77 100644 --- a/pkgs/development/libraries/at-spi2-core/default.nix +++ b/pkgs/development/libraries/at-spi2-core/default.nix @@ -21,11 +21,11 @@ stdenv.mkDerivation rec { pname = "at-spi2-core"; - version = "2.40.2"; + version = "2.40.3"; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "RNwXr5Q7D9GWxhweA7bBZpYDhcrpbMtelb3v/7aEn5g="; + sha256 = "5Jg3wq0w1x4fKcqOCWilS5UDAnL3/0C4m0iWhlPzelw="; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/libraries/bctoolbox/default.nix b/pkgs/development/libraries/bctoolbox/default.nix index 1a42211b9393..c1d2813a4f2a 100644 --- a/pkgs/development/libraries/bctoolbox/default.nix +++ b/pkgs/development/libraries/bctoolbox/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { pname = "bctoolbox"; - version = "4.5.20"; + version = "5.0.0"; nativeBuildInputs = [ cmake bcunit ]; buildInputs = [ mbedtls ]; @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { group = "BC"; repo = pname; rev = version; - sha256 = "sha256-n/S0G7dGaDWWsvOITceITmWUNpebcHMedkLTklxGjQg="; + sha256 = "sha256-/jv59ZeELfP7PokzthvZNL4FS3tyzRmCHp4I/Lp8BJM="; }; # Do not build static libraries diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix index f18a7e94f069..414194acb830 100644 --- a/pkgs/development/libraries/cairo/default.nix +++ b/pkgs/development/libraries/cairo/default.nix @@ -42,6 +42,16 @@ in stdenv.mkDerivation rec { url = "https://gitlab.freedesktop.org/cairo/cairo/commit/5e34c5a9640e49dcc29e6b954c4187cfc838dbd1.patch"; sha256 = "yCwsDUY7efVvOZkA6a0bPS+RrVc8Yk9bfPwWHeOjq5o="; }) + + # Fixes CVE-2020-35492; see https://github.com/NixOS/nixpkgs/issues/120364. + # CVE information: https://nvd.nist.gov/vuln/detail/CVE-2020-35492 + # Upstream PR: https://gitlab.freedesktop.org/cairo/cairo/merge_requests/85 + (fetchpatch { + name = "CVE-2020-35492.patch"; + includes = [ "src/cairo-image-compositor.c" ]; + url = "https://github.com/freedesktop/cairo/commit/78266cc8c0f7a595cfe8f3b694bfb9bcc3700b38.patch"; + sha256 = "048nzfz7rkgqb9xs0dfs56qdw7ckkxr87nbj3p0qziqdq4nb6wki"; + }) ] ++ optionals stdenv.hostPlatform.isDarwin [ # Workaround https://gitlab.freedesktop.org/cairo/cairo/-/issues/121 ./skip-configure-stderr-check.patch diff --git a/pkgs/development/libraries/gtest/default.nix b/pkgs/development/libraries/gtest/default.nix index d15ce77213ca..ffe85538684d 100644 --- a/pkgs/development/libraries/gtest/default.nix +++ b/pkgs/development/libraries/gtest/default.nix @@ -1,8 +1,8 @@ -{ lib, stdenv, cmake, ninja, fetchFromGitHub, fetchpatch }: +{ lib, stdenv, cmake, ninja, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "gtest"; - version = "1.10.0"; + version = "1.11.0"; outputs = [ "out" "dev" ]; @@ -10,16 +10,11 @@ stdenv.mkDerivation rec { owner = "google"; repo = "googletest"; rev = "release-${version}"; - sha256 = "1zbmab9295scgg4z2vclgfgjchfjailjnvzc6f5x9jvlsdi3dpwz"; + hash = "sha256-SjlJxushfry13RGA7BCjYC9oZqV4z6x8dOiHfl/wpF0="; }; patches = [ ./fix-cmake-config-includedir.patch - (fetchpatch { - name = "fix-pkgconfig-paths.patch"; - url = "https://github.com/google/googletest/commit/5126ff48d9ac54828d1947d1423a5ef2a8efee3b.patch"; - sha256 = "sha256-TBvECU/9nuvwjsCjWJP2b6DNy+FYnHIFZeuVW7g++JE="; - }) ]; nativeBuildInputs = [ cmake ninja ]; diff --git a/pkgs/development/libraries/libedit/default.nix b/pkgs/development/libraries/libedit/default.nix index daf0f2928416..35efdc781d46 100644 --- a/pkgs/development/libraries/libedit/default.nix +++ b/pkgs/development/libraries/libedit/default.nix @@ -2,11 +2,11 @@ stdenv.mkDerivation rec { pname = "libedit"; - version = "20210522-3.1"; + version = "20210714-3.1"; src = fetchurl { url = "https://thrysoee.dk/editline/${pname}-${version}.tar.gz"; - sha256 = "sha256-AiC8IEfpJ8DBmE7197TrKpRppbe/ErpXPKOyPKAru28="; + sha256 = "sha256-MCO0mK1ZP9d0WuOyCrrVRt5Qa2e4+7VXljfKaauC28k="; }; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix index 48611dffb069..4332f43c5afb 100644 --- a/pkgs/development/libraries/libffi/default.nix +++ b/pkgs/development/libraries/libffi/default.nix @@ -10,11 +10,11 @@ stdenv.mkDerivation rec { pname = "libffi"; - version = "3.3"; + version = "3.4.2"; src = fetchurl { - url = "https://sourceware.org/pub/libffi/${pname}-${version}.tar.gz"; - sha256 = "0mi0cpf8aa40ljjmzxb7im6dbj45bb0kllcd09xgmp834y9agyvj"; + url = "https://github.com/libffi/libffi/releases/download/v${version}/${pname}-${version}.tar.gz"; + sha256 = "081nx7wpzds168jbr59m34n6s3lyiq6r8zggvqxvlslsc4hvf3sl"; }; patches = []; @@ -24,6 +24,12 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-gcc-arch=generic" # no detection of -march= or -mtune= "--enable-pax_emutramp" + + # Causes issues in downstream packages which misuse ffi_closure_alloc + # Reenable once these issues are fixed and merged: + # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6155 + # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/283 + "--disable-exec-static-tramp" ]; preCheck = '' diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix index 8121074f841e..e46e25593365 100644 --- a/pkgs/development/libraries/libgpg-error/default.nix +++ b/pkgs/development/libraries/libgpg-error/default.nix @@ -1,5 +1,4 @@ { stdenv, lib, buildPackages, fetchurl, gettext -, fetchpatch , genPosixLockObjOnly ? false }: let genPosixLockObjOnlyAttrs = lib.optionalAttrs genPosixLockObjOnly { @@ -25,14 +24,9 @@ in stdenv.mkDerivation (rec { sha256 = "sha256-/AfnD2xhX4xPWQqON6m43S4soelAj45gRZxnRSuSXiM="; }; - patches = lib.optionals (with stdenv; buildPlatform != hostPlatform) [ - # Fix cross-compilation, remove in next release - # TODO apply unconditionally - (fetchpatch { - url = "https://github.com/gpg/libgpg-error/commit/33593864cd54143db594c4237bba41e14179061c.patch"; - sha256 = "1jnd7flaj5nlc7spa6mwwygmh5fajw1n8js8f23jpw4pbgvgdv4r"; - }) - ]; + # 1.42 breaks (some?) cross-compilation (e.g. x86_64 -> aarch64). + # Backporting this fix (merged in upstream master but no release cut) by David Michael https://dev.gnupg.org/rE33593864cd54143db594c4237bba41e14179061c + patches = [ ./fix-1.42-cross-compilation.patch ]; postPatch = '' sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure diff --git a/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch b/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch new file mode 100644 index 000000000000..6c3099f72144 --- /dev/null +++ b/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch @@ -0,0 +1,142 @@ +diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh +index a710f0c..258eec6 100755 +--- a/src/gen-lock-obj.sh ++++ b/src/gen-lock-obj.sh +@@ -1,136 +1,136 @@ + #! /bin/sh + # + # gen-lock-obj.sh - Build tool to construct the lock object. + # + # Copyright (C) 2020, 2021 g10 Code GmbH + # + # This file is part of libgpg-error. + # + # libgpg-error is free software; you can redistribute it and/or + # modify it under the terms of the GNU Lesser General Public License + # as published by the Free Software Foundation; either version 2.1 of + # the License, or (at your option) any later version. + # + # libgpg-error is distributed in the hope that it will be useful, but + # WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + # Lesser General Public License for more details. + # + # You should have received a copy of the GNU Lesser General Public + # License along with this program; if not, see . + # + + # + # Following variables should be defined to invoke this script + # + # CC + # OBJDUMP + # AWK + # ac_ext + # ac_object + # host + # LOCK_ABI_VERSION + # + # An example: + # + # LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \ + # CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \ + # AWK=gawk ./gen-lock-obj.sh + # + +-if test -n `echo -n`; then ++if test -n "`echo -n`"; then + ECHO_C='\c' + ECHO_N='' + else + ECHO_C='' + ECHO_N='-n' + fi + + if test "$1" = --disable-threads; then + cat <conftest.$ac_ext + #include + pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; + EOF + + if $CC -c conftest.$ac_ext; then : + ac_mtx_size=$($OBJDUMP -j .bss -t conftest.$ac_objext \ + | $AWK $AWK_OPTION ' + /mtx$/ { mtx_size = int("0x" $5) } + END { print mtx_size }') + else + echo "Can't determine mutex size" + exit 1 + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + cat < dconf != null; @@ -32,53 +32,43 @@ assert withGtk3 -> gtk3 != null; let compareVersion = v: builtins.compareVersions version v; - qmakeCacheName = - if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash"; + qmakeCacheName = if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash"; debugSymbols = debug || developerBuild; in stdenv.mkDerivation { - - name = "qtbase-${version}"; + pname = "qtbase"; inherit qtCompatVersion src version; debug = debugSymbols; - propagatedBuildInputs = - [ - libxml2 libxslt openssl sqlite zlib + propagatedBuildInputs = [ + libxml2 libxslt openssl sqlite zlib + + # Text rendering + harfbuzz icu + + # Image formats + libjpeg libpng + (if compareVersion "5.9.0" < 0 then pcre16 else pcre2) + ] ++ ( + if stdenv.isDarwin then [ + # TODO: move to buildInputs, this should not be propagated. + AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth + CoreLocation CoreServices DiskArbitration Foundation OpenGL + libobjc libiconv MetalKit IOKit + ] else [ + dbus glib udev # Text rendering - harfbuzz icu + fontconfig freetype - # Image formats - libjpeg libpng - (if compareVersion "5.9.0" < 0 then pcre16 else pcre2) - ] - ++ ( - if stdenv.isDarwin - then with darwin.apple_sdk.frameworks; - [ - # TODO: move to buildInputs, this should not be propagated. - AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth - CoreLocation CoreServices DiskArbitration Foundation OpenGL - darwin.libobjc libiconv MetalKit IOKit - ] - else - [ - dbus glib udev + # X11 libs + libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil + xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm + ] ++ lib.optional libGLSupported libGL + ); - # Text rendering - fontconfig freetype - - # X11 libs - libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil - xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm - ] - ++ lib.optional libGLSupported libGL - ); - - buildInputs = - [ python3 ] + buildInputs = [ python3 ] ++ lib.optionals (!stdenv.isDarwin) ( [ libinput ] @@ -89,8 +79,8 @@ stdenv.mkDerivation { ++ lib.optional (libmysqlclient != null) libmysqlclient ++ lib.optional (postgresql != null) postgresql; - nativeBuildInputs = - [ bison flex gperf lndir perl pkg-config which ]; + nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ] + ++ lib.optionals stdenv.isDarwin [ xcbuild ]; propagatedNativeBuildInputs = [ lndir ]; @@ -107,59 +97,42 @@ stdenv.mkDerivation { . ${../hooks/fix-qmake-libtool.sh} ''; - postPatch = + postPatch = '' + for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do + substituteInPlace "mkspecs/features/$prf" \ + --subst-var qtPluginPrefix \ + --subst-var qtQmlPrefix \ + --subst-var qtDocPrefix + done + + substituteInPlace configure --replace /bin/pwd pwd + substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls + sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf + + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake + sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in + sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in + '' + ( + if stdenv.isDarwin then '' + sed -i \ + -e 's|/usr/bin/xcode-select|xcode-select|' \ + -e 's|/usr/bin/xcrun|xcrun|' \ + -e 's|/usr/bin/xcodebuild|xcodebuild|' \ + -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \ + ./configure + substituteInPlace ./mkspecs/common/mac.conf \ + --replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \ + --replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/" + '' else lib.optionalString libGLSupported '' + sed -i mkspecs/common/linux.conf \ + -e "/^QMAKE_INCDIR_OPENGL/ s|$|${libGL.dev or libGL}/include|" \ + -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${libGL.out}/lib|" + '' + lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU) '' + sed -i mkspecs/common/gcc-base-unix.conf \ + -e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/" '' - for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do - substituteInPlace "mkspecs/features/$prf" \ - --subst-var qtPluginPrefix \ - --subst-var qtQmlPrefix \ - --subst-var qtDocPrefix - done - - substituteInPlace configure --replace /bin/pwd pwd - substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls - sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf - - sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in - sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake - sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in - sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in - '' - - + ( - if stdenv.isDarwin - then - '' - sed -i \ - -e 's|! /usr/bin/xcode-select --print-path >/dev/null 2>&1;|false;|' \ - -e 's|! /usr/bin/xcrun -find xcodebuild >/dev/null 2>&1;|false;|' \ - -e 's|sysroot=$(/usr/bin/xcodebuild -sdk $sdk -version Path 2>/dev/null)|sysroot=/nonsense|' \ - -e 's|sysroot=$(/usr/bin/xcrun --sdk $sdk --show-sdk-path 2>/dev/null)|sysroot=/nonsense|' \ - -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \ - -e 's|XCRUN=`/usr/bin/xcrun -sdk macosx clang -v 2>&1`|XCRUN="clang -v 2>&1"|' \ - -e 's#sdk_val=$(/usr/bin/xcrun -sdk $sdk -find $(echo $val | cut -d \x27 \x27 -f 1))##' \ - -e 's#val=$(echo $sdk_val $(echo $val | cut -s -d \x27 \x27 -f 2-))##' \ - ./configure - substituteInPlace ./mkspecs/common/mac.conf \ - --replace "/System/Library/Frameworks/OpenGL.framework/" "${darwin.apple_sdk.frameworks.OpenGL}/Library/Frameworks/OpenGL.framework/" - substituteInPlace ./mkspecs/common/mac.conf \ - --replace "/System/Library/Frameworks/AGL.framework/" "${darwin.apple_sdk.frameworks.AGL}/Library/Frameworks/AGL.framework/" - '' - # Note on the above: \x27 is a way if including a single-quote - # character in the sed string arguments. - else - lib.optionalString libGLSupported - '' - sed -i mkspecs/common/linux.conf \ - -e "/^QMAKE_INCDIR_OPENGL/ s|$|${libGL.dev or libGL}/include|" \ - -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${libGL.out}/lib|" - '' + - lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU) - '' - sed -i mkspecs/common/gcc-base-unix.conf \ - -e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/" - '' - ); + ); qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins"; qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml"; @@ -218,153 +191,128 @@ stdenv.mkDerivation { PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq"; # TODO Remove obsolete and useless flags once the build will be totally mastered - configureFlags = - [ - "-plugindir $(out)/$(qtPluginPrefix)" - "-qmldir $(out)/$(qtQmlPrefix)" - "-docdir $(out)/$(qtDocPrefix)" + configureFlags = [ + "-plugindir $(out)/$(qtPluginPrefix)" + "-qmldir $(out)/$(qtQmlPrefix)" + "-docdir $(out)/$(qtDocPrefix)" - "-verbose" - "-confirm-license" - "-opensource" + "-verbose" + "-confirm-license" + "-opensource" - "-release" - "-shared" - "-accessibility" - "-optimized-qmake" - "-strip" - "-system-proxies" - "-pkg-config" + "-release" + "-shared" + "-accessibility" + "-optimized-qmake" + "-strip" + "-system-proxies" + "-pkg-config" - "-gui" - "-widgets" - "-opengl desktop" - "-icu" - "-L" "${icu.out}/lib" - "-I" "${icu.dev}/include" - "-pch" - ] - ++ lib.optional debugSymbols "-debug" - ++ lib.optionals (compareVersion "5.11.0" < 0) - [ - "-qml-debug" - ] - ++ lib.optionals (compareVersion "5.9.0" < 0) - [ - "-c++11" - "-no-reduce-relocations" - ] - ++ lib.optionals developerBuild [ - "-developer-build" - "-no-warnings-are-errors" + "-gui" + "-widgets" + "-opengl desktop" + "-icu" + "-L" "${icu.out}/lib" + "-I" "${icu.dev}/include" + "-pch" + ] ++ lib.optional debugSymbols "-debug" + ++ lib.optionals (compareVersion "5.11.0" < 0) [ + "-qml-debug" + ] ++ lib.optionals (compareVersion "5.9.0" < 0) [ + "-c++11" + "-no-reduce-relocations" + ] ++ lib.optionals developerBuild [ + "-developer-build" + "-no-warnings-are-errors" + ] ++ (if (!stdenv.hostPlatform.isx86_64) then [ + "-no-sse2" + ] else lib.optionals (compareVersion "5.9.0" >= 0) [ + "-sse2" + "${lib.optionalString (!stdenv.hostPlatform.sse3Support) "-no"}-sse3" + "${lib.optionalString (!stdenv.hostPlatform.ssse3Support) "-no"}-ssse3" + "${lib.optionalString (!stdenv.hostPlatform.sse4_1Support) "-no"}-sse4.1" + "${lib.optionalString (!stdenv.hostPlatform.sse4_2Support) "-no"}-sse4.2" + "${lib.optionalString (!stdenv.hostPlatform.avxSupport) "-no"}-avx" + "${lib.optionalString (!stdenv.hostPlatform.avx2Support) "-no"}-avx2" ] + ) ++ [ + "-no-mips_dsp" + "-no-mips_dspr2" + ] ++ [ + "-system-zlib" + "-L" "${zlib.out}/lib" + "-I" "${zlib.dev}/include" + "-system-libjpeg" + "-L" "${libjpeg.out}/lib" + "-I" "${libjpeg.dev}/include" + "-system-harfbuzz" + "-L" "${harfbuzz.out}/lib" + "-I" "${harfbuzz.dev}/include" + "-system-pcre" + "-openssl-linked" + "-L" "${openssl.out}/lib" + "-I" "${openssl.dev}/include" + "-system-sqlite" + ''-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql'' + ''-${if postgresql != null then "plugin" else "no"}-sql-psql'' + + "-make libs" + "-make tools" + ''-${lib.optionalString (!buildExamples) "no"}make examples'' + ''-${lib.optionalString (!buildTests) "no"}make tests'' + ] ++ lib.optional (compareVersion "5.15.0" < 0) "-v" ++ ( - if (!stdenv.hostPlatform.isx86_64) then [ - "-no-sse2" - ] else if (compareVersion "5.9.0" >= 0) then [ - "-sse2" - "${if stdenv.hostPlatform.sse3Support then "" else "-no"}-sse3" - "${if stdenv.hostPlatform.ssse3Support then "" else "-no"}-ssse3" - "${if stdenv.hostPlatform.sse4_1Support then "" else "-no"}-sse4.1" - "${if stdenv.hostPlatform.sse4_2Support then "" else "-no"}-sse4.2" - "${if stdenv.hostPlatform.avxSupport then "" else "-no"}-avx" - "${if stdenv.hostPlatform.avx2Support then "" else "-no"}-avx2" - ] else [ - ] - ) - ++ [ - "-no-mips_dsp" - "-no-mips_dspr2" + if stdenv.isDarwin then [ + "-platform macx-clang" + "-no-fontconfig" + "-qt-freetype" + "-qt-libpng" + "-no-framework" + ] else [ + "-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath" + ] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-xcb" + ++ [ + "-xcb" + "-qpa xcb" + "-L" "${libX11.out}/lib" + "-I" "${libX11.out}/include" + "-L" "${libXext.out}/lib" + "-I" "${libXext.out}/include" + "-L" "${libXrender.out}/lib" + "-I" "${libXrender.out}/include" + + "-libinput" + + ''-${lib.optionalString (cups == null) "no-"}cups'' + "-dbus-linked" + "-glib" + ] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-libjpeg" + ++ [ + "-system-libpng" + ] ++ lib.optional withGtk3 "-gtk" + ++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify" + ++ lib.optionals (compareVersion "5.10.0" >= 0) [ + # Without these, Qt stops working on kernels < 3.17. See: + # https://github.com/NixOS/nixpkgs/issues/38832 + "-no-feature-renameat2" + "-no-feature-getentropy" + ] ++ lib.optionals (compareVersion "5.12.1" < 0) [ + # use -xkbcommon and -xkbcommon-evdev for versions before 5.12.1 + "-system-xkbcommon" + "-xkbcommon-evdev" + ] ++ lib.optionals (cups != null) [ + "-L" "${cups.lib}/lib" + "-I" "${cups.dev}/include" + ] ++ lib.optionals (libmysqlclient != null) [ + "-L" "${libmysqlclient}/lib" + "-I" "${libmysqlclient}/include" ] + ); - ++ [ - "-system-zlib" - "-L" "${zlib.out}/lib" - "-I" "${zlib.dev}/include" - "-system-libjpeg" - "-L" "${libjpeg.out}/lib" - "-I" "${libjpeg.dev}/include" - "-system-harfbuzz" - "-L" "${harfbuzz.out}/lib" - "-I" "${harfbuzz.dev}/include" - "-system-pcre" - "-openssl-linked" - "-L" "${openssl.out}/lib" - "-I" "${openssl.dev}/include" - "-system-sqlite" - ''-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql'' - ''-${if postgresql != null then "plugin" else "no"}-sql-psql'' - - "-make libs" - "-make tools" - ''-${lib.optionalString (!buildExamples) "no"}make examples'' - ''-${lib.optionalString (!buildTests) "no"}make tests'' - ] - ++ lib.optional (compareVersion "5.15.0" < 0) "-v" - - ++ ( - if stdenv.isDarwin - then - [ - "-platform macx-clang" - "-no-fontconfig" - "-qt-freetype" - "-qt-libpng" - "-no-framework" - ] - else - [ - "-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath" - ] - ++ lib.optional (compareVersion "5.15.0" < 0) "-system-xcb" - ++ [ - "-xcb" - "-qpa xcb" - "-L" "${libX11.out}/lib" - "-I" "${libX11.out}/include" - "-L" "${libXext.out}/lib" - "-I" "${libXext.out}/include" - "-L" "${libXrender.out}/lib" - "-I" "${libXrender.out}/include" - - "-libinput" - - ''-${lib.optionalString (cups == null) "no-"}cups'' - "-dbus-linked" - "-glib" - ] - ++ lib.optional (compareVersion "5.15.0" < 0) "-system-libjpeg" - ++ [ - "-system-libpng" - ] - ++ lib.optional withGtk3 "-gtk" - ++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify" - ++ lib.optionals (compareVersion "5.10.0" >= 0) [ - # Without these, Qt stops working on kernels < 3.17. See: - # https://github.com/NixOS/nixpkgs/issues/38832 - "-no-feature-renameat2" - "-no-feature-getentropy" - ] - ++ lib.optionals (compareVersion "5.12.1" < 0) [ - # use -xkbcommon and -xkbcommon-evdev for versions before 5.12.1 - "-system-xkbcommon" - "-xkbcommon-evdev" - ] - ++ lib.optionals (cups != null) [ - "-L" "${cups.lib}/lib" - "-I" "${cups.dev}/include" - ] - ++ lib.optionals (libmysqlclient != null) [ - "-L" "${libmysqlclient}/lib" - "-I" "${libmysqlclient}/include" - ] - ); - - postInstall = - # Move selected outputs. - '' - moveToOutput "mkspecs" "$dev" - ''; + # Move selected outputs. + postInstall = '' + moveToOutput "mkspecs" "$dev" + ''; devTools = [ "bin/fixqt4headers.pl" @@ -378,35 +326,27 @@ stdenv.mkDerivation { "bin/uic" ]; - postFixup = + 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?' - '' + sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri + fixQtModulePaths "''${!outputDev}/mkspecs/modules" + fixQtBuiltinPaths "''${!outputDev}" '*.pr?' # Move development tools to $dev - + '' - moveQtDevTools - moveToOutput bin "$dev" - '' + moveQtDevTools + moveToOutput bin "$dev" # fixup .pc file (where to find 'moc' etc.) - + '' - sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \ - -e "/^host_bins=/ c host_bins=$dev/bin" - ''; + sed -i "$dev/lib/pkgconfig/Qt5Core.pc" \ + -e "/^host_bins=/ c host_bins=$dev/bin" + ''; dontStrip = debugSymbols; setupHook = ../hooks/qtbase-setup-hook.sh; meta = with lib; { - homepage = "http://www.qt.io"; + homepage = "https://www.qt.io/"; description = "A cross-platform application framework for C++"; license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ]; maintainers = with maintainers; [ qknight ttuegel periklis bkchr ]; diff --git a/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix b/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix index 97248ca18076..89f2672c26dd 100644 --- a/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix +++ b/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix @@ -1,7 +1,5 @@ { qtModule, lib, python3, qtbase, qtsvg }: -with lib; - qtModule { pname = "qtdeclarative"; qtInputs = [ qtbase qtsvg ]; diff --git a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix index 0d2d565fe7ae..baf5c30e73c4 100644 --- a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix +++ b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix @@ -1,17 +1,24 @@ -{ qtModule, lib, stdenv, qtbase, qtdeclarative, pkg-config -, alsa-lib, gstreamer, gst-plugins-base, libpulseaudio, wayland +{ qtModule +, lib +, stdenv +, qtbase +, qtdeclarative +, pkg-config +, alsa-lib +, gstreamer +, gst-plugins-base +, libpulseaudio +, wayland }: -with lib; - qtModule { pname = "qtmultimedia"; qtInputs = [ qtbase qtdeclarative ]; nativeBuildInputs = [ pkg-config ]; buildInputs = [ gstreamer gst-plugins-base libpulseaudio ] - ++ optional (stdenv.isLinux) alsa-lib - ++ optional (versionAtLeast qtbase.version "5.14.0" && stdenv.isLinux) wayland; + ++ lib.optional (stdenv.isLinux) alsa-lib + ++ lib.optional (lib.versionAtLeast qtbase.version "5.14.0" && stdenv.isLinux) wayland; outputs = [ "bin" "dev" "out" ]; qmakeFlags = [ "GST_VERSION=1.0" ]; - NIX_LDFLAGS = optionalString (stdenv.isDarwin) "-lobjc"; + NIX_LDFLAGS = lib.optionalString (stdenv.isDarwin) "-lobjc"; } diff --git a/pkgs/development/libraries/qt-5/modules/qtserialport.nix b/pkgs/development/libraries/qt-5/modules/qtserialport.nix index caeaedbcf3d5..89d96eb29124 100644 --- a/pkgs/development/libraries/qt-5/modules/qtserialport.nix +++ b/pkgs/development/libraries/qt-5/modules/qtserialport.nix @@ -1,11 +1,7 @@ { qtModule, stdenv, lib, qtbase, systemd }: -let inherit (lib) getLib optional; in - qtModule { pname = "qtserialport"; qtInputs = [ qtbase ]; - NIX_CFLAGS_COMPILE = - optional stdenv.isLinux - ''-DNIXPKGS_LIBUDEV="${getLib systemd}/lib/libudev"''; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-DNIXPKGS_LIBUDEV=\"${lib.getLib systemd}/lib/libudev\""; } diff --git a/pkgs/development/libraries/qt-5/modules/qttools.nix b/pkgs/development/libraries/qt-5/modules/qttools.nix index 437ec6cef743..27008f6714ed 100644 --- a/pkgs/development/libraries/qt-5/modules/qttools.nix +++ b/pkgs/development/libraries/qt-5/modules/qttools.nix @@ -1,7 +1,5 @@ { qtModule, stdenv, lib, qtbase, qtdeclarative }: -with lib; - qtModule { pname = "qttools"; qtInputs = [ qtbase qtdeclarative ]; @@ -10,9 +8,9 @@ qtModule { # fixQtBuiltinPaths overwrites a builtin path we should keep postPatch = '' sed -i "src/linguist/linguist.pro" \ - -e '/^cmake_linguist_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${getDev qtbase}|' + -e '/^cmake_linguist_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|' sed -i "src/qtattributionsscanner/qtattributionsscanner.pro" \ - -e '/^cmake_qattributionsscanner_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${getDev qtbase}|' + -e '/^cmake_qattributionsscanner_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|' ''; devTools = [ @@ -34,12 +32,11 @@ qtModule { "bin/qthelpconverter" "bin/lprodump" "bin/qdistancefieldgenerator" - ] ++ optionals stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ "bin/macdeployqt" ]; - NIX_CFLAGS_COMPILE = - lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; + NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"''; setupHook = ../hooks/qttools-setup-hook.sh; } diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index 8d1eae712761..03247487749a 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -15,21 +15,22 @@ , pipewire_0_2 , enableProprietaryCodecs ? true , gn -, cups, darwin, openbsm, runCommand, xcbuild, writeScriptBin +, cctools, libobjc, libunwind, sandbox, xnu +, ApplicationServices, AVFoundation, Foundation, ForceFeedback, GameController, AppKit +, ImageCaptureCore, CoreBluetooth, IOBluetooth, CoreWLAN, Quartz, Cocoa, LocalAuthentication +, cups, openbsm, runCommand, xcbuild, writeScriptBin , ffmpeg ? null , lib, stdenv, fetchpatch , version ? null , qtCompatVersion }: -with lib; - qtModule { pname = "qtwebengine"; qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ]; nativeBuildInputs = [ bison coreutils flex git gperf ninja pkg-config python2 which gn nodejs - ] ++ optional stdenv.isDarwin xcbuild; + ] ++ lib.optional stdenv.isDarwin xcbuild; doCheck = true; outputs = [ "bin" "dev" "out" ]; @@ -42,66 +43,65 @@ qtModule { # which cannot be set at the same time as -Wformat-security hardeningDisable = [ "format" ]; - postPatch = - '' - # Patch Chromium build tools - ( - cd src/3rdparty/chromium; + postPatch = '' + # Patch Chromium build tools + ( + cd src/3rdparty/chromium; - # Manually fix unsupported shebangs - substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \ - --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true + # Manually fix unsupported shebangs + substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \ + --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true - patchShebangs . - ) - '' - # Prevent Chromium build script from making the path to `clang` relative to - # the build directory. `clang_base_path` is the value of `QMAKE_CLANG_DIR` - # from `src/core/config/mac_osx.pri`. - + optionalString stdenv.isDarwin '' - substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \ - --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"' - '' - # Patch library paths in Qt sources - + '' - sed -i \ - -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \ - -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \ - -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \ - src/core/web_engine_library_info.cpp - '' - # Patch library paths in Chromium sources - + optionalString (!stdenv.isDarwin) '' - sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \ - src/3rdparty/chromium/device/udev_linux/udev?_loader.cc + # TODO: be more precise + patchShebangs . + ) + '' + # Prevent Chromium build script from making the path to `clang` relative to + # the build directory. `clang_base_path` is the value of `QMAKE_CLANG_DIR` + # from `src/core/config/mac_osx.pri`. + + lib.optionalString stdenv.isDarwin '' + substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \ + --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"' + '' + # Patch library paths in Qt sources + + '' + sed -i \ + -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \ + -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \ + -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \ + src/core/web_engine_library_info.cpp + '' + # Patch library paths in Chromium sources + + lib.optionalString (!stdenv.isDarwin) '' + 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 - '' - + optionalString stdenv.isDarwin ( - (if (lib.versionAtLeast qtCompatVersion "5.14") then '' - substituteInPlace src/buildtools/config/mac_osx.pri \ - --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' - '' else '' - substituteInPlace src/core/config/mac_osx.pri \ - --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' - '') - # Following is required to prevent a build error: - # ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it - + '' - substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \ - --replace '$sysroot/usr' "${darwin.xnu}" - '' - # Apple has some secret stuff they don't share with OpenBSM - + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' - substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \ - --replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]" - substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \ - --replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]" - '' else '' - substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ - --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" - '')); + 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 ( + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' + substituteInPlace src/buildtools/config/mac_osx.pri \ + --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' + '' else '' + substituteInPlace src/core/config/mac_osx.pri \ + --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"' + '') + # Following is required to prevent a build error: + # ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it + + '' + substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \ + --replace '$sysroot/usr' "${xnu}" + '' + # Apple has some secret stuff they don't share with OpenBSM + + (if (lib.versionAtLeast qtCompatVersion "5.14") then '' + substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \ + --replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]" + substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \ + --replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]" + '' else '' + substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \ + --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]" + '')); NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit @@ -134,8 +134,8 @@ qtModule { ''; qmakeFlags = [ "--" "-system-ffmpeg" ] - ++ optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire" - ++ optional enableProprietaryCodecs "-proprietary-codecs"; + ++ lib.optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire" + ++ lib.optional enableProprietaryCodecs "-proprietary-codecs"; propagatedBuildInputs = [ # Image formats @@ -152,7 +152,7 @@ qtModule { libevent ffmpeg - ] ++ optionals (!stdenv.isDarwin) [ + ] ++ lib.optionals (!stdenv.isDarwin) [ dbus zlib minizip snappy nss protobuf jsoncpp # Audio formats @@ -168,14 +168,14 @@ qtModule { xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst xorg.libXcomposite xorg.libXdamage libdrm xorg.libxkbfile - ] ++ optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [ + ] ++ lib.optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [ # Pipewire pipewire_0_2 ] # FIXME These dependencies shouldn't be needed but can't find a way # around it. Chromium pulls this in while bootstrapping GN. - ++ lib.optionals stdenv.isDarwin (with darwin; with apple_sdk.frameworks; [ + ++ lib.optionals stdenv.isDarwin [ libobjc cctools @@ -196,11 +196,11 @@ qtModule { openbsm libunwind - ]); + ]; - buildInputs = optionals stdenv.isDarwin (with darwin; [ + buildInputs = lib.optionals stdenv.isDarwin [ cups - apple_sdk.libs.sandbox + sandbox # `sw_vers` is used by `src/3rdparty/chromium/build/config/mac/sdk_info.py` # to get some information about the host platform. @@ -216,11 +216,10 @@ qtModule { shift done '') - ]); + ]; dontUseNinjaBuild = true; dontUseNinjaInstall = true; - dontUseXcbuild = true; postInstall = lib.optionalString stdenv.isLinux '' cat > $out/libexec/qt.conf <