Re: [PATCH] gnu: Add p7zip.

2016-09-04 Thread Ricardo Wurmus

Hi Kei,

> Ricardo Wurmus  writes:
>
>> Kei Kebreau  writes:
>>
>>> Ricardo Wurmus  writes:
>>>
 Kei Kebreau  writes:

> Whoops, last patch was a bit messy and stacked on the previous one. This
> patch should be better!

 I just wanted to push a slightly modified version of this (attached) but
 I cannot actually build the package.  The patch to remove unused code
 does not apply due to different line endings.

 Could you please take a look at this again and make sure that the patch
 to the sources applies?

 ~~ Ricardo

>>> I just tried it on my machine, and everything applied and built
>>> correctly from a clean Guix tree. I don't exactly know how to proceed
>>> From here. Perhaps a third party can try to build from the patch?
>>
>> The problem might be with the inline patch in the email.  Don’t know.
>>
>> ~~ Ricardo
>
> I'll try sending it again, for lack of a better plan. If all else fails
> I can post it on paste.lisp.org.

I fetched the unpatched sources, initialised a fresh git repo, then
partially applied the patch, then fixed the errors, then regenerated the
patch and compared it to your patch.  Turns out that all of the lines in
the two failed hunks end on 0x0d0a, but in your patch this doesn’t
happen, hence the error messages.

I pushed the amended commit to master as
adbd7faf412297e48931ba4f7ad9a062d852ab8a.

~~ Ricardo




Re: [PATCH] gnu: Add p7zip.

2016-09-02 Thread Kei Kebreau
Ricardo Wurmus  writes:

> Efraim Flashner  writes:
>
>> On Thu, Sep 01, 2016 at 03:05:34PM -0400, Kei Kebreau wrote:
>>> Ricardo Wurmus  writes:
>>> 
>>> > Kei Kebreau  writes:
>>> >
>>> >> Ricardo Wurmus  writes:
>>> >>
>>> >>> Kei Kebreau  writes:
>>> >>>
>>>  Whoops, last patch was a bit messy and stacked on the previous one. 
>>>  This
>>>  patch should be better!
>>> >>>
>>> >>> I just wanted to push a slightly modified version of this (attached) but
>>> >>> I cannot actually build the package.  The patch to remove unused code
>>> >>> does not apply due to different line endings.
>>> >>>
>>> >>> Could you please take a look at this again and make sure that the patch
>>> >>> to the sources applies?
>>> >>>
>>> >>> ~~ Ricardo
>>> >>>
>>> >> I just tried it on my machine, and everything applied and built
>>> >> correctly from a clean Guix tree. I don't exactly know how to proceed
>>> >> From here. Perhaps a third party can try to build from the patch?
>>> >
>>> > The problem might be with the inline patch in the email.  Don’t know.
>>> >
>>> > ~~ Ricardo
>>> 
>>> I'll try sending it again, for lack of a better plan. If all else fails
>>> I can post it on paste.lisp.org.
>
>> Hunk #1 FAILED at 139 (different line endings).
> [...]
>> Hunk #1 FAILED at 47 (different line endings).
>
> These are the exact same errors I got.  Maybe the line endings were
> converted automatically when you saved the patch with your editor?
>
> ~~ Ricardo

Maybe gnus is fixing the line endings when I save the patch. Try getting
the patch from http://paste.lisp.org/+6YOD. Other than that I'm not sure
what to do. None of my editors (Emacs, Zile and Nano) say anything weird
about the line endings.


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add p7zip.

2016-09-02 Thread Ricardo Wurmus

Efraim Flashner  writes:

> On September 2, 2016 2:51:03 PM GMT+03:00, Ricardo Wurmus 
>  wrote:
>>
>>Efraim Flashner  writes:
>>
>>> On Thu, Sep 01, 2016 at 03:05:34PM -0400, Kei Kebreau wrote:
 Ricardo Wurmus  writes:
 
 > Kei Kebreau  writes:
 >
 >> Ricardo Wurmus  writes:
 >>
 >>> Kei Kebreau  writes:
 >>>
  Whoops, last patch was a bit messy and stacked on the previous
>>one. This
  patch should be better!
 >>>
 >>> I just wanted to push a slightly modified version of this
>>(attached) but
 >>> I cannot actually build the package.  The patch to remove unused
>>code
 >>> does not apply due to different line endings.
 >>>
 >>> Could you please take a look at this again and make sure that
>>the patch
 >>> to the sources applies?
 >>>
 >>> ~~ Ricardo
 >>>
 >> I just tried it on my machine, and everything applied and built
 >> correctly from a clean Guix tree. I don't exactly know how to
>>proceed
 >> From here. Perhaps a third party can try to build from the patch?
 >
 > The problem might be with the inline patch in the email.  Don’t
>>know.
 >
 > ~~ Ricardo
 
 I'll try sending it again, for lack of a better plan. If all else
>>fails
 I can post it on paste.lisp.org.
>>
>>> Hunk #1 FAILED at 139 (different line endings).
>>[...]
>>> Hunk #1 FAILED at 47 (different line endings).
>>
>>These are the exact same errors I got.  Maybe the line endings were
>>converted automatically when you saved the patch with your editor?
>>
>>~~ Ricardo
>
> I opened the mail with mutt, passed the patch to "cd workspace/guix; git am", 
> which is my normal workflow

Sorry, my reply was meant to be directed at Kei.

~~ Ricardo



Re: [PATCH] gnu: Add p7zip.

2016-09-02 Thread Efraim Flashner


On September 2, 2016 2:51:03 PM GMT+03:00, Ricardo Wurmus 
 wrote:
>
>Efraim Flashner  writes:
>
>> On Thu, Sep 01, 2016 at 03:05:34PM -0400, Kei Kebreau wrote:
>>> Ricardo Wurmus  writes:
>>> 
>>> > Kei Kebreau  writes:
>>> >
>>> >> Ricardo Wurmus  writes:
>>> >>
>>> >>> Kei Kebreau  writes:
>>> >>>
>>>  Whoops, last patch was a bit messy and stacked on the previous
>one. This
>>>  patch should be better!
>>> >>>
>>> >>> I just wanted to push a slightly modified version of this
>(attached) but
>>> >>> I cannot actually build the package.  The patch to remove unused
>code
>>> >>> does not apply due to different line endings.
>>> >>>
>>> >>> Could you please take a look at this again and make sure that
>the patch
>>> >>> to the sources applies?
>>> >>>
>>> >>> ~~ Ricardo
>>> >>>
>>> >> I just tried it on my machine, and everything applied and built
>>> >> correctly from a clean Guix tree. I don't exactly know how to
>proceed
>>> >> From here. Perhaps a third party can try to build from the patch?
>>> >
>>> > The problem might be with the inline patch in the email.  Don’t
>know.
>>> >
>>> > ~~ Ricardo
>>> 
>>> I'll try sending it again, for lack of a better plan. If all else
>fails
>>> I can post it on paste.lisp.org.
>
>> Hunk #1 FAILED at 139 (different line endings).
>[...]
>> Hunk #1 FAILED at 47 (different line endings).
>
>These are the exact same errors I got.  Maybe the line endings were
>converted automatically when you saved the patch with your editor?
>
>~~ Ricardo

