nixpkgs/pkgs/by-name/pa/pantum-driver/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.5 KiB
Nix
Raw Normal View History

2022-02-04 14:31:49 +00:00
{ lib
, stdenv
, fetchzip
, libusb1
, cups
, dpkg
, libjpeg8
, makeWrapper
, autoPatchelfHook
, enablePtqpdf ? false # Pantum's version of qpdf
}:
let
architecture = {
i686-linux = "i386";
x86_64-linux = "amd64";
}.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation rec {
pname = "pantum-driver";
2024-06-19 18:09:16 +00:00
version = "1.1.123";
2022-02-04 14:31:49 +00:00
src = fetchzip {
2024-06-19 18:09:16 +00:00
url = "https://github.com/ArticExploit/pantum-driver/releases/download/${version}/Pantum.Ubuntu.Driver.V${builtins.replaceStrings ["."] ["_"] version}.zip";
hash = "sha256-TUk6CTnWlSvyG8MOpDRhg/eblAo6X/MDUFOiWuOuro0=";
2022-02-04 14:31:49 +00:00
};
buildInputs = [ libusb1 libjpeg8 cups ];
nativeBuildInputs = [ dpkg autoPatchelfHook ];
installPhase = ''
dpkg-deb -x ./Resources/pantum_${version}-1_${architecture}.deb .
mkdir -p $out $out/lib
cp -r etc $out/
cp -r usr/lib/cups $out/lib/
cp -r usr/local/lib/* $out/lib/
cp -r usr/share $out/
cp Resources/locale/en_US.UTF-8/* $out/share/doc/pantum/
'' + lib.optionalString enablePtqpdf ''
cp -r opt/pantum/* $out/
ln -s $out/lib/libqpdf.so* $out/lib/libqpdf.so
ln -s $out/lib/libqpdf.so $out/lib/libqpdf.so.21
'';
2024-02-10 09:00:50 +00:00
meta = with lib; {
2022-02-04 14:31:49 +00:00
description = "Pantum universal driver";
homepage = "https://global.pantum.com/";
2024-02-10 09:00:50 +00:00
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2022-02-04 14:31:49 +00:00
license = lib.licenses.unfree;
platforms = [ "i686-linux" "x86_64-linux" ];
2024-02-10 09:00:50 +00:00
maintainers = with maintainers; [ deinferno ];
2022-02-04 14:31:49 +00:00
};
}