Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

labelife-label-printer: init at 1.2.1 #290455

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions pkgs/by-name/la/labelife-label-printer/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ lib
, stdenv
, fetchurl
, cups
, autoPatchelfHook
}:

stdenv.mkDerivation (finalAttrs: {
pname = "labelife-label-printer";
version = "1.2.1";

arch =
if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64"
else if stdenv.hostPlatform.system == "i686-linux" then "i386"
else throw "Unsupported system: ${stdenv.hostPlatform.system}";

src = fetchurl {
url = "https://oss.saas.aimocloud.com/saas/Lablife/bag/LabelPrinter-${finalAttrs.version}.tar.gz";
hash = "sha256-twnIFMBMyEM3xGlsuk3763C3emz3mgpEnlfvnL0XRWw=";
};

nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = [ cups ];

installPhase =
drupol marked this conversation as resolved.
Show resolved Hide resolved
''
runHook preInstall
# Install the CUPS filter with executable permissions
install -Dm755 ./${finalAttrs.arch}/rastertolabeltspl $out/lib/cups/filter/rastertolabeltspl

# Install all PPD files with read and write permissions for owner, and read for group and others
for ppd in ./ppds/*.ppd; do
install -Dm644 $ppd $out/share/cups/model/label/$(basename $ppd)
done
runHook postInstall
'';
daniel-fahey marked this conversation as resolved.
Show resolved Hide resolved

meta = {
description = "CUPS driver for several Labelife-compatible thermal label printers";
downloadPage = "https://labelife.net/#/chart";
homepage = "https://labelife.net";
license = lib.licenses.unfree;
longDescription = ''
Supported printer models include:
- D520 & D520BT
- PM-201
- PM-241 & PM-241-BT
- PM-246 & PM-246S

Brands using Labelife drivers include:
- Phomemo
- Itari
- Omezizy
- Aimo
'';
maintainers = with lib.maintainers; [ daniel-fahey ];
platforms = with lib; [ "i686-linux" "x86_64-linux" ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})
Loading