unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 07/24] gnu: compression: Add snappy.
  2016-08-16 18:39 [PATCH 01/24] gnu: qt: Add qtquickcontrols David Craven
@ 2016-08-16 18:39 ` David Craven
  2016-08-16 19:45   ` Alex Kost
  0 siblings, 1 reply; 11+ messages in thread
From: David Craven @ 2016-08-16 18:39 UTC (permalink / raw)
  To: guix-devel; +Cc: David Craven

* gnu/packages/compression.scm (snappy): New variable.
---
 gnu/packages/compression.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index e63c1af..cd1866b 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016 David Craven <david@craven.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -871,3 +872,38 @@ 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 snappy
+  (package
+    (name "snappy")
+    (version "1.1.3")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                "https://github.com/google/snappy/archive/"
+                version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "04lc9n1fr4kak8yd68v61w561zcbykfyj9f745smva8hcn0hyk7r"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'autoconf
+           (lambda _
+             (zero? (system* "autoreconf" "-vfi")))))))
+    (home-page "https://github.com/open-source-parsers/jsoncpp")
+    (synopsis "Fast compressor/decompressor")
+    (description "Snappy is a compression/decompression library. It does not
+aim for maximum compression, or compatibility with any other compression library;
+instead, it aims for very high speeds and reasonable compression. For instance,
+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)))
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 07/24] gnu: compression: Add snappy.
  2016-08-16 18:39 ` [PATCH 07/24] gnu: compression: Add snappy David Craven
@ 2016-08-16 19:45   ` Alex Kost
  0 siblings, 0 replies; 11+ messages in thread
From: Alex Kost @ 2016-08-16 19:45 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven (2016-08-16 21:39 +0300) wrote:

> * gnu/packages/compression.scm (snappy): New variable.
> ---
>  gnu/packages/compression.scm | 36 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 36 insertions(+)
>
>
> diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
> index e63c1af..cd1866b 100644
> --- a/gnu/packages/compression.scm
> +++ b/gnu/packages/compression.scm
> @@ -11,6 +11,7 @@
>  ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
>  ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
>  ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2016 David Craven <david@craven.ch>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -871,3 +872,38 @@ 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 snappy
> +  (package
> +    (name "snappy")
> +    (version "1.1.3")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                "https://github.com/google/snappy/archive/"
> +                version ".tar.gz"))
> +              (file-name (string-append name "-" version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "04lc9n1fr4kak8yd68v61w561zcbykfyj9f745smva8hcn0hyk7r"))))
> +    (build-system gnu-build-system)
> +    (native-inputs
> +     `(("autoconf" ,autoconf)
> +       ("automake" ,automake)
> +       ("libtool" ,libtool)
> +       ("pkg-config" ,pkg-config)))
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'autoconf
> +           (lambda _
> +             (zero? (system* "autoreconf" "-vfi")))))))
> +    (home-page "https://github.com/open-source-parsers/jsoncpp")

I think you meant "https://github.com/google/snappy"

Also there is a real release that shouldn't require autoreconf phase:
<https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz>
Did you try using it?

> +    (synopsis "Fast compressor/decompressor")
> +    (description "Snappy is a compression/decompression library. It does not
> +aim for maximum compression, or compatibility with any other compression library;
> +instead, it aims for very high speeds and reasonable compression. For instance,
> +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)))

-- 
Alex

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 07/24] gnu: compression: Add snappy.
@ 2016-08-17  8:30 David Craven
  2016-08-17 19:02 ` Alex Kost
  0 siblings, 1 reply; 11+ messages in thread
From: David Craven @ 2016-08-17  8:30 UTC (permalink / raw)
  To: guix-devel, Alex Kost

> Also there is a real release that shouldn't require autoreconf phase:
> <https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz>
> Did you try using it?

Just did, and requires running autoreconf too...

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 07/24] gnu: compression: Add snappy.
  2016-08-17  8:30 [PATCH 07/24] gnu: compression: Add snappy David Craven
