Re: [PATCH] gnu: Add darkhttpd.

2016-09-15 Thread Leo Famulari
On Thu, Sep 15, 2016 at 11:47:16AM +0530, Arun Isaac wrote:
> 
> > I found some tests! See attached. Part of the test suite wants some
> > static library from Clang / LLVM; I couldn't make that work in 5 minutes
> > so I gave up ;) I think it's okay to commit in this state.
> 
> Yeah, the darkhttpd git repo has some test cases, but the release
> tarball does not. Since we will be moving to the release tarball once
> the release tarball URL problem is fixed upstream, I think we should not
> do the test cases.

Okay, makes sense. Pushed as 797a5cf57f038e31e464afd5256a9faff5b46689


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add darkhttpd.

2016-09-15 Thread Arun Isaac

> I found some tests! See attached. Part of the test suite wants some
> static library from Clang / LLVM; I couldn't make that work in 5 minutes
> so I gave up ;) I think it's okay to commit in this state.

Yeah, the darkhttpd git repo has some test cases, but the release
tarball does not. Since we will be moving to the release tarball once
the release tarball URL problem is fixed upstream, I think we should not
do the test cases.


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add darkhttpd.

2016-09-14 Thread Leo Famulari
On Wed, Sep 14, 2016 at 11:31:59AM +0530, Arun Isaac wrote:
> * gnu/packages/web.scm (darkhttpd): New variable.

Thanks for the updated patch!

