From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:54223) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAto8-0003qT-2m for guix-patches@gnu.org; Thu, 19 Sep 2019 06:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAto6-0006tF-Kz for guix-patches@gnu.org; Thu, 19 Sep 2019 06:37:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAto6-0006t7-I8 for guix-patches@gnu.org; Thu, 19 Sep 2019 06:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iAto6-0008Er-AM for guix-patches@gnu.org; Thu, 19 Sep 2019 06:37:02 -0400 Subject: [bug#37457] [PATCH] gnu: Add makeself-safeextract. Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:54109) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAtnI-0002xg-IS for guix-patches@gnu.org; Thu, 19 Sep 2019 06:36:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAtnG-0006aC-Fc for guix-patches@gnu.org; Thu, 19 Sep 2019 06:36:11 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:43441) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iAtnG-0006Z7-3p for guix-patches@gnu.org; Thu, 19 Sep 2019 06:36:10 -0400 Received: from localhost.localdomain (lfbn-1-4117-127.w92-169.abo.wanadoo.fr [92.169.116.127]) (Authenticated sender: mail@ambrevar.xyz) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id C5CF520016 for ; Thu, 19 Sep 2019 10:36:07 +0000 (UTC) From: Pierre Neidhardt Date: Thu, 19 Sep 2019 12:35:52 +0200 Message-Id: <20190919103552.1415-1-mail@ambrevar.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37457@debbugs.gnu.org * gnu/packages/compression.scm (makeself-safeextract): New variable. --- gnu/packages/compression.scm | 49 +++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index bda43bfd18..9785fa7a60 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -22,7 +22,7 @@ ;;; Copyright © 2017 Julien Lepiller ;;; Copyright © 2018 Rutger Helling ;;; Copyright © 2018 Joshua Sierles, Nextjournal -;;; Copyright © 2018 Pierre Neidhardt +;;; Copyright © 2018, 2019 Pierre Neidhardt ;;; Copyright © 2019 Nicolas Goaziou ;;; ;;; This file is part of GNU Guix. @@ -48,6 +48,7 @@ #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages assembly) #:use-module (gnu packages autotools) @@ -2000,3 +2001,49 @@ external compressors: the compressor to be used for each format is configurable at run time, and must be installed separately.") (license (list license:bsd-2 ; arg_parser.{cc,h} license:gpl2+)))) ; the rest + +(define-public makeself-safeextract + (let ((commit "1a95e121fa8e3c02d307ae37b9b7834e616c3683")) + (package + (name "makeself-safeextract") + (version (git-version "0.0.0" "1" commit)) + (home-page "https://github.com/ssokolow/makeself_safeextract") + (source + (origin + (method git-fetch) + (uri (git-reference + (url home-page) + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1anlinaj9lvfi8bn00wp11vzqq0f9sig4fm9yrspisx31v0z4a2c")))) + (build-system trivial-build-system) + (inputs + `(("python" ,python-2) + ("p7zip" ,p7zip) + ("unzip" ,unzip))) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((name "makeself_safeextract") + (source (string-append (assoc-ref %build-inputs "source") + "/" name ".py")) + (bin (string-append (assoc-ref %outputs "out") "/bin")) + (target (string-append bin "/" name)) + (python (string-append (assoc-ref %build-inputs "python") "/bin")) + (7z (string-append (assoc-ref %build-inputs "p7zip") "/bin/7z")) + (unzip (string-append (assoc-ref %build-inputs "unzip") "/bin/unzip"))) + (setenv "PATH" (string-append (getenv "PATH") ":" python)) + (mkdir-p bin) + (copy-file source target) + (substitute* target + (("'7z'") (format #f "'~a'" 7z)) + (("'unzip'") (format #f "'~a'" unzip))) + (patch-shebang target))))) + (synopsis "Extract makeself and mojo archives without running untrusted code") + (description "A simple script to unpack makeself-generated +self-extractors without running the possibly untrusted shell script.") + (license license:gpl3+)))) -- 2.23.0