GNU bug report logs - #74315
[PATCH 0/1] gnu: Add ptouch-print.

Previous Next

Package: guix-patches;

Reported by: Fredrik Salomonsson <plattfot <at> posteo.net>

Date: Tue, 12 Nov 2024 03:20:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> chbouib.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 74315 in the body.
You can then email your comments to 74315 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Tue, 12 Nov 2024 03:20:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Fredrik Salomonsson <plattfot <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 12 Nov 2024 03:20:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Fredrik Salomonsson <plattfot <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Fredrik Salomonsson <plattfot <at> posteo.net>
Subject: [PATCH 0/1] gnu: Add ptouch-print.
Date: Tue, 12 Nov 2024 03:18:50 +0000
Hi Guix,

Adding a package to be able to print labels with a Brother P-touch printer.  I
tested this with a P700 and it worked fine.  It installs the udev rules that
should allow any user to use this CLI tool without needing sudo.  But I could
not get that to work.  Might be my setup or that Guix System does not properly
support the uaccess tag.  E.g. see the Arch Wiki [0] on what the uaccess tag
is suppose to trigger.

[0] https://wiki.archlinux.org/title/Udev#Allowing_regular_users_to_use_devices

Fredrik Salomonsson (1):
  gnu: Add ptouch-print.

 gnu/packages/printers.scm | 55 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)


base-commit: b790db7589858fc77989b4d1f369c52bca6d6e7c
-- 
2.46.0





Information forwarded to guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Tue, 12 Nov 2024 03:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 74315 <at> debbugs.gnu.org (full text, mbox):

From: Fredrik Salomonsson <plattfot <at> posteo.net>
To: 74315 <at> debbugs.gnu.org
Cc: Fredrik Salomonsson <plattfot <at> posteo.net>
Subject: [PATCH 1/1] gnu: Add ptouch-print.
Date: Tue, 12 Nov 2024 03:28:07 +0000
* gnu/packages/printers.scm (ptouch-print): New variable.

Change-Id: I2ab2a80b80932af8566f6c5879e63e7b0bced747
---
 gnu/packages/printers.scm | 55 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/printers.scm b/gnu/packages/printers.scm
index 0069494b4d..995af76359 100644
--- a/gnu/packages/printers.scm
+++ b/gnu/packages/printers.scm
@@ -22,14 +22,18 @@ (define-module (gnu packages printers)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages avahi)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages golang-xyz)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages man)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages qt))
 
 ;; This is a module for packages related to printer-like devices, but not
@@ -69,6 +73,57 @@ (define-public ipp-usb
 simply relay a TCP connection to USB do not work.")
     (license license:bsd-2)))
 