I opened the mail with mutt, passed the patch to "cd workspace/guix; git am", 
which is my normal workflow
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.



Re: [PATCH] gnu: Add p7zip.

2016-09-02 Thread Ricardo Wurmus

Efraim Flashner  writes:

> On Thu, Sep 01, 2016 at 03:05:34PM -0400, Kei Kebreau wrote:
>> Ricardo Wurmus  writes:
>> 
>> > Kei Kebreau  writes:
>> >
>> >> Ricardo Wurmus  writes:
>> >>
>> >>> Kei Kebreau  writes:
>> >>>
>>  Whoops, last patch was a bit messy and stacked on the previous one. This
>>  patch should be better!
>> >>>
>> >>> I just wanted to push a slightly modified version of this (attached) but
>> >>> I cannot actually build the package.  The patch to remove unused code
>> >>> does not apply due to different line endings.
>> >>>
>> >>> Could you please take a look at this again and make sure that the patch
>> >>> to the sources applies?
>> >>>
>> >>> ~~ Ricardo
>> >>>
>> >> I just tried it on my machine, and everything applied and built
>> >> correctly from a clean Guix tree. I don't exactly know how to proceed
>> >> From here. Perhaps a third party can try to build from the patch?
>> >
>> > The problem might be with the inline patch in the email.  Don’t know.
>> >
>> > ~~ Ricardo
>> 
>> I'll try sending it again, for lack of a better plan. If all else fails
>> I can post it on paste.lisp.org.

> Hunk #1 FAILED at 139 (different line endings).
[...]
> Hunk #1 FAILED at 47 (different line endings).

These are the exact same errors I got.  Maybe the line endings were
converted automatically when you saved the patch with your editor?

~~ Ricardo



Re: [PATCH] gnu: Add p7zip.

2016-09-02 Thread Efraim Flashner
On Thu, Sep 01, 2016 at 03:05:34PM -0400, Kei Kebreau wrote:
> Ricardo Wurmus  writes:
> 
> > Kei Kebreau  writes:
> >
> >> Ricardo Wurmus  writes:
> >>
> >>> Kei Kebreau  writes:
> >>>
>  Whoops, last patch was a bit messy and stacked on the previous one. This
>  patch should be better!
> >>>
> >>> I just wanted to push a slightly modified version of this (attached) but
> >>> I cannot actually build the package.  The patch to remove unused code
> >>> does not apply due to different line endings.
> >>>
> >>> Could you please take a look at this again and make sure that the patch
> >>> to the sources applies?
> >>>
> >>> ~~ Ricardo
> >>>
> >> I just tried it on my machine, and everything applied and built
> >> correctly from a clean Guix tree. I don't exactly know how to proceed
> >> From here. Perhaps a third party can try to build from the patch?
> >
> > The problem might be with the inline patch in the email.  Don’t know.
> >
> > ~~ Ricardo
> 
> I'll try sending it again, for lack of a better plan. If all else fails
> I can post it on paste.lisp.org.

patching file C/Sha1.c
patching file C/Sha1.h
patching file CPP/7zip/Archive/7z/7zUpdate.cpp
patching file CPP/7zip/Bundles/Format7zFree/makefile.list
patching file CPP/7zip/CMAKE/Format7zFree/CMakeLists.txt
patching file CPP/7zip/Crypto/Sha1Cls.h
patching file CPP/7zip/Guid.txt
patching file CPP/7zip/QMAKE/Format7zFree/Format7zFree.pro
patching file CPP/7zip/QMAKE/all.pro
patching file CPP/7zip/UI/Client7z/Client7z.cpp
patching file CPP/7zip/UI/Common/LoadCodecs.h
patching file CPP/7zip/UI/Common/OpenArchive.cpp
patching file CPP/7zip/UI/FileManager/FM_rc.cpp
patching file CPP/ANDROID/Format7zFree/jni/Android.mk
patching file ChangeLog
patching file DOC/License.txt
patching file DOC/MANUAL/cmdline/switches/update.htm
Hunk #1 FAILED at 139 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file 
DOC/MANUAL/cmdline/switches/update.htm.rej
patching file DOC/MANUAL/general/formats.htm
Hunk #1 FAILED at 47 (different line endings).
1 out of 1 hunk FAILED -- saving rejects to file 
DOC/MANUAL/general/formats.htm.rej
patching file DOC/Methods.txt
patching file DOC/readme.txt
patching file DOC/src-history.txt
patching file GUI/Contents/Info.plist
patching file README
patching file Utils/bin_to_sources.py
patching file Utils/file_7z_so.py
patching file Utils/generate.py
patching file contrib/qnx630sp3/qnx630sp3-shared
patching file makefile
patching file makefile.oldmake
patching file makefile.qnx_shared.so
source is under 'p7zip_16.02'
applying 
'/gnu/store/ypyc1ar3iajzslgn9zbx1vjm7b1ljfq9-p7zip-remove-unused-code.patch'...
builder for 
`/gnu/store/hbijqwhsvzaknxkrv7pgylnj0a3qsdjw-p7zip_16.02_src_all.tar.xz.drv' 
failed to produce output path 
`/gnu/store/c704yy8fn1sb7ikn7q74nd0hkjfj12bx-p7zip_16.02_src_all.tar.xz'



-- 
Efraim Flashner      אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add p7zip.

2016-09-01 Thread Kei Kebreau
Ricardo Wurmus <rek...@elephly.net> writes:

