From patchwork Thu Sep 19 10:35:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre Neidhardt X-Patchwork-Id: 15411 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B20F3173B8; Thu, 19 Sep 2019 11:37:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 5E67C17382 for ; Thu, 19 Sep 2019 11:37:16 +0100 (BST) Received: from localhost ([::1]:42146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAtoJ-0003ud-JT for patchwork@mira.cbaines.net; Thu, 19 Sep 2019 06:37:15 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#37457] [PATCH] gnu: Add makeself-safeextract. Resent-From: Pierre Neidhardt Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 19 Sep 2019 10:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 37457 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37457@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.156888938131620 (code B ref -1); Thu, 19 Sep 2019 10:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Sep 2019 10:36:21 +0000 Received: from localhost ([127.0.0.1]:55180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAtnM-0008Ds-Rs for submit@debbugs.gnu.org; Thu, 19 Sep 2019 06:36:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:50190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iAtnK-0008Dj-I7 for submit@debbugs.gnu.org; Thu, 19 Sep 2019 06:36:15 -0400 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 X-Originating-IP: 92.169.116.127 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> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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+))))