Skip to content

Commit

Permalink
Merge pull request #181875 from Artturin/fix-pkg-config-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin committed Sep 8, 2022
2 parents b5e9deb + 3643102 commit eb15a96
Show file tree
Hide file tree
Showing 71 changed files with 707 additions and 30 deletions.
10 changes: 10 additions & 0 deletions pkgs/applications/misc/maliit-framework/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ mkDerivation
, lib
, fetchFromGitHub
, fetchpatch

, at-spi2-atk
, at-spi2-core
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions pkgs/applications/radio/soapysdr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions pkgs/desktops/lxqt/lxqt-build-tools/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, mkDerivation
, fetchpatch
, fetchFromGitHub
, cmake
, pkg-config
Expand All @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/compilers/seexpr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/";
Expand Down
9 changes: 9 additions & 0 deletions pkgs/development/libraries/arrow-cpp/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ stdenv
, lib
, fetchurl
, fetchpatch
, fetchFromGitHub
, fixDarwinDylibNames
, abseil-cpp
Expand Down Expand Up @@ -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 = [
Expand Down
11 changes: 10 additions & 1 deletion pkgs/development/libraries/audio/libkeyfinder/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, fftw, catch2 }:
{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, fftw, catch2 }:

stdenv.mkDerivation rec {
pname = "libkeyfinder";
Expand All @@ -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 ];
Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/libraries/bcg729/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
7 changes: 7 additions & 0 deletions pkgs/development/libraries/cglm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/libraries/cm256cc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/libraries/cxxopts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/libraries/drumstick/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
Expand Down
11 changes: 11 additions & 0 deletions pkgs/development/libraries/eccodes/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/libraries/entt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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++";
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/libraries/ffmpegthumbnailer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
5 changes: 5 additions & 0 deletions pkgs/development/libraries/gbenchmark/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions pkgs/development/libraries/getdns/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/google-cloud-cpp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/libraries/gstreamer/bad/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
, srt
, vo-aacenc
, libfreeaptx
, zxing-cpp
, VideoToolbox
, AudioToolbox
, AVFoundation
Expand Down Expand Up @@ -171,6 +172,7 @@ stdenv.mkDerivation rec {
srt
vo-aacenc
libfreeaptx
zxing-cpp
] ++ lib.optionals enableZbar [
zbar
] ++ lib.optionals faacSupport [
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions pkgs/development/libraries/libargs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
7 changes: 7 additions & 0 deletions pkgs/development/libraries/libbtbb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
14 changes: 10 additions & 4 deletions pkgs/development/libraries/libcork/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/libraries/libebml/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/libraries/libebur128/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Loading

0 comments on commit eb15a96

Please sign in to comment.