Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / ca / canon-capt / package.nix
blobe2f77fee9c07bb53fe63139d160d638bc5f5d803
2   autoconf,
3   automake,
4   cups,
5   fetchFromGitHub,
6   lib,
7   stdenv,
8 }:
10 let
11   version = "0.1.4.2-GxB";
13 stdenv.mkDerivation {
14   pname = "canon-capt";
15   inherit version;
17   src = fetchFromGitHub {
18     owner = "mounaiban";
19     repo = "captdriver";
20     rev = "8ecc3cde1ae9a20dcb015994bb0fea0dbefa2b83";
21     hash = "sha256-FslofWZNmF7G9+lmw1JehRBYZIAXcg6Dmv9xJ/c4Evo=";
22   };
24   nativeBuildInputs = [
25     autoconf
26     automake
27   ];
29   buildInputs = [ cups ];
31   # Fix for 'ppdc: Unable to find include file "<font.defs>"', which blocks '*.ppd' generation.
32   # Issue occurs in hermetic sandbox; this workaround is the current solution.
33   # Source: https://github.com/NixOS/nixpkgs/blob/9997402000a82eda4327fde36291234118c7515e/pkgs/misc/drivers/hplip/default.nix#L160
34   CUPS_DATADIR = "${cups}/share/cups";
36   configurePhase = ''
37     runHook preConfigure
38     aclocal
39     autoconf
40     automake --add-missing
41     ./configure --prefix=$out/usr
42     runHook postConfigure
43   '';
45   buildPhase = ''
46     runHook preBuild
47     make
48     make ppd
49     runHook postBuild
50   '';
52   installPhase = ''
53     runHook preInstall
54     mkdir -p $out/lib/cups/filter
55     install -D -m 755 ./src/rastertocapt $out/lib/cups/filter/rastertocapt
57     mkdir -p $out/share/cups/model/canon
58     install -D -m 644 ./ppd/CanonLBP-2900-3000.ppd $out/share/cups/model/canon/CanonLBP-2900-3000.ppd
59     install -D -m 644 ./ppd/CanonLBP-3010-3018-3050.ppd $out/share/cups/model/canon/CanonLBP-3010-3018-3050.ppd
61     runHook postInstall
62   '';
64   meta = with lib; {
65     description = "Community-driven driver for Canon CAPT-based printers";
66     homepage = "https://github.com/mounaiban/captdriver";
67     license = licenses.gpl3;
68     maintainers = with maintainers; [ cryptoluks ];
69     platforms = platforms.linux;
70   };