2024-09-19 14:19:46 +00:00
{
stdenvNoCC ,
lib ,
fetchurl ,
autoPatchelfHook ,
cups ,
e2fsprogs ,
krb5 ,
libxcrypt-legacy ,
unzip ,
} :
stdenvNoCC . mkDerivation {
pname = " c u p s - i d p r t - t s p l " ;
version = " 1 . 4 . 7 " ;
src = fetchurl {
name = " i d p r t _ t s p l _ p r i n t e r _ l i n u x _ d r i v e r . z i p " ; # This is not the original name, but there was debate about whether rec or finalAttrs should be used, so I just renamed it
url = " h t t p s : / / w w w . i d p r t . c o m / p r t _ v 2 / f i l e s / d o w n _ f i l e / i d / 2 8 3 / f i d / 6 6 8 . h t m l " ; # NOTE: This is NOT an HTML page, but a ZIP file
hash = " s h a 2 5 6 - P 3 A K S q C h 5 o n O v 0 i t J a y E J 6 P 5 p m l k O w O h 1 O t U j g 4 0 B R w = " ;
} ;
buildInputs = [
cups
e2fsprogs
krb5
libxcrypt-legacy
] ;
nativeBuildInputs = [
autoPatchelfHook
unzip
] ;
installPhase =
let
2024-10-04 16:56:33 +00:00
arch =
{
x86_64-linux = " x 6 4 " ;
x86-linux = " x 8 6 " ;
}
. " ${ stdenvNoCC . hostPlatform . system } "
or ( throw " c u p s - i d p r t - t s p l : N o p r e b u i l t f i l t e r s f o r s y s t e m : ${ stdenvNoCC . hostPlatform . system } " ) ;
2024-09-19 14:19:46 +00:00
in
''
runHook preInstall
mkdir - p $ out/share/cups/model $ out/lib/cups/filter
cp - r filter / $ { arch } /. $ out/lib/cups/filter
cp - r ppd/. $ out/share/cups/model
rm $ out/share/cups/model /* . p p d ~
chmod + x $ out/lib/cups/filter /*
runHook postInstall
'' ;
meta = {
description = " C U P S d r i v e r s f o r T S P L - b a s e d i D P R T t h e r m a l l a b e l p r i n t e r s ( S P 2 1 0 , S P 3 1 0 , S P 3 2 0 , S P 3 2 0 E , S P 4 1 0 , S P 4 1 0 B T , S P 4 2 0 , S P 4 5 0 , S P 4 6 0 B T ) " ;
platforms = [
" x 8 6 _ 6 4 - l i n u x "
" x 8 6 - l i n u x "
] ;
license = lib . licenses . unfree ;
sourceProvenance = with lib . sourceTypes ; [ binaryNativeCode ] ;
maintainers = with lib . maintainers ; [ pandapip1 ] ;
} ;
}