mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 18:33:00 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
55 lines
1.5 KiB
Nix
55 lines
1.5 KiB
Nix
{ 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";
|
|
version = "1.1.123";
|
|
|
|
src = fetchzip {
|
|
url = "https://github.com/ArticExploit/pantum-driver/releases/download/${version}/Pantum.Ubuntu.Driver.V${builtins.replaceStrings ["."] ["_"] version}.zip";
|
|
hash = "sha256-TUk6CTnWlSvyG8MOpDRhg/eblAo6X/MDUFOiWuOuro0=";
|
|
};
|
|
|
|
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
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Pantum universal driver";
|
|
homepage = "https://global.pantum.com/";
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
license = lib.licenses.unfree;
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
|
maintainers = with maintainers; [ deinferno ];
|
|
};
|
|
}
|