From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tanguy Le Carrour Subject: Re: Packaging "single file" Date: Tue, 5 Nov 2019 14:04:21 +0100 Message-ID: <20191105130421.vpycyhng5uont7zu@rafflesia> References: <20191104150424.7umrtlev4aymzraa@rafflesia> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35435) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iRyVX-00011z-KD for guix-devel@gnu.org; Tue, 05 Nov 2019 08:04:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iRyVW-0003ev-2X for guix-devel@gnu.org; Tue, 05 Nov 2019 08:04:27 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:40705) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iRyVV-0003cd-SV for guix-devel@gnu.org; Tue, 05 Nov 2019 08:04:26 -0500 Content-Disposition: inline In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Jack Hill Cc: Guix Hi Jack! Le 11/04, Jack Hill a écrit : > On Mon, 4 Nov 2019, Tanguy Le Carrour wrote: > > I intended to ask this question later, but now that ungoogled-chromium > > has been superseded by icecat, I find myself stuck! > > > > Is it possible to package a single file? The "file" being a bash script or > > a binary. Is there a package definition I can look into for an example? > > I've had a need to package a bash wrapper around scp, and the module with it > is below. It it, I use the trivial-build-system, and replaced occurrences of > commands the script calls with full store paths. > > Does this help? It's a perfect example! Thanks! I'll do the same for rofi-pass! > Where are you getting stuck? I'm stuck with my UI tests! :-( I was relying on `chromedriver` (packaged with ungoogled-chromium), but now that it's been deprecated… I'm stuck! ^_^' `geckodriver` is not packaged with icecat. This is why I wanted to a) download it or b) package it. The problem is that a) the version I download does not work (a problem specific to Guix System, I guess, that would be solved by packaging… another wild guess) and b) it's a bit of work to package. But, all of sudden, I wonder if `geckodriver` could not be part of icecat, like `chromedriver` was part of ungoogled-chromium?! > (define-module (guix-at-duke packages utils) > #:use-module (gnu packages bash) > #:use-module (gnu packages ssh) > #:use-module (guix build-system trivial) > #:use-module (guix download) > #:use-module ((guix licenses) #:prefix license:) > #:use-module (guix packages)) > > (define-public duo-scp > (package > (name "duo-scp") > (version "0") > (source > (origin > (method url-fetch) > (uri "https://gitlab.oit.duke.edu/snippets/82/raw") > (sha256 > (base32 "1mrf5451cj8010iq76866dli1hxa31rk8i993arf9dfyzws26v2b")) > (file-name name))) > (build-system trivial-build-system) > (arguments > `(#:modules ((guix build utils)) > #:builder > (begin > (use-modules (guix build utils)) > (let ((source (assoc-ref %build-inputs "source")) > (ssh (assoc-ref %build-inputs "openssh")) > (bash (assoc-ref %build-inputs "bash")) > (script "duo-scp") > (out (assoc-ref %outputs "out"))) > (copy-file source script) > (substitute* script > (("/bin/bash") (string-append bash "/bin/bash")) > (("scp") (string-append ssh "/bin/scp"))) > (chmod script #o555) > (install-file script (string-append out "/bin")))))) > (inputs > `(("bash" ,bash) > ("openssh" ,openssh))) > (home-page "https://gitlab.oit.duke.edu/snippets/82/raw") > (synopsis "User Duo Passcode with scp and login_duo") > (description "Wrapper script for scp that prompts for a passcode > before calling scp. This allows the user to supply a passcode from e.g. a Yubikey > to avoid getting a Duo push or phone call when talking to an ssh server that uses > the login_duo script for multifactor.") > (license license:cc0))) Thanks again for the snippet! -- Tanguy