-
Notifications
You must be signed in to change notification settings - Fork 2
/
common.nix
39 lines (34 loc) · 962 Bytes
/
common.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
{name, version, homepage}:
let
windows32 = import <nixpkgs> {
# system = "i686-linux"; # local system
crossSystem = {
config = "i686-w64-mingw32";
arch = "x86";
libc = "msvcrt";
platform = {};
openssl.system = "mingw";
};
};
game = {stdenv, nasm, petool}: stdenv.mkDerivation rec {
inherit name;
inherit version;
nativeBuildInputs = [ nasm petool ];
src = ./..;
preBuild = "makeFlagsArray="
+ "(REV=${version}"
+ " CP=cp"
+ " CC=${stdenv.cross.config}-gcc"
+ " WINDRES=${stdenv.cross.config}-windres"
+ ")";
enableParallelBuilding = true;
meta = with stdenv.lib; {
inherit homepage;
description = "";
# maintainers =
license = map (builtins.getAttr "shortName") [ licenses.mit ];
# Buildable on any platform, runable only on Windows
platforms = stdenv.lib.platforms.all;
};
};
in windows32.callPackage game {}