Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / le / lexmark-aex / package.nix
blobcfb02f70d6f3e5fabf990960c06035ad4b4523c0
1 { lib
2 , stdenv
3 , cups
4 , fetchurl
5 , patchPpdFilesHook
6 , autoPatchelfHook
7 , dpkg
8 , perl
9 , avahi
12 stdenv.mkDerivation {
13   pname = "lexmark-aex";
14   version = "1.0";
16   dontPatchELF = true;
17   dontStrip = true;
19   src = fetchurl {
20     url = "https://downloads.lexmark.com/downloads/drivers/Lexmark-AEX-PPD-Files-1.0-01242019.amd64.deb";
21     hash = "sha256-igrJEeFLArGbncOwk/WttnWfPjOokD0/IzpJ4VSOtHk=";
22   };
24   strictDeps = true;
26   nativeBuildInputs = [
27     autoPatchelfHook
28     patchPpdFilesHook
29     dpkg
30   ];
32   buildInputs = [
33     # Needed for autoPatchelfHook.
34     avahi
35     cups
36     # Needed for patchShebangs.
37     perl
38   ];
40   # Needed for autoPatchelfHook.
41   runtimeDependencies = [ (lib.getLib cups) ];
43   ppdFileCommands = [ "CommandFileFilterG2" "rerouteprintoption" ];
45   installPhase = let
46     libdir =
47       if stdenv.system == "x86_64-linux"    then "lib64"
48       else if stdenv.system == "i686_linux" then "lib"
49       else throw "other platforms than i686_linux and x86_64-linux are not yet supported";
50   in ''
51     runHook preInstall
53     prefix=usr/local/Lexmark/ppd/Lexmark-AEX-PPD-Files/GlobalPPD_1.4
55     # Install raster image filter.
56     install -Dm755 "$prefix/rerouteprintoption" "$out/lib/cups/filter/rerouteprintoption"
57     patchShebangs "$out/lib/cups/filter/rerouteprintoption"
59     # Install additional binary filters.
60     for i in CommandFileFilterG2 LexHBPFilter; do
61       install -Dm755 "$prefix/${libdir}/$i" "$out/lib/cups/filter/$i"
62     done
64     # Install PPD.
65     install -Dm 0644 -t "$out/share/cups/model/Lexmark" "$prefix"/*.ppd
67     runHook postInstall
68   '';
70   meta = with lib; {
71     description = "CUPS drivers for Lexmark B2200 and MB2200 Series printers";
72     homepage = "https://support.lexmark.com/en_xm/drivers-downloads.html";
73     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
74     license = licenses.unfree;
75     maintainers = [ maintainers.tobim ];
76     platforms = [ "x86_64-linux" "i686-linux" ];
77   };