@ 2016-08-17 19:02 ` Alex Kost
  2016-08-17 19:20   ` David Craven
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Kost @ 2016-08-17 19:02 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven (2016-08-17 11:30 +0300) wrote:

>> Also there is a real release that shouldn't require autoreconf phase:
>> <https://github.com/google/snappy/releases/download/1.1.3/snappy-1.1.3.tar.gz>
>> Did you try using it?
>
> Just did, and requires running autoreconf too...

I don't believe you :-)

I've just tried, and autoreconf is not needed for this tarball:

(define-public snappy
  (package
    (name "snappy")
    (version "1.1.3")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/google/snappy/releases/download/"
                    version "/" name "-" version ".tar.gz"))
              (sha256
               (base32
                "1wzf8yif5ym2gj52db6v5m1pxnmn258i38x7llk9x346y2nq47ig"))))
    (build-system gnu-build-system)
    (home-page "https://github.com/google/snappy")
    (synopsis "Fast compressor/decompressor")
    (description "Snappy is a compression/decompression library. It does not
aim for maximum compression, or compatibility with any other compression library;
instead, it aims for very high speeds and reasonable compression. For instance,
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)))

-- 
Alex

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 07/24] gnu: compression: Add snappy.
  2016-08-17 19:02 ` Alex Kost
@ 2016-08-17 19:20   ` David Craven
  2016-08-17 19:27     ` David Craven
  2016-08-18  1:25     ` Leo Famulari
  0 siblings, 2 replies; 11+ messages in thread
From: David Craven @ 2016-08-17 19:20 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

> I don't believe you :-)

Oh, that's embarrassing. I must have forgotten to change the hash and
guix cached the tarball. Is that possible?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 07/24] gnu: compression: Add snappy.
  2016-08-17 19:20   ` David Craven
@ 2016-08-17 19:27     ` David Craven
  2016-08-18  7:21       ` Alex Kost
  2016-08-18  1:25     ` Leo Famulari
  1 sibling, 1 reply; 11+ messages in thread
From: David Craven @ 2016-08-17 19:27 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

>> I don't believe you :-)
>
> Oh, that's embarrassing. I must have forgotten to change the hash and
> guix cached the tarball. Is that possible?

Sorry about that. I make many stupid mistakes, but I'm not a liar... ;-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 07/24] gnu: compression: Add snappy.
  2016-08-17 19:20   ` David Craven
  2016-08-17 19:27     ` David Craven
@ 2016-08-18  1:25     ` Leo Famulari
  2016-08-27 23:12       ` ‘guix lint’ URL checks Ludovic Courtès
  1 sibling, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2016-08-18  1:25 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel, Alex Kost

On Wed, Aug 17, 2016 at 09:20:42PM +0200, David Craven wrote:
> Oh, that's embarrassing. I must have forgotten to change the hash and
> guix cached the tarball. Is that possible?

If the hash is matched in the store, the URL is not used, so you won't
see an incorrect URL fail to match the hash.

This is a common cause of buggy patches.

I wonder, are there any drawbacks of making the linter check that the
URL provides the data named by the hash?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 07/24] gnu: compression: Add snappy.
  2016-08-17 19:27     ` David Craven
@ 2016-08-18  7:21       ` Alex Kost
  2016-08-18 12:41         ` David Craven
  0 siblings, 1 reply; 11+ messages in thread
From: Alex Kost @ 2016-08-18  7:21 UTC (permalink / raw)
  To: David Craven; +Cc: guix-devel

David Craven (2016-08-17 22:27 +0300) wrote:

>>> I don't believe you :-)
>>
>> Oh, that's embarrassing. I must have forgotten to change the hash and
>> guix cached the tarball. Is that possible?
>
> Sorry about that. I make many stupid mistakes, but I'm not a liar... ;-)

Oh, I didn't mean that!  I just wanted to say that it works as expected,
so you probably made some mistake.  As for the hash, yes it's possible
as Leo explained.

-- 
Alex

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 07/24] gnu: compression: Add snappy.
  2016-08-18  7:21       ` Alex Kost
