-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.nix
More file actions
37 lines (32 loc) · 967 Bytes
/
package.nix
File metadata and controls
37 lines (32 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ lib
, stdenv_32bit
, pkgsi686Linux
, perlPackages
, elfkickers
, nasm
, upx
, zip
, withTarget ? "vulpforth"
, withSstrip ? true
, withUpx ? true
}:
stdenv_32bit.mkDerivation {
name = "vulpforth";
dontStrip = true;
src = ./.;
nativeBuildInputs = [ nasm zip ];
buildInputs = with pkgsi686Linux; [ musl ];
buildPhase = ''
make ${if withTarget == "vulpforth.zip" then "vulpforthzip files.zip CFLAGS=-O1" else withTarget}
'' + lib.optionalString withSstrip ''
${elfkickers}/bin/sstrip -z ${if withTarget == "vulpforth.zip" then "vulpforthzip" else withTarget}
'' + lib.optionalString (withTarget == "vulpforth.zip") ''
${perlPackages.strip-nondeterminism}/bin/strip-nondeterminism files.zip
${lib.optionalString withUpx "${upx}/bin/upx --brute vulpforthzip"}
${lib.optionalString withSstrip "${elfkickers}/bin/sstrip vulpforthzip"}
make vulpforth.zip
'';
installPhase = ''
install -Dt $out/bin ${withTarget}
'';
}