libx86: reimplement using mkDerivation

This commit is contained in:
Joachim Fasting 2015-04-25 16:55:47 +02:00
parent 4fb29f8d3b
commit a799e1dff2
2 changed files with 19 additions and 28 deletions

View File

@ -1,38 +1,29 @@
a :
let
s = import ./src-for-default.nix;
buildInputs = with a; [
];
in
rec {
src = a.fetchUrlFromSrcInfo s;
{ stdenv, fetchurl }:
inherit (s) name;
inherit buildInputs;
phaseNames = ["doPatch" "fixX86Def" "killUsr" "doMakeInstall"];
patches = [./constants.patch ./non-x86.patch];
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 = [
"DESTDIR=$out"
] ++ a.stdenv.lib.optionals ( a.stdenv.isx86_64 || a.stdenv.isArm ) [ "BACKEND=x86emu" ];
"DESTDIR=$(out)"
] ++ stdenv.lib.optional (stdenv.isx86_64 || stdenv.isArm) "BACKEND=x86emu";
fixX86Def = a.fullDepEntry (''
preBuild = ''
sed -i lrmi.c -e 's@defined(__i386__)@(defined(__i386__) || defined(__x86_64__))@'
'') ["doUnpack" "minInit"];
killUsr = a.fullDepEntry (''
sed -e s@/usr@@ -i Makefile
'') ["doUnpack" "minInit"];
meta = {
'';
meta = with stdenv.lib; {
description = "Real-mode x86 code emulator";
maintainers = [
a.lib.maintainers.raskin
];
platforms = with a.lib.platforms;
linux ++ freebsd ++ netbsd;
maintainers = with maintainers; [ raskin ];
platforms = with platforms; linux ++ freebsd ++ netbsd;
license = licenses.mit;
};
}

View File

@ -7631,7 +7631,7 @@ let
libwpg = callPackage ../development/libraries/libwpg { };
libx86 = builderDefsPackage ../development/libraries/libx86 {};
libx86 = callPackage ../development/libraries/libx86 {};
libxdg_basedir = callPackage ../development/libraries/libxdg-basedir { };