+(define-public ptouch-print
+  (let ((commit "740b20e150e030aa2e75086d1202064f9c4c4090")
+        (revision "0"))
+    (package
+      (name "ptouch-print")
+      (version (git-version "1.5" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url
+                "https://git.familie-radermacher.ch/linux/ptouch-print.git")
+               (commit commit)))
+         (sha256
+          (base32 "17lw6gyb9hqdzdlypm98bdpnfjn74a3jrdd0rwic63a7072iqnzr"))
+         (file-name (git-file-name name version))))
+      (build-system cmake-build-system)
+      (arguments
+       '(#:tests? #f ;no test target
+         #:phases (modify-phases %standard-phases
+                    (add-before 'configure 'patch-cmakefile
+                      (lambda _
+                        (substitute* "CMakeLists.txt"
+                          ;; Remove the internal override of CMAKE_INSTALL_PREFIX
+                          (("set\\(CMAKE_INSTALL_PREFIX /usr\\)")
+                           "")
+                          ;; Remove hard coded udev install steps, installing it in the
+                          ;; install-udev-rules phase
+                          (("if\\(EXISTS /etc/udev/rules.d\\)
+\tinstall\\(FILES udev/90-usb-ptouch-permissions.rules DESTINATION /etc/udev/rules.d\\)
+\tinstall\\(CODE \"execute_process(COMMAND udevadm control --reload-rules)\"\\)
+endif\\(\\)
+")
+                           "")) #t))
+                    (add-after 'install 'install-udev-rules
+                      (lambda* (#:key outputs #:allow-other-keys)
+                        (let* ((out (assoc-ref outputs "out"))
+                               (rules (string-append out "/lib/udev/rules.d/")))
+                          (install-file
+                           "../source/udev/90-usb-ptouch-permissions.rules"
+                           rules)))))))
+      (native-inputs (list gd git gettext-minimal libusb pkg-config))
+      (synopsis "CLI tool to print labels on Brother P-Touch printers")
+      (description
+       "A command line tool to print labels on Brother P-Touch
+printers on Linux.  Note that there is no need to install the printer via CUPS, the
+printer is accessed directly via libusb.")
+      (home-page
+       "https://dominic.familie-radermacher.ch/projekte/ptouch-print/")
+      (license license:gpl3))))
+
 (define-public robocut
   (package
     (name "robocut")
-- 
2.46.0





Information forwarded to guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Fri, 14 Feb 2025 11:05:02 GMT) Full text and rfc822 format available.

Message #11 received at 74315 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 74315 <at> debbugs.gnu.org
Subject: [PATCH 0/1] gnu: Add ptouch-print.
Date: Fri, 14 Feb 2025 11:03:36 +0000
[Message part 1 (text/plain, inline)]
Hi,

I started reviewing you patch, just a question of interest why commit
and not git tag?

--8<---------------cut here---------------start------------->8---
+(define-public ptouch-print
+  (let ((commit "740b20e150e030aa2e75086d1202064f9c4c4090")
+        (revision "0"))
--8<---------------cut here---------------end--------------->8---

There is a fresh one
https://git.familie-radermacher.ch/linux/ptouch-print.git/tag/?h=v1.6

--
Oleg
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Tue, 08 Apr 2025 12:57:02 GMT) Full text and rfc822 format available.

Message #14 received at 74315 <at> debbugs.gnu.org (full text, mbox):

From: Steve George <steve <at> futurile.net>
To: 74315 <at> debbugs.gnu.org, 74315-submitter <at> debbugs.gnu.org
Subject: RE: Add ptouch-print to Guix
Date: Tue, 8 Apr 2025 13:56:19 +0100
Hi Fredrik,

Just a reminder that Sharlatan left a question when reviewing your patch. Just in case you didn't get the notification:

  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74315

  Cheers,

  Futurile / Steve




Message sent on to Fredrik Salomonsson <plattfot <at> posteo.net>:
bug#74315. (Tue, 08 Apr 2025 12:57:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Tue, 08 Apr 2025 16:55:02 GMT) Full text and rfc822 format available.

Message #20 received at 74315 <at> debbugs.gnu.org (full text, mbox):

From: Fredrik Salomonsson <plattfot <at> posteo.net>
To: 74315 <at> debbugs.gnu.org
Subject: RE: [bug#74315] [PATCH 0/1] gnu: Add ptouch-print.
Date: Tue, 08 Apr 2025 16:54:08 +0000
Hi Sharlatan,

Sorry I missed your question, for some reason I didn't get the email.

Sharlatan Hellseher <sharlatanus <at> gmail.com> writes:

> I started reviewing you patch, just a question of interest why commit
> and not git tag?
>
> +(define-public ptouch-print
> +  (let ((commit "740b20e150e030aa2e75086d1202064f9c4c4090")
> +        (revision "0"))
>
> There is a fresh one
> https://git.familie-radermacher.ch/linux/ptouch-print.git/tag/?h=v1.6

It seems to be just bad timing on my part.  As I'd packaged this in my
own channel 2024 October 26 — at that time it was just the v1.5 tag from
three years ago so I opted for the latest commit.  I tested it in my
channel to see if it was working then ported it to the main Guix
channel.  It seems that the tag was created about a week after I created
the package in my channel.  And I forgot to check the repository when I
ported it to guix.

I'll update the patch to use the tag instead, should be in a few hours
or so.

And thank you Steve for the reminder!

-- 
s/Fred[re]+i[ck]+/Fredrik/g




Information forwarded to plattfot <at> posteo.net, sharlatanus <at> gmail.com, steve <at> futurile.net, guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Tue, 08 Apr 2025 22:06:02 GMT) Full text and rfc822 format available.

Message #23 received at 74315 <at> debbugs.gnu.org (full text, mbox):

From: Fredrik Salomonsson <plattfot <at> posteo.net>
To: 74315 <at> debbugs.gnu.org
Cc: Fredrik Salomonsson <plattfot <at> posteo.net>
Subject: [PATCH v2] gnu: Add ptouch-print.
Date: Tue,  8 Apr 2025 22:04:46 +0000
* gnu/packages/printers.scm (ptouch-print): New variable.

Change-Id: I2ab2a80b80932af8566f6c5879e63e7b0bced747
---
 gnu/packages/printers.scm | 51 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/printers.scm b/gnu/packages/printers.scm
index 0069494b4d..8a78adbfd7 100644
--- a/gnu/packages/printers.scm
+++ b/gnu/packages/printers.scm
@@ -22,14 +22,18 @@ (define-module (gnu packages printers)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages avahi)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages golang-xyz)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages man)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages qt))
 
 ;; This is a module for packages related to printer-like devices, but not
@@ -69,6 +73,53 @@ (define-public ipp-usb
 simply relay a TCP connection to USB do not work.")
     (license license:bsd-2)))
 
+(define-public ptouch-print
+  (package
+    (name "ptouch-print")
+    (version "1.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.familie-radermacher.ch/linux/ptouch-print.git")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "1pxi30a74azhzsl1wni2va4rkhlfn97qxmz4kryrj9xkvf55jv88"))
+       (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:tests? #f ;no test target
+       #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'patch-cmakefile
+                    (lambda _
+                      (substitute* "CMakeLists.txt"
+                        ;; Remove the internal override of CMAKE_INSTALL_PREFIX
+                        (("set\\(CMAKE_INSTALL_PREFIX /usr\\)")
+                         "")
+                        ;; Remove hard coded udev install steps, installing it in the
+                        ;; install-udev-rules phase
+                        (("if\\(EXISTS /etc/udev/rules.d\\)
+	install\\(FILES udev/90-usb-ptouch-permissions.rules DESTINATION /etc/udev/rules.d\\)
+	install\\(CODE \"execute_process(COMMAND udevadm control --reload-rules)\"\\)
+endif\\(\\)
+")
+                         "")) #t))
+                  (add-after 'install 'install-udev-rules
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (rules (string-append out "/lib/udev/rules.d/")))
+                        (install-file
+                         "../source/udev/90-usb-ptouch-permissions.rules"
+                         rules)))))))
+    (native-inputs (list gd git gettext-minimal libusb pkg-config))
+    (synopsis "CLI tool to print labels on Brother P-Touch printers")
+    (description
+     "A command line tool to print labels on Brother P-Touch
+printers on Linux.  Note that there is no need to install the printer via CUPS, the
+printer is accessed directly via libusb.")
+    (home-page "https://dominic.familie-radermacher.ch/projekte/ptouch-print/")
+    (license license:gpl3)))
+
 (define-public robocut
   (package
     (name "robocut")

base-commit: c9dfe2aceb69e121b03349b6610d51d9374b4570
-- 
2.49.0





Message sent on to Fredrik Salomonsson <plattfot <at> posteo.net>:
bug#74315. (Mon, 14 Apr 2025 13:38:01 GMT) Full text and rfc822 format available.

Message #26 received at 74315-submitter <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Steve George <steve <at> futurile.net>
Cc: 74315 <at> debbugs.gnu.org, 74315-submitter <at> debbugs.gnu.org
Subject: Re: Add ptouch-print to Guix
Date: Mon, 14 Apr 2025 15:37:24 +0200
Hello Fredrik,

unfortunately your patch fails to apply, could you send it again applied
on current master (and keep me in cc so that I can push it)?

Some small remarks:
- We do not end phases by #t anymore.
- Please use full sentences in the description.
- "guix lint" complains about too long lines.

I have checked the license, it is indeed gpl3 (no newer versions).

Andreas





Information forwarded to guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Mon, 14 Apr 2025 13:39:01 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Mon, 14 Apr 2025 18:40:02 GMT) Full text and rfc822 format available.

Message #32 received at 74315 <at> debbugs.gnu.org (full text, mbox):

From: Fredrik Salomonsson <plattfot <at> posteo.net>
To: 74315 <at> debbugs.gnu.org
Cc: andreas <at> enge.fr, Fredrik Salomonsson <plattfot <at> posteo.net>
Subject: [PATCH v3 0/1] gnu: Add ptouch-print.
Date: Mon, 14 Apr 2025 18:38:39 +0000
Hi Andreas,

> unfortunately your patch fails to apply, could you send it again applied
> on current master (and keep me in cc so that I can push it)?

I rebased it on the latest commit on master so it should now apply fine.
I verified that it also builds fine.

> 
> Some small remarks:
> - We do not end phases by #t anymore.

Got it.  Removed in v3.

> - Please use full sentences in the description.

I rewrote the description, hopefully it flows better now.

> - "guix lint" complains about too long lines.

I changed the substitution strings to use more regexp to make them shorter.
Breaking them up with just a newline escape got lost when I applied `guix
style`.


Fredrik Salomonsson (1):
  gnu: Add ptouch-print.

 gnu/packages/printers.scm | 52 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)


base-commit: dd947985522886f9de6fdfdde3f0601e42219da5
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#74315; Package guix-patches. (Mon, 14 Apr 2025 18:40:02 GMT) Full text and rfc822 format available.

Message #35 received at 74315 <at> debbugs.gnu.org (full text, mbox):

From: Fredrik Salomonsson <plattfot <at> posteo.net>
To: 74315 <at> debbugs.gnu.org
Cc: andreas <at> enge.fr, Fredrik Salomonsson <plattfot <at> posteo.net>
Subject: [PATCH v3 1/1] gnu: Add ptouch-print.
Date: Mon, 14 Apr 2025 18:38:40 +0000
* gnu/packages/printers.scm (ptouch-print): New variable.

Change-Id: I2ab2a80b80932af8566f6c5879e63e7b0bced747
---
 gnu/packages/printers.scm | 52 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/printers.scm b/gnu/packages/printers.scm
index 6060f8afb2..be13c2a10c 100644
--- a/gnu/packages/printers.scm
+++ b/gnu/packages/printers.scm
@@ -23,13 +23,17 @@ (define-module (gnu packages printers)
   #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix git-download)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (gnu packages avahi)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages golang-xyz)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages version-control)
   #:use-module (gnu packages qt))
 
 ;; This is a module for packages related to printer-like devices, but not
@@ -88,6 +92,54 @@ (define-public ipp-usb
 simply relay a TCP connection to USB do not work.")
     (license license:bsd-2)))
 
+(define-public ptouch-print
+  (package
+    (name "ptouch-print")
+    (version "1.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://git.familie-radermacher.ch/linux/ptouch-print.git")
+             (commit (string-append "v" version))))
+       (sha256
+        (base32 "1pxi30a74azhzsl1wni2va4rkhlfn97qxmz4kryrj9xkvf55jv88"))
+       (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:tests? #f ;no test target
+       #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'patch-cmakefile
+                    (lambda _
+                      (substitute* "CMakeLists.txt"
+                        ;; Remove the internal override of CMAKE_INSTALL_PREFIX
+                        (("set\\(CMAKE_INSTALL_PREFIX /usr\\)")
+                         "")
+                        ;; Remove hard coded udev install steps, installing it in the
+                        ;; install-udev-rules phase
+                        (("if\\(EXISTS /etc/udev/rules.d\\)
+[[:blank:]]+install\\(FILES udev/.*?\\.rules DESTINATION /etc/udev/rules.d\\)
+[[:blank:]]+install\\(CODE \".*?\"\\)
+endif\\(\\)
+")
+                         ""))))
+                  (add-after 'install 'install-udev-rules
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out"))
+                             (rules (string-append out "/lib/udev/rules.d/")))
+                        (install-file
+                         "../source/udev/90-usb-ptouch-permissions.rules"
+                         rules)))))))
+    (native-inputs (list gd git gettext-minimal libusb pkg-config))
+    (synopsis "CLI tool to print labels on Brother P-Touch printers")
+    (description
+     "This package provides the command line tool @command{ptouch-print} to
+print labels on Brother P-Touch printers.  It also contains udev rules for
+non-root access for the known P-Touch printers.  This does not require CUPS
+to work as the printer is accessed directly via libusb.")
+    (home-page "https://dominic.familie-radermacher.ch/projekte/ptouch-print/")
+    (license license:gpl3)))
+
 (define-public robocut
   (package
     (name "robocut")
-- 
2.49.0





Reply sent to Ludovic Courtès <ludo <at> chbouib.org>:
You have taken responsibility. (Tue, 15 Apr 2025 08:25:04 GMT) Full text and rfc822 format available.

Notification sent to Fredrik Salomonsson <plattfot <at> posteo.net>:
bug acknowledged by developer. (Tue, 15 Apr 2025 08:25:05 GMT) Full text and rfc822 format available.

Message #40 received at 74315-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> chbouib.org>
To: Fredrik Salomonsson <plattfot <at> posteo.net>
Cc: andreas <at> enge.fr, 74315-done <at> debbugs.gnu.org
Subject: Re: [bug#74315] [PATCH v3 1/1] gnu: Add ptouch-print.
Date: Tue, 15 Apr 2025 09:56:07 +0200
Fredrik Salomonsson <plattfot <at> posteo.net> writes:

> * gnu/packages/printers.scm (ptouch-print): New variable.
>
> Change-Id: I2ab2a80b80932af8566f6c5879e63e7b0bced747

Applied, thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 13 May 2025 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 51 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.