nixpkgs/pkgs/tools/graphics/argyllcms/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

131 lines
3.7 KiB
Nix
Raw Normal View History

2015-09-07 09:41:39 +00:00
{ stdenv, fetchzip, jam, unzip, libX11, libXxf86vm, libXrandr, libXinerama
, libXrender, libXext, libtiff, libjpeg, libpng, libXScrnSaver, writeText
, libXdmcp, libXau, lib, openssl }:
2021-07-14 15:10:11 +00:00
stdenv.mkDerivation rec {
2019-08-13 21:52:01 +00:00
pname = "argyllcms";
2022-07-07 18:48:49 +00:00
version = "2.3.1";
2015-09-07 09:41:39 +00:00
src = fetchzip {
# Kind of flacky URL, it was reaturning 406 and inconsistent binaries for a
# while on me. It might be good to find a mirror
url = "https://www.argyllcms.com/Argyll_V${version}_src.zip";
2022-07-07 18:48:49 +00:00
sha256 = "sha256-XWsubjdD1tg0o7x/aoAalemAChehWkwh4fkP2WRvhAw=";
};
nativeBuildInputs = [ jam unzip ];
2015-09-07 09:41:39 +00:00
postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
substituteInPlace Jambase \
--replace "-m64" ""
'';
2015-09-07 09:41:39 +00:00
preConfigure = let
# The contents of this file comes from the Jamtop file from the
# root of the ArgyllCMS distribution, rewritten to pick up Nixpkgs
# library paths. When ArgyllCMS is updated, make sure that changes
# in that file is reflected here.
jamTop = writeText "argyllcms_jamtop" ''
DESTDIR = "/" ;
REFSUBDIR = "share/argyllcms" ;
2015-09-07 09:41:39 +00:00
# Keep this DESTDIR anchored to Jamtop. PREFIX is used literally
ANCHORED_PATH_VARS = DESTDIR ;
2015-09-07 09:41:39 +00:00
# Tell standalone libraries that they are part of Argyll:
DEFINES += ARGYLLCMS ;
2015-09-07 09:41:39 +00:00
# enable serial instruments & support
USE_SERIAL = true ;
2015-09-07 09:41:39 +00:00
# enable fast serial instruments & support
USE_FAST_SERIAL = true ; # (Implicit in USE_SERIAL too)
2015-09-07 09:41:39 +00:00
# enable USB instruments & support
USE_USB = true ;
2021-09-22 14:39:23 +00:00
# enable dummy Demo Instrument (only if code is available)
USE_DEMOINST = true ;
2021-09-22 14:39:23 +00:00
# enable Video Test Patch Generator and 3DLUT device support
# (V2.0.0 and above)
USE_VTPGLUT = false ;
2021-09-22 14:39:23 +00:00
# enable Printer device support
USE_PRINTER = false ;
2015-09-07 09:41:39 +00:00
# enable CMF Measurement device and accessory support (if present)
USE_CMFM = false ;
# Use ArgyllCMS version of libusb (deprecated - don't use)
USE_LIBUSB = false ;
# Compile in graph plotting code (Not fully implemented)
USE_PLOT = true ; # [true]
JPEGLIB = ;
JPEGINC = ;
HAVE_JPEG = true ;
2015-09-07 09:41:39 +00:00
TIFFLIB = ;
TIFFINC = ;
HAVE_TIFF = true ;
2015-09-07 09:41:39 +00:00
PNGLIB = ;
PNGINC = ;
HAVE_PNG = true ;
2015-09-07 09:41:39 +00:00
ZLIB = ;
ZINC = ;
HAVE_Z = true ;
SSLLIB = ;
SSLINC = ;
HAVE_SSL = true ;
LINKFLAGS +=
${lib.concatStringsSep " " (map (x: "-L${x}/lib") buildInputs)}
-lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss
-ljpeg -ltiff -lpng -lssl ;
'';
in ''
cp ${jamTop} Jamtop
substituteInPlace Makefile --replace "-j 3" "-j $NIX_BUILD_CORES"
2015-09-07 09:41:39 +00:00
# Remove tiff, jpg and png to be sure the nixpkgs-provided ones are used
rm -rf tiff jpg png
export AR="$AR rusc"
'';
2015-09-07 09:41:39 +00:00
buildInputs = [
libtiff libjpeg libpng libX11 libXxf86vm libXrandr libXinerama libXext
libXrender libXScrnSaver libXdmcp libXau openssl
];
2019-10-26 15:39:27 +00:00
buildFlags = [ "all" ];
2019-10-26 15:39:27 +00:00
makeFlags = [
"PREFIX=${placeholder "out"}"
2019-10-26 15:39:27 +00:00
];
2015-09-07 09:41:39 +00:00
# Install udev rules, but remove lines that set up the udev-acl
# stuff, since that is handled by udev's own rules (70-udev-acl.rules)
postInstall = ''
rm -v $out/bin/License.txt
mkdir -p $out/etc/udev/rules.d
2015-09-07 09:41:39 +00:00
sed -i '/udev-acl/d' usb/55-Argyll.rules
cp -v usb/55-Argyll.rules $out/etc/udev/rules.d/
sed -i -e 's/^CREATED .*/CREATED "'"$(date -d @$SOURCE_DATE_EPOCH)"'"/g' $out/share/argyllcms/RefMediumGamut.gam
'';
meta = with lib; {
homepage = "http://www.argyllcms.com";
description = "Color management system (compatible with ICC)";
license = licenses.gpl3;
maintainers = [];
platforms = platforms.linux;
};
}