1a :
2let
3 s = import ./src-for-default.nix;
4 buildInputs = with a; [
5
6 ];
7in
8rec {
9 src = a.fetchUrlFromSrcInfo s;
10
11 inherit (s) name;
12 inherit buildInputs;
13
14 phaseNames = ["doPatch" "fixX86Def" "killUsr" "doMakeInstall"];
15 patches = [./constants.patch ./non-x86.patch];
16
17 # using BACKEND=x86emu on 64bit systems fixes:
18 # http://www.mail-archive.com/suspend-devel@lists.sourceforge.net/msg02355.html
19 makeFlags = [
20 "DESTDIR=$out"
21 ] ++ a.stdenv.lib.optionals ( a.stdenv.isx86_64 || a.stdenv.isArm ) [ "BACKEND=x86emu" ];
22
23 fixX86Def = a.fullDepEntry (''
24 sed -i lrmi.c -e 's@defined(__i386__)@(defined(__i386__) || defined(__x86_64__))@'
25 '') ["doUnpack" "minInit"];
26 killUsr = a.fullDepEntry (''
27 sed -e s@/usr@@ -i Makefile
28 '') ["doUnpack" "minInit"];
29
30 meta = {
31 description = "Real-mode x86 code emulator";
32 maintainers = [
33 a.lib.maintainers.raskin
34 ];
35 platforms = with a.lib.platforms;
36 linux ++ freebsd ++ netbsd;
37 };
38}