blob: 22bb34d3937508c284d75e4a58cb53549afd35b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
|
{
stdenv,
lib,
fetchurl,
dpkg,
autoPatchelfHook,
cups,
xorg,
}:
let
debPlatform =
if stdenv.hostPlatform.system == "x86_64-linux" then
"x86_64"
else if stdenv.hostPlatform.system == "i686-linux" then
"i686"
else
throw "Unsupported system: ${stdenv.hostPlatform.system}";
in
stdenv.mkDerivation rec {
pname = "xerox-workcentre-7800-series-driver";
version = "5.20.661.4684";
debpkg = "XeroxOfficev5Pkg-Linux${debPlatform}-${version}.deb";
src = fetchurl {
url = "https://download.support.xerox.com/pub/drivers/CQ8580/drivers/linux/pt_BR/${debpkg}";
sha256 = "014k0r9ij3401mnab1qzv96bjl9x7rf11aw1ibf0q370pk9jqqjb"; # TODO correct hash for i686
};
nativeBuildInputs = [ dpkg autoPatchelfHook ];
# TODO add support for disable xorg
buildInputs = [
cups
stdenv.cc.cc.lib
xorg.libX11
xorg.libXrender
xorg.libXfixes
xorg.libXdamage
xorg.libXcomposite
xorg.libXcursor
xorg.libXrandr
xorg.libXext
xorg.libXinerama
];
sourceRoot = ".";
unpackCmd = "dpkg-deb -x $curSrc .";
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -r usr/lib $out
mkdir -p $out/share/cups/model
cp opt/XeroxOffice/prtsys/ppd/XROFFSTD.ppd $out/share/cups/model
## Main CUPS filter + PPD location
#mkdir -p $out/lib/cups/filter
#cp -a usr/lib/cups/filter/* $out/lib/cups/filter/
#mkdir -p $out/share/cups/model/xerox
#cp -a opt/XeroxOffice/prtsys/ppd/XROFFSTD.ppd $out/share/cups/model/xerox/
# Binaries (queue/log/print managers – optional but nice to have)
mkdir -p $out/bin
cp -a usr/bin/xeroxoffice* $out/bin/
cp -a opt/XeroxOffice/prtsys/xeroxoffice* $out/bin/ || true
# The big blob of libraries & data
mkdir -p $out/opt/XeroxOffice
cp -a opt/XeroxOffice/* $out/opt/XeroxOffice/
# Man pages (optional)
mkdir -p $out/share/man/man1
cp -a usr/share/man/man1/* $out/share/man/man1/
runHook postInstall
# runHook preInstall
# mkdir -p $out
# # Copy and patch the binaries and libraries
# cp -r opt $out/
# cp -r usr $out/
# # FIX
# mkdir -p $out/lib/cups/filter
# cp -a usr/lib/cups/filter/* $out/lib/cups/filter/ # or * if multiple
# chmod +x $out/lib/cups/filter/*
# # Move the PPD to CUPS model dir
# mkdir -p $out/share/cups/model
# cp opt/XeroxOffice/prtsys/ppd/*.ppd $out/share/cups/model/
# # Install the CUPS filters
# mkdir -p $out/lib/cups/filter
# cp usr/lib/cups/filter/* $out/lib/cups/filter/
# # Install man pages
# mkdir -p $out/share/man
# cp -r usr/share/man/* $out/share/man/
# runHook postInstall
'';
meta = with lib; {
description = "Xerox WorkCentre 7800 Series Linux Printer Driver";
longDescription = ''
WorkCentre 7830/7835/7845/7855
'';
homepage = "https://www.support.xerox.com/en-us/product/workcentre-7800-series/downloads?platform=linux";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
#license = licenses.unfree;
maintainers = [];
platforms = platforms.linux;
};
}
|