32 lines
664 B
Nix
32 lines
664 B
Nix
|
{
|
||
|
pkgs ? import <nixpkgs> {}
|
||
|
, src ? ./.
|
||
|
}:
|
||
|
|
||
|
with pkgs;
|
||
|
|
||
|
stdenv.mkDerivation {
|
||
|
pname = "oeffisearch";
|
||
|
version = "0.1.0";
|
||
|
inherit src;
|
||
|
nativeBuildInputs = [ nim ];
|
||
|
buildInputs = [ openssl ];
|
||
|
buildPhase = ''
|
||
|
runHook preBuild
|
||
|
nim c -d:release --nimcache:$PWD src/oeffisearch.nim
|
||
|
runHook postBuild
|
||
|
'';
|
||
|
installPhase = ''
|
||
|
runHook preInstall
|
||
|
install -Dm755 src/oeffisearch $out/bin/oeffisearch
|
||
|
mkdir -p $out/share
|
||
|
cp -r client $out/share/client
|
||
|
runHook postInstall
|
||
|
'';
|
||
|
fixupPhase = ''
|
||
|
runHook preFixup
|
||
|
patchelf --set-rpath ${lib.makeLibraryPath [ openssl ]} $out/bin/oeffisearch
|
||
|
runHook postFixup
|
||
|
'';
|
||
|
}
|