diff mbox

gnu: Add darkhttpd.

Message ID 20160911192014.23019-1-arunisaac@systemreboot.net
State New
Headers show

Commit Message

Arun Sept. 11, 2016, 7:20 p.m. UTC
* gnu/packages/web.scm (darkhttpd): New variable.
---
 gnu/packages/web.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

Comments

Leo Famulari Sept. 13, 2016, 3:42 p.m. UTC | #1
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?
Arun Sept. 13, 2016, 5:09 p.m. UTC | #2
> 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.
diff mbox

Patch

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 20c7d12..2b73446 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -14,6 +14,7 @@ 
 ;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;; Copyright © 2016 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3633,3 +3634,40 @@  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 "master")))
+       (sha256
+        (base32
+         "0wi8dfgj4ic0fsy4dszl69xgxdxlwxz4c30vsw2i2dpnczgjm04k"))
+       (file-name (string-append name "-" version "-checkout"))))
+    (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"))
+             #t)))))
+    (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)))