nix: use zig build hook instead of manual build phase and fix installPhase
Browse files
+2 −12 default.nix
| @@ -15,7 +15,7 @@ stdenv.mkDerivation (finalAttrs: { | ||
| 15 | 15 | |
| 16 | 16 | src = ./.; |
| 17 | 17 | |
| 18 | - nativeBuildInputs = [zig pkg-config]; | |
| 18 | + nativeBuildInputs = [zig.hook pkg-config]; | |
| 19 | 19 | |
| 20 | 20 | buildInputs = [ |
| 21 | 21 | xorg.libX11 |
| @@ -26,20 +26,10 @@ stdenv.mkDerivation (finalAttrs: { | ||
| 26 | 26 | fontconfig |
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | - dontConfigure = true; | |
| 30 | - | |
| 31 | - buildPhase = '' | |
| 32 | - runHook preBuild | |
| 33 | - zig build -Doptimize=ReleaseSafe --prefix $out | |
| 34 | - runHook postBuild | |
| 35 | - ''; | |
| 36 | - | |
| 37 | - installPhase = '' | |
| 38 | - runHook preInstall | |
| 29 | + postInstall = '' | |
| 39 | 30 | install resources/oxwm.desktop -Dt $out/share/xsessions |
| 40 | 31 | install -Dm644 resources/oxwm.1 -t $out/share/man/man1 |
| 41 | 32 | install -Dm644 templates/oxwm.lua -t $out/share/oxwm |
| 42 | - runHook postInstall | |
| 43 | 33 | ''; |
| 44 | 34 | |
| 45 | 35 | # tests require a running X server |