Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken CMake-generated pkg-config files #181875

Merged
merged 74 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
61bffac
zxing: fix paths in pkg-config file
alexshpilkin May 9, 2022
1554ab5
gst_all_1.gst-plugins-bad: link with zxing-cpp
alexshpilkin May 9, 2022
2ddb885
spirv-tools: fix paths in pkg-config files
alexshpilkin May 9, 2022
aa473c6
libjxl: fix paths in pkg-config files
alexshpilkin May 9, 2022
1024921
wildmidi: fix paths in pkg-config file
alexshpilkin May 9, 2022
7baca96
usrsctp: fix paths in pkg-config file
alexshpilkin May 9, 2022
869539e
openalSoft: update homepage URL
alexshpilkin May 9, 2022
4f7b421
openalSoft: fix paths in pkg-config file
alexshpilkin May 9, 2022
52938dd
libebur128: fix paths in pkg-config file
alexshpilkin May 9, 2022
5b12efa
openobex: fix paths in pkg-config file
alexshpilkin May 9, 2022
ca04904
ffmpegthumbnailer: fix path in pkg-config file
alexshpilkin May 9, 2022
5dedecf
libmatroska: fix paths in pkg-config file
alexshpilkin May 9, 2022
a693b0c
extra-cmake-modules: fix paths in generated pkg-config files
alexshpilkin May 9, 2022
bb1d2fa
libebml: fix paths in pkg-config file
alexshpilkin May 9, 2022
d5ad233
libargs: fix path in pkg-config file
alexshpilkin May 13, 2022
89f39f5
arrow-cpp: fix paths in CMake and pkg-config files
alexshpilkin May 16, 2022
427ae9a
bcc: fix path in pkg-config file
alexshpilkin May 16, 2022
da6a954
bcg729: fix path in pkg-config file
alexshpilkin May 16, 2022
3bf5a3c
cglm: fix paths in pkg-config file
alexshpilkin May 16, 2022
6f1dd9a
cm256cc: fix path in pkg-config file
alexshpilkin May 16, 2022
23fa3f2
cog: fix path in pkg-config file
alexshpilkin May 16, 2022
4f04707
cxxopts: fix path in pkg-config file
alexshpilkin May 16, 2022
44acd93
plasma5Packages.drumstick: fix paths in pkg-config files
alexshpilkin May 16, 2022
092a1ea
eccodes: fix paths in pkg-config files
alexshpilkin May 16, 2022
1c09946
entt: fix path in pkg-config file
alexshpilkin May 16, 2022
499b90f
gbenchmark: fix paths in pkg-config file
alexshpilkin May 16, 2022
0035e65
getdns: fix paths in pkg-config file
alexshpilkin May 16, 2022
f2e74c1
google-cloud-cpp: fix paths in pkg-config files
alexshpilkin May 17, 2022
7b77d68
libbaseencode: fix paths in pkg-config file
alexshpilkin May 17, 2022
e1adfee
libbtbb: fix paths in pkg-config file
alexshpilkin May 17, 2022
d1f14fa
libcork: fix paths in pkg-config file
alexshpilkin May 17, 2022
3bbc6d7
libcotp: fix paths in pkg-config file
alexshpilkin May 17, 2022
722cacf
libdnf: fix path in pkg-config file
alexshpilkin May 17, 2022
ad67699
libkeyfinder: fix paths in pkg-config file
alexshpilkin May 17, 2022
3481609
lxqt.lxqt-build-tools: fix paths in generated pkg-config files
alexshpilkin May 17, 2022
0fb6766
libmodule: fix paths in pkg-config file
alexshpilkin May 17, 2022
4c5e1c7
libnats-c: fix path in pkg-config file
alexshpilkin May 17, 2022
50cee47
libquotient: fix paths in pkg-config file
alexshpilkin May 17, 2022
91bbd95
libsurvive: fix path in pkg-config file
alexshpilkin May 17, 2022
e7b9363
libtorrent-rasterbar: fix paths in pkg-config file
alexshpilkin May 18, 2022
c29cb15
libtsm: fix paths in pkg-config file
alexshpilkin May 18, 2022
4523fb5
libunarr: fix paths in pkg-config file
alexshpilkin May 18, 2022
32e540e
maliit-framework: fix paths in pkg-config files
alexshpilkin May 18, 2022
3e6abe1
mysocketw: fix path in pkg-config file
alexshpilkin May 18, 2022
e3d63b7
nanomsg: fix path in pkg-config file
alexshpilkin May 18, 2022
b3d9858
notcurses: fix paths in pkg-config files
alexshpilkin May 18, 2022
96a487c
obexftp: fix paths in pkg-config file
alexshpilkin May 18, 2022
c709dd4
olm: fix paths in pkg-config file
alexshpilkin May 18, 2022
d6ad6c4
opencolorio: fix path in pkg-config file
alexshpilkin May 18, 2022
8b387ff
opendht: fix paths in pkg-config file
alexshpilkin May 18, 2022
cb3a81d
openxr-loader: fix path in pkg-config file
alexshpilkin May 18, 2022
bf76af5
orcania: fix paths in pkg-config file
alexshpilkin May 18, 2022
5c42107
powercap: fix paths in pkg-config file
alexshpilkin May 18, 2022
ce8e657
proj: fix paths in CMake and pkg-config files
alexshpilkin May 18, 2022
00b5281
rabbitmq-c: fix paths in pkg-config file
alexshpilkin May 18, 2022
73f88f1
recastnavigation: fix paths in pkg-config file
alexshpilkin May 18, 2022
e059421
reproc: fix paths in pkg-config files
alexshpilkin May 18, 2022
7a2593d
rinutils: fix path in pkg-config file
alexshpilkin May 18, 2022
d5f218a
rnp: fix path in pkg-config file
alexshpilkin May 18, 2022
2e07f8a
rocm-thunk: fix paths in pkg-config file
alexshpilkin May 18, 2022
a6ef202
seexpr: fix path in pkg-config file
alexshpilkin May 18, 2022
18c0a8b
sentencepiece: fix paths in pkg-config file
alexshpilkin May 18, 2022
02f6b12
shadowsocks-libev: fix paths in pkg-config files
alexshpilkin May 18, 2022
9d05c94
soapysdr: fix paths in pkg-config file
alexshpilkin May 18, 2022
2d03092
spdlog: fix path in pkg-config file
Artturin Aug 10, 2022
ab2ace0
spirv-headers: fix path in pkg-config file
alexshpilkin May 18, 2022
960e3c4
tdlib: fix paths in pkg-config files
alexshpilkin May 18, 2022
347b676
tinyobjloader: fix paths in pkg-config file
alexshpilkin May 18, 2022
89f5bb4
libbaseencode: 1.0.12 -> 1.0.14
alexshpilkin May 19, 2022
9b66b71
libcotp: 1.2.4 -> 1.2.6
alexshpilkin May 19, 2022
6a0a4f9
xsimd: fix path in pkg-config file
alexshpilkin May 19, 2022
a2a8c38
xtensor: fix path in pkg-config file
alexshpilkin May 19, 2022
00c23f4
libzra: fix paths in pkg-config file
alexshpilkin May 26, 2022
3643102
libiio: 0.21 -> 0.23
alexshpilkin Jun 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@ \
Copy link
Member Author

@Artturin Artturin Jul 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexshpilkin

''${something} is the proper way to escape ${

Please confirm If that is what you were trying to do then I'll change them all to that

Copy link
Member

@alexshpilkin alexshpilkin Jul 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that wasn’t it. This is more clever than I would like, but it has a purpose: there are two levels of escaping here, from Nix when it’s generating the script and from Bash when it’s executing it. That is to say, the file we’re patching contains the literal string ${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ in it—the ${...} is not shell syntax, it is pkg-config syntax. If you wanted to do this with standard Nix escaping as you suggest, you would end up with \''${exec_prefix} or '''${exec_prefix}', which is less subtle but even harder to parse I think.

(This is when .in files are being patched; take care that in some cases, CMake sources are being patched instead—so the interpolation is passing through Nix, Bash, and CMake on the way to the pkg-config file—and the CMake file being patched is already escaping the variable reference in one of a couple ways I’ve seen.)

If you see a clearer way, go for it, but the change you’re suggesting here wouldn’t work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, do you think this is ready to merge?

--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