diff --git a/pkgs/applications/misc/maliit-framework/default.nix b/pkgs/applications/misc/maliit-framework/default.nix index 6a6e66f293bd..ca942ca72d47 100644 --- a/pkgs/applications/misc/maliit-framework/default.nix +++ b/pkgs/applications/misc/maliit-framework/default.nix @@ -1,6 +1,7 @@ { mkDerivation , lib , fetchFromGitHub +, fetchpatch , at-spi2-atk , at-spi2-core @@ -32,6 +33,15 @@ mkDerivation rec { sha256 = "138jyvw130kmrldksbk4l38gvvahh3x51zi4vyplad0z5nxmbazb"; }; + # in master post 2.2.1, see https://github.com/maliit/framework/issues/106 + patches = [ + (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/maliit/framework/commit/1e20a4a5113f1c092295f5a5f04ab6e584f6fcff.patch"; + sha256 = "0h7jfqnqvjka626wx2z2g150rch4air7q3zbq59gcb12g7x6gfyn"; + }) + ]; + buildInputs = [ at-spi2-atk at-spi2-core diff --git a/pkgs/applications/radio/soapysdr/default.nix b/pkgs/applications/radio/soapysdr/default.nix index 422e665b9372..adf997773ecc 100644 --- a/pkgs/applications/radio/soapysdr/default.nix +++ b/pkgs/applications/radio/soapysdr/default.nix @@ -40,6 +40,13 @@ in stdenv.mkDerivation { "-DCMAKE_BUILD_TYPE=Release" ] ++ lib.optional usePython "-DUSE_PYTHON_CONFIG=ON"; + # https://github.com/pothosware/SoapySDR/issues/352 + postPatch = '' + substituteInPlace lib/SoapySDR.in.pc \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + postFixup = lib.optionalString (lib.length extraPackages != 0) '' # Join all plugins via symlinking for i in ${toString extraPackages}; do diff --git a/pkgs/desktops/lxqt/lxqt-build-tools/default.nix b/pkgs/desktops/lxqt/lxqt-build-tools/default.nix index f72394a09825..d543cf11c359 100644 --- a/pkgs/desktops/lxqt/lxqt-build-tools/default.nix +++ b/pkgs/desktops/lxqt/lxqt-build-tools/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , mkDerivation +, fetchpatch , fetchFromGitHub , cmake , pkg-config @@ -22,6 +23,15 @@ mkDerivation rec { sha256 = "vzppKTDwADBG5pOaluT858cWCKFFRaSbHz2Qhe6799E="; }; + patches = [ + # in master post 0.11.0, see https://github.com/lxqt/lxqt-build-tools/pull/76 + (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/lxqt/lxqt-build-tools/pull/76/commits/fa9672b671ede3f46b004f81580f9afb50fedf00.patch"; + sha256 = "0dl7n1afcc6ky9vd9lpc65p9grpszpql7lfjq2vlzlilixnv8xv1"; + }) + ]; + postPatch = '' # Nix clang on darwin identifies as 'Clang', not 'AppleClang' # Without this, dependants fail to link. diff --git a/pkgs/development/compilers/seexpr/default.nix b/pkgs/development/compilers/seexpr/default.nix index b07a91599332..210daae37459 100644 --- a/pkgs/development/compilers/seexpr/default.nix +++ b/pkgs/development/compilers/seexpr/default.nix @@ -31,6 +31,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ libGLU libpng zlib qt4 python3Packages.pyqt4 python3Packages.boost bison flex ]; + # https://github.com/wdas/SeExpr/issues/106 + postPatch = '' + substituteInPlace src/build/seexpr2.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { description = "Embeddable expression evaluation engine from Disney Animation"; homepage = "https://wdas.github.io/SeExpr/"; diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix index d3b736fbe0f0..1402fc6ed946 100644 --- a/pkgs/development/libraries/arrow-cpp/default.nix +++ b/pkgs/development/libraries/arrow-cpp/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchurl +, fetchpatch , fetchFromGitHub , fixDarwinDylibNames , abseil-cpp @@ -112,6 +113,14 @@ stdenv.mkDerivation rec { patches = [ # patch to fix python-test ./darwin.patch + # in master post 8.0.0, see https://github.com/apache/arrow/pull/13182 + (fetchpatch { + name = "fix-pkg-config.patch"; + stripLen = 1; + excludes = [ "src/arrow/engine/arrow-substrait.pc.in" ]; # for < 8.0.0 + url = "https://github.com/apache/arrow/commit/a242eb17362c0352fc3291213542c48abfe18669.patch"; + sha256 = "15gz13f8q75l7d4z5blyvxd805hwfcvrbrxs2kbfal9vcbnirycx"; + }) ]; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/audio/libkeyfinder/default.nix b/pkgs/development/libraries/audio/libkeyfinder/default.nix index 65e4d0fb15ee..0a48dc479045 100644 --- a/pkgs/development/libraries/audio/libkeyfinder/default.nix +++ b/pkgs/development/libraries/audio/libkeyfinder/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, fftw, catch2 }: +{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, fftw, catch2 }: stdenv.mkDerivation rec { pname = "libkeyfinder"; @@ -11,6 +11,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-7w/Wc9ncLinbnM2q3yv5DBtFoJFAM2e9xAUTsqvE9mg="; }; + # in main post 2.2.6, see https://github.com/mixxxdj/libkeyfinder/issues/21 + patches = [ + (fetchpatch { + name = "fix-pkg-config"; + url = "https://github.com/mixxxdj/libkeyfinder/commit/4e1a5022d4c91e3ecfe9be5c3ac7cc488093bd2e.patch"; + sha256 = "08llmgp6r11bq5s820j3fs9bgriaibkhq8r3v2av064w66mwp48x"; + }) + ]; + nativeBuildInputs = [ cmake ]; buildInputs = [ fftw ]; diff --git a/pkgs/development/libraries/bcg729/default.nix b/pkgs/development/libraries/bcg729/default.nix index 125512c3fed6..ff5840b8373f 100644 --- a/pkgs/development/libraries/bcg729/default.nix +++ b/pkgs/development/libraries/bcg729/default.nix @@ -18,6 +18,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} + ''; + meta = with lib; { description = "Opensource implementation of both encoder and decoder of the ITU G729 Annex A/B speech codec"; homepage = "https://linphone.org/technical-corner/bcg729"; diff --git a/pkgs/development/libraries/cglm/default.nix b/pkgs/development/libraries/cglm/default.nix index 50a9bf62c54b..0a1544df0ade 100644 --- a/pkgs/development/libraries/cglm/default.nix +++ b/pkgs/development/libraries/cglm/default.nix @@ -17,6 +17,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # https://github.com/recp/cglm/issues/249 + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + ''; + meta = with lib; { homepage = "https://github.com/recp/cglm"; description = "Highly Optimized Graphics Math (glm) for C"; diff --git a/pkgs/development/libraries/cm256cc/default.nix b/pkgs/development/libraries/cm256cc/default.nix index 09b0ffba98ba..3a2538898cce 100644 --- a/pkgs/development/libraries/cm256cc/default.nix +++ b/pkgs/development/libraries/cm256cc/default.nix @@ -14,6 +14,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ boost ]; + # https://github.com/f4exb/cm256cc/issues/16 + postPatch = '' + substituteInPlace libcm256cc.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { description = "Fast GF(256) Cauchy MDS Block Erasure Codec in C++"; homepage = "https://github.com/f4exb/cm256cc"; diff --git a/pkgs/development/libraries/cxxopts/default.nix b/pkgs/development/libraries/cxxopts/default.nix index 5d12b3c19ee3..cf36a88a35be 100644 --- a/pkgs/development/libraries/cxxopts/default.nix +++ b/pkgs/development/libraries/cxxopts/default.nix @@ -31,6 +31,12 @@ stdenv.mkDerivation rec { # Conflict on case-insensitive filesystems. dontUseCmakeBuildDir = true; + # https://github.com/jarro2783/cxxopts/issues/332 + postPatch = '' + substituteInPlace packaging/pkgconfig.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { homepage = "https://github.com/jarro2783/cxxopts"; description = "Lightweight C++ GNU-style option parser library"; diff --git a/pkgs/development/libraries/drumstick/default.nix b/pkgs/development/libraries/drumstick/default.nix index 6d11d8bfc8a3..36a4c56bbaf7 100644 --- a/pkgs/development/libraries/drumstick/default.nix +++ b/pkgs/development/libraries/drumstick/default.nix @@ -18,6 +18,11 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace library/rt/backendmanager.cpp --subst-var out + + # https://sourceforge.net/p/drumstick/bugs/39/ + substituteInPlace drumstick-alsa.pc.in drumstick-file.pc.in drumstick-rt.pc.in drumstick-widgets.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ ''; outputs = [ "out" "dev" "man" ]; diff --git a/pkgs/development/libraries/eccodes/default.nix b/pkgs/development/libraries/eccodes/default.nix index b6d4cd29f7e1..54df7be6f1ba 100644 --- a/pkgs/development/libraries/eccodes/default.nix +++ b/pkgs/development/libraries/eccodes/default.nix @@ -24,6 +24,17 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace cmake/FindOpenJPEG.cmake --replace openjpeg-2.1 ${openjpeg.incDir} + + # https://github.com/ecmwf/ecbuild/issues/40 + substituteInPlace cmake/ecbuild_config.h.in \ + --replace @CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@ @eccodes_FULL_INSTALL_LIB_DIR@ \ + --replace @CMAKE_INSTALL_PREFIX@/@INSTALL_BIN_DIR@ @eccodes_FULL_INSTALL_BIN_DIR@ + substituteInPlace cmake/pkg-config.pc.in \ + --replace '$'{prefix}/@INSTALL_LIB_DIR@ @eccodes_FULL_INSTALL_LIB_DIR@ \ + --replace '$'{prefix}/@INSTALL_INCLUDE_DIR@ @eccodes_FULL_INSTALL_INCLUDE_DIR@ \ + --replace '$'{prefix}/@INSTALL_BIN_DIR@ @eccodes_FULL_INSTALL_BIN_DIR@ + substituteInPlace cmake/ecbuild_install_project.cmake \ + --replace '$'{CMAKE_INSTALL_PREFIX}/'$'{INSTALL_INCLUDE_DIR} '$'{'$'{PROJECT_NAME}_FULL_INSTALL_INCLUDE_DIR} ''; nativeBuildInputs = [ cmake gfortran perl ]; diff --git a/pkgs/development/libraries/entt/default.nix b/pkgs/development/libraries/entt/default.nix index 7c87580aea11..01d4b88246a8 100644 --- a/pkgs/development/libraries/entt/default.nix +++ b/pkgs/development/libraries/entt/default.nix @@ -12,6 +12,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # https://github.com/skypjack/entt/issues/890 + postPatch = '' + substituteInPlace cmake/in/entt.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { homepage = "https://github.com/skypjack/entt"; description = "A header-only, tiny and easy to use library for game programming and much more written in modern C++"; diff --git a/pkgs/development/libraries/ffmpegthumbnailer/default.nix b/pkgs/development/libraries/ffmpegthumbnailer/default.nix index cb7b8214c57d..bfe8f80032dd 100644 --- a/pkgs/development/libraries/ffmpegthumbnailer/default.nix +++ b/pkgs/development/libraries/ffmpegthumbnailer/default.nix @@ -16,6 +16,12 @@ stdenv.mkDerivation rec { buildInputs = [ ffmpeg libpng libjpeg ]; cmakeFlags = [ "-DENABLE_THUMBNAILER=ON" ]; + # https://github.com/dirkvdb/ffmpegthumbnailer/issues/215 + postPatch = '' + substituteInPlace libffmpegthumbnailer.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { homepage = "https://github.com/dirkvdb/ffmpegthumbnailer"; description = "A lightweight video thumbnailer"; diff --git a/pkgs/development/libraries/gbenchmark/default.nix b/pkgs/development/libraries/gbenchmark/default.nix index fc356d6f0034..ff7aa2fbdda8 100644 --- a/pkgs/development/libraries/gbenchmark/default.nix +++ b/pkgs/development/libraries/gbenchmark/default.nix @@ -16,6 +16,11 @@ stdenv.mkDerivation rec { postPatch = '' cp -r ${gtest.src} googletest chmod -R u+w googletest + + # https://github.com/google/benchmark/issues/1396 + substituteInPlace cmake/benchmark.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ ''; doCheck = true; diff --git a/pkgs/development/libraries/getdns/default.nix b/pkgs/development/libraries/getdns/default.nix index 1ad8f1027c19..3691dc164077 100644 --- a/pkgs/development/libraries/getdns/default.nix +++ b/pkgs/development/libraries/getdns/default.nix @@ -29,6 +29,13 @@ in rec { buildInputs = [ libidn2 openssl unbound ]; + # https://github.com/getdnsapi/getdns/issues/517 + postPatch = '' + substituteInPlace getdns.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + postInstall = "rm -r $out/share/doc"; meta = with lib; diff --git a/pkgs/development/libraries/google-cloud-cpp/default.nix b/pkgs/development/libraries/google-cloud-cpp/default.nix index 2c5cade6b69c..18acca3f6915 100644 --- a/pkgs/development/libraries/google-cloud-cpp/default.nix +++ b/pkgs/development/libraries/google-cloud-cpp/default.nix @@ -42,6 +42,14 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace external/googleapis/CMakeLists.txt \ --replace "https://github.com/googleapis/googleapis/archive/\''${GOOGLE_CLOUD_CPP_GOOGLEAPIS_COMMIT_SHA}.tar.gz" "file://${googleapis}" + + # https://github.com/googleapis/google-cloud-cpp/issues/8992 + for file in external/googleapis/config.pc.in google/cloud/{,*/}config.pc.in; do + substituteInPlace "$file" \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_BINDIR@ @CMAKE_INSTALL_FULL_BINDIR@ + done ''; nativeBuildInputs = [ diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index be7509d4cfbf..b378c81c89f4 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -85,6 +85,7 @@ , srt , vo-aacenc , libfreeaptx +, zxing-cpp , VideoToolbox , AudioToolbox , AVFoundation @@ -171,6 +172,7 @@ stdenv.mkDerivation rec { srt vo-aacenc libfreeaptx + zxing-cpp ] ++ lib.optionals enableZbar [ zbar ] ++ lib.optionals faacSupport [ @@ -259,7 +261,6 @@ stdenv.mkDerivation rec { "-Dwasapi=disabled" # not packaged in nixpkgs as of writing / no Windows support "-Dwasapi2=disabled" # not packaged in nixpkgs as of writing / no Windows support "-Dwpe=disabled" # required `wpe-webkit` library not packaged in nixpkgs as of writing - "-Dzxing=disabled" # required `zxing-cpp` library not packaged in nixpkgs as of writing "-Disac=disabled" # depends on `webrtc-audio-coding-1` not compatible with 0.3 "-Dgs=disabled" # depends on `google-cloud-cpp` "-Donnx=disabled" # depends on `libonnxruntime` not packaged in nixpkgs as of writing diff --git a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix index b274999010a2..e4168299c182 100644 --- a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix +++ b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix @@ -1,10 +1,15 @@ -{ mkDerivation, lib, cmake, pkg-config }: +{ mkDerivation, lib, fetchpatch, cmake, pkg-config }: mkDerivation { pname = "extra-cmake-modules"; patches = [ ./nix-lib-path.patch + # https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/268 + (fetchpatch { + url = "https://invent.kde.org/frameworks/extra-cmake-modules/-/commit/5862a6f5b5cd7ed5a7ce2af01e44747c36318220.patch"; + sha256 = "10y36fc3hnpmcsmjgfxn1rp4chj5yrhgghj7m8gbmcai1q5jr0xj"; + }) ]; outputs = [ "out" ]; # this package has no runtime components diff --git a/pkgs/development/libraries/libargs/default.nix b/pkgs/development/libraries/libargs/default.nix index f75f556fb0de..3b27df772117 100644 --- a/pkgs/development/libraries/libargs/default.nix +++ b/pkgs/development/libraries/libargs/default.nix @@ -13,6 +13,14 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # https://github.com/Taywee/args/issues/108 + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace '$'{CMAKE_INSTALL_LIBDIR_ARCHIND} '$'{CMAKE_INSTALL_LIBDIR} + substituteInPlace packaging/pkgconfig.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { description = "A simple header-only C++ argument parser library"; homepage = "https://github.com/Taywee/args"; diff --git a/pkgs/development/libraries/libbtbb/default.nix b/pkgs/development/libraries/libbtbb/default.nix index 2e2b95c2d8c7..e0e70005e25f 100644 --- a/pkgs/development/libraries/libbtbb/default.nix +++ b/pkgs/development/libraries/libbtbb/default.nix @@ -13,6 +13,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ] ++ lib.optionals stdenv.isDarwin [ CoreServices ]; + # https://github.com/greatscottgadgets/libbtbb/issues/63 + postPatch = '' + substituteInPlace lib/libbtbb.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { description = "Bluetooth baseband decoding library"; homepage = "https://github.com/greatscottgadgets/libbtbb"; diff --git a/pkgs/development/libraries/libcork/default.nix b/pkgs/development/libraries/libcork/default.nix index 3875ff91185a..305ba24e280e 100644 --- a/pkgs/development/libraries/libcork/default.nix +++ b/pkgs/development/libraries/libcork/default.nix @@ -16,14 +16,20 @@ stdenv.mkDerivation rec { sha256 = "152gqnmr6wfmflf5l6447am4clmg3p69pvy3iw7yhaawjqa797sk"; }; - # N.B. We need to create this file, otherwise it tries to use git to - # determine the package version, which we do not want. - # - # N.B. We disable tests by force, since their build is broken. postPatch = '' + # N.B. We need to create this file, otherwise it tries to use git to + # determine the package version, which we do not want. echo "${version}" > .version-stamp echo "${version}" > .commit-stamp + + # N.B. We disable tests by force, since their build is broken. sed -i '/add_subdirectory(tests)/d' ./CMakeLists.txt + + # https://github.com/dcreager/libcork/issues/173 + substituteInPlace cmake/FindCTargets.cmake \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} \ + --replace '\$'{datarootdir}/'$'{base_docdir} '$'{CMAKE_INSTALL_FULL_DOCDIR} ''; nativeBuildInputs = [ cmake pkg-config ]; diff --git a/pkgs/development/libraries/libebml/default.nix b/pkgs/development/libraries/libebml/default.nix index 84025e24f659..00fc506add7f 100644 --- a/pkgs/development/libraries/libebml/default.nix +++ b/pkgs/development/libraries/libebml/default.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation rec { sha256 = "1yd6rsds03kwx5jki4hihd2bpfh26g5l1pi82qzaqzarixdxwzvl"; excludes = [ "ChangeLog" ]; }) + # in master post 1.4.2, see https://github.com/Matroska-Org/libebml/issues/97 + (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/Matroska-Org/libebml/commit/42fbae35d291b737f2bb4ad5d643fd0d48537a88.patch"; + sha256 = "020qp4a3l60mcm4n310ynxbbv5qlpmybb9xy10pjvx4brp83pmy3"; + }) ]; nativeBuildInputs = [ cmake pkg-config ]; diff --git a/pkgs/development/libraries/libebur128/default.nix b/pkgs/development/libraries/libebur128/default.nix index 656923da3d15..c91cb23189f7 100644 --- a/pkgs/development/libraries/libebur128/default.nix +++ b/pkgs/development/libraries/libebur128/default.nix @@ -14,6 +14,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ speexdsp ]; + # https://github.com/jiixyj/libebur128/issues/121 + postPatch = '' + substituteInPlace ebur128/libebur128.pc.cmake \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { description = "Implementation of the EBU R128 loudness standard"; homepage = "https://github.com/jiixyj/libebur128"; diff --git a/pkgs/development/libraries/libiio/cmake-fix-libxml2-find-package.patch b/pkgs/development/libraries/libiio/cmake-fix-libxml2-find-package.patch index 25345bef90c4..034f6d32c7d1 100644 --- a/pkgs/development/libraries/libiio/cmake-fix-libxml2-find-package.patch +++ b/pkgs/development/libraries/libiio/cmake-fix-libxml2-find-package.patch @@ -1,13 +1,13 @@ diff --color -ur a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt 2021-05-30 13:46:22.256040282 +0200 -+++ b/CMakeLists.txt 2021-05-30 14:15:42.530181216 +0200 -@@ -333,7 +333,7 @@ - # So, try first to find the CMake module provided by libxml2 package, then fallback - # on the CMake's FindLibXml2.cmake module (which can lack some definition, especially - # in static build case). --find_package(LibXml2 QUIET NO_MODULE) -+find_package(LibXml2 QUIET MODULE) - if(DEFINED LIBXML2_VERSION_STRING) - set(LIBXML2_FOUND ON) - set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) +--- a/CMakeLists.txt 2022-06-02 02:57:01.503340155 +0300 ++++ b/CMakeLists.txt 2022-06-02 02:54:33.726941188 +0300 +@@ -378,7 +378,7 @@ + # So, try first to find the CMake module provided by libxml2 package, then fallback + # on the CMake's FindLibXml2.cmake module (which can lack some definition, especially + # in static build case). +- find_package(LibXml2 QUIET NO_MODULE) ++ find_package(LibXml2 QUIET MODULE) + if(DEFINED LIBXML2_VERSION_STRING) + set(LIBXML2_FOUND ON) + set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) Seulement dans b: good.patch diff --git a/pkgs/development/libraries/libiio/default.nix b/pkgs/development/libraries/libiio/default.nix index e704076ab57a..400da08cab32 100644 --- a/pkgs/development/libraries/libiio/default.nix +++ b/pkgs/development/libraries/libiio/default.nix @@ -6,13 +6,15 @@ , libxml2 , python , libusb1 +, avahi +, libaio , runtimeShell , lib }: stdenv.mkDerivation rec { pname = "libiio"; - version = "0.21"; + version = "0.23"; outputs = [ "out" "lib" "dev" "python" ]; @@ -20,7 +22,7 @@ stdenv.mkDerivation rec { owner = "analogdevicesinc"; repo = "libiio"; rev = "v${version}"; - sha256 = "0psw67mzysdb8fkh8xpcwicm7z94k8plkcc8ymxyvl6inshq0mc7"; + sha256 = "0awny9zb43dcnxa5jpxay2zxswydblnbn4x6vi5mlw1r48pzhjf8"; }; # Revert after https://github.com/NixOS/nixpkgs/issues/125008 is @@ -37,6 +39,8 @@ stdenv.mkDerivation rec { python libxml2 libusb1 + avahi + libaio ] ++ lib.optional python.isPy3k python.pkgs.setuptools; cmakeFlags = [ diff --git a/pkgs/development/libraries/libjxl/default.nix b/pkgs/development/libraries/libjxl/default.nix index 461a3579ddef..567d985fd3d4 100644 --- a/pkgs/development/libraries/libjxl/default.nix +++ b/pkgs/development/libraries/libjxl/default.nix @@ -35,6 +35,13 @@ stdenv.mkDerivation rec { }; patches = [ + # present in master, see https://github.com/libjxl/libjxl/pull/1403 + (fetchpatch { + name = "prefixless-pkg-config.patch"; + url = "https://github.com/libjxl/libjxl/commit/0b906564bfbfd8507d61c5d6a447f545f893227c.patch"; + sha256 = "1g5c6lrsmgxb9j64pjy8lbdgbvw834m5jyfivy9ppmd8iiv0kkq4"; + }) + # present in master, remove after 0.7? (fetchpatch { name = "fix-link-lld-macho.patch"; diff --git a/pkgs/development/libraries/libmatroska/default.nix b/pkgs/development/libraries/libmatroska/default.nix index a89bf9fc4ab9..1d5d13259bb2 100644 --- a/pkgs/development/libraries/libmatroska/default.nix +++ b/pkgs/development/libraries/libmatroska/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config +{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config , libebml }: stdenv.mkDerivation rec { @@ -12,6 +12,15 @@ stdenv.mkDerivation rec { sha256 = "01dg12ndxfdqgjx5v2qy4mff6xjdxglywyg82sr3if5aw6rp3dji"; }; + # in master post 1.6.3, see https://github.com/Matroska-Org/libmatroska/issues/62 + patches = [ + (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/Matroska-Org/libmatroska/commit/53f6ea573878621871bca5f089220229fcb33a3b.patch"; + sha256 = "1lcxl3n32kk5x4aa4ja7p68km7qb2bwscavpv7qdmbhp3w5ia0mk"; + }) + ]; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ libebml ]; diff --git a/pkgs/development/libraries/libmodule/default.nix b/pkgs/development/libraries/libmodule/default.nix index d77d2bcbdcd7..dd98908f3111 100644 --- a/pkgs/development/libraries/libmodule/default.nix +++ b/pkgs/development/libraries/libmodule/default.nix @@ -17,6 +17,13 @@ stdenv.mkDerivation rec { pkg-config ]; + # https://github.com/FedeDP/libmodule/issues/7 + postPatch = '' + substituteInPlace Extra/libmodule.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { description = "C simple and elegant implementation of an actor library"; homepage = "https://github.com/FedeDP/libmodule"; diff --git a/pkgs/development/libraries/libnats-c/default.nix b/pkgs/development/libraries/libnats-c/default.nix index 7c72b6774994..b39cb7be189a 100644 --- a/pkgs/development/libraries/libnats-c/default.nix +++ b/pkgs/development/libraries/libnats-c/default.nix @@ -20,6 +20,12 @@ stdenv.mkDerivation rec { separateDebugInfo = true; outputs = [ "out" "dev" ]; + # https://github.com/nats-io/nats.c/issues/542 + postPatch = '' + substituteInPlace src/libnats.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { description = "C API for the NATS messaging system"; homepage = "https://github.com/nats-io/nats.c"; diff --git a/pkgs/development/libraries/libquotient/default.nix b/pkgs/development/libraries/libquotient/default.nix index eea7eeb88fc7..0f75c8d1f4e5 100644 --- a/pkgs/development/libraries/libquotient/default.nix +++ b/pkgs/development/libraries/libquotient/default.nix @@ -20,6 +20,13 @@ mkDerivation rec { "-DQuotient_ENABLE_E2EE=OFF" ]; + # https://github.com/quotient-im/libQuotient/issues/551 + postPatch = '' + substituteInPlace Quotient.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { description = "A Qt5 library to write cross-platform clients for Matrix"; homepage = "https://matrix.org/docs/projects/sdk/quotient"; diff --git a/pkgs/development/libraries/libsurvive/default.nix b/pkgs/development/libraries/libsurvive/default.nix index 02c4ddffd78a..429c4bb33d96 100644 --- a/pkgs/development/libraries/libsurvive/default.nix +++ b/pkgs/development/libraries/libsurvive/default.nix @@ -34,6 +34,12 @@ stdenv.mkDerivation rec { eigen ]; + # https://github.com/cntools/libsurvive/issues/272 + postPatch = '' + substituteInPlace survive.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { description = "Open Source Lighthouse Tracking System"; homepage = "https://github.com/cntools/libsurvive"; diff --git a/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/pkgs/development/libraries/libtorrent-rasterbar/default.nix index 412446f215f8..09788cfef71d 100644 --- a/pkgs/development/libraries/libtorrent-rasterbar/default.nix +++ b/pkgs/development/libraries/libtorrent-rasterbar/default.nix @@ -25,6 +25,18 @@ in stdenv.mkDerivation { buildInputs = [ boostPython openssl zlib python ncurses ] ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ]; + # https://github.com/arvidn/libtorrent/issues/6865 + postPatch = '' + substituteInPlace cmake/Modules/GeneratePkgConfig.cmake \ + --replace @CMAKE_INSTALL_PREFIX@/'$<'1: '$<'1: + substituteInPlace cmake/Modules/GeneratePkgConfig/target-compile-settings.cmake.in \ + --replace 'set(_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@")' \ + 'set(_INSTALL_LIBDIR "@CMAKE_INSTALL_LIBDIR@") + set(_INSTALL_FULL_LIBDIR "@CMAKE_INSTALL_FULL_LIBDIR@")' + substituteInPlace cmake/Modules/GeneratePkgConfig/pkg-config.cmake.in \ + --replace '$'{prefix}/@_INSTALL_LIBDIR@ @_INSTALL_FULL_LIBDIR@ + ''; + postInstall = '' moveToOutput "include" "$dev" moveToOutput "lib/${python.libPrefix}" "$python" diff --git a/pkgs/development/libraries/libtsm/default.nix b/pkgs/development/libraries/libtsm/default.nix index 25214242b531..7c0868509f09 100644 --- a/pkgs/development/libraries/libtsm/default.nix +++ b/pkgs/development/libraries/libtsm/default.nix @@ -15,6 +15,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config ]; + # https://github.com/Aetf/libtsm/issues/20 + postPatch = '' + substituteInPlace etc/libtsm.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { description = "Terminal-emulator State Machine"; homepage = "http://www.freedesktop.org/wiki/Software/kmscon/libtsm/"; diff --git a/pkgs/development/libraries/libunarr/default.nix b/pkgs/development/libraries/libunarr/default.nix index 523ce82ce22d..94269e85c66d 100644 --- a/pkgs/development/libraries/libunarr/default.nix +++ b/pkgs/development/libraries/libunarr/default.nix @@ -11,6 +11,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # https://github.com/selmf/unarr/issues/23 + postPatch = '' + substituteInPlace pkg-config.pc.cmake \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { homepage = "https://github.com/selmf/unarr"; description = "A lightweight decompression library with support for rar, tar and zip archives"; diff --git a/pkgs/development/libraries/libzra/default.nix b/pkgs/development/libraries/libzra/default.nix index 3ebfc21095d1..feb0f1840b4d 100644 --- a/pkgs/development/libraries/libzra/default.nix +++ b/pkgs/development/libraries/libzra/default.nix @@ -17,6 +17,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # in submodule dev as of 1.4.7 + postPatch = '' + (cd submodule/zstd && patch -Np1 < ${./fix-pkg-config.patch}) + ''; + meta = with lib; { homepage = "https://github.com/zraorg/ZRA"; description = "Library for ZStandard random access"; diff --git a/pkgs/development/libraries/libzra/fix-pkg-config.patch b/pkgs/development/libraries/libzra/fix-pkg-config.patch new file mode 100644 index 000000000000..5b0d40a4233f --- /dev/null +++ b/pkgs/development/libraries/libzra/fix-pkg-config.patch @@ -0,0 +1,150 @@ +From 7be7e35d61d8d499599623502a35460d410de114 Mon Sep 17 00:00:00 2001 +From: Alexander Shpilkin +Date: Thu, 26 May 2022 16:03:27 +0300 +Subject: [PATCH] Squashed commit of the following: + +commit 9aacb9d5da65a64c3845937a6f9eede329d43989 +Author: W. Felix Handte +Date: Tue Dec 8 20:46:02 2020 -0500 + + Apply Same Strategy to CMake + + (cherry picked from commit a75f9ce3e924564ab358c2c1aa95b6268383ec42) + +commit e21b7ad0d98d1322ea92f99fcd1f85e2d6b6f6b7 +Author: W. Felix Handte +Date: Tue Dec 8 20:10:05 2020 -0500 + + Avoid Use of Regexes in Building Package-Config File + + (cherry picked from commit b521183c74795bd9bdd9bdebe74af01cae4d3d43) +--- + build/cmake/lib/CMakeLists.txt | 29 ++++++++++++++++++++++++---- + lib/Makefile | 35 ++++++++++++++++------------------ + lib/libzstd.pc.in | 6 +++--- + 3 files changed, 44 insertions(+), 26 deletions(-) + +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 32ae7525..466c2c7b 100644 +--- a/build/cmake/lib/CMakeLists.txt ++++ b/build/cmake/lib/CMakeLists.txt +@@ -137,12 +137,33 @@ endif () + if (UNIX) + # pkg-config + set(PREFIX "${CMAKE_INSTALL_PREFIX}") +- set(LIBDIR "${CMAKE_INSTALL_LIBDIR}") +- set(INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}") ++ set(EXEC_PREFIX "\\$$\{prefix}") ++ set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}") ++ set(INCLUDEDIR "${CMAKE_INSTALL_FULL_INCLUDEDIR}") + set(VERSION "${zstd_VERSION}") ++ ++ string(LENGTH "${PREFIX}" PREFIX_LENGTH) ++ string(SUBSTRING "${LIBDIR}" 0 ${PREFIX_LENGTH} LIBDIR_PREFIX) ++ string(SUBSTRING "${LIBDIR}" ${PREFIX_LENGTH} -1 LIBDIR_SUFFIX) ++ string(SUBSTRING "${INCLUDEDIR}" 0 ${PREFIX_LENGTH} INCLUDEDIR_PREFIX) ++ string(SUBSTRING "${INCLUDEDIR}" ${PREFIX_LENGTH} -1 INCLUDEDIR_SUFFIX) ++ ++ if ("${INCLUDEDIR_PREFIX}" STREQUAL "${PREFIX}") ++ set(INCLUDEDIR_PREFIX "\\$$\{prefix}") ++ endif() ++ if ("${LIBDIR_PREFIX}" STREQUAL "${PREFIX}") ++ set(LIBDIR_PREFIX "\\$$\{exec_prefix}") ++ endif() ++ + add_custom_target(libzstd.pc ALL +- ${CMAKE_COMMAND} -DIN="${LIBRARY_DIR}/libzstd.pc.in" -DOUT="libzstd.pc" +- -DPREFIX="${PREFIX}" -DLIBDIR="${LIBDIR}" -DINCLUDEDIR="${INCLUDEDIR}" -DVERSION="${VERSION}" ++ ${CMAKE_COMMAND} ++ -DIN="${LIBRARY_DIR}/libzstd.pc.in" ++ -DOUT="libzstd.pc" ++ -DPREFIX="${PREFIX}" ++ -DEXEC_PREFIX="${EXEC_PREFIX}" ++ -DINCLUDEDIR="${INCLUDEDIR_PREFIX}${INCLUDEDIR_SUFFIX}" ++ -DLIBDIR="${LIBDIR_PREFIX}${LIBDIR_SUFFIX}" ++ -DVERSION="${VERSION}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake" + COMMENT "Creating pkg-config file") + +diff --git a/lib/Makefile b/lib/Makefile +index 4a9ab799..2893ec21 100644 +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -257,6 +257,8 @@ ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD Ne + + all: libzstd.pc + ++HAS_EXPLICIT_EXEC_PREFIX := $(if $(or $(EXEC_PREFIX),$(exec_prefix)),1,) ++ + DESTDIR ?= + # directory variables : GNU conventions prefer lowercase + # see https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html +@@ -270,24 +272,17 @@ LIBDIR ?= $(libdir) + includedir ?= $(PREFIX)/include + INCLUDEDIR ?= $(includedir) + +-PCLIBDIR ?= $(shell echo "$(LIBDIR)" | sed -n $(SED_ERE_OPT) -e "s@^$(EXEC_PREFIX)(/|$$)@@p") +-PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | sed -n $(SED_ERE_OPT) -e "s@^$(PREFIX)(/|$$)@@p") ++PCINCDIR := $(patsubst $(PREFIX)%,%,$(INCLUDEDIR)) ++PCLIBDIR := $(patsubst $(EXEC_PREFIX)%,%,$(LIBDIR)) + +-ifeq (,$(PCLIBDIR)) +-# Additional prefix check is required, since the empty string is technically a +-# valid PCLIBDIR +-ifeq (,$(shell echo "$(LIBDIR)" | sed -n $(SED_ERE_OPT) -e "\\@^$(EXEC_PREFIX)(/|$$)@ p")) +-$(error configured libdir ($(LIBDIR)) is outside of prefix ($(PREFIX)), can't generate pkg-config file) +-endif +-endif ++# If we successfully stripped off a prefix, we'll add a reference to the ++# relevant pc variable. ++PCINCPREFIX := $(if $(findstring $(INCLUDEDIR),$(PCINCDIR)),,$${prefix}) ++PCLIBPREFIX := $(if $(findstring $(LIBDIR),$(PCLIBDIR)),,$${exec_prefix}) + +-ifeq (,$(PCINCDIR)) +-# Additional prefix check is required, since the empty string is technically a +-# valid PCINCDIR +-ifeq (,$(shell echo "$(INCLUDEDIR)" | sed -n $(SED_ERE_OPT) -e "\\@^$(PREFIX)(/|$$)@ p")) +-$(error configured includedir ($(INCLUDEDIR)) is outside of exec_prefix ($(EXEC_PREFIX)), can't generate pkg-config file) +-endif +-endif ++# If no explicit EXEC_PREFIX was set by the caller, write it out as a reference ++# to PREFIX, rather than as a resolved value. ++PCEXEC_PREFIX := $(if $(HAS_EXPLICIT_EXEC_PREFIX),$(EXEC_PREFIX),$${prefix}) + + ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly)) + PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig +@@ -308,9 +303,11 @@ INSTALL_DATA ?= $(INSTALL) -m 644 + libzstd.pc: + libzstd.pc: libzstd.pc.in + @echo creating pkgconfig +- $(Q)@sed $(SED_ERE_OPT) -e 's|@PREFIX@|$(PREFIX)|' \ +- -e 's|@LIBDIR@|$(PCLIBDIR)|' \ +- -e 's|@INCLUDEDIR@|$(PCINCDIR)|' \ ++ $(Q)@sed $(SED_ERE_OPT) \ ++ -e 's|@PREFIX@|$(PREFIX)|' \ ++ -e 's|@EXEC_PREFIX@|$(PCEXEC_PREFIX)|' \ ++ -e 's|@INCLUDEDIR@|$(PCINCPREFIX)$(PCINCDIR)|' \ ++ -e 's|@LIBDIR@|$(PCLIBPREFIX)$(PCLIBDIR)|' \ + -e 's|@VERSION@|$(VERSION)|' \ + $< >$@ + +diff --git a/lib/libzstd.pc.in b/lib/libzstd.pc.in +index 8ec0235a..8465c977 100644 +--- a/lib/libzstd.pc.in ++++ b/lib/libzstd.pc.in +@@ -3,9 +3,9 @@ + # BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) + + prefix=@PREFIX@ +-exec_prefix=${prefix} +-includedir=${prefix}/@INCLUDEDIR@ +-libdir=${exec_prefix}/@LIBDIR@ ++exec_prefix=@EXEC_PREFIX@ ++includedir=@INCLUDEDIR@ ++libdir=@LIBDIR@ + + Name: zstd + Description: fast lossless compression algorithm library +-- +2.36.0 + diff --git a/pkgs/development/libraries/mysocketw/default.nix b/pkgs/development/libraries/mysocketw/default.nix index 32987d649922..5ee10c854a55 100644 --- a/pkgs/development/libraries/mysocketw/default.nix +++ b/pkgs/development/libraries/mysocketw/default.nix @@ -1,10 +1,20 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch +, fetchurl , openssl , cmake }: +let + + joinpaths-src = fetchurl { + url = "https://github.com/AnotherFoxGuy/CMakeCM/raw/afe41f4536ae21f6f11f83e8c0b8b8c450ef1332/modules/JoinPaths.cmake"; + hash = "sha256-eUsNj6YqO3mMffEtUBFFgNGkeiNL+2tNgwkutkam7MQ="; + }; + +in stdenv.mkDerivation rec { pname = "mysocketw"; version = "3.11.0"; @@ -16,6 +26,15 @@ stdenv.mkDerivation rec { hash = "sha256-mpfhmKE2l59BllkOjmURIfl17lAakXpmGh2x9SFSaAo="; }; + patches = [ + # in master post 3.11.0, see https://github.com/RigsOfRods/socketw/issues/16 + (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/RigsOfRods/socketw/commit/17cad062c3673bd0da74a2fecadb01dbf9813a07.patch"; + sha256 = "01b019gfm01g0r1548cizrf7mqigsda8jnrzhg8dhi9c49nfw1bp"; + }) + ]; + nativeBuildInputs = [ cmake ]; @@ -24,6 +43,12 @@ stdenv.mkDerivation rec { openssl ]; + postUnpack = ''( + mkdir -p source/build/_cmcm-modules/resolved && cd $_ + cp ${joinpaths-src} JoinPaths.cmake + printf %s 'https://AnotherFoxGuy.com/CMakeCM::modules/JoinPaths.cmake.1' > JoinPaths.cmake.whence + )''; + postPatch = lib.optionalString stdenv.isDarwin '' substituteInPlace src/Makefile \ --replace -Wl,-soname, -Wl,-install_name,$out/lib/ diff --git a/pkgs/development/libraries/nanomsg/default.nix b/pkgs/development/libraries/nanomsg/default.nix index e7290d54c0b8..d7b7409dad14 100644 --- a/pkgs/development/libraries/nanomsg/default.nix +++ b/pkgs/development/libraries/nanomsg/default.nix @@ -21,6 +21,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # https://github.com/nanomsg/nanomsg/issues/1082 + postPatch = '' + substituteInPlace src/pkgconfig.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { description= "Socket library that provides several common communication patterns"; homepage = "https://nanomsg.org/"; diff --git a/pkgs/development/libraries/notcurses/default.nix b/pkgs/development/libraries/notcurses/default.nix index 21b10ad4ed15..a0a5ddfa9c2d 100644 --- a/pkgs/development/libraries/notcurses/default.nix +++ b/pkgs/development/libraries/notcurses/default.nix @@ -44,6 +44,22 @@ stdenv.mkDerivation rec { lib.optional (qrcodegenSupport) "-DUSE_QRCODEGEN=ON" ++ lib.optional (!multimediaSupport) "-DUSE_MULTIMEDIA=none"; + # https://github.com/dankamongmen/notcurses/issues/2661 + postPatch = '' + substituteInPlace tools/notcurses-core.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + substituteInPlace tools/notcurses-ffi.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + substituteInPlace tools/notcurses++.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + substituteInPlace tools/notcurses.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { homepage = "https://github.com/dankamongmen/notcurses"; description = "Blingful TUIs and character graphics"; diff --git a/pkgs/development/libraries/olm/default.nix b/pkgs/development/libraries/olm/default.nix index 47a265687122..8c205d73287f 100644 --- a/pkgs/development/libraries/olm/default.nix +++ b/pkgs/development/libraries/olm/default.nix @@ -16,6 +16,12 @@ stdenv.mkDerivation rec { doCheck = true; + postPatch = '' + substituteInPlace olm.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { description = "Implements double cryptographic ratchet and Megolm ratchet"; homepage = "https://gitlab.matrix.org/matrix-org/olm"; diff --git a/pkgs/development/libraries/openal-soft/default.nix b/pkgs/development/libraries/openal-soft/default.nix index fa1d5af48042..434918c0c87b 100644 --- a/pkgs/development/libraries/openal-soft/default.nix +++ b/pkgs/development/libraries/openal-soft/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config +{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config , alsaSupport ? !stdenv.isDarwin, alsa-lib , dbusSupport ? !stdenv.isDarwin, dbus , pipewireSupport ? !stdenv.isDarwin, pipewire @@ -17,9 +17,16 @@ stdenv.mkDerivation rec { sha256 = "sha256-MVM0qCZDWcO7/Hnco+0dBqzBLcWD279xjx0slxxlc4w="; }; - # this will make it find its own data files (e.g. HRTF profiles) - # without any other configuration - patches = [ ./search-out.patch ]; + patches = [ + # this will make it find its own data files (e.g. HRTF profiles) + # without any other configuration + ./search-out.patch + # merged after 1.22.0 in https://github.com/kcat/openal-soft/pull/696 + (fetchpatch { + url = "https://github.com/kcat/openal-soft/commit/0bf2abae9b2121c3bc5a56dab30eca308136bc29.patch"; + sha256 = "1fhjjy7nrhrj3a0wlmsqpf8h3ss6s487vz5jrhamyv04nbcahn20"; + }) + ]; postPatch = '' substituteInPlace core/helpers.cpp \ --replace "@OUT@" $out @@ -46,7 +53,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "OpenAL alternative"; - homepage = "https://kcat.strangesoft.net/openal.html"; + homepage = "https://openal-soft.org/"; license = licenses.lgpl2; maintainers = with maintainers; [ftrvxmtrx]; platforms = platforms.unix; diff --git a/pkgs/development/libraries/opencolorio/default.nix b/pkgs/development/libraries/opencolorio/default.nix index 81ab688b6436..79f66a616b95 100644 --- a/pkgs/development/libraries/opencolorio/default.nix +++ b/pkgs/development/libraries/opencolorio/default.nix @@ -55,6 +55,13 @@ stdenv.mkDerivation rec { # TODO Investigate this: Python and GPU tests fail to load libOpenColorIO.so.2.0 # doCheck = true; + # https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1649 + postPatch = '' + substituteInPlace src/OpenColorIO/CMakeLists.txt \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} + ''; + meta = with lib; { homepage = "https://opencolorio.org"; description = "A color management framework for visual effects and animation"; diff --git a/pkgs/development/libraries/opendht/default.nix b/pkgs/development/libraries/opendht/default.nix index dc1afaab3f40..26a7676dd615 100644 --- a/pkgs/development/libraries/opendht/default.nix +++ b/pkgs/development/libraries/opendht/default.nix @@ -59,6 +59,13 @@ stdenv.mkDerivation rec { "-DOPENDHT_PUSH_NOTIFICATIONS=ON" ]; + # https://github.com/savoirfairelinux/opendht/issues/612 + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + ''; + outputs = [ "out" "lib" "dev" "man" ]; meta = with lib; { diff --git a/pkgs/development/libraries/openxr-loader/default.nix b/pkgs/development/libraries/openxr-loader/default.nix index 51f86ef38604..6731fb716fe7 100644 --- a/pkgs/development/libraries/openxr-loader/default.nix +++ b/pkgs/development/libraries/openxr-loader/default.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" "layers" ]; + # https://github.com/KhronosGroup/OpenXR-SDK-Source/issues/305 + postPatch = '' + substituteInPlace src/loader/openxr.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + postInstall = '' mkdir -p "$layers/share" mv "$out/share/openxr" "$layers/share" diff --git a/pkgs/development/libraries/orcania/default.nix b/pkgs/development/libraries/orcania/default.nix index abe45b63372f..338deafa763e 100644 --- a/pkgs/development/libraries/orcania/default.nix +++ b/pkgs/development/libraries/orcania/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, check, subunit }: +{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, check, subunit }: stdenv.mkDerivation rec { pname = "orcania"; version = "2.3.0"; @@ -10,6 +10,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-QAq/6MGVj+iBHLElHuqokF1v3LU1TZ9hVVJE1s3y6f0="; }; + # in master post 2.2.2, see https://github.com/babelouest/orcania/issues/27 + patches = [ + (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/babelouest/orcania/commit/4eac7d5ff76bb3bec8250fef300b723c8891552a.patch"; + sha256 = "01bsxay1ca8d08ac3ddcqyvjwgz5mgs68jz5y3gzq4qnzl3q1i54"; + }) + ]; + nativeBuildInputs = [ cmake ]; checkInputs = [ check subunit ]; diff --git a/pkgs/development/libraries/proj/default.nix b/pkgs/development/libraries/proj/default.nix index 68b47e2a2eb3..c7a316778212 100644 --- a/pkgs/development/libraries/proj/default.nix +++ b/pkgs/development/libraries/proj/default.nix @@ -22,6 +22,19 @@ stdenv.mkDerivation rec { sha256 = "sha256-zMP+WzC65BFz8g8mF5t7toqxmxCJePysd6WJuqpe8yg="; }; + # https://github.com/OSGeo/PROJ/issues/3206 + postPatch = '' + # NB will not apply once https://github.com/OSGeo/PROJ/pull/3150 is released + substituteInPlace cmake/ProjUtilities.cmake \ + --replace '$\{exec_prefix\}/$'{PROJ_LIB_SUBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '$\{prefix\}/$'{PROJ_INCLUDE_SUBDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} \ + --replace '$\{prefix\}/$'{CMAKE_INSTALL_DATAROOTDIR} '$'{CMAKE_INSTALL_FULL_DATAROOTDIR} + substituteInPlace cmake/project-config.cmake.in \ + --replace '$'{_ROOT}/@INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ \ + --replace '$'{_ROOT}/@LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{_ROOT}/@BINDIR@ @CMAKE_INSTALL_FULL_BINDIR@ + ''; + outputs = [ "out" "dev" ]; nativeBuildInputs = [ cmake pkg-config ]; diff --git a/pkgs/development/libraries/rabbitmq-c/default.nix b/pkgs/development/libraries/rabbitmq-c/default.nix index 3d8fa0f95d93..b5324abd6ced 100644 --- a/pkgs/development/libraries/rabbitmq-c/default.nix +++ b/pkgs/development/libraries/rabbitmq-c/default.nix @@ -14,6 +14,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ openssl popt xmlto ]; + # https://github.com/alanxz/rabbitmq-c/issues/733 + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + ''; + meta = with lib; { description = "RabbitMQ C AMQP client library"; homepage = "https://github.com/alanxz/rabbitmq-c"; diff --git a/pkgs/development/libraries/recastnavigation/default.nix b/pkgs/development/libraries/recastnavigation/default.nix index 7825983a455b..59f39986ffcd 100644 --- a/pkgs/development/libraries/recastnavigation/default.nix +++ b/pkgs/development/libraries/recastnavigation/default.nix @@ -15,6 +15,11 @@ stdenv.mkDerivation rec { postPatch = '' cp ${catch}/include/catch/catch.hpp Tests/catch.hpp + + # https://github.com/recastnavigation/recastnavigation/issues/524 + substituteInPlace CMakeLists.txt \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} ''; doCheck = true; diff --git a/pkgs/development/libraries/reproc/default.nix b/pkgs/development/libraries/reproc/default.nix index b8449b61d76d..2083a6a7af4d 100644 --- a/pkgs/development/libraries/reproc/default.nix +++ b/pkgs/development/libraries/reproc/default.nix @@ -22,6 +22,16 @@ stdenv.mkDerivation rec { "-DREPROC_TEST=ON" ]; + # https://github.com/DaanDeMeyer/reproc/issues/81 + postPatch = '' + substituteInPlace reproc++/reproc++.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + substituteInPlace reproc/reproc.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { homepage = "https://github.com/DaanDeMeyer/reproc"; description = "A cross-platform (C99/C++11) process library"; diff --git a/pkgs/development/libraries/rinutils/default.nix b/pkgs/development/libraries/rinutils/default.nix index d80a5f79d6ad..efb2adf497f1 100644 --- a/pkgs/development/libraries/rinutils/default.nix +++ b/pkgs/development/libraries/rinutils/default.nix @@ -18,4 +18,11 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake perl ]; + + # https://github.com/shlomif/rinutils/issues/5 + # (variable was unused at time of writing) + postPatch = '' + substituteInPlace librinutils.pc.in \ + --replace '$'{exec_prefix}/@RINUTILS_INSTALL_MYLIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; } diff --git a/pkgs/development/libraries/rocm-thunk/default.nix b/pkgs/development/libraries/rocm-thunk/default.nix index 583d9b59900e..c2a67a6f1462 100644 --- a/pkgs/development/libraries/rocm-thunk/default.nix +++ b/pkgs/development/libraries/rocm-thunk/default.nix @@ -26,6 +26,13 @@ stdenv.mkDerivation rec { buildInputs = [ libdrm numactl ]; + # https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/issues/75 + postPatch = '' + substituteInPlace libhsakmt.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + postInstall = '' cp -r $src/include $out ''; diff --git a/pkgs/development/libraries/sentencepiece/default.nix b/pkgs/development/libraries/sentencepiece/default.nix index cc4dd1268e60..ea903ca58e0e 100644 --- a/pkgs/development/libraries/sentencepiece/default.nix +++ b/pkgs/development/libraries/sentencepiece/default.nix @@ -24,6 +24,13 @@ stdenv.mkDerivation rec { outputs = [ "bin" "dev" "out" ]; + # https://github.com/google/sentencepiece/issues/754 + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace '\$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + ''; + meta = with lib; { homepage = "https://github.com/google/sentencepiece"; description = "Unsupervised text tokenizer for Neural Network-based text generation"; diff --git a/pkgs/development/libraries/spdlog/default.nix b/pkgs/development/libraries/spdlog/default.nix index 9c61ef70624d..b77eb935d4e6 100644 --- a/pkgs/development/libraries/spdlog/default.nix +++ b/pkgs/development/libraries/spdlog/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, fmt_8 +{ lib, stdenv, fetchFromGitHub, cmake, fmt_8, fetchpatch , staticBuild ? stdenv.hostPlatform.isStatic }: @@ -15,6 +15,13 @@ let inherit sha256; }; + # in master post 1.10.0, see https://github.com/gabime/spdlog/issues/2380 + patches = lib.optional (lib.versionAtLeast version "1.4.1") (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/gabime/spdlog/commit/afb69071d5346b84e38fbcb0c8c32eddfef02a55.patch"; + sha256 = "0cab2bbv8zyfhrhfvcyfwf5p2fddlq5hs2maampn5w18f6jhvk6q"; + }); + nativeBuildInputs = [ cmake ]; # spdlog <1.3 uses a bundled version of fmt propagatedBuildInputs = lib.optional (lib.versionAtLeast version "1.3") fmt_8; diff --git a/pkgs/development/libraries/spirv-headers/default.nix b/pkgs/development/libraries/spirv-headers/default.nix index 36ab5008e6ab..de135e9168ac 100644 --- a/pkgs/development/libraries/spirv-headers/default.nix +++ b/pkgs/development/libraries/spirv-headers/default.nix @@ -13,6 +13,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # https://github.com/KhronosGroup/SPIRV-Headers/issues/282 + postPatch = '' + substituteInPlace SPIRV-Headers.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { inherit (src.meta) homepage; description = "Machine-readable components of the Khronos SPIR-V Registry"; diff --git a/pkgs/development/libraries/tdlib/default.nix b/pkgs/development/libraries/tdlib/default.nix index 0196e62fb977..10982240d971 100644 --- a/pkgs/development/libraries/tdlib/default.nix +++ b/pkgs/development/libraries/tdlib/default.nix @@ -15,6 +15,16 @@ stdenv.mkDerivation rec { buildInputs = [ gperf openssl readline zlib ]; nativeBuildInputs = [ cmake ]; + # https://github.com/tdlib/td/issues/1974 + postPatch = '' + substituteInPlace CMake/GeneratePkgConfig.cmake \ + --replace 'function(generate_pkgconfig' \ + 'include(GNUInstallDirs) + function(generate_pkgconfig' \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + ''; + meta = with lib; { description = "Cross-platform library for building Telegram clients"; homepage = "https://core.telegram.org/tdlib/"; diff --git a/pkgs/development/libraries/tinyobjloader/default.nix b/pkgs/development/libraries/tinyobjloader/default.nix index 113e5f5ae95a..d07a841c3c02 100644 --- a/pkgs/development/libraries/tinyobjloader/default.nix +++ b/pkgs/development/libraries/tinyobjloader/default.nix @@ -16,6 +16,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # https://github.com/tinyobjloader/tinyobjloader/issues/336 + postPatch = '' + substituteInPlace tinyobjloader.pc.in \ + --replace '$'{prefix}/@TINYOBJLOADER_LIBRARY_DIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@TINYOBJLOADER_INCLUDE_DIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { homepage = "https://github.com/tinyobjloader/tinyobjloader"; description = "Tiny but powerful single file wavefront obj loader"; diff --git a/pkgs/development/libraries/usrsctp/default.nix b/pkgs/development/libraries/usrsctp/default.nix index 64b1debc0ce5..af8979c79d13 100644 --- a/pkgs/development/libraries/usrsctp/default.nix +++ b/pkgs/development/libraries/usrsctp/default.nix @@ -13,6 +13,13 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # https://github.com/sctplab/usrsctp/issues/662 + postPatch = '' + substituteInPlace usrsctplib/CMakeLists.txt \ + --replace '$'{exec_prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + ''; + meta = with lib; { homepage = "https://github.com/sctplab/usrsctp"; description = "A portable SCTP userland stack"; diff --git a/pkgs/development/libraries/wildmidi/default.nix b/pkgs/development/libraries/wildmidi/default.nix index 7983806a3090..88dd403a31fd 100644 --- a/pkgs/development/libraries/wildmidi/default.nix +++ b/pkgs/development/libraries/wildmidi/default.nix @@ -18,6 +18,10 @@ stdenv.mkDerivation rec { preConfigure = '' substituteInPlace CMakeLists.txt \ --replace /etc/wildmidi $out/etc + # https://github.com/Mindwerks/wildmidi/issues/236 + substituteInPlace src/wildmidi.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ ''; postInstall = '' diff --git a/pkgs/development/libraries/xsimd/default.nix b/pkgs/development/libraries/xsimd/default.nix index 79bfdf9712ad..7d0af99645ec 100644 --- a/pkgs/development/libraries/xsimd/default.nix +++ b/pkgs/development/libraries/xsimd/default.nix @@ -25,6 +25,12 @@ stdenv.mkDerivation rec { in "-${builtins.concatStringsSep ":" filteredTests}"; + # https://github.com/xtensor-stack/xsimd/issues/748 + postPatch = '' + substituteInPlace xsimd.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { description = "C++ wrappers for SIMD intrinsics"; homepage = "https://github.com/xtensor-stack/xsimd"; diff --git a/pkgs/development/libraries/xtensor/default.nix b/pkgs/development/libraries/xtensor/default.nix index fe978998d637..3503c6894efe 100644 --- a/pkgs/development/libraries/xtensor/default.nix +++ b/pkgs/development/libraries/xtensor/default.nix @@ -26,6 +26,12 @@ stdenv.mkDerivation rec { checkInputs = [ gtest ]; checkTarget = "xtest"; + # https://github.com/xtensor-stack/xtensor/issues/2542 + postPatch = '' + substituteInPlace xtensor.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + meta = with lib; { description = "Multi-dimensional arrays with broadcasting and lazy computing."; homepage = "https://github.com/xtensor-stack/xtensor"; diff --git a/pkgs/development/libraries/zxing-cpp/default.nix b/pkgs/development/libraries/zxing-cpp/default.nix index 126ef2bc69d6..b9d61e5af626 100644 --- a/pkgs/development/libraries/zxing-cpp/default.nix +++ b/pkgs/development/libraries/zxing-cpp/default.nix @@ -26,6 +26,17 @@ stdenv.mkDerivation rec { "-DBUILD_BLACKBOX_TESTS=OFF" ]; + # https://github.com/nu-book/zxing-cpp/issues/335 + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace 'configure_file(zxing.pc.in' \ + 'include(GNUInstallDirs) + configure_file(zxing.pc.in' + substituteInPlace zxing.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { homepage = "https://github.com/nu-book/zxing-cpp"; description = "C++ port of zxing (a Java barcode image processing library)"; diff --git a/pkgs/development/tools/spirv-tools/default.nix b/pkgs/development/tools/spirv-tools/default.nix index 0a35478c5e36..327fed92d46f 100644 --- a/pkgs/development/tools/spirv-tools/default.nix +++ b/pkgs/development/tools/spirv-tools/default.nix @@ -17,6 +17,21 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DSPIRV-Headers_SOURCE_DIR=${spirv-headers.src}" ]; + # https://github.com/KhronosGroup/SPIRV-Tools/issues/3905 + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace '-P ''${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake' \ + '-DCMAKE_INSTALL_FULL_LIBDIR=''${CMAKE_INSTALL_FULL_LIBDIR} + -DCMAKE_INSTALL_FULL_INCLUDEDIR=''${CMAKE_INSTALL_FULL_INCLUDEDIR} + -P ''${CMAKE_CURRENT_SOURCE_DIR}/cmake/write_pkg_config.cmake' + substituteInPlace cmake/SPIRV-Tools.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + substituteInPlace cmake/SPIRV-Tools-shared.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + meta = with lib; { inherit (src.meta) homepage; description = "The SPIR-V Tools project provides an API and commands for processing SPIR-V modules"; diff --git a/pkgs/development/web/cog/default.nix b/pkgs/development/web/cog/default.nix index a08687e70fd8..c350149f32e2 100644 --- a/pkgs/development/web/cog/default.nix +++ b/pkgs/development/web/cog/default.nix @@ -53,6 +53,12 @@ stdenv.mkDerivation rec { "-DCOG_USE_WEBKITGTK=ON" ]; + # https://github.com/Igalia/cog/issues/438 + postPatch = '' + substituteInPlace core/cogcore.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ + ''; + # not ideal, see https://github.com/WebPlatformForEmbedded/libwpe/issues/59 preFixup = '' wrapProgram $out/bin/cog \ diff --git a/pkgs/os-specific/linux/bcc/default.nix b/pkgs/os-specific/linux/bcc/default.nix index ab3e2232852b..bb042e31c0e8 100644 --- a/pkgs/os-specific/linux/bcc/default.nix +++ b/pkgs/os-specific/linux/bcc/default.nix @@ -52,6 +52,10 @@ python.pkgs.buildPythonApplication rec { substituteAll ${./absolute-ausyscall.patch} ./absolute-ausyscall.patch patch -p1 < absolute-ausyscall.patch + + # https://github.com/iovisor/bcc/issues/3996 + substituteInPlace src/cc/libbcc.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ ''; postInstall = '' diff --git a/pkgs/os-specific/linux/powercap/default.nix b/pkgs/os-specific/linux/powercap/default.nix index 96ec83852d9d..e705b6a34857 100644 --- a/pkgs/os-specific/linux/powercap/default.nix +++ b/pkgs/os-specific/linux/powercap/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }: stdenv.mkDerivation rec { pname = "powercap"; @@ -11,6 +11,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-l+IpFqBnCYUU825++sUPySD/Ku0TEIX2kt+S0Wml6iA="; }; + # in master post 0.6.0, see https://github.com/powercap/powercap/issues/8 + patches = [ + (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/powercap/powercap/commit/278dceb51635686e343edfc357b6020533fff299.patch"; + sha256 = "0h62j63xdn0iqyx4xbia6hlmdjn45camb82z4vv6sb37x9sph7rg"; + }) + ]; + nativeBuildInputs = [ cmake ]; cmakeFlags = [ diff --git a/pkgs/tools/bluetooth/obexftp/default.nix b/pkgs/tools/bluetooth/obexftp/default.nix index 3d9eda383ddf..8fd031d331c0 100644 --- a/pkgs/tools/bluetooth/obexftp/default.nix +++ b/pkgs/tools/bluetooth/obexftp/default.nix @@ -15,6 +15,13 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ openobex ]; + # https://sourceforge.net/p/openobex/bugs/66/ + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} + ''; + # There's no such thing like "bluetooth" library; possibly they meant "bluez" but it links correctly without this. postFixup = '' sed -i 's,^Requires: bluetooth,Requires:,' $out/lib/pkgconfig/obexftp.pc diff --git a/pkgs/tools/bluetooth/openobex/default.nix b/pkgs/tools/bluetooth/openobex/default.nix index 831644bd4ac0..5d18319ac603 100644 --- a/pkgs/tools/bluetooth/openobex/default.nix +++ b/pkgs/tools/bluetooth/openobex/default.nix @@ -17,6 +17,10 @@ stdenv.mkDerivation rec { patchPhase = '' sed -i "s!/lib/udev!$out/lib/udev!" udev/CMakeLists.txt sed -i "/if ( PKGCONFIG_UDEV_FOUND )/,/endif ( PKGCONFIG_UDEV_FOUND )/d" udev/CMakeLists.txt + # https://sourceforge.net/p/openobex/bugs/66/ + substituteInPlace CMakeLists.txt \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \ + --replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR} ''; meta = with lib; { diff --git a/pkgs/tools/networking/shadowsocks-libev/default.nix b/pkgs/tools/networking/shadowsocks-libev/default.nix index 3ad9161c716b..6018e77e5e43 100644 --- a/pkgs/tools/networking/shadowsocks-libev/default.nix +++ b/pkgs/tools/networking/shadowsocks-libev/default.nix @@ -25,6 +25,26 @@ stdenv.mkDerivation rec { "-DCMAKE_SKIP_BUILD_RPATH=ON" ]; + postPatch = '' + # https://github.com/shadowsocks/shadowsocks-libev/issues/2901 + substituteInPlace CMakeLists.txt \ + --replace '# pkg-config' \ + '# pkg-config + include(GNUInstallDirs)' + substituteInPlace cmake/shadowsocks-libev.pc.cmake \ + --replace @prefix@ @CMAKE_INSTALL_PREFIX@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_BINDIR@ @CMAKE_INSTALL_FULL_BINDIR@ \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_FULL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_DATAROOTDIR@ @CMAKE_INSTALL_FULL_DATAROOTDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_MANDIR@ @CMAKE_INSTALL_FULL_MANDIR@ + + # https://github.com/dcreager/libcork/issues/173 but needs a different patch (yay vendoring) + substituteInPlace libcork/src/libcork.pc.in \ + --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ \ + --replace '$'{prefix}/@CMAKE_INSTALL_INCLUDEDIR@ @CMAKE_INSTALL_FULL_INCLUDEDIR@ + ''; + postInstall = '' cp lib/* $out/lib ''; diff --git a/pkgs/tools/package-management/libdnf/default.nix b/pkgs/tools/package-management/libdnf/default.nix index 1cfccdd098f3..136b888f009a 100644 --- a/pkgs/tools/package-management/libdnf/default.nix +++ b/pkgs/tools/package-management/libdnf/default.nix @@ -41,11 +41,15 @@ stdenv.mkDerivation rec { cp ${libsolv}/share/cmake/Modules/FindLibSolv.cmake cmake/modules/ ''; - # See https://github.com/NixOS/nixpkgs/issues/107428 postPatch = '' + # See https://github.com/NixOS/nixpkgs/issues/107428 substituteInPlace CMakeLists.txt \ --replace "enable_testing()" "" \ --replace "add_subdirectory(tests)" "" + + # https://github.com/rpm-software-management/libdnf/issues/1518 + substituteInPlace libdnf/libdnf.pc.in \ + --replace '$'{prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@ ''; cmakeFlags = [ diff --git a/pkgs/tools/security/rnp/default.nix b/pkgs/tools/security/rnp/default.nix index a18571c80404..63053a10095c 100644 --- a/pkgs/tools/security/rnp/default.nix +++ b/pkgs/tools/security/rnp/default.nix @@ -5,6 +5,7 @@ , bzip2 , cmake , fetchFromGitHub +, fetchpatch , gnupg , gtest , json_c @@ -24,6 +25,15 @@ stdenv.mkDerivation rec { sha256 = "u0etVslTBF9fBqnpVBofYsm0uC/eR6gO3lhwzqua5Qw="; }; + # in master post 0.16.0, see https://github.com/rnpgp/rnp/issues/1835 + patches = [ + (fetchpatch { + name = "fix-pkg-config.patch"; + url = "https://github.com/rnpgp/rnp/commit/de9856c94ea829cad277800ee03ec52e30993d8e.patch"; + sha256 = "1vd83fva7lhmvqnvsrifqb2zdhfrbx84lf3l9i0hcph0k8h3ddx9"; + }) + ]; + buildInputs = [ zlib bzip2 json_c botan2 ]; cmakeFlags = [