> Kei Kebreau <k...@openmailbox.org> writes:
>
>> Ricardo Wurmus <rek...@elephly.net> writes:
>>
>>> Kei Kebreau <k...@openmailbox.org> writes:
>>>
>>>> Whoops, last patch was a bit messy and stacked on the previous one. This
>>>> patch should be better!
>>>
>>> I just wanted to push a slightly modified version of this (attached) but
>>> I cannot actually build the package.  The patch to remove unused code
>>> does not apply due to different line endings.
>>>
>>> Could you please take a look at this again and make sure that the patch
>>> to the sources applies?
>>>
>>> ~~ Ricardo
>>>
>> I just tried it on my machine, and everything applied and built
>> correctly from a clean Guix tree. I don't exactly know how to proceed
>> From here. Perhaps a third party can try to build from the patch?
>
> The problem might be with the inline patch in the email.  Don’t know.
>
> ~~ Ricardo

I'll try sending it again, for lack of a better plan. If all else fails
I can post it on paste.lisp.org.
From 1359649b23f1d7f2455797ac71549f00892abe10 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <k...@openmailbox.org>
Date: Sat, 27 Aug 2016 06:33:26 -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.
---
 gnu/local.mk   |   1 +
 gnu/packages/compression.scm   |  65 ++
 .../patches/p7zip-remove-unused-code.patch | 959 +
 3 files changed, 1025 insertions(+)
 create mode 100644 gnu/packages/patches/p7zip-remove-unused-code.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b8c5378..cb82ff4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -694,6 +694,7 @@ dist_patch_DATA =   
\
   %D%/packages/patches/openssl-CVE-2016-2178.patch \
   %D%/packages/patches/orpheus-cast-errors-and-includes.patch  \
   %D%/packages/patches/ots-no-include-missing-file.patch   \
+  %D%/packages/patches/p7zip-remove-unused-code.patch  \
   %D%/packages/patches/patchelf-page-size.patch\
   %D%/packages/patches/patchelf-rework-for-arm.patch   \
   %D%/packages/patches/patchutils-xfail-gendiff-tests.patch\
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index c239d16..4e494c7 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2016 Danny Milosavljevic <dan...@scratchpost.org>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <m...@tobias.gr>
 ;;; Copyright © 2016 David Craven <da...@craven.ch>
+;;; Copyright © 2016 Kei Kebreau <k...@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -895,3 +896,67 @@ compared to the fastest mode of zlib, Snappy is an order 
of magnitude faster
 for most inputs, but the resulting compressed files are anywhere from 20% to
 100% bigger.")
 (license license:asl2.0)))
