From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kei Kebreau Subject: Re: [PATCH] gnu: Add p7zip. Date: Mon, 22 Aug 2016 19:58:36 -0400 Message-ID: <87r39ge4pe.fsf@openmailbox.org> References: <87a8gwxa9c.fsf@openmailbox.org> <87y44f4plm.fsf@mdc-berlin.de> <20ae08af155acdc7edd02b68afb9e66d@openmailbox.org> <20160808195835.GF18650@jasmine> <871t1y74fe.fsf@mdc-berlin.de> <87d1lheore.fsf@mdc-berlin.de> <87oa51puzr.fsf@openmailbox.org> <878tw5el71.fsf@elephly.net> <87k2floj6v.fsf@openmailbox.org> <87r39hysdu.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbz7H-0005mi-Ca for guix-devel@gnu.org; Mon, 22 Aug 2016 19:58:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbz7C-0006qm-Ug for guix-devel@gnu.org; Mon, 22 Aug 2016 19:58:54 -0400 Received: from mail.openmailbox.org ([62.4.1.34]:35670) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbz7C-0006pO-He for guix-devel@gnu.org; Mon, 22 Aug 2016 19:58:50 -0400 In-Reply-To: <87r39hysdu.fsf@elephly.net> (Ricardo Wurmus's message of "Mon, 22 Aug 2016 13:06:53 +0200") 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: Ricardo Wurmus Cc: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ricardo Wurmus writes: > Kei Kebreau writes: > >> Here's the corresponding patch. Maybe you or someone else can double (or= triple?) >> check and make sure there are no proprietary files the source after runn= ing >> "./pre-inst-env guix build -S p7zip." > > The patch looks good. It=E2=80=99s fine to delete the non-free files in a > snippet. I have a couple of changes that I=E2=80=99d to see in the packa= ge > expression, though. > >> + >> +(define-public p7zip >> + (package >> + (name "p7zip") >> + (version "16.02") >> + (source (origin >> + (method url-fetch) >> + (uri (string-append "mirror://sourceforge/" name "/" name= "/" >> + version "/" name "_" version >> + "_src_all.tar.bz2")) >> + (sha256 >> + (base32 >> + "07rlwbbgszq8i7m8jh3x6j2w2hc9a72dc7fmqawnqkwlwb00mcjy")) >> + (modules '((guix build utils))) >> + (snippet >> + '(begin >> + ;; Remove non-free source files >> + (for-each delete-file >> + (find-files "CPP/7zip/Compress/" >> + (string-append "Rar*"))) > > You don=E2=80=99t need =E2=80=9Cstring-append=E2=80=9D here. > >> + (delete-file-recursively "CPP/7zip/Compress/Rar"))) > > I think we may want to delete even more Rar stuff to be on the safe > side, so the total list of deletions would be: > > CPP/7zip/Archive/Rar/ > CPP/7zip/Archive/Rar* > CPP/7zip/Crypto/Rar* > CPP/7zip/Compress/Rar* > DOC/unRarLicense.txt > Utils/file_Codecs_Rar_so.py > > What do you think? > > Also note that the snippet should end on =E2=80=9C#t=E2=80=9D. > >> + (patches (search-patches "remove-unused-p7zip-code.patch"= )))) >> + (build-system gnu-build-system) >> + (arguments >> + `(#:make-flags >> + (list (let ((system ,(or (%current-target-system) >> + (%current-system)))) >> + (string-append "-f " >> + (cond >> + ((string-prefix? "x86_64" system) >> + "makefile.linux_amd64_asm") >> + ((string-prefix? "i686" system) >> + "makefile.linux_x86_asm_gcc_4.X") >> + (else >> + "makefile.linux_any_cpu_gcc_4.X"))))) >> + #:phases >> + (modify-phases %standard-phases >> + (replace 'configure >> + (lambda* (#:key system outputs #:allow-other-keys) >> + ;; fix install directory >> + (substitute* "install.sh" >> + (("/usr/local") (assoc-ref outputs "out"))))) > > We should end phases with =E2=80=9C#t=E2=80=9D. However, in this case I = think we should > better move this to the replaced install phase to keep related things in > one place. > >> + (replace 'build >> + (lambda _ >> + (zero? (system* "make" "all3")))) > > I think we can avoid replacing the build phase by adding > > #:make-flags '("all3") > > instead. What do you think? > >> + (replace 'check >> + (lambda _ >> + (and (zero? (system* "make" "test")) >> + (zero? (system* "make" "test_7z")) >> + (zero? (system* "make" "test_7zr"))))) >> + ;; without replacing the install phase, install.sh would be pa= ssed >> + ;; arguments containing the wrong installation directories. >> + (replace 'install >> + (lambda _ >> + (zero? (system* "sh" "install.sh"))))))) > > I don=E2=80=99t understand the comment. The makefiles don=E2=80=99t seem= to have an > =E2=80=9Cinstall=E2=80=9D target at all. > >> + (inputs >> + `(,@(cond ((string-prefix? "x86_64" (or (%current-target-system) >> + (%current-system))) >> + `(("yasm" ,yasm))) >> + ((string-prefix? "i686" (or (%current-target-system) >> + (%current-system))) >> + `(("nasm" ,nasm))) >> + (else '())))) >> + (home-page "http://p7zip.sourceforge.net/") >> + (synopsis "Command-line file archiver with high compression ratio") >> + (description "p7zip is the Unix command-line port of 7-Zip, a file = archiver >> +that handles the 7z format which features very high compression >> ratios.") > > How about replacing =E2=80=9CUnix=E2=80=9D with =E2=80=9CPOSIX=E2=80=9D? > >> + (license (list license:lgpl2.1+ license:gpl2+ >> license:public-domain)))) > > Here I=E2=80=99d like to see a comment that explains what this list means. > > Do you think you could provide us with an updated patch? If you=E2=80=99= re > already tired of this patch I could perform the changes on your behalf > some time later. Attached is a patch with your adjustments taken into consideration. > > Thanks for your patience so far :) > > ~~ Ricardo You're welcome! I expect that you're busy and getting to things as time and energy allows. :) --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=0001-gnu-Add-p7zip.patch Content-Transfer-Encoding: quoted-printable From=20aad5d8a92d95f831ead90ec213f2b28c56dfeb79 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Mon, 22 Aug 2016 19:54:07 -0400 Subject: [PATCH] gnu: Add p7zip. * gnu/packages/compression.scm (p7zip): New variable. * gnu/packages/patches/remove-unused-p7zip-code.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. =2D-- gnu/packages/compression.scm | 47 +++++++++++++++++++++-------------------= ---- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index c6820c1..b8df41c 100644 =2D-- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -915,10 +915,11 @@ for most inputs, but the resulting compressed files a= re anywhere from 20% to '(begin ;; Remove non-free source files (for-each delete-file =2D (find-files "CPP/7zip/Compress/Rar*") =2D (find-files "CPP/7zip/Crypto/Rar*") =2D (find-files "DOC/unRarLicense.txt") =2D (find-files "Utils/file_Codecs_Rar_so.py")) + (append + (find-files "CPP/7zip/Compress" "Rar.*") + (find-files "CPP/7zip/Crypto" "Rar.*")=20=20= =20=20=20=20=20=20=20 + (find-files "DOC/unRarLicense.txt")=20=20=20= =20=20=20=20 + (find-files "Utils/file_Codecs_Rar_so.py"))) (delete-file-recursively "CPP/7zip/Archive/Rar") (delete-file-recursively "CPP/7zip/Compress/Rar") #t)) @@ -927,33 +928,29 @@ for most inputs, but the resulting compressed files a= re anywhere from 20% to (arguments `(#:make-flags (list =2D ("all3") =2D (let ((system ,(or (%current-target-system) =2D (%current-system)))) =2D (string-append "-f " =2D (cond =2D ((string-prefix? "x86_64" system) =2D "makefile.linux_amd64_asm") =2D ((string-prefix? "i686" system) =2D "makefile.linux_x86_asm_gcc_4.X") =2D (else =2D "makefile.linux_any_cpu_gcc_4.X"))))) + (string-append "DEST_HOME=3D" (assoc-ref %outputs "out")) + "all3") #:phases (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key system outputs #:allow-other-keys) + (zero? (system* "cp" + (let ((system ,(or (%current-target-system) + (%current-system)))) +=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 + (cond + ((string-prefix? "x86_64" system) + "makefile.linux_amd64_asm") + ((string-prefix? "i686" system) + "makefile.linux_x86_asm_gcc_4.X") + (else + "makefile.linux_any_cpu_gcc_4.X"))) + "makefile.machine")))) (replace 'check (lambda _ (and (zero? (system* "make" "test")) (zero? (system* "make" "test_7z")) =2D (zero? (system* "make" "test_7zr"))))) =2D ;; without calling install.sh manually, install.sh is passed ar= guments =2D ;; containing the wrong installation directories (see line 116 = of =2D ;; makefile.common) =2D (replace 'install =2D (lambda* (#:key system outputs #:allow-other-keys)=20 =2D ;; fix install directory =2D (substitute* "install.sh" =2D (("/usr/local") (assoc-ref outputs "out"))) =2D #t))))) + (zero? (system* "make" "test_7zr")))))))) (inputs `(,@(cond ((string-prefix? "x86_64" (or (%current-target-system) (%current-system))) =2D-=20 2.9.3 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXu5GtAAoJEOal7jwZRnoNrFUP/RNAWFpNNugEbrI/UDCThpwV eLtL/LE6bypPDXvsy7JzxAxFs5hxMP8ABSyGFcSXyTFHFnXKofirmPChbNSgIJOq DzCD6btKAgByCtczgvvXgEK6y2lkomxPYmDu8DqxFNNNTqnZLc6ptvtRwDuVyvTf pHUesdl4KMdiLhY2ytAFnijkhi/SQ/j7UWFQA0Rq+7uzQRs2DDwz028mh1RGr4RW Xechy8/Zcj8ZlipyyQzOb4le2k6Fi14Nvw9gKGz6W4qF9AyERUdlQMSsIBqHEoE2 HTg6nVc8t4GoFaT1Ci1qLUAKTkKnGvkxEAH1Ykvzl9oBM6NMWfR9reMxXrp9jah9 tDr1pU+I5lEpFw5NOG9FhmXaldxLr12zOhzxRPxYK5s9mX5Yi5G6nJnB4t5kwRMn tAzHaSRxClEgSJhD8x5CN+nIOCS9qjleHktVnTdAteBunMI79OYSyuIsnK6Y3AcJ 1s4Zv+30rYe07yWfmneRPSMr6RdA4uxalUo6/3wRxtxeGY113tPWRF4IMAWg47OF lQSuE1G0wGJ01S733TqgTGC8g2eKSq3AS2BCsynnChsfa1C/p1mCREx8/kkJsmBX 2TpyHX+/dO5wFDJjJzpkznA34BfwA+o6C/DDTcDx11OdjZj38SHEcS6CKLX8EpvF Ig5fLNGRx3riqHUJXqql =Pkqq -----END PGP SIGNATURE----- --==-=-=--