Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl }: 2 3stdenv.mkDerivation rec { 4 pname = "libx86"; 5 version = "1.1"; 6 src = fetchurl { 7 url = "https://www.codon.org.uk/~mjg59/libx86/downloads/${pname}-${version}.tar.gz"; 8 sha256 = "0j6h6bc02c6qi0q7c1ncraz4d1hkm5936r35rfsp4x1jrc233wav"; 9 }; 10 patches = [./constants.patch ./non-x86.patch ]; 11 12 # using BACKEND=x86emu on 64bit systems fixes: 13 # http://www.mail-archive.com/suspend-devel@lists.sourceforge.net/msg02355.html 14 makeFlags = [ 15 "DESTDIR=$(out)" 16 ] ++ lib.optional (!stdenv.isi686) "BACKEND=x86emu"; 17 18 preBuild = '' 19 sed -i lrmi.c -e 's@defined(__i386__)@(defined(__i386__) || defined(__x86_64__))@' 20 sed -e s@/usr@@ -i Makefile 21 ''; 22 23 meta = with lib; { 24 description = "Real-mode x86 code emulator"; 25 maintainers = with maintainers; [ raskin ]; 26 platforms = [ "x86_64-linux" "i686-linux" ]; 27 license = licenses.mit; 28 }; 29}