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