nixpkgs/pkgs/development/libraries/libx86/default.nix

30 lines
929 B
Nix
Raw Normal View History

2015-04-25 15:55:47 +01:00
{ stdenv, fetchurl }:
2015-04-25 15:55:47 +01:00
stdenv.mkDerivation rec {
name = "libx86-${version}";
version = "1.1";
src = fetchurl {
url = "http://www.codon.org.uk/~mjg59/libx86/downloads/${name}.tar.gz";
sha256 = "0j6h6bc02c6qi0q7c1ncraz4d1hkm5936r35rfsp4x1jrc233wav";
};
patches = [./constants.patch ./non-x86.patch ];
# using BACKEND=x86emu on 64bit systems fixes:
# http://www.mail-archive.com/suspend-devel@lists.sourceforge.net/msg02355.html
makeFlags = [
2015-04-25 15:55:47 +01:00
"DESTDIR=$(out)"
] ++ stdenv.lib.optional (stdenv.isx86_64 || stdenv.isArm) "BACKEND=x86emu";
2015-04-25 15:55:47 +01:00
preBuild = ''
sed -i lrmi.c -e 's@defined(__i386__)@(defined(__i386__) || defined(__x86_64__))@'
sed -e s@/usr@@ -i Makefile
2015-04-25 15:55:47 +01:00
'';
meta = with stdenv.lib; {
description = "Real-mode x86 code emulator";
2015-04-25 15:55:47 +01:00
maintainers = with maintainers; [ raskin ];
platforms = with platforms; linux ++ freebsd ++ netbsd;
license = licenses.mit;
};
}