Nixpkgs/Create and debug packages: Difference between revisions
m 'show-derivation' is a deprecated alias for 'derivation show' |
m →Using nix-shell for package development: Improve grammar in note about preConfigurePhase |
||
(2 intermediate revisions by one other user not shown) | |||
Line 249: | Line 249: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{Note| | {{Note|You do not need to run $preConfigurePhase explicitly, as it will already be run implicitly when running configurePhase.}} | ||
To list all functions which are declared in '''set''': | To list all functions which are declared in '''set''': | ||
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 { | |||
pname = "something"; | |||
version = "1"; | |||
strictDeps = true; | |||
# host/target agnostic programs | |||
depsBuildBuild = [ | |||
hello | |||
]; | |||
# compilers & linkers & dependecy finding programs | |||
nativeBuildInputs = [ | |||
pkg-config | |||
]; | |||
# libraries | |||
buildInputs = [ | |||
my-library | |||
]; | |||
} | |||
) { } | |||
</syntaxhighlight> | </syntaxhighlight> | ||