1{
2 stdenv,
3 lib,
4 fetchzip,
5 dpkg,
6 autoPatchelfHook,
7 cups,
8}:
9let
10 debPlatform =
11 if stdenv.hostPlatform.system == "x86_64-linux" then
12 "amd64"
13 else if stdenv.hostPlatform.system == "i686-linux" then
14 "i386"
15 else
16 throw "Unsupported system: ${stdenv.hostPlatform.system}";
17in
18stdenv.mkDerivation rec {
19 pname = "fxlinuxprint";
20 version = "1.1.2-1";
21
22 # https://support-fb.fujifilm.com/driver_downloads/fxlinuxpdf112119031.zip is gone
23 src = fetchzip {
24 url = "https://github.com/NixOS/nixpkgs/files/12232817/fxlinuxpdf112119031.zip";
25 sha256 = "1mv07ch6ysk9bknfmjqsgxb803sj6vfin29s9knaqv17jvgyh0n3";
26 };
27
28 nativeBuildInputs = [
29 dpkg
30 autoPatchelfHook
31 ];
32 buildInputs = [ cups ];
33
34 sourceRoot = ".";
35 unpackCmd = "dpkg-deb -x $curSrc/fxlinuxprint_${version}_${debPlatform}.deb .";
36
37 dontConfigure = true;
38 dontBuild = true;
39
40 installPhase = ''
41 mkdir -p $out
42 mv etc $out
43 mv usr/lib $out
44
45 mkdir -p $out/share/cups/model
46 mv usr/share/ppd/FujiXerox/* $out/share/cups/model
47 '';
48
49 meta = with lib; {
50 description = "Fuji Xerox Linux Printer Driver";
51 longDescription = ''
52 DocuPrint P365/368 d
53 DocuPrint CM315/318 z
54 DocuPrint CP315/318 dw
55 ApeosPort-VI C2271/C3370/C3371/C4471/C5571/C6671/C7771
56 DocuCentre-VI C2271/C3370/C3371/C4471/C5571/C6671/C7771
57 DocuPrint 3205 d/3208 d/3505 d/3508 d/4405 d/4408 d
58 '';
59 homepage = "https://onlinesupport.fujixerox.com";
60 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
61 license = licenses.unfree;
62 maintainers = [ ];
63 platforms = platforms.linux;
64 };
65}