+
+(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
+(append
+ (find-files "CPP/7zip/Compress" "Rar.*")
+ (find-files "CPP/7zip/Crypto" "Rar.*")
+ (find-files "DOC/unRarLicense.txt")
+ (find-files  "Utils/file_Codecs_Rar_so.py")))
+   (delete-file-recursively "CPP/7zip/Archive/Rar")
+   (delete-file-recursively "CPP/7zip/Compress/Rar")
+   #t))
+  (patches (search-patches "p7zip-remove-unused-code.patch"
+(build-system gnu-build-system)
+(arguments
+ `(#:make-flags
+   (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
+   #:phases
+   (modify-phases %standard-phases
+ (replace 'configure
+   (lambda* (#

Re: [PATCH] gnu: Add p7zip.

2016-09-01 Thread Ricardo Wurmus

Kei Kebreau  writes:

> Ricardo Wurmus  writes:
>
>> Kei Kebreau  writes:
>>
>>> Whoops, last patch was a bit messy and stacked on the previous one. This
>>> patch should be better!
>>
>> I just wanted to push a slightly modified version of this (attached) but
>> I cannot actually build the package.  The patch to remove unused code
>> does not apply due to different line endings.
>>
>> Could you please take a look at this again and make sure that the patch
>> to the sources applies?
>>
>> ~~ Ricardo
>>
> I just tried it on my machine, and everything applied and built
> correctly from a clean Guix tree. I don't exactly know how to proceed
> From here. Perhaps a third party can try to build from the patch?

The problem might be with the inline patch in the email.  Don’t know.

~~ Ricardo




Re: [PATCH] gnu: Add p7zip.

2016-09-01 Thread Kei Kebreau
Ricardo Wurmus <rek...@elephly.net> writes:

> Kei Kebreau <k...@openmailbox.org> writes:
>
>> Whoops, last patch was a bit messy and stacked on the previous one. This
>> patch should be better!
>
> I just wanted to push a slightly modified version of this (attached) but
> I cannot actually build the package.  The patch to remove unused code
> does not apply due to different line endings.
>
> Could you please take a look at this again and make sure that the patch
> to the sources applies?
>
> ~~ Ricardo
>
I just tried it on my machine, and everything applied and built
correctly from a clean Guix tree. I don't exactly know how to proceed
From here. Perhaps a third party can try to build from the patch?

> From 709859c8c8d7d05a523c715f3163e02cec37131b Mon Sep 17 00:00:00 2001
> From: Kei Kebreau <k...@openmailbox.org>
> Date: Sat, 27 Aug 2016 06:33:26 -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.
> ---
>  gnu/local.mk   |   1 +
>  gnu/packages/compression.scm   |  67 ++
>  .../patches/p7zip-remove-unused-code.patch | 959 
> +
>  3 files changed, 1027 insertions(+)
>  create mode 100644 gnu/packages/patches/p7zip-remove-unused-code.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 5ec47fc..1688eba 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -703,6 +703,7 @@ dist_patch_DATA = 
> \
>%D%/packages/patches/openssl-CVE-2016-2178.patch   \
>%D%/packages/patches/orpheus-cast-errors-and-includes.patch\
>%D%/packages/patches/ots-no-include-missing-file.patch \
> +  %D%/packages/patches/p7zip-remove-unused-code.patch\
>%D%/packages/patches/patchelf-page-size.patch  \
>%D%/packages/patches/patchelf-rework-for-arm.patch \
>%D%/packages/patches/patchutils-xfail-gendiff-tests.patch  \
> diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
> index c239d16..0040e45 100644
> --- a/gnu/packages/compression.scm
> +++ b/gnu/packages/compression.scm
> @@ -12,6 +12,7 @@
>  ;;; Copyright © 2016 Danny Milosavljevic <dan...@scratchpost.org>
>  ;;; Copyright © 2016 Tobias Geerinckx-Rice <m...@tobias.gr>
>  ;;; Copyright © 2016 David Craven <da...@craven.ch>
> +;;; Copyright © 2016 Kei Kebreau <k...@openmailbox.org>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -895,3 +896,69 @@ compared to the fastest mode of zlib, Snappy is an order 
> of magnitude faster
>  for most inputs, but the resulting compressed files are anywhere from 20% to
>  100% bigger.")
>  (license license:asl2.0)))
> +
> +(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
> +(append
> + (find-files "CPP/7zip/Compress" "Rar.*")
> + (find-files "CPP/7zip/Crypto" "Rar.*")
> + (find-files "DOC/unRarLicense.txt")
> + (find-files  "Utils/file_Codecs_Rar_so.py")))
> +  (delete-file-recursively "CPP/7zip/Archive/Rar")
> +  (delete-file-recursively "CPP/7zip/Compress/Rar")
> +  #t))
> +  (patches (search-patches "p7zip-remove-unused-code.patch"
> +(build-system gnu-build-system)
> +(arguments
> + `(#:make-flags
> +   (list (string-append "DEST_HOME=" (assoc-ref %outputs "out")) "all3")
> +   #:phases
> +   (modify-phases %standard-phases
> + (replace 'configure
> +   (lambda* (#:key system outputs #:allow-other-keys)
> + (zero? (system* "cp"
> 

Re: [PATCH] gnu: Add p7zip.

2016-08-31 Thread Ricardo Wurmus

Kei Kebreau <k...@openmailbox.org> writes:

> Whoops, last patch was a bit messy and stacked on the previous one. This
> patch should be better!

I just wanted to push a slightly modified version of this (attached) but
I cannot actually build the package.  The patch to remove unused code
does not apply due to different line endings.

Could you please take a look at this again and make sure that the patch
to the sources applies?

~~ Ricardo

>From 709859c8c8d7d05a523c715f3163e02cec37131b Mon Sep 17 00:00:00 2001
From: Kei Kebreau <k...@openmailbox.org>
Date: Sat, 27 Aug 2016 06:33:26 -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.
---
 gnu/local.mk   |   1 +
 gnu/packages/compression.scm   |  67 ++
 .../patches/p7zip-remove-unused-code.patch | 959 +
 3 files changed, 1027 insertions(+)
 create mode 100644 gnu/packages/patches/p7zip-remove-unused-code.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5ec47fc..1688eba 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -703,6 +703,7 @@ dist_patch_DATA =		\
   %D%/packages/patches/openssl-CVE-2016-2178.patch		\
   %D%/packages/patches/orpheus-cast-errors-and-includes.patch	\
   %D%/packages/patches/ots-no-include-missing-file.patch	\
+  %D%/packages/patches/p7zip-remove-unused-code.patch		\
   %D%/packages/patches/patchelf-page-size.patch			\
   %D%/packages/patches/patchelf-rework-for-arm.patch		\
   %D%/packages/patches/patchutils-xfail-gendiff-tests.patch	\
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index c239d16..0040e45 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2016 Danny Milosavljevic <dan...@scratchpost.org>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <m...@tobias.gr>
 ;;; Copyright © 2016 David Craven <da...@craven.ch>
+;;; Copyright © 2016 Kei Kebreau <k...@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -895,3 +896,69 @@ compared to the fastest mode of zlib, Snappy is an order of magnitude faster
 for most inputs, but the resulting compressed files are anywhere from 20% to
 100% bigger.")
 (license license:asl2.0)))
+
+(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
+(append
+ (find-files "CPP/7zip/Compress" "Rar.*")
+ (find-files "CPP/7zip/Crypto" "Rar.*")
+ (find-files "DOC/unRarLicense.txt")
+ (find-files  "Utils/file_Codecs_Rar_so.py")))
+  (delete-file-recursively "CPP/7zip/Archive/Rar")
+  (delete-file-recursively "CPP/7zip/Compress/Rar")
+  #t))
+  (patches (search-patches "p7zip-remove-unused-code.patch"
+(build-system gnu-build-system)
+(arguments
+ `(#:make-flags
+   (list (string-append "DEST_HOME=" (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
+   (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"))
+ 

Re: [PATCH] gnu: Add p7zip.

2016-08-27 Thread Kei Kebreau
gt;>
>> I don’t understand the comment.  The makefiles don’t seem to have an
>> “install” 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 “Unix” with “POSIX”?
>>
>>> +(license (list license:lgpl2.1+ license:gpl2+
>>> license:public-domain
>>
>> Here I’d like to see a comment that explains what this list means.
>>
>> Do you think you could provide us with an updated patch?  If you’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. :)
Whoops, last patch was a bit messy and stacked on the previous one. This
patch should be better!
From 1359649b23f1d7f2455797ac71549f00892abe10 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <k...@openmailbox.org>
Date: Sat, 27 Aug 2016 06:33:26 -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.
---
 gnu/local.mk   |   1 +
 gnu/packages/compression.scm   |  65 ++
 .../patches/p7zip-remove-unused-code.patch | 959 +
 3 files changed, 1025 insertions(+)
 create mode 100644 gnu/packages/patches/p7zip-remove-unused-code.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b8c5378..cb82ff4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -694,6 +694,7 @@ dist_patch_DATA =   
\
   %D%/packages/patches/openssl-CVE-2016-2178.patch \
   %D%/packages/patches/orpheus-cast-errors-and-includes.patch  \
   %D%/packages/patches/ots-no-include-missing-file.patch   \
+  %D%/packages/patches/p7zip-remove-unused-code.patch  \
   %D%/packages/patches/patchelf-page-size.patch\
   %D%/packages/patches/patchelf-rework-for-arm.patch   \
   %D%/packages/patches/patchutils-xfail-gendiff-tests.patch\
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index c239d16..4e494c7 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2016 Danny Milosavljevic <dan...@scratchpost.org>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <m...@tobias.gr>
 ;;; Copyright © 2016 David Craven <da...@craven.ch>
+;;; Copyright © 2016 Kei Kebreau <k...@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -895,3 +896,67 @@ compared to the fastest mode of zlib, Snappy is an order 
of magnitude faster
 for most inputs, but the resulting compressed files are anywhere from 20% to
 100% bigger.")
 (license license:asl2.0)))
+
+(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
+(append
+ (find-files "CPP/7zip/Compress" "Rar.*")
+ (find-files "CPP/7zip/Crypto" "Rar.*")
+ (find-files "DOC/unRarLicense.txt")
+ (find-files  "Utils/file_Codecs_Rar_so.py

Re: [PATCH] gnu: Add p7zip.

2016-08-22 Thread Kei Kebreau
>> +   (%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 “Unix” with “POSIX”?
>
>> +(license (list license:lgpl2.1+ license:gpl2+
>> license:public-domain
>
> Here I’d like to see a comment that explains what this list means.
>
> Do you think you could provide us with an updated patch?  If you’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. :)

From aad5d8a92d95f831ead90ec213f2b28c56dfeb79 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <k...@openmailbox.org>
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.
---
 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
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -915,10 +915,11 @@ for most inputs, but the resulting compressed files are 
anywhere from 20% to
'(begin
   ;; Remove non-free source files
   (for-each delete-file
-(find-files "CPP/7zip/Compress/Rar*")
-(find-files "CPP/7zip/Crypto/Rar*")
-(find-files "DOC/unRarLicense.txt")
-(find-files "Utils/file_Codecs_Rar_so.py"))
+(append
+ (find-files "CPP/7zip/Compress" "Rar.*")
+ (find-files "CPP/7zip/Crypto" "Rar.*") 
+ (find-files "DOC/unRarLicense.txt")   
+ (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 are 
anywhere from 20% to
 (arguments
  `(#:make-flags
(list
-("all3")
-(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")
+(string-append "DEST_HOME=" (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
+   
+   (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"))
-  (zero? (system* "make" "test_7zr")
- ;; without calling install.sh manually, install.sh is passed arguments
- ;; containing the wrong installation directories (see line 116 of
- ;; makefile.common)
- (replace 'install
-   (lambda* (#:key system outputs #:allow-other-keys) 
- ;; fix install directory
- (substitute* "install.sh"
-   (("/usr/local") (assoc-ref outputs "out")))
- #t)
+  (zero? (system* "make" "test_7zr"
 (inputs
  `(,@(cond ((string-prefix? "x86_64" (or (%current-target-system)
  (%current-system)))
-- 
2.9.3



signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add p7zip.

2016-08-22 Thread Ricardo Wurmus

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 running
> "./pre-inst-env guix build -S p7zip."

The patch looks good.  It’s fine to delete the non-free files in a
snippet.  I have a couple of changes that I’d to see in the package
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’t need “string-append” 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 “#t”.

> +  (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 “#t”.  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 passed
> + ;; arguments containing the wrong installation directories.
> + (replace 'install
> +   (lambda _
> + (zero? (system* "sh" "install.sh")))

I don’t understand the comment.  The makefiles don’t seem to have an
“install” 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 “Unix” with “POSIX”?

> +(license (list license:lgpl2.1+ license:gpl2+
> license:public-domain

Here I’d like to see a comment that explains what this list means.

Do you think you could provide us with an updated patch?  If you’re
already tired of this patch I could perform the changes on your behalf
some time later.

Thanks for your patience so far :)

~~ Ricardo




Re: [PATCH] gnu: Add p7zip.

2016-08-12 Thread Kei Kebreau
Ricardo Wurmus <rek...@elephly.net> writes:

> Kei Kebreau <k...@openmailbox.org> writes:
>
>> Ricardo Wurmus <ricardo.wur...@mdc-berlin.de> writes:
>>
>>> k...@openmailbox.org writes:
>>>
>>>> On 2016-08-09 04:05, Ricardo Wurmus wrote:
>>>>> Leo Famulari <l...@famulari.name> writes:
>>>>> 
>>>>>>> > I see that you took care of removing non-free parts in a patch and a
>>>>>>> > build phase.  Since “guix build -S p7zip” doesn’t run the build phase
>>>>>>> > users would still end up with a source archive containing the non-free
>>>>>>> > parts.  The best way is thus to remove things in a snippet.
>>>>>>> >
>>>>>>> > In “shogun” from the “machine-learning” module we remove supporting 
>>>>>>> > code
>>>>>>> > for non-free features in a snippet by cutting out anything between 
>>>>>>> > some
>>>>>>> > ifdef markers, but looking at the patch I see that it wouldn’t be
>>>>>>> > feasible for p7zip.
>>>>>>> 
>>>>>>> Also note that it is not completely desirable for nonfree code to be 
>>>>>>> removed
>>>>>>> with a patch, and is one of the reasons Guix supports snippets in the 
>>>>>>> first
>>>>>>> place.
>>>>>> 
>>>>>> Is there a reason to not use a patch in this case? Or can we proceed
>>>>>> with packaging p7zip, using a patch to remove non-free parts?
>>>>> 
>>>>> We don’t want to have a “reverse image” of the non-free code in a 
>>>>> patch.
>>>>> Arguably that would just be a derivative of the non-free code, so we
>>>>> also couldn’t freely distribute it.
>>>>> 
>>>> If this is the case, then should we alert the Parabola GNU/Linux-libre 
>>>> packagers?
>>>> The patch I submitted is the same one they use when installing p7zip 
>>>> from the
>>>> source code (see 
>>>> https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch).
>>>
>>> I see.  I think we first need to figure out exactly what license applies
>>> to which part of the code.  A big chunk of the patch is to remove
>>> references to RAR stuff in the build system and the documentation; that
>>> could probably be removed with a patch.  What is critical is code that’s
>>> actually under the unRAR license.
>>>
>>> A quick look at the patch shows me this:
>>>
>>>> -  Licenses for files are:
>>>> -
>>>> -1) CPP/7zip/Compress/Rar* files:  GNU LGPL + unRAR restriction
>>>> -2) All other files:  GNU LGPL
>>>
>>> (https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch#n540)
>>>
>>> This means that we need to delete all files in (1) — for everything else
>>> it’s just a matter of patching the files.  If I’m not mistaken this
>>> means that deleting the files in a snippet and applying this patch on
>>> top of it would be okay.
>>>
>>> What do others think?
>>>
>>> ~~ Ricardo
>>
>> Just to clarify, I'm interpreting what you are saying as:
>>
>> (1) Remove proprietary files in a snippet so "guix build -S p7zip" only
>> returns free source code, and
>>
>> (2) Apply the patch to get rid of the resultant unused code.
>>
>> If you mean those two things, then it sounds like a fine solution to
>> me. :-)
>
> Yes, that’s what I meant.  I hope I didn’t overlook anything here, so
> I’d be happy if someone else could check that this is fine.
>
> ~~ Ricardo

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 running
"./pre-inst-env guix build -S p7zip."

From 10133e613714b3a59af18e5f579c596362b7ec9c Mon Sep 17 00:00:00 2001
From: Kei Kebreau <k...@openmailbox.org>
Date: Fri, 12 Aug 2016 15:20:19 -0400
Subject: [PATCH] [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.
---
 gnu/local.mk   |   1 +
 gnu/packages/compression.scm   |  69 ++
 .../patches/remove-unused-p7zip-code.patch | 959 +
 3 files changed, 1029 in

Re: [PATCH] gnu: Add p7zip.

2016-08-09 Thread Ricardo Wurmus

Kei Kebreau  writes:

> Ricardo Wurmus  writes:
>
>> k...@openmailbox.org writes:
>>
>>> On 2016-08-09 04:05, Ricardo Wurmus wrote:
 Leo Famulari  writes:
 
>> > I see that you took care of removing non-free parts in a patch and a
>> > build phase.  Since “guix build -S p7zip” doesn’t run the build phase
>> > users would still end up with a source archive containing the non-free
>> > parts.  The best way is thus to remove things in a snippet.
>> >
>> > In “shogun” from the “machine-learning” module we remove supporting 
>> > code
>> > for non-free features in a snippet by cutting out anything between some
>> > ifdef markers, but looking at the patch I see that it wouldn’t be
>> > feasible for p7zip.
>> 
>> Also note that it is not completely desirable for nonfree code to be 
>> removed
>> with a patch, and is one of the reasons Guix supports snippets in the 
>> first
>> place.
> 
> Is there a reason to not use a patch in this case? Or can we proceed
> with packaging p7zip, using a patch to remove non-free parts?
 
 We don’t want to have a “reverse image” of the non-free code in a 
 patch.
 Arguably that would just be a derivative of the non-free code, so we
 also couldn’t freely distribute it.
 
>>> If this is the case, then should we alert the Parabola GNU/Linux-libre 
>>> packagers?
>>> The patch I submitted is the same one they use when installing p7zip 
>>> from the
>>> source code (see 
>>> https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch).
>>
>> I see.  I think we first need to figure out exactly what license applies
>> to which part of the code.  A big chunk of the patch is to remove
>> references to RAR stuff in the build system and the documentation; that
>> could probably be removed with a patch.  What is critical is code that’s
>> actually under the unRAR license.
>>
>> A quick look at the patch shows me this:
>>
>>> -  Licenses for files are:
>>> -
>>> -1) CPP/7zip/Compress/Rar* files:  GNU LGPL + unRAR restriction
>>> -2) All other files:  GNU LGPL
>>
>> (https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch#n540)
>>
>> This means that we need to delete all files in (1) — for everything else
>> it’s just a matter of patching the files.  If I’m not mistaken this
>> means that deleting the files in a snippet and applying this patch on
>> top of it would be okay.
>>
>> What do others think?
>>
>> ~~ Ricardo
>
> Just to clarify, I'm interpreting what you are saying as:
>
> (1) Remove proprietary files in a snippet so "guix build -S p7zip" only
> returns free source code, and
>
> (2) Apply the patch to get rid of the resultant unused code.
>
> If you mean those two things, then it sounds like a fine solution to
> me. :-)

Yes, that’s what I meant.  I hope I didn’t overlook anything here, so
I’d be happy if someone else could check that this is fine.

~~ Ricardo




Re: [PATCH] gnu: Add p7zip.

2016-08-09 Thread Kei Kebreau
Ricardo Wurmus  writes:

> k...@openmailbox.org writes:
>
>> On 2016-08-09 04:05, Ricardo Wurmus wrote:
>>> Leo Famulari  writes:
>>> 
> > I see that you took care of removing non-free parts in a patch and a
> > build phase.  Since “guix build -S p7zip” doesn’t run the build phase
> > users would still end up with a source archive containing the non-free
> > parts.  The best way is thus to remove things in a snippet.
> >
> > In “shogun” from the “machine-learning” module we remove supporting code
> > for non-free features in a snippet by cutting out anything between some
> > ifdef markers, but looking at the patch I see that it wouldn’t be
> > feasible for p7zip.
> 
> Also note that it is not completely desirable for nonfree code to be 
> removed
> with a patch, and is one of the reasons Guix supports snippets in the 
> first
> place.
 
 Is there a reason to not use a patch in this case? Or can we proceed
 with packaging p7zip, using a patch to remove non-free parts?
>>> 
>>> We don’t want to have a “reverse image” of the non-free code in a 
>>> patch.
>>> Arguably that would just be a derivative of the non-free code, so we
>>> also couldn’t freely distribute it.
>>> 
>> If this is the case, then should we alert the Parabola GNU/Linux-libre 
>> packagers?
>> The patch I submitted is the same one they use when installing p7zip 
>> from the
>> source code (see 
>> https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch).
>
> I see.  I think we first need to figure out exactly what license applies
> to which part of the code.  A big chunk of the patch is to remove
> references to RAR stuff in the build system and the documentation; that
> could probably be removed with a patch.  What is critical is code that’s
> actually under the unRAR license.
>
> A quick look at the patch shows me this:
>
>> -  Licenses for files are:
>> -
>> -1) CPP/7zip/Compress/Rar* files:  GNU LGPL + unRAR restriction
>> -2) All other files:  GNU LGPL
>
> (https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch#n540)
>
> This means that we need to delete all files in (1) — for everything else
> it’s just a matter of patching the files.  If I’m not mistaken this
> means that deleting the files in a snippet and applying this patch on
> top of it would be okay.
>
> What do others think?
>
> ~~ Ricardo

Just to clarify, I'm interpreting what you are saying as:

(1) Remove proprietary files in a snippet so "guix build -S p7zip" only
returns free source code, and

(2) Apply the patch to get rid of the resultant unused code.

If you mean those two things, then it sounds like a fine solution to
me. :-)



Re: [PATCH] gnu: Add p7zip.

2016-08-09 Thread Ricardo Wurmus

k...@openmailbox.org writes:

> On 2016-08-09 04:05, Ricardo Wurmus wrote:
>> Leo Famulari  writes:
>> 
 > I see that you took care of removing non-free parts in a patch and a
 > build phase.  Since “guix build -S p7zip” doesn’t run the build phase
 > users would still end up with a source archive containing the non-free
 > parts.  The best way is thus to remove things in a snippet.
 >
 > In “shogun” from the “machine-learning” module we remove supporting code
 > for non-free features in a snippet by cutting out anything between some
 > ifdef markers, but looking at the patch I see that it wouldn’t be
 > feasible for p7zip.
 
 Also note that it is not completely desirable for nonfree code to be 
 removed
 with a patch, and is one of the reasons Guix supports snippets in the 
 first
 place.
>>> 
>>> Is there a reason to not use a patch in this case? Or can we proceed
>>> with packaging p7zip, using a patch to remove non-free parts?
>> 
>> We don’t want to have a “reverse image” of the non-free code in a 
>> patch.
>> Arguably that would just be a derivative of the non-free code, so we
>> also couldn’t freely distribute it.
>> 
> If this is the case, then should we alert the Parabola GNU/Linux-libre 
> packagers?
> The patch I submitted is the same one they use when installing p7zip 
> from the
> source code (see 
> https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch).

I see.  I think we first need to figure out exactly what license applies
to which part of the code.  A big chunk of the patch is to remove
references to RAR stuff in the build system and the documentation; that
could probably be removed with a patch.  What is critical is code that’s
actually under the unRAR license.

A quick look at the patch shows me this:

> -  Licenses for files are:
> -
> -1) CPP/7zip/Compress/Rar* files:  GNU LGPL + unRAR restriction
> -2) All other files:  GNU LGPL

(https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch#n540)

This means that we need to delete all files in (1) — for everything else
it’s just a matter of patching the files.  If I’m not mistaken this
means that deleting the files in a snippet and applying this patch on
top of it would be okay.

What do others think?

~~ Ricardo



Re: [PATCH] gnu: Add p7zip.

2016-08-09 Thread kei

On 2016-08-09 04:05, Ricardo Wurmus wrote:

Leo Famulari  writes:


> I see that you took care of removing non-free parts in a patch and a
> build phase.  Since “guix build -S p7zip” doesn’t run the build phase
> users would still end up with a source archive containing the non-free
> parts.  The best way is thus to remove things in a snippet.
>
> In “shogun” from the “machine-learning” module we remove supporting code
> for non-free features in a snippet by cutting out anything between some
> ifdef markers, but looking at the patch I see that it wouldn’t be
> feasible for p7zip.

Also note that it is not completely desirable for nonfree code to be 
removed
with a patch, and is one of the reasons Guix supports snippets in the 
first

place.


Is there a reason to not use a patch in this case? Or can we proceed
with packaging p7zip, using a patch to remove non-free parts?


We don’t want to have a “reverse image” of the non-free code in a 
patch.

Arguably that would just be a derivative of the non-free code, so we
also couldn’t freely distribute it.

If this is the case, then should we alert the Parabola GNU/Linux-libre 
packagers?
The patch I submitted is the same one they use when installing p7zip 
from the
source code (see 
https://git.parabola.nu/abslibre.git/tree/libre/p7zip/libre.patch).





Re: [PATCH] gnu: Add p7zip.

2016-08-09 Thread Ricardo Wurmus

Leo Famulari  writes:

>> > I see that you took care of removing non-free parts in a patch and a
>> > build phase.  Since “guix build -S p7zip” doesn’t run the build phase
>> > users would still end up with a source archive containing the non-free
>> > parts.  The best way is thus to remove things in a snippet.
>> > 
>> > In “shogun” from the “machine-learning” module we remove supporting code
>> > for non-free features in a snippet by cutting out anything between some
>> > ifdef markers, but looking at the patch I see that it wouldn’t be
>> > feasible for p7zip.
>> 
>> Also note that it is not completely desirable for nonfree code to be removed
>> with a patch, and is one of the reasons Guix supports snippets in the first
>> place.
>
> Is there a reason to not use a patch in this case? Or can we proceed
> with packaging p7zip, using a patch to remove non-free parts?

We don’t want to have a “reverse image” of the non-free code in a patch.
Arguably that would just be a derivative of the non-free code, so we
also couldn’t freely distribute it.

We have to distinguish between code under a non-free license and bits
and pieces that refer to non-free software.  The former needs work as
done in shogun where the latter can probably be removed with a simple
patch in a snippet.

~~ Ricardo



Re: [PATCH] gnu: Add p7zip.

2016-08-08 Thread Leo Famulari
On Tue, Aug 02, 2016 at 01:38:17PM -0500, Eric Bavier wrote:
> On 2016-08-02 02:06, Ricardo Wurmus wrote:
> > Hi Kei,
> > 
> > > This patch should install p7zip correctly on every architecture
> > > supported by Guix. Ideally, this should be tested it on each arch for
> > > the sake of completeness and safety. I've got x86_64 covered so far.
> > > :-)
> > 
> > thank you for this patch!
> > 
> > I see that you took care of removing non-free parts in a patch and a
> > build phase.  Since “guix build -S p7zip” doesn’t run the build phase
> > users would still end up with a source archive containing the non-free
> > parts.  The best way is thus to remove things in a snippet.
> > 
> > In “shogun” from the “machine-learning” module we remove supporting code
> > for non-free features in a snippet by cutting out anything between some
> > ifdef markers, but looking at the patch I see that it wouldn’t be
> > feasible for p7zip.
> 
> Also note that it is not completely desirable for nonfree code to be removed
> with a patch, and is one of the reasons Guix supports snippets in the first
> place.

Is there a reason to not use a patch in this case? Or can we proceed
with packaging p7zip, using a patch to remove non-free parts?



Re: [PATCH] gnu: Add p7zip.

2016-08-03 Thread Kei Kebreau
Kei Kebreau  writes:

> Ricardo Wurmus  writes:
>
>> Hi Kei,
>>
>>> This patch should install p7zip correctly on every architecture
>>> supported by Guix. Ideally, this should be tested it on each arch for
>>> the sake of completeness and safety. I've got x86_64 covered so far. :-)
>>
>> thank you for this patch!
>>
>> I see that you took care of removing non-free parts in a patch and a
>> build phase.  Since “guix build -S p7zip” doesn’t run the build phase
>> users would still end up with a source archive containing the non-free
>> parts.  The best way is thus to remove things in a snippet.
>>
>> In “shogun” from the “machine-learning” module we remove supporting code
>> for non-free features in a snippet by cutting out anything between some
>> ifdef markers, but looking at the patch I see that it wouldn’t be
>> feasible for p7zip.
>>
>
> Perhaps I can just clear the non-free files and add that to the patch?

Never mind, I read your email incorrectly. After looking at many of the
snippets in the Guix tree, I agree that the equivalent for p7zip would
be quite large and unwieldy. Perhaps there is pre-sanitized p7zip code to
pull from if a patch can't be used?


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add p7zip.

2016-08-02 Thread Eric Bavier

On 2016-08-02 02:06, Ricardo Wurmus wrote:

Hi Kei,


This patch should install p7zip correctly on every architecture
supported by Guix. Ideally, this should be tested it on each arch for
the sake of completeness and safety. I've got x86_64 covered so far. 
:-)


thank you for this patch!

I see that you took care of removing non-free parts in a patch and a
build phase.  Since “guix build -S p7zip” doesn’t run the build phase
users would still end up with a source archive containing the non-free
parts.  The best way is thus to remove things in a snippet.

In “shogun” from the “machine-learning” module we remove supporting 
code

for non-free features in a snippet by cutting out anything between some
ifdef markers, but looking at the patch I see that it wouldn’t be
feasible for p7zip.


Also note that it is not completely desirable for nonfree code to be 
removed with a patch, and is one of the reasons Guix supports snippets 
in the first place.


In this case, I don't think we need to go as far as removing mentions of 
unRAR in the ChangeLog.


--
`~Eric



Re: [PATCH] gnu: Add p7zip.

2016-08-02 Thread Kei Kebreau
Ricardo Wurmus  writes:

> Hi Kei,
>
>> This patch should install p7zip correctly on every architecture
>> supported by Guix. Ideally, this should be tested it on each arch for
>> the sake of completeness and safety. I've got x86_64 covered so far. :-)
>
> thank you for this patch!
>
> I see that you took care of removing non-free parts in a patch and a
> build phase.  Since “guix build -S p7zip” doesn’t run the build phase
> users would still end up with a source archive containing the non-free
> parts.  The best way is thus to remove things in a snippet.
>
> In “shogun” from the “machine-learning” module we remove supporting code
> for non-free features in a snippet by cutting out anything between some
> ifdef markers, but looking at the patch I see that it wouldn’t be
> feasible for p7zip.
>

Perhaps I can just clear the non-free files and add that to the patch?
> About the new configure phase: I think you could avoid copying the
> Makefile by using “#:make-flags” similar to this:
>
> #:make-flags
> (list (string-append "-f "
>  ((string-prefix? "x86_64" system)
>   "makefile.linux_amd64_asm")
>  …)
>
> What do you think?
>

I've implemented this successfully like so:

#: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")


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add p7zip.

2016-08-02 Thread Ricardo Wurmus

Hi Kei,

> This patch should install p7zip correctly on every architecture
> supported by Guix. Ideally, this should be tested it on each arch for
> the sake of completeness and safety. I've got x86_64 covered so far. :-)

thank you for this patch!

I see that you took care of removing non-free parts in a patch and a
build phase.  Since “guix build -S p7zip” doesn’t run the build phase
users would still end up with a source archive containing the non-free
parts.  The best way is thus to remove things in a snippet.

In “shogun” from the “machine-learning” module we remove supporting code
for non-free features in a snippet by cutting out anything between some
ifdef markers, but looking at the patch I see that it wouldn’t be
feasible for p7zip.

About the new configure phase: I think you could avoid copying the
Makefile by using “#:make-flags” similar to this:

#:make-flags
(list (string-append "-f "
 ((string-prefix? "x86_64" system)
  "makefile.linux_amd64_asm")
 …)

What do you think?

~~ Ricardo



[PATCH] gnu: Add p7zip.

2016-08-01 Thread Kei Kebreau

This patch should install p7zip correctly on every architecture
supported by Guix. Ideally, this should be tested it on each arch for
the sake of completeness and safety. I've got x86_64 covered so far. :-)

From 0a9779d78a86e06bad08917c408699838d99b771 Mon Sep 17 00:00:00 2001
From: Kei Kebreau <k...@openmailbox.org>
Date: Mon, 1 Aug 2016 20:42:59 -0400
Subject: [PATCH] gnu: Add p7zip.

* gnu/packages/compression.scm (p7zip): New variable.
* gnu/packages/patches/remove-nonfree-p7zip-code.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk   |   1 +
 gnu/packages/compression.scm   |  87 ++
 .../patches/remove-nonfree-p7zip-code.patch| 959 +
 3 files changed, 1047 insertions(+)
 create mode 100644 gnu/packages/patches/remove-nonfree-p7zip-code.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f94b123..648097a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -747,6 +747,7 @@ dist_patch_DATA =   
\
   %D%/packages/patches/rapicorn-isnan.patch\
   %D%/packages/patches/ratpoison-shell.patch   \
   %D%/packages/patches/readline-link-ncurses.patch \
+  %D%/packages/patches/remove-nonfree-p7zip-code.patch \
   %D%/packages/patches/ripperx-missing-file.patch  \
   %D%/packages/patches/rpm-CVE-2014-8118.patch \
   %D%/packages/patches/rsem-makefile.patch \
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index e63c1af..e24f97e 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrust...@gmail.com>
 ;;; Copyright © 2016 Danny Milosavljevic <dan...@scratchpost.org>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <m...@tobias.gr>
+;;; Copyright © 2016 Kei Kebreau <k...@openmailbox.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -871,3 +872,89 @@ even LZMA can provide, or a higher speed than gzip while 
compressing as
 well as bzip2.")
 (license (list license:gpl3+
license:public-domain ; most files in lzma/
+
+(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"))
+  (patches (search-patches "remove-nonfree-p7zip-code.patch"
+(build-system gnu-build-system)
+(arguments
+ `(#:phases
+   (modify-phases %standard-phases
+ (replace 'configure
+   (lambda* (#:key system outputs #:allow-other-keys)
+ (cond
+  ((string-prefix? "x86_64" system)
+   (zero?
+(system*
+ "cp" "makefile.linux_amd64_asm" "makefile.linux")))
+  ((string-prefix? "i686" system)
+   (zero?
+(system*
+ "cp" "makefile.linux_x86_asm_gcc_4.X" "makefile.linux")))
+  (else
+   (zero?
+(system*
+ "cp" "makefile.linux_any_cpu_gcc_4.X" "makefile.linux"
+ ;; fix install directory
+ (substitute* "install.sh"
+   (("/usr/local") (assoc-ref outputs "out")
+ (add-after 'configure 'remove-nonfree-files
+   (lambda _
+ (for-each delete-file-recursively
+   '("CPP/7zip/Archive/Rar"
+ "CPP/7zip/Compress/Rar"
+ "CPP/7zip/Compress/Rar1Decoder.cpp"
+ "CPP/7zip/Compress/Rar1Decoder.h"
+ "CPP/7zip/Compress/Rar2Decoder.cpp"
+ "CPP/7zip/Compress/Rar2Decoder.h"
+ "CPP/7zip/Compress/Rar3Decoder.cpp"
+ "CPP/7zip/Compress/Rar3Decoder.h"
+ "CPP/7zip/Compress/Rar3Vm.cpp"
+ "CPP/7zip/Compress/Rar3Vm.h"
+ "CPP/7zip/Compress/RarCodecsRegister.cpp"
+ "CPP/7zip/Crypto/Rar20Crypto.cpp"
+ "CPP/7zip/Crypto/Rar20Crypto.h"
+ "CPP/7zip/Crypto/Rar5Aes.cpp"
+ "CP