summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/ff/fflinuxprint/package.nix
blob: ac55c789c44ac338a3b6b9472ce66b2f2b20dcde (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
{
  autoPatchelfHook,
  cups,
  dpkg,
  fetchurl,
  lib,
  stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "fflinuxprint";
  version = "1.1.4-3";

  src = fetchurl {
    url = "https://support-fb.fujifilm.com/driver_downloads/fflinuxprint_${finalAttrs.version}_amd64.deb";
    hash = "sha256-oi6p4e9Uigz0TbEcmloDhv3qU98Ou1qqdorGY3942uM=";
    curlOpts = "--user-agent Mozilla/5.0"; # HTTP 410 otherwise
  };

  nativeBuildInputs = [
    autoPatchelfHook
    dpkg
  ];

  buildInputs = [
    cups
  ];

  dontConfigure = true;
  dontBuild = true;

  installPhase = ''
    runHook preInstall

    mkdir -p $out/share/cups/model
    mv usr/lib $out
    mv usr/share/ppd/fujifilm/* $out/share/cups/model

    runHook postInstall
  '';

  meta = {
    description = "FujiFILM Linux Printer Driver";
    homepage = "https://support-fb.fujifilm.com";
    license = lib.licenses.unfree;
    maintainers = with lib.maintainers; [ jaduff ];
    platforms = lib.platforms.linux;
    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
  };
})