git.iko.soy/typeable/nixpkgs
on master help sign in
hplip_3_16_11: drop
commita38942945313fb1b9a1e52773e851f0012228b56 authorajs124 <git@ajs124.de> dateFri 21 Jan 2022, 03:51 (5 years ago) parent8858896
2 files changed−196
pkgs/misc/drivers/hplip/3.16.11.nix−192 pkgs/top-level/all-packages.nix−4
pkgs/misc/drivers/hplip/3.16.11.nixdeleted−192
@@ -1,192 +0,0 @@
1−{ lib, stdenv, fetchurl, substituteAll
2−, pkg-config
3−, cups, libjpeg, libusb1, python2Packages, sane-backends, dbus, usbutils
4−, net-snmp, openssl, nettools
5−, bash, util-linux
6−, qtSupport ? true
7−, withPlugin ? false
8−}:
9−
10−let
11−
12− name = "hplip-${version}";
13− version = "3.16.11";
14−
15− src = fetchurl {
16− url = "mirror://sourceforge/hplip/${name}.tar.gz";
17− sha256 = "094vkyr0rjng72m13dgr824cdl7q20x23qjxzih4w7l9njn0rqpn";
18− };
19−
20− plugin = fetchurl {
21− url = "http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${name}-plugin.run";
22− sha256 = "1y3wdax2wb6kdd8bi40wl7v9s8ffyjz95bz42sjcpzzddmlhcaxg";
23− };
24−
25− hplipState = substituteAll {
26− inherit version;
27− src = ./hplip.state;
28− };
29−
30− hplipPlatforms = {
31− i686-linux = "x86_32";
32− x86_64-linux = "x86_64";
33− armv6l-linux = "arm32";
34− armv7l-linux = "arm32";
35− aarch64-linux = "arm64";
36− };
37−
38− hplipArch = hplipPlatforms.${stdenv.hostPlatform.system}
39− or (throw "HPLIP not supported on ${stdenv.hostPlatform.system}");
40−
41− pluginArches = [ "x86_32" "x86_64" "arm32" "arm64" ];
42−
43−in
44−
45−assert withPlugin -> builtins.elem hplipArch pluginArches
46− || throw "HPLIP plugin not supported on ${stdenv.hostPlatform.system}";
47−
48−python2Packages.buildPythonApplication {
49− inherit name src;
50− format = "other";
51−
52− buildInputs = [
53− libjpeg
54− cups
55− libusb1
56− sane-backends
57− dbus
58− net-snmp
59− openssl
60− ];
61−
62− nativeBuildInputs = [
63− pkg-config
64− ];
65−
66− pythonPath = with python2Packages; [
67− dbus
68− pillow
69− pygobject2
70− reportlab
71− usbutils
72− ] ++ lib.optionals qtSupport [
73− pyqt4
74− ];
75−
76− makeWrapperArgs = [ "--prefix" "PATH" ":" "${nettools}/bin" ];
77−
78− prePatch = ''
79− # HPLIP hardcodes absolute paths everywhere. Nuke from orbit.
80− find . -type f -exec sed -i \
81− -e s,/etc/hp,$out/etc/hp, \
82− -e s,/etc/sane.d,$out/etc/sane.d, \
83− -e s,/usr/include/libusb-1.0,${libusb1.dev}/include/libusb-1.0, \
84− -e s,/usr/share/hal/fdi/preprobe/10osvendor,$out/share/hal/fdi/preprobe/10osvendor, \
85− -e s,/usr/lib/systemd/system,$out/lib/systemd/system, \
86− -e s,/var/lib/hp,$out/var/lib/hp, \
87− {} +
88− '';
89−
90− preConfigure = ''
91− export configureFlags="$configureFlags
92− --with-hpppddir=$out/share/cups/model/HP
93− --with-cupsfilterdir=$out/lib/cups/filter
94− --with-cupsbackenddir=$out/lib/cups/backend
95− --with-icondir=$out/share/applications
96− --with-systraydir=$out/xdg/autostart
97− --with-mimedir=$out/etc/cups
98− --enable-policykit
99− "
100−
101− export makeFlags="
102− halpredir=$out/share/hal/fdi/preprobe/10osvendor
103− rulesdir=$out/etc/udev/rules.d
104− policykit_dir=$out/share/polkit-1/actions
105− policykit_dbus_etcdir=$out/etc/dbus-1/system.d
106− policykit_dbus_sharedir=$out/share/dbus-1/system-services
107− hplip_confdir=$out/etc/hp
108− hplip_statedir=$out/var/lib/hp
109− "
110− '';
111−
112− enableParallelBuilding = true;
113−
114− postInstall = lib.optionalString withPlugin ''
115− sh ${plugin} --noexec --keep
116− cd plugin_tmp
117−
118− cp plugin.spec $out/share/hplip/
119−
120− mkdir -p $out/share/hplip/data/firmware
121− cp *.fw.gz $out/share/hplip/data/firmware
122−
123− mkdir -p $out/share/hplip/data/plugins
124− cp license.txt $out/share/hplip/data/plugins
125−
126− mkdir -p $out/share/hplip/prnt/plugins
127− for plugin in lj hbpl1; do
128− cp $plugin-${hplipArch}.so $out/share/hplip/prnt/plugins
129− ln -s $out/share/hplip/prnt/plugins/$plugin-${hplipArch}.so \
130− $out/share/hplip/prnt/plugins/$plugin.so
131− done
132−
133− mkdir -p $out/share/hplip/scan/plugins
134− for plugin in bb_soap bb_marvell bb_soapht fax_marvell; do
135− cp $plugin-${hplipArch}.so $out/share/hplip/scan/plugins
136− ln -s $out/share/hplip/scan/plugins/$plugin-${hplipArch}.so \
137− $out/share/hplip/scan/plugins/$plugin.so
138− done
139−
140− mkdir -p $out/var/lib/hp
141− cp ${hplipState} $out/var/lib/hp/hplip.state
142−
143− mkdir -p $out/etc/sane.d/dll.d
144− mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf
145− '';
146−
147− # The installed executables are just symlinks into $out/share/hplip,
148− # but wrapPythonPrograms ignores symlinks. We cannot replace the Python
149− # modules in $out/share/hplip with wrapper scripts because they import
150− # each other as libraries. Instead, we emulate wrapPythonPrograms by
151− # 1. Calling patchPythonProgram on the original script in $out/share/hplip
152− # 2. Making our own wrapper pointing directly to the original script.
153− dontWrapPythonPrograms = true;
154− preFixup = ''
155− buildPythonPath "$out $pythonPath"
156−
157− for bin in $out/bin/*; do
158− py=$(readlink -m $bin)
159− rm $bin
160− echo "patching \`$py'..."
161− patchPythonScript "$py"
162− echo "wrapping \`$bin'..."
163− makeWrapper "$py" "$bin" \
164− --prefix PATH ':' "$program_PATH" \
165− --set PYTHONNOUSERSITE "true" \
166− $makeWrapperArgs
167− done
168− '';
169−
170− postFixup = ''
171− substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
172− # Patch udev rules:
173− # with plugin, they upload firmware to printers,
174− # without plugin, they complain about the missing plugin.
175− substituteInPlace $out/etc/udev/rules.d/56-hpmud.rules \
176− --replace {,${bash}}/bin/sh \
177− --replace /usr/bin/nohup "" \
178− --replace {,${util-linux}/bin/}logger \
179− --replace {/usr,$out}/bin
180− '';
181−
182− meta = with lib; {
183− description = "Print, scan and fax HP drivers for Linux";
184− homepage = "http://hplipopensource.com/";
185− downloadPage = "https://sourceforge.net/projects/hplip/files/hplip/";
186− license = if withPlugin
187− then licenses.unfree
188− else with licenses; [ mit bsd2 gpl2Plus ];
189− platforms = [ "i686-linux" "x86_64-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
190− maintainers = with maintainers; [ ttuegel ];
191− };
192−}
pkgs/top-level/all-packages.nix−4
@@ -32877,10 +32877,6 @@ with pkgs;
3287732877
3287832878 hplipWithPlugin = hplip.override { withPlugin = true; };
3287932879
32880− hplip_3_16_11 = callPackage ../misc/drivers/hplip/3.16.11.nix { };
32881−
32882− hplipWithPlugin_3_16_11 = hplip_3_16_11.override { withPlugin = true; };
32883−
3288432880 hyperfine = callPackage ../tools/misc/hyperfine {
3288532881 inherit (darwin.apple_sdk.frameworks) Security;
3288632882 };