> +   (uri (git-reference
> + (url (string-append "https://unix4lyfe.org/git/darkhttpd;))
> + (commit "41b68476c35270f47dcd2ddebe27cbcd87e43d41"))
^
There was a missing parentheses here ---|

> +   #:tests? #f ; No test suite

I found some tests! See attached. Part of the test suite wants some
static library from Clang / LLVM; I couldn't make that work in 5 minutes
so I gave up ;) I think it's okay to commit in this state.

What do you think?
>From 8268e04b18292047ff1922a151ad7458b443b9a0 Mon Sep 17 00:00:00 2001
From: Arun Isaac 
Date: Wed, 14 Sep 2016 11:31:59 +0530
Subject: [PATCH] gnu: Add darkhttpd.

* gnu/packages/web.scm (darkhttpd): New variable.

Signed-off-by: Leo Famulari 
---
 gnu/packages/web.scm | 44 
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index b9c201d..14cdf49 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2016 Ben Woodcroft 
 ;;; Copyright © 2016 Clément Lassieur 
 ;;; Copyright © 2016 ng0 
+;;; Copyright © 2016 Arun Isaac 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3633,3 +3634,46 @@ provides a unix command line interface to a variety of 
popular www search engine
 and similar services.")
 (home-page "https://surfraw.alioth.debian.org/;)
 (license l:public-domain)))
+
+(define-public darkhttpd
+  (package
+(name "darkhttpd")
+(version "1.12")
+(source
+ (origin
+   ;; The darkhttpd release tarball URL fails to download with a
+   ;; 'TLS warning alert'. Download from the darkhttpd git repo
+   ;; until the problem has been fixed upstream.
+   (method git-fetch)
+   (uri (git-reference
+ (url (string-append "https://unix4lyfe.org/git/darkhttpd;))
+ (commit "41b68476c35270f47dcd2ddebe27cbcd87e43d41")))
+   (sha256
+(base32
+ "0wi8dfgj4ic0fsy4dszl69xgxdxlwxz4c30vsw2i2dpnczgjm04k"))
+   (file-name (string-append name "-" version "-checkout"
+(build-system gnu-build-system)
+(native-inputs
+ `(("python-2" ,python-2)))
+(arguments
+ `(#:make-flags '("CC=gcc")
+   #:phases
+   (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'install
+   (lambda* (#:key outputs #:allow-other-keys)
+ (install-file "darkhttpd"
+   (string-append (assoc-ref outputs "out")
+  "/bin"))
+ #t))
+
+ ;; TODO Fix "***WARNING*** $CLANG \
+ ;; (/homeless-shelter/llvm/install/bin/clang) doesn't exist."
+ (replace 'check
+   (lambda _ (zero? (system* "make" "--directory" "devel")))
+(synopsis "Simple static web server")
+(description "darkhttpd is a simple static web server.  It is
+standalone and does not need inetd or ucspi-tcp.  It does not need any
+config files---you only have to specify the www root.")
+(home-page "https://unix4lyfe.org/darkhttpd/;)
+(license l:isc)))
-- 
2.10.0



Re: [PATCH] gnu: Add darkhttpd.

2016-09-13 Thread Arun Isaac

> If I understand correctly, this will not work as expected. When the
> master branch gets another commit, our package's hash will become
> invalid.

Oops! I didn't think of that. I'll fix it.

> Did you notice if there is any documentation that could be installed too?

There's only a README file. And, that doesn't have very much that can be
considered documentation. `darkhttpd --help` is all the documentation
for this program, I guess.

> In any case, can you send a revised patch addressing the commit /
> version issue?

I'll send a revised patch soon.


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add darkhttpd.

2016-09-13 Thread Leo Famulari
On Mon, Sep 12, 2016 at 12:50:14AM +0530, Arun Isaac wrote:
> * gnu/packages/web.scm (darkhttpd): New variable.

Thanks for this patch!

> +(version "1.12")
> +(source
> + (origin
> +   ;; The darkhttpd release tarball URL fails to download with a
> +   ;; 'TLS warning alert'. Download from the darkhttpd git repo
> +   ;; until the problem has been fixed upstream.
> +   (method git-fetch)
> +   (uri (git-reference
> + (url (string-append "https://unix4lyfe.org/git/darkhttpd;))
> + (commit "master")))

If I understand correctly, this will not work as expected. When the
master branch gets another commit, our package's hash will become
invalid.

Too bad upstream doesn't make Git tags for their releases. Commit
41b68476c35270f47dcd2ddebe27cbcd87e43d41 appears to correspond to the
1.12 release, so we should specify that commit:

https://unix4lyfe.org/gitweb/darkhttpd/commit/41b68476c35270f47dcd2ddebe27cbcd87e43d41

> + (replace 'install
> +   (lambda* (#:key outputs #:allow-other-keys)
> + (install-file "darkhttpd"
> +   (string-append (assoc-ref outputs "out")
> +  "/bin"))
> + #t)

Did you notice if there is any documentation that could be installed too?

In any case, can you send a revised patch addressing the commit /
version issue?



Re: [PATCH] gnu: Add darkhttpd.

2016-09-11 Thread Arun Isaac

> No, no, I don't insist; this problem shouldn't block packaging,
> git-fetch will be OK, but I think there should be a comment explaining
> why the tarball is not used.

Sure, I'll send a new patch shortly with all suggested changes
incorporated.


signature.asc
Description: PGP signature


Re: [PATCH] gnu: Add darkhttpd.

2016-09-11 Thread Ludovic Courtès
Arun Isaac  skribis:

>> Why 'git-fetch'?  There is a release tarball:
>>
>> https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2
>
> Yes, there is a release tarball. But, there is some server side issue
> with the url. When I try to download it with wget, I get a "The server
> name sent was not recognized" warning. wget ignores this warning and
> moves on. The guix downloader fails completely. Should the guix
> downloader be patched to ignore this warning as well?
>
> The guix downloader output is shown below.
>
> $ guix download https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2
>
> Starting download of /tmp/guix-file.9jzMRu
> From https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2...
> ERROR: Throw to key `gnutls-error' with args `(# warning alert has been received.> handshake)'.
> failed to download "/tmp/guix-file.9jzMRu" from 
> "https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2;
> guix download: error: https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2: 
> download failed
>
> The wget downloader output is shown below.
>
> $ wget https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2
>
> --2016-09-09 23:58:53--  
> https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2
> Resolving unix4lyfe.org (unix4lyfe.org)... 64.62.188.248, 
> 2001:470:1:41::403e:bcf8
> Connecting to unix4lyfe.org (unix4lyfe.org)|64.62.188.248|:443... connected.
> GnuTLS: A TLS warning alert has been received.
> GnuTLS: received alert [112]: The server name sent was not recognized

This has to do with the TLS ‘SERVER NAME’ extension (info "(gnutls)
Server name indication").  Unfortunately

  gnutls-cli -p https unix4lyfe.org -VV

doesn’t seem to provide helpful info.

I don’t think we can easily ignore this alert in (guix build download),
and it’s really a server configuration issue in the first place.

Ludo’.



Re: [PATCH] gnu: Add darkhttpd.

2016-09-10 Thread Alex Kost
Arun Isaac (2016-09-10 18:00 +0530) wrote:

>> Why 'git-fetch'?  There is a release tarball:
>>
>> https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2
>
> Yes, there is a release tarball. But, there is some server side issue
> with the url. When I try to download it with wget, I get a "The server
> name sent was not recognized" warning. wget ignores this warning and
> moves on. The guix downloader fails completely. Should the guix
> downloader be patched to ignore this warning as well?

Oh, indeed (sorry, I didn't try to do "guix download").  Actually I
don't even know whether this problem can be fixed on the guix side
(since the error comes from gnutls).

[...]
> I have initiated a conversation about this problem with the darkhttpd
> developer. But, he has no idea what the problem might be. I'll have to
> do some research on the Internet. Any ideas?

Sorry, no ideas.  All this TLS stuff is a complete mistery for me, I
hope a more knowledgeable person will comment on this.

> If you insist on a tarball instead of the git repo, we can add this
> package after this tarball download url problem is fixed.

No, no, I don't insist; this problem shouldn't block packaging,
git-fetch will be OK, but I think there should be a comment explaining
why the tarball is not used.

-- 
Alex



Re: [PATCH] gnu: Add darkhttpd.

2016-09-10 Thread Arun Isaac

> Why 'git-fetch'?  There is a release tarball:
>
> https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2

Yes, there is a release tarball. But, there is some server side issue
with the url. When I try to download it with wget, I get a "The server
name sent was not recognized" warning. wget ignores this warning and
moves on. The guix downloader fails completely. Should the guix
downloader be patched to ignore this warning as well?

The guix downloader output is shown below.

$ guix download https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2

Starting download of /tmp/guix-file.9jzMRu
>From https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2...
ERROR: Throw to key `gnutls-error' with args `(# handshake)'.
failed to download "/tmp/guix-file.9jzMRu" from 
"https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2;
guix download: error: https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2: 
download failed

The wget downloader output is shown below.

$ wget https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2

--2016-09-09 23:58:53--  https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2
Resolving unix4lyfe.org (unix4lyfe.org)... 64.62.188.248, 
2001:470:1:41::403e:bcf8
Connecting to unix4lyfe.org (unix4lyfe.org)|64.62.188.248|:443... connected.
GnuTLS: A TLS warning alert has been received.
GnuTLS: received alert [112]: The server name sent was not recognized
HTTP request sent, awaiting response... 200 OK
Length: 20184 (20K) [application/x-bzip2]
Saving to: 'darkhttpd-1.12.tar.bz2'

darkhttpd-1.12.tar.bz2
100%[===>]  19.71K  
39.6KB/sin 0.5s

2016-09-09 23:58:56 (39.6 KB/s) - 'darkhttpd-1.12.tar.bz2' saved [20184/20184]

I have initiated a conversation about this problem with the darkhttpd
developer. But, he has no idea what the problem might be. I'll have to
do some research on the Internet. Any ideas?

If you insist on a tarball instead of the git repo, we can add this
package after this tarball download url problem is fixed.

> I think (file-name (string-append name "-" version "-checkout")) is a
> cleaner name for a git checkout directory (but using the tarball is
> preferred).
>
> If a phase succeed, it should return non-false value, while the value of
> 'install-file' is unspecified.  In such cases we add #t to the end of
> the phase.  BTW I would shorten that last line by moving "/bin" to the
> next one.

Sure, I'll make these changes as well.



Re: [PATCH] gnu: Add darkhttpd.

2016-09-10 Thread Alex Kost
Arun Isaac (2016-09-10 12:21 +0530) wrote:

> * gnu/packages/web.scm (darkhttpd): New variable.
> ---
>  gnu/packages/web.scm | 33 +
>  1 file changed, 33 insertions(+)
>
> diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
> index 20c7d12..287c389 100644
> --- a/gnu/packages/web.scm
> +++ b/gnu/packages/web.scm
> @@ -14,6 +14,7 @@
>  ;;; Copyright © 2016 Ben Woodcroft 
>  ;;; Copyright © 2016 Clément Lassieur 
>  ;;; Copyright © 2016 ng0 
> +;;; Copyright © 2016 Arun Isaac 
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -3633,3 +3634,35 @@ provides a unix command line interface to a variety of 
> popular www search engine
>  and similar services.")
>  (home-page "https://surfraw.alioth.debian.org/;)
>  (license l:public-domain)))
> +
> +(define-public darkhttpd
> +  (package
> +(name "darkhttpd")
> +(version "1.12")
> +(source
> + (origin
> +   (method git-fetch)

Why 'git-fetch'?  There is a release tarball:

https://unix4lyfe.org/darkhttpd/darkhttpd-1.12.tar.bz2

> +   (uri (git-reference
> + (url (string-append "https://unix4lyfe.org/git/darkhttpd;))
> + (commit "master")))
> +   (sha256
> +(base32
> + "0wi8dfgj4ic0fsy4dszl69xgxdxlwxz4c30vsw2i2dpnczgjm04k"))
> +   (file-name (string-append name "-" version

I think (file-name (string-append name "-" version "-checkout")) is a
cleaner name for a git checkout directory (but using the tarball is
preferred).

> +(build-system gnu-build-system)
> +(arguments
> + `(#:make-flags '("CC=gcc")
> +   #:tests? #f ; No test suite
> +   #:phases
> +   (modify-phases %standard-phases
> + (delete 'configure)
> + (replace 'install
> +   (lambda* (#:key outputs #:allow-other-keys)
> + (install-file "darkhttpd"
> +   (string-append (assoc-ref outputs "out") 
> "/bin")))

If a phase succeed, it should return non-false value, while the value of
'install-file' is unspecified.  In such cases we add #t to the end of
the phase.  BTW I would shorten that last line by moving "/bin" to the
next one.

> +(synopsis "Simple static web server")
> +(description "darkhttpd is a simple static web server.  It is
> +standalone and does not need inetd or ucspi-tcp.  It does not need any
> +config files---you only have to specify the www root.")
> +(home-page "https://unix4lyfe.org/darkhttpd/;)
> +(license l:isc)))

-- 
Alex



Re: [PATCH] gnu: Add darkhttpd.

2016-09-09 Thread Arun Isaac

> Can you send an updated patch?

Sure, I'll make the changes and send an updated patch soon.



Re: [PATCH] gnu: Add darkhttpd.

2016-09-09 Thread Leo Famulari
On Sat, Sep 10, 2016 at 01:26:23AM +0530, Arun Isaac wrote:
> * gnu/packages/web.scm (darkhttpd): New variable.

Hi, thank you for this patch!

> + `(#:tests? #f

When we disable the tests, we have to leave a comment explaining why. It
can be as simple as "No test suite" if that is the case.

> + (replace 'configure
> +   (lambda _ (setenv "CC" "gcc")))

This has the effect of setting the CC variable and skipping any other
'configure' actions. Is this intended? If there is no './configure'
script or similar tool, this environment variable could be set in
#:make-flags or in a 'setenv' phase.

> + (replace 'install
> +   (lambda* (#:key outputs #:allow-other-keys)
> + (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
> +   (mkdir-p bin)
> +   (copy-file "darkhttpd" (string-append bin "/darkhttpd"

mkdir-p and copy-file and be replaced with install-file.

> +(description "darkhttpd is a simple static web server.  It is
> +standalone and does not need inetd or ucspi-tcp.  It does not need any
> +config files -- you only have to specify the www root.")

You can make an 'em dash' in Texinfo like this:
"...config files---you only..."

> +(home-page "https://unix4lyfe.org/darkhttpd/;)
> +(license l:bsd-2)))

The license on the main source file is the ISC license:
https://unix4lyfe.org/gitweb/darkhttpd/blob/HEAD:/darkhttpd.c

Can you send an updated patch?