70 lines
1.8 KiB
Nix
70 lines
1.8 KiB
Nix
{
|
|
cups,
|
|
fetchzip,
|
|
lib,
|
|
stdenv,
|
|
rpm,
|
|
}:
|
|
|
|
let
|
|
version = "1.2.8";
|
|
in
|
|
stdenv.mkDerivation {
|
|
inherit version;
|
|
name = "citizen-cups";
|
|
pname = "citizen-cups";
|
|
|
|
src = fetchzip {
|
|
url = "https://www.citizen-systems.com/resource/support/POS/Generic_Printer_Files/CUPS_Linux_Driver/CUPS_Linux_Driver.zip";
|
|
hash = "sha256-2ha24/7oS/rINKmYxyVryX66kkc6niCChxhw/2KOPSw=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
rpm
|
|
];
|
|
|
|
buildInputs = [
|
|
cups
|
|
];
|
|
|
|
postUnpack = ''
|
|
pushd source
|
|
ls -la
|
|
rpm2archive ctzpos-cups-1.2.8-0.src.rpm
|
|
tar xvf ctzpos-cups-1.2.8-0.src.rpm.tgz
|
|
tar xvf ctzpos-cups-1.2.8.tar.bz2
|
|
popd
|
|
'';
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
pushd "ctzpos-cups-${version}";
|
|
gcc -Wl,-rpath,/usr/lib -Wall -fPIC -O2 -o rastertocbm1k rastertocbm1k.c -lcupsimage -lcups
|
|
gcc -Wl,-rpath,/usr/lib -Wall -fPIC -O2 -o rastertocds500 rastertocds500.c -lcupsimage -lcups
|
|
gcc -Wl,-rpath,/usr/lib -Wall -fPIC -O2 -o rastertocts2kl rastertocts2kl.c -lcupsimage -lcups
|
|
popd
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/lib/cups/filter
|
|
install -D -m 755 ./ctzpos-cups-${version}/rastertocbm1k $out/lib/cups/filter/rastertocbm1k
|
|
install -D -m 755 ./ctzpos-cups-${version}/rastertocds500 $out/lib/cups/filter/rastertocds500
|
|
install -D -m 755 ./ctzpos-cups-${version}/rastertocts2kl $out/lib/cups/filter/rastertocts2kl
|
|
|
|
mkdir -p $out/share/cups/model/citizen
|
|
install -D -m 644 ./ctzpos-cups-${version}/*.ppd $out/share/cups/model/citizen
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Citizen CUPS drivers and filters";
|
|
homepage = "https://www.citizen-systems.com";
|
|
#license = licenses.unfreeRedistributable;
|
|
maintainers = with maintainers; [ dadada ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|