@ 2016-08-18 12:41         ` David Craven
  0 siblings, 0 replies; 11+ messages in thread
From: David Craven @ 2016-08-18 12:41 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

> I wonder, are there any drawbacks of making the linter check that the
> URL provides the data named by the hash?

That may be useful. I think if guix refresh would accept a version
flag, and possibly a force flag, that would also be useful.

The version flag would be used as follows:

guix refresh qtbase -u --version=5.7.0

If the version is already set to 5.7.0 a -f flag would download and
update the hash anyway. This is useful when the download url has
changed, but the version hasn't as in the snappy example. I think
these two features could make guix refresh more generally applicable,
to packages that don't have an automatic updater.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* ‘guix lint’ URL checks
  2016-08-18  1:25     ` Leo Famulari
@ 2016-08-27 23:12       ` Ludovic Courtès
  2016-08-30 18:28         ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2016-08-27 23:12 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel, Alex Kost

Leo Famulari <leo@famulari.name> skribis:

> On Wed, Aug 17, 2016 at 09:20:42PM +0200, David Craven wrote:
>> Oh, that's embarrassing. I must have forgotten to change the hash and
>> guix cached the tarball. Is that possible?
>
> If the hash is matched in the store, the URL is not used, so you won't
> see an incorrect URL fail to match the hash.
>
> This is a common cause of buggy patches.
>
> I wonder, are there any drawbacks of making the linter check that the
> URL provides the data named by the hash?

The rationale so far was that ‘guix lint foo’ should be fast (a couple
of seconds at most), and ‘guix lint’ (all packages) should complete in
less than a day.  ;-)

Thus, the ‘source’ and ‘home-page’ checks simply ensure that the URI
points to something accessible instead of actually downloading the
thing.  This is fast and catches the most obvious errors, but has the
drawback of not catching the right-URL-wrong-hash kind of errors.

Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ‘guix lint’ URL checks
  2016-08-27 23:12       ` ‘guix lint’ URL checks Ludovic Courtès
@ 2016-08-30 18:28         ` Leo Famulari
  0 siblings, 0 replies; 11+ messages in thread
From: Leo Famulari @ 2016-08-30 18:28 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, Alex Kost

On Sun, Aug 28, 2016 at 01:12:09AM +0200, Ludovic Courtès wrote:
> Leo Famulari <leo@famulari.name> skribis:
> > I wonder, are there any drawbacks of making the linter check that the
> > URL provides the data named by the hash?
> 
> The rationale so far was that ‘guix lint foo’ should be fast (a couple
> of seconds at most), and ‘guix lint’ (all packages) should complete in
> less than a day.  ;-)

Reasonable :)

> Thus, the ‘source’ and ‘home-page’ checks simply ensure that the URI
> points to something accessible instead of actually downloading the
> thing.  This is fast and catches the most obvious errors, but has the
> drawback of not catching the right-URL-wrong-hash kind of errors.

I guess that `guix build --check --source foo` is the right way to check
for this mistake.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-08-30 18:28 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-17  8:30 [PATCH 07/24] gnu: compression: Add snappy David Craven
2016-08-17 19:02 ` Alex Kost
2016-08-17 19:20   ` David Craven
2016-08-17 19:27     ` David Craven
2016-08-18  7:21       ` Alex Kost
2016-08-18 12:41         ` David Craven
2016-08-18  1:25     ` Leo Famulari
2016-08-27 23:12       ` ‘guix lint’ URL checks Ludovic Courtès
2016-08-30 18:28         ` Leo Famulari
  -- strict thread matches above, loose matches on Subject: below --
2016-08-16 18:39 [PATCH 01/24] gnu: qt: Add qtquickcontrols David Craven
2016-08-16 18:39 ` [PATCH 07/24] gnu: compression: Add snappy David Craven
2016-08-16 19:45   ` Alex Kost

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).