tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
argyllcms: make reproducible
and make binfmt cross-compilable
Artturin
4 years ago
e7a05e90
23f71e94
+61
-53
1 changed file
expand all
collapse all
unified
split
pkgs
tools
graphics
argyllcms
default.nix
+61
-53
pkgs/tools/graphics/argyllcms/default.nix
···
13
sha256 = "sha256-umY3wQfG26Okqnw+MCUnlwWTAyJ6MR/FHe5oe61KBh0=";
14
};
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" ;
23
24
-
# Keep this DESTDIR anchored to Jamtop. PREFIX is used literally
25
-
ANCHORED_PATH_VARS = DESTDIR ;
0
0
26
27
-
# Tell standalone libraries that they are part of Argyll:
28
-
DEFINES += ARGYLLCMS ;
0
0
0
0
0
0
29
30
-
# enable serial instruments & support
31
-
USE_SERIAL = true ;
32
33
-
# enable fast serial instruments & support
34
-
USE_FAST_SERIAL = true ; # (Implicit in USE_SERIAL too)
35
36
-
# enable USB instruments & support
37
-
USE_USB = true ;
38
39
-
# enable dummy Demo Instrument (only if code is available)
40
-
USE_DEMOINST = true ;
41
42
-
# enable Video Test Patch Generator and 3DLUT device support
43
-
# (V2.0.0 and above)
44
-
USE_VTPGLUT = false ;
45
46
-
# enable Printer device support
47
-
USE_PRINTER = false ;
48
49
-
# enable CMF Measurement device and accessory support (if present)
50
-
USE_CMFM = false ;
0
51
52
-
# Use ArgyllCMS version of libusb (deprecated - don't use)
53
-
USE_LIBUSB = false ;
54
55
-
# Compile in graph plotting code (Not fully implemented)
56
-
USE_PLOT = true ; # [true]
57
58
-
JPEGLIB = ;
59
-
JPEGINC = ;
60
-
HAVE_JPEG = true ;
61
62
-
TIFFLIB = ;
63
-
TIFFINC = ;
64
-
HAVE_TIFF = true ;
65
66
-
PNGLIB = ;
67
-
PNGINC = ;
68
-
HAVE_PNG = true ;
69
70
-
ZLIB = ;
71
-
ZINC = ;
72
-
HAVE_Z = true ;
73
74
-
SSLLIB = ;
75
-
SSLINC = ;
76
-
HAVE_SSL = true ;
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
-
'';
83
84
-
nativeBuildInputs = [ jam unzip ];
0
0
85
86
-
preConfigure = ''
0
0
0
0
0
87
cp ${jamTop} Jamtop
88
substituteInPlace Makefile --replace "-j 3" "-j $NIX_BUILD_CORES"
89
# Remove tiff, jpg and png to be sure the nixpkgs-provided ones are used
90
rm -rf tiff jpg png
91
92
-
unset AR
93
'';
94
95
buildInputs = [
···
110
mkdir -p $out/etc/udev/rules.d
111
sed -i '/udev-acl/d' usb/55-Argyll.rules
112
cp -v usb/55-Argyll.rules $out/etc/udev/rules.d/
0
0
0
113
'';
114
115
meta = with lib; {
···
13
sha256 = "sha256-umY3wQfG26Okqnw+MCUnlwWTAyJ6MR/FHe5oe61KBh0=";
14
};
15
16
+
nativeBuildInputs = [ jam unzip ];
0
0
0
0
0
0
17
18
+
postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
19
+
substituteInPlace Jambase \
20
+
--replace "-m64" ""
21
+
'';
22
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" ;
31
32
+
# Keep this DESTDIR anchored to Jamtop. PREFIX is used literally
33
+
ANCHORED_PATH_VARS = DESTDIR ;
34
35
+
# Tell standalone libraries that they are part of Argyll:
36
+
DEFINES += ARGYLLCMS ;
37
38
+
# enable serial instruments & support
39
+
USE_SERIAL = true ;
40
41
+
# enable fast serial instruments & support
42
+
USE_FAST_SERIAL = true ; # (Implicit in USE_SERIAL too)
43
44
+
# enable USB instruments & support
45
+
USE_USB = true ;
0
46
47
+
# enable dummy Demo Instrument (only if code is available)
48
+
USE_DEMOINST = true ;
49
50
+
# enable Video Test Patch Generator and 3DLUT device support
51
+
# (V2.0.0 and above)
52
+
USE_VTPGLUT = false ;
53
54
+
# enable Printer device support
55
+
USE_PRINTER = false ;
56
57
+
# enable CMF Measurement device and accessory support (if present)
58
+
USE_CMFM = false ;
59
60
+
# Use ArgyllCMS version of libusb (deprecated - don't use)
61
+
USE_LIBUSB = false ;
0
62
63
+
# Compile in graph plotting code (Not fully implemented)
64
+
USE_PLOT = true ; # [true]
0
65
66
+
JPEGLIB = ;
67
+
JPEGINC = ;
68
+
HAVE_JPEG = true ;
69
70
+
TIFFLIB = ;
71
+
TIFFINC = ;
72
+
HAVE_TIFF = true ;
73
74
+
PNGLIB = ;
75
+
PNGINC = ;
76
+
HAVE_PNG = true ;
77
78
+
ZLIB = ;
79
+
ZINC = ;
80
+
HAVE_Z = true ;
0
0
81
82
+
SSLLIB = ;
83
+
SSLINC = ;
84
+
HAVE_SSL = true ;
85
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 ''
92
cp ${jamTop} Jamtop
93
substituteInPlace Makefile --replace "-j 3" "-j $NIX_BUILD_CORES"
94
# Remove tiff, jpg and png to be sure the nixpkgs-provided ones are used
95
rm -rf tiff jpg png
96
97
+
export AR="$AR rusc"
98
'';
99
100
buildInputs = [
···
115
mkdir -p $out/etc/udev/rules.d
116
sed -i '/udev-acl/d' usb/55-Argyll.rules
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
+
121
'';
122
123
meta = with lib; {