26 stdenv.mkDerivation rec {
31 # Kind of flacky URL, it was reaturning 406 and inconsistent binaries for a
32 # while on me. It might be good to find a mirror
33 url = "https://www.argyllcms.com/Argyll_V${version}_src.zip";
34 hash = "sha256-xpbj15GzpGS0d1UjzvYiZ1nmmTjNIyv0ST2blmi7ZSk=";
42 patches = lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) (
43 # Build process generates files by compiling and then invoking an executable.
44 replaceVars ./jam-cross.patch {
45 emulator = stdenv.hostPlatform.emulator buildPackages;
49 postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
50 substituteInPlace Jambase \
56 # The contents of this file comes from the Jamtop file from the
57 # root of the ArgyllCMS distribution, rewritten to pick up Nixpkgs
58 # library paths. When ArgyllCMS is updated, make sure that changes
59 # in that file is reflected here.
60 jamTop = writeText "argyllcms_jamtop" ''
62 REFSUBDIR = "share/argyllcms" ;
64 # Keep this DESTDIR anchored to Jamtop. PREFIX is used literally
65 ANCHORED_PATH_VARS = DESTDIR ;
67 # Tell standalone libraries that they are part of Argyll:
68 DEFINES += ARGYLLCMS ;
70 # enable serial instruments & support
73 # enable fast serial instruments & support
74 USE_FAST_SERIAL = true ; # (Implicit in USE_SERIAL too)
76 # enable USB instruments & support
79 # enable dummy Demo Instrument (only if code is available)
82 # enable Video Test Patch Generator and 3DLUT device support
86 # enable Printer device support
89 # enable CMF Measurement device and accessory support (if present)
92 # Use ArgyllCMS version of libusb (deprecated - don't use)
95 # Compile in graph plotting code (Not fully implemented)
96 USE_PLOT = true ; # [true]
119 ${lib.concatStringsSep " " (map (x: "-L${x}/lib") buildInputs)}
120 -lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss
121 -ljpeg -ltiff -lpng -lssl ;
126 substituteInPlace Makefile --replace "-j 3" "-j $NIX_BUILD_CORES"
127 # Remove tiff, jpg and png to be sure the nixpkgs-provided ones are used
149 buildFlags = [ "all" ];
152 "PREFIX=${placeholder "out"}"
155 # Install udev rules, but remove lines that set up the udev-acl
156 # stuff, since that is handled by udev's own rules (70-udev-acl.rules)
158 rm -v $out/bin/License.txt
159 mkdir -p $out/etc/udev/rules.d
160 sed -i '/udev-acl/d' usb/55-Argyll.rules
161 cp -v usb/55-Argyll.rules $out/etc/udev/rules.d/
163 sed -i -e 's/^CREATED .*/CREATED "'"$(date -d @$SOURCE_DATE_EPOCH)"'"/g' $out/share/argyllcms/RefMediumGamut.gam
168 updateScript = writeScript "update-argyllcms" ''
169 #!/usr/bin/env nix-shell
170 #!nix-shell -i bash -p curl pcre common-updater-scripts
174 # Expect the text in format of 'Current Version 3.0.1 (19th October 2023)'
175 new_version="$(curl -s https://www.argyllcms.com/ |
176 pcregrep -o1 '>Current Version ([0-9.]+) ')"
177 update-source-version ${pname} "$new_version"
182 homepage = "https://www.argyllcms.com/";
183 description = "Color management system (compatible with ICC)";
184 license = licenses.gpl3;
186 platforms = platforms.linux;