From a799e1dff2e5134eb2d0f84fae1d095abf4fc8aa Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Sat, 25 Apr 2015 16:55:47 +0200 Subject: libx86: reimplement using mkDerivation --- pkgs/development/libraries/libx86/default.nix | 45 +++++++++++---------------- 1 file changed, 18 insertions(+), 27 deletions(-) (limited to 'pkgs/development/libraries/libx86') diff --git a/pkgs/development/libraries/libx86/default.nix b/pkgs/development/libraries/libx86/default.nix index 011e936548a..162d284f402 100644 --- a/pkgs/development/libraries/libx86/default.nix +++ b/pkgs/development/libraries/libx86/default.nix @@ -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; }; } -- cgit 1.4.1