-
Notifications
You must be signed in to change notification settings - Fork 22
/
release.nix
100 lines (88 loc) · 2.67 KB
/
release.nix
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
{ nixpkgs ? <nixpkgs>
, systems ? [ "i686-linux" "x86_64-linux" ]
, buildForAmiga ? false
, buildForWindows ? false
, amigaosenvPath ? <amigaosenv>
, kickstartROMFile ? null
, baseDiskImage ? null
, useUAE ? true
, libiff ? { outPath = ./.; rev = 1234; }
, officialRelease ? false
}:
let
pkgs = import nixpkgs {};
version = builtins.readFile ./version;
jobs = rec {
tarball =
with pkgs;
releaseTools.sourceTarball {
name = "libiff-tarball";
src = libiff;
inherit version officialRelease;
dontBuild = false;
CFLAGS = "-ansi -pedantic -Wall";
buildInputs = [ help2man ];
};
build =
(pkgs.lib.genAttrs systems (system:
with import nixpkgs { inherit system; };
releaseTools.nixBuild {
name = "libiff";
inherit version;
src = tarball;
CFLAGS = "-ansi -pedantic -Wall";
}
)) //
(pkgs.lib.optionalAttrs (buildForWindows) { i686-windows =
pkgs.dotnetenv.buildSolution {
name = "libiff";
src = ./.;
baseDir = "src";
slnFile = "libiff.sln";
preBuild = ''
sed "s/@IFF_BIG_ENDIAN@/0/" libiff/ifftypes.h.in > libiff/ifftypes.h
'';
postInstall = ''
mkdir -p $out/include/libiff
cp -v libiff/*.h $out/include/libiff
'';
};
}) //
(pkgs.lib.optionalAttrs (buildForAmiga)
(let
amigaosenv = import amigaosenvPath {
inherit (pkgs) stdenv fetchurl lhasa uae fsuae procps bchunk cdrtools;
inherit (pkgs.xorg) lndir;
};
in
{
m68k-amigaos.lib = amigaosenv.mkDerivation {
name = "libiff-${version}";
src = "${tarball}/tarballs/libiff-${version}pre1234.tar.gz";
buildCommand = ''
tar xfvz $src
cd libiff-${version}pre1234
CFLAGS='-noixemul -O3' ./configure --prefix=/OUT --disable-shared
cd src/libiff
make
make install
'';
inherit kickstartROMFile baseDiskImage useUAE;
};
m68k-amigaos.tools = amigaosenv.mkDerivation {
name = "libiff-${version}";
src = "${tarball}/tarballs/libiff-${version}pre1234.tar.gz";
buildCommand = ''
tar xfvz $src
cd libiff-${version}pre1234
./configure --prefix=/OUT --disable-shared
make
make check
make install
'';
inherit kickstartROMFile baseDiskImage useUAE;
};
}));
};
in
jobs