Nixpkgs/Create and debug packages: Difference between revisions
m 'show-derivation' is a deprecated alias for 'derivation show' |
→Adding custom libraries and dependencies to a package: Cross improvement |
||
| Line 379: | Line 379: | ||
Your program to test the library: | Your program to test the library: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
{ pkgs ? import <nixpkgs> { | { | ||
pkgs ? import <nixpkgs> { | |||
overlays = [ | |||
(final: prev: { | |||
stdenv.mkDerivation { | my-library = prev.callPackage ./my-library.nix { }; | ||
}) | |||
]; | |||
}, | |||
}: | |||
pkgs.callPackage ( | |||
{ | |||
stdenv, | |||
hello, | |||
pkg-config, | |||
} | my-library, | ||
}: | |||
stdenv.mkDerivation { | |||
strictDeps = true; | |||
# host/target agnostic programs | |||
depsBuildBuild = [ | |||
hello | |||
]; | |||
# compilers & linkers & dependecy finding programs | |||
nativeBuildInputs = [ | |||
pkg-config | |||
]; | |||
# libraries | |||
buildInputs = [ | |||
my-library | |||
]; | |||
} | |||
) { } | |||
</syntaxhighlight> | </syntaxhighlight> | ||