Last active
December 8, 2019 16:09
-
-
Save zopsicle/7ba22865dde3b176011314560dcd8941 to your computer and use it in GitHub Desktop.
pkg-configWithPackages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{pkgs ? import ./nix/pkgs.nix {}}: | |
let | |
pkg-configWithPackages = packages: pkgs.stdenvNoCC.mkDerivation { | |
name = "pkg-configWithPackages"; | |
buildInputs = [pkgs.makeWrapper]; | |
phases = ["installPhase"]; | |
installPhase = '' | |
makeWrapperFlags=() | |
for package in ${pkgs.lib.concatMapStringsSep " " (p: "${p}") packages}; do | |
makeWrapperFlags+=(--prefix PKG_CONFIG_PATH : $package/lib/pkgconfig) | |
done | |
mkdir --parents $out/bin | |
makeWrapper ${pkgs.pkg-config}/bin/pkg-config $out/bin/pkg-config \ | |
"''${makeWrapperFlags[@]}" | |
''; | |
}; | |
in | |
[ | |
pkgs.bash | |
pkgs.coreutils | |
# etc | |
( | |
pkg-configWithPackages [ | |
pkgs.zeromq4 | |
] | |
) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix run -ic pkg-config --libs libzmq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment