aboutsummaryrefslogtreecommitdiff
path: root/guix-env.scm
blob: e4185ae360935c7801f287433a8707ca90aa5f47 (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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
(use-modules ((guix licenses) #:select (bsd-3 gpl3+ psfl lgpl2.1+))
             (guix packages)
             (guix download)
             (guix git-download)
             (guix gexp)
             (guix build-system gnu)
             (guix build-system cmake)
             (guix build-system python)
             (guix build-system trivial)
             (gnu packages python)
             (gnu packages xml)
             (gnu packages tls)
             (gnu packages emacs)
             (gnu packages package-management)
             (gnu packages zip)
             (gnu packages swig)
             (gnu packages compression)
             (gnu packages guile))

(define libsolv
  (package
    (name "libsolv")
    (version "0.6.22")
    (source (origin
             (method url-fetch)
             (uri (string-append "https://github.com/openSUSE/libsolv/archive/"
                                 version ".tar.gz"))
             (file-name (string-append name "-" version ".tar.gz"))
             (modules '((guix build utils)))
             (sha256
              (base32
               "0zl7dlqmib05y5f2wkbz66n68bmqk2fxhvph1dfr071v7jnzc6gf"))
             (snippet
               '(substitute* '("bindings/python/CMakeLists.txt")
                  (("EXECUTE_PROCESS.*") "")
                  (("libsolv ") "libsolv python2.7 ")
                  ))))
    (build-system cmake-build-system)
    (inputs
     `(("expat" ,expat)
       ("zlib" ,zlib)
       ("python" ,python-2.7)
       ("swig" ,swig)))
    (arguments
     '(#:configure-flags
       (list (string-append "-DPYTHON_INSTALL_DIR="
                            (assoc-ref %outputs "out") "/lib/python2.7/site-packages")
             "-DENABLE_PYTHON=1"
             (string-append ; uses lib64 by default
               "-DLIB=lib")
             (string-append "-DCMAKE_INSTALL_RPATH="
                            (assoc-ref %outputs "out") "/lib"))))
                            ;(assoc-ref %outputs "out") "/lib:"
                            ;(assoc-ref %outputs "out") "/lib64"))))
    (home-page "https://github.com/openSUSE/libsolv")
    (synopsis "libsolv")
    (description "")
    (license bsd-3)))

(define pyguile
  (package
    (name "pyguile")
    (version "0.3.1")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                     (url "http://git.cbaines.net/pyguile")
                     (commit "HEAD")))
              (sha256
                     (base32
                      "037w1bf58yn4kfy5jydd1jzfi7dpg0m2w8p1sd2wnr6py03hybwq"))))
    ;(source (origin
    ;         (method url-fetch)
    ;         (uri (string-append "https://github.com/cbaines/pyguile/archive/v"
    ;                             version ".tar.gz"))
    ;         (file-name (string-append name "-" version ".tar.gz"))
    ;         (modules '((guix build utils)))
    ;         (sha256
    ;          (base32
    ;           "0ds5pnm4dc0vyfa5wlyw9dvzl6dyiizh4q8s153byyn8jkiimb5c"))))
    (build-system cmake-build-system)
    (inputs
     `(("python" ,python-2.7)
       ("guile" ,guile-2.0)))
    (arguments
     '(;#:tests? #f ; no tests
       ;#:make-flags (list "CC=gcc"
       ;                   (string-append "PREFIX=" %output))
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)
         (delete 'check)
         (replace 'build
          (lambda* (#:key outputs #:allow-other-keys)
           ;(chdir "..")
           (display "CWD ")(display (getcwd))(display "\n")
           (let ((out (assoc-ref outputs "out")))
            (zero?
             (system* "make" "CC=gcc")))))
         (replace
          'install
          (lambda* (#:key outputs #:allow-other-keys)
            (let* ((out     (assoc-ref outputs "out"))
                   (guild (string-append (assoc-ref %build-inputs "guile")
                                         "/bin/guild"))
                   (scm-dir
                     (string-append out "/share/guile/site/2.0/"))
                   (scm-path
                     (string-append scm-dir "pyguile.scm"))
                   (lib-dir
                     (string-append out "/lib/"))
                   (lib-path
                     (string-append lib-dir "libpyguile.so")))
              (mkdir-p scm-dir)
              (mkdir-p lib-dir)
              (copy-file "pyguile.scm" scm-path)
              (copy-file "libpyguile.so" lib-path)
              (substitute* scm-path
                           (("libpyguile")
                            (string-append lib-dir "libpyguile")))
              (setenv "GUILE_AUTO_COMPILE" "0")
              (unless (zero?
                        (system* guild "compile" scm-path
                                  "-o" (string-append scm-dir "pyguile.go")))
                (error "failed to compile"))
              #t))))))
    (home-page "https://github.com/tddpirate/pyguile")
    (synopsis "pyguile")
    (description "")
    (license lgpl2.1+)))

(define python-packaging
  (package
    (name "python-packaging")
    (version "16.7")
    (source
      (origin
        (method url-fetch)
        (uri (string-append
               "https://pypi.python.org/packages/28/ad/4e6601d14b11bb300719a8bb6247f6ef5861467a692523c978a4e9e3981a/packaging-"
               version
               ".tar.gz"))
        (sha256
          (base32
            "07h18mrpqs0lv2x4fl43pqi0xj6hdrmrnm6v9q634yliagg6q91f"))))
    (build-system python-build-system)
    (inputs
      `(("python-setuptools" ,python-setuptools)))
    (propagated-inputs
     `(("python-pyparsing" ,python-pyparsing)
       ("python-six" ,python-six)))
    (home-page "https://github.com/pypa/packaging")
    (synopsis "Core utilities for Python packages")
    (description
      "Core utilities for Python packages")
    (license #f)))

(define python2-packaging
  (package-with-python2 python-packaging))

(define python-setuptools
  (package
    (name "python-setuptools")
    (version "20.10.1")
    (source
     (origin
      (method url-fetch)
      (uri "https://pypi.python.org/packages/d3/16/21cf5dc6974280197e42d57bf7d372380562ec69aef9bb796b5e2dbbed6e/setuptools-20.10.1.tar.gz")
      (sha256
       (base32
        "1pdm34rjixkdyp5j2yp774ri1da7ncqy8s34h4qxdl4yy22whn9y"))))
    (build-system python-build-system)
    ;; FIXME: Tests require pytest, which itself relies on setuptools.
    ;; One could bootstrap with an internal untested setuptools.
    (arguments
     `(#:tests? #f))
    (home-page "https://pypi.python.org/pypi/setuptools")
    (synopsis
     "Library designed to facilitate packaging Python projects")
    (description
     "Setuptools is a fully-featured, stable library designed to facilitate
packaging Python projects, where packaging includes:
Python package and module definitions,
distribution package metadata,
test hooks,
project installation,
platform-specific details,
Python 3 support.")
    (license psfl)))

(define python2-setuptools
  (package-with-python2 python-setuptools))

(define guix-pypi-utils
  (package
    (name "guix-pypi-utils")
    (version "0.1")
    (source (local-file "." #:recursive? #t))
    (build-system trivial-build-system)
    (inputs
      `(("unzip" ,unzip)
        ("libsolv" ,libsolv)
        ("guile" ,guile-2.0)))
    (propagated-inputs
      `(("guix" ,guix-0.11.0)
        ("guile-lib" ,guile-lib)
        ("guile-json" ,guile-json)
        ("pyguile" ,pyguile)
        ("python" ,python-2.7)
        ("python2-setuptools" ,python2-setuptools)
        ("python2-packaging" ,python2-packaging)))
    (home-page "https://example.com")
    (synopsis "guix-pypi-utils")
    (description "")
    (license gpl3+)))

guix-pypi-utils