1
1
mirror of https://github.com/nmattia/niv.git synced 2024-11-29 09:42:35 +03:00
niv/examples/cpp-libosmium/default.nix
2020-01-11 12:03:22 +01:00

38 lines
823 B
Nix

let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {
overlays = [
(_: _: { inherit sources; })
(import ./overlay.nix)
];
};
in
with pkgs;
stdenv.mkDerivation {
name = "nix-cpp-demo";
nativeBuildInputs = [ cmake pkgconfig ];
src = pkgs.lib.cleanSource ./.;
# tell Cmake location of all headers
cmakeFlags = [
"-DEXTERNAL_INCLUDE_DIRECTORIES=${stdenv.lib.strings.makeSearchPathOutput "dev" "include" libosmium.buildInputs}"
];
buildInputs = stdenv.lib.lists.concatLists [
# We want to check if dependencies exist using find_package
[
libosmium.buildInputs
]
# dependencies
[
libosmium
]
];
installPhase = ''
mkdir -p $out/bin
cp bin/hello-world $out/bin
'';
}