summaryrefslogtreecommitdiff
path: root/guix-gnurl.scm
blob: 23235ee59795ae1083ebdc849bc915596f3b700b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
;;; /***************************************************************************
;;; *
;;; *
;;; * Copyright (C) 2016, 2017 ng0 <ng0@infotropique.org>.
;;; *
;;; * This file is an appendum to gnURL.
;;; *
;;; * This software is licensed as described in the file COPYING, which
;;; * you should have received as part of this distribution. The terms
;;; * are also available at https://curl.haxx.se/docs/copyright.html.
;;; *
;;; * You may opt to use, copy, modify, merge, publish, distribute and/or sell
;;; * copies of the Software, and permit persons to whom the Software is
;;; * furnished to do so, under the terms of the COPYING file.
;;; *
;;; * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
;;; * KIND, either express or implied.
;;; *
;;; ***************************************************************************/


(use-modules
 (ice-9 popen)
 (ice-9 match)
 (ice-9 rdelim)
 (srfi srfi-1)
 (guix packages)
 (guix build-system gnu)
 (guix gexp)
 (guix utils)
 ((guix build utils) #:select (with-directory-excursion))
 (gnu packages)
 (gnu packages base)
 (gnu packages autotools)
 (gnu packages gnunet)
 (gnu packages libidn))

(define %source-dir (dirname (current-filename)))

(define-public gnurl-git
  (package
    (inherit gnurl)
    (name "gnurl-git")
    (version (string-append "7.56.0-" "dev"))
    (source
     (local-file %source-dir
                 #:recursive? #t))
    (native-inputs
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
       ,@(package-native-inputs gnurl)))
    ;; (inputs
    ;;  `(("libidn2" ,libidn2)
    ;;    ,@(alist-delete "libidn" (package-inputs gnurl))))
    ;; (arguments
    ;;  (substitute-keyword-arguments (package-arguments gnurl)
    ;;    ((#:phases phases)
    ;;     `(modify-phases ,phases
    ;;        (add-after 'unpack 'autoconf
    ;;          (lambda _
    ;;            (zero? (system* "sh" "buildconf"))))))))
    (arguments
     ;;`(;#:configure-flags '("--enable-gnurl")
     `(;;#:configure-flags '("--disable-ntlm-wb")
       #:test-target "test"
       #:parallel-tests? #f
       #:phases
       ;; We have to patch runtests.pl in tests/ directory
       (modify-phases %standard-phases
         (add-after 'unpack 'autoconf
           (lambda _
             (zero? (system* "sh" "buildconf"))))
         (add-after 'install 'move-man3-pages
           (lambda* (#:key outputs #:allow-other-keys)
             ;; Move section 3 man pages to "doc".
             (let ((out (assoc-ref outputs "out"))
                   (doc (assoc-ref outputs "doc")))
               (mkdir-p (string-append doc "/share/man"))
               (rename-file (string-append out "/share/man/man3")
                            (string-append doc "/share/man/man3"))
               #t)))
         (replace 'check
           (lambda _
             ;; It is unclear why test1026 fails, however the content of it
             ;; suggests that it is not vital for gnurl.
             ;;(delete-file "tests/data/test1026")

             (substitute* "tests/runtests.pl"
               (("/bin/sh") (which "sh")))

             ;; Make test output more verbose.
             (zero? (system* "make" "-C" "tests" "test"))
             #t)))))))
           ;; (add-after 'build 'dist
           ;;   (lambda _
           ;;     (zero? (system* "maketgz" "7.56.0-dev"))))))))))
           ;; (add-after 'check 'dist-check
           ;;   (lambda _
           ;;     (zero? (system* "make" "distcheck"))))))))))

gnurl-git