argyllcms: make reproducible

and make binfmt cross-compilable

Artturin e7a05e90 23f71e94

+61 -53
+61 -53
pkgs/tools/graphics/argyllcms/default.nix
··· 13 13 sha256 = "sha256-umY3wQfG26Okqnw+MCUnlwWTAyJ6MR/FHe5oe61KBh0="; 14 14 }; 15 15 16 - # The contents of this file comes from the Jamtop file from the 17 - # root of the ArgyllCMS distribution, rewritten to pick up Nixpkgs 18 - # library paths. When ArgyllCMS is updated, make sure that changes 19 - # in that file is reflected here. 20 - jamTop = writeText "argyllcms_jamtop" '' 21 - DESTDIR = "/" ; 22 - REFSUBDIR = "share/argyllcms" ; 16 + nativeBuildInputs = [ jam unzip ]; 23 17 24 - # Keep this DESTDIR anchored to Jamtop. PREFIX is used literally 25 - ANCHORED_PATH_VARS = DESTDIR ; 18 + postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' 19 + substituteInPlace Jambase \ 20 + --replace "-m64" "" 21 + ''; 26 22 27 - # Tell standalone libraries that they are part of Argyll: 28 - DEFINES += ARGYLLCMS ; 23 + preConfigure = let 24 + # The contents of this file comes from the Jamtop file from the 25 + # root of the ArgyllCMS distribution, rewritten to pick up Nixpkgs 26 + # library paths. When ArgyllCMS is updated, make sure that changes 27 + # in that file is reflected here. 28 + jamTop = writeText "argyllcms_jamtop" '' 29 + DESTDIR = "/" ; 30 + REFSUBDIR = "share/argyllcms" ; 29 31 30 - # enable serial instruments & support 31 - USE_SERIAL = true ; 32 + # Keep this DESTDIR anchored to Jamtop. PREFIX is used literally 33 + ANCHORED_PATH_VARS = DESTDIR ; 32 34 33 - # enable fast serial instruments & support 34 - USE_FAST_SERIAL = true ; # (Implicit in USE_SERIAL too) 35 + # Tell standalone libraries that they are part of Argyll: 36 + DEFINES += ARGYLLCMS ; 35 37 36 - # enable USB instruments & support 37 - USE_USB = true ; 38 + # enable serial instruments & support 39 + USE_SERIAL = true ; 38 40 39 - # enable dummy Demo Instrument (only if code is available) 40 - USE_DEMOINST = true ; 41 + # enable fast serial instruments & support 42 + USE_FAST_SERIAL = true ; # (Implicit in USE_SERIAL too) 41 43 42 - # enable Video Test Patch Generator and 3DLUT device support 43 - # (V2.0.0 and above) 44 - USE_VTPGLUT = false ; 44 + # enable USB instruments & support 45 + USE_USB = true ; 45 46 46 - # enable Printer device support 47 - USE_PRINTER = false ; 47 + # enable dummy Demo Instrument (only if code is available) 48 + USE_DEMOINST = true ; 48 49 49 - # enable CMF Measurement device and accessory support (if present) 50 - USE_CMFM = false ; 50 + # enable Video Test Patch Generator and 3DLUT device support 51 + # (V2.0.0 and above) 52 + USE_VTPGLUT = false ; 51 53 52 - # Use ArgyllCMS version of libusb (deprecated - don't use) 53 - USE_LIBUSB = false ; 54 + # enable Printer device support 55 + USE_PRINTER = false ; 54 56 55 - # Compile in graph plotting code (Not fully implemented) 56 - USE_PLOT = true ; # [true] 57 + # enable CMF Measurement device and accessory support (if present) 58 + USE_CMFM = false ; 57 59 58 - JPEGLIB = ; 59 - JPEGINC = ; 60 - HAVE_JPEG = true ; 60 + # Use ArgyllCMS version of libusb (deprecated - don't use) 61 + USE_LIBUSB = false ; 61 62 62 - TIFFLIB = ; 63 - TIFFINC = ; 64 - HAVE_TIFF = true ; 63 + # Compile in graph plotting code (Not fully implemented) 64 + USE_PLOT = true ; # [true] 65 65 66 - PNGLIB = ; 67 - PNGINC = ; 68 - HAVE_PNG = true ; 66 + JPEGLIB = ; 67 + JPEGINC = ; 68 + HAVE_JPEG = true ; 69 69 70 - ZLIB = ; 71 - ZINC = ; 72 - HAVE_Z = true ; 70 + TIFFLIB = ; 71 + TIFFINC = ; 72 + HAVE_TIFF = true ; 73 73 74 - SSLLIB = ; 75 - SSLINC = ; 76 - HAVE_SSL = true ; 74 + PNGLIB = ; 75 + PNGINC = ; 76 + HAVE_PNG = true ; 77 77 78 - LINKFLAGS += 79 - ${lib.concatStringsSep " " (map (x: "-L${x}/lib") buildInputs)} 80 - -ldl -lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss 81 - -ljpeg -ltiff -lpng -lssl ; 82 - ''; 78 + ZLIB = ; 79 + ZINC = ; 80 + HAVE_Z = true ; 83 81 84 - nativeBuildInputs = [ jam unzip ]; 82 + SSLLIB = ; 83 + SSLINC = ; 84 + HAVE_SSL = true ; 85 85 86 - preConfigure = '' 86 + LINKFLAGS += 87 + ${lib.concatStringsSep " " (map (x: "-L${x}/lib") buildInputs)} 88 + -ldl -lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss 89 + -ljpeg -ltiff -lpng -lssl ; 90 + ''; 91 + in '' 87 92 cp ${jamTop} Jamtop 88 93 substituteInPlace Makefile --replace "-j 3" "-j $NIX_BUILD_CORES" 89 94 # Remove tiff, jpg and png to be sure the nixpkgs-provided ones are used 90 95 rm -rf tiff jpg png 91 96 92 - unset AR 97 + export AR="$AR rusc" 93 98 ''; 94 99 95 100 buildInputs = [ ··· 110 115 mkdir -p $out/etc/udev/rules.d 111 116 sed -i '/udev-acl/d' usb/55-Argyll.rules 112 117 cp -v usb/55-Argyll.rules $out/etc/udev/rules.d/ 118 + 119 + sed -i -e 's/^CREATED .*/CREATED "'"$(date -d @$SOURCE_DATE_EPOCH)"'"/g' $out/share/argyllcms/RefMediumGamut.gam 120 + 113 121 ''; 114 122 115 123 meta = with lib; {