From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#35640: Make USB modems just work on Guix Date: Wed, 15 May 2019 15:01:04 +0200 Message-ID: <87ef4zvpm7.fsf@gnu.org> References: <20190508182607.wcjfxkoqwcvzrdmt@pelzflorian.localdomain> <87v9yjd51k.fsf@gnu.org> <20190513205720.k2bruoaa5zpdslhu@pelzflorian.localdomain> <20190513210443.y2xs7fsvxwng3zjz@pelzflorian.localdomain> <20190514103555.1b2a6316@scratchpost.org> <20190514205648.nl4s4lwvc4t67gho@pelzflorian.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:38677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQtXn-00053T-IE for bug-guix@gnu.org; Wed, 15 May 2019 09:02:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQtXm-00085c-DY for bug-guix@gnu.org; Wed, 15 May 2019 09:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37920) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQtXm-00085M-A2 for bug-guix@gnu.org; Wed, 15 May 2019 09:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQtXm-0008BU-6G for bug-guix@gnu.org; Wed, 15 May 2019 09:02:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20190514205648.nl4s4lwvc4t67gho@pelzflorian.localdomain> (pelzflorian@pelzflorian.de's message of "Tue, 14 May 2019 22:56:48 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: "pelzflorian (Florian Pelz)" Cc: 35640@debbugs.gnu.org Hi, "pelzflorian (Florian Pelz)" skribis: > On Tue, May 14, 2019 at 10:35:55AM +0200, Danny Milosavljevic wrote: [...] >> The problem is there's a use-modules cycle somewhere. >> Try putting usb-modeswitch in another module (a new one if necessary). >> > > Using a new module helps, thank you! Now I also do not need a prefix > tcl: anymore. @Ludo: without that prefix, I got errors because 'zip > was redefined or something, I do not remember now. That could be a collision with =E2=80=98zip=E2=80=99 from (srfi srfi-1) or = with =E2=80=98zlib=E2=80=99 from (guix licenses), which can both be worked around by doing something along these lines: #:use-module ((srfi srfi-1) #:hide (zip)) > Now only packaging issues remain. When I use trivial-build-system, > > #:builder > (begin > (use-modules (guix build utils) > (guix packages)) > (let ((source (assoc-ref %build-inputs "source")) > (tar (assoc-ref %build-inputs "tar")) > (bzip2 (assoc-ref %build-inputs "bzip2")) > (share-dir (string-append %output "/share"))) > (copy-file source "data.tar.bz2") > (invoke (string-append bzip2 "/bin/bzip2") "-d" "data.tar.bz2") > (invoke (string-append tar "/bin/tar") "xvf" "data.tar") > (install-file (string-append "usb-modeswitch-data-" > (package-version this-package) ^ You=E2=80=99re missing a comma (=E2=80=9Cunquote=E2=80=9D) so that =E2=80= =98package-version=E2=80=99 is called on the host side; it doesn=E2=80=99t exist on the build side. > "/usb_modeswitch.d") share-dir)) > #t))) #t is unnecessary here. > From 3430070606904b6dc6b247a6b8bfb2ce7c4fce0f Mon Sep 17 00:00:00 2001 > From: Florian Pelz > Date: Tue, 14 May 2019 12:36:24 +0200 > Subject: [PATCH] Add USB_ModeSwitch. > > * gnu/packages/usb-modeswitch.scm (usb-modeswitch-data) Add it. > (usb-modeswitch) Add it. Just =E2=80=9CNew file=E2=80=9D. Make sure to add the file to gnu/local.mk= please. > +(define-module (gnu packages libusb) Please adjust the module name: it should be =E2=80=98usb-modeswitch=E2=80= =99. > + (synopsis "Data package for USB_ModeSwitch") > + (description "Device data collection and UDEV rules file for > +USB_ModeSwitch.") Please make it a full sentence, and ideally expound a bit (info "(guix) Synopses and Descriptions"). > +;; (use-modules (guix build utils)) Make sure to remove any leftovers like this comment before sending the next version. :-) > + (replace 'install > + (lambda _ ; calling make would use usr as PR= EFIX > + (let* ((source (assoc-ref %build-inputs "source")) > + (out (assoc-ref %outputs "out")) > + (bin (string-append out "/bin")) Please don=E2=80=99t refer to global variables =E2=80=98%outputs=E2=80=99 a= nd =E2=80=98%build-inputs=E2=80=99. Instead, take them from the phase=E2=80=99s arguments: (lambda* (#:key source outputs inputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out"))) =E2=80=A6)) > + (install-file "usb_modeswitch_dispatcher" > + dispatcher-bin)))))))) The phase must return #t. > + (synopsis "Mode switching tool for controlling 'multi-mode' USB devi= ces") Probably `multi-mode', as expected in Texinfo. > + (description "USB_ModeSwitch is a mode switching tool for controllin= g USB > +devices with multiple \"modes\". When plugged in for the first time man= y USB =E2=80=A6 and @dfn{modes} Could you send an updated patch? Is USB_ModeSwitch needed for proper use of ModemManager? I=E2=80=99d say = =E2=80=9Cno=E2=80=9D but I=E2=80=99m unsure. Thanks for working on it! Ludo=E2=80=99.