gnu: python-pymysql: Update to 0.9.3.
[jackhill/guix/guix.git] / gnu / packages / docker.scm
CommitLineData
d020bfc2
DT
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 David Thompson <davet@gnu.org>
42531fd3 3;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
26b7d23a 4;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
975a953b 5;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
d020bfc2
DT
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22(define-module (gnu packages docker)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (gnu packages)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
f87ea24a 28 #:use-module (guix build-system gnu)
4e5b8f72 29 #:use-module (guix build-system go)
d020bfc2
DT
30 #:use-module (guix build-system python)
31 #:use-module (guix utils)
e9b31645 32 #:use-module (gnu packages autotools)
58adcaa1 33 #:use-module (gnu packages base)
42531fd3 34 #:use-module (gnu packages check)
f87ea24a 35 #:use-module (gnu packages compression)
6b6a25d4 36 #:use-module (gnu packages glib)
4e5b8f72
DM
37 #:use-module (gnu packages golang)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages pkg-config)
1b2f753d 40 #:use-module (gnu packages python)
1f1e338a 41 #:use-module (gnu packages python-web)
44d10b1f 42 #:use-module (gnu packages python-xyz)
6b6a25d4 43 #:use-module (gnu packages version-control)
1f1e338a 44 #:use-module (gnu packages virtualization))
d020bfc2 45
ea7cddaa 46(define %docker-version "18.09.2")
f87ea24a 47
d020bfc2
DT
48(define-public python-docker-py
49 (package
50 (name "python-docker-py")
b24da117 51 (version "1.10.6")
d020bfc2
DT
52 (source
53 (origin
54 (method url-fetch)
55 (uri (pypi-uri "docker-py" version))
56 (sha256
57 (base32
b24da117 58 "05f49f6hnl7npmi7kigg0ibqk8s3fhzx1ivvz1kqvlv4ay3paajc"))))
d020bfc2
DT
59 (build-system python-build-system)
60 ;; TODO: Tests require a running Docker daemon.
61 (arguments '(#:tests? #f))
62 (inputs
63 `(("python-requests" ,python-requests)
d020bfc2
DT
64 ("python-six" ,python-six)
65 ("python-websocket-client" ,python-websocket-client)))
66 (home-page "https://github.com/docker/docker-py/")
67 (synopsis "Python client for Docker")
68 (description "Docker-Py is a Python client for the Docker container
69management tool.")
70 (license license:asl2.0)))
b42c9c81
DT
71
72(define-public python-dockerpty
73 (package
74 (name "python-dockerpty")
75 (version "0.3.4")
76 (source
77 (origin
78 (method url-fetch)
79 (uri (pypi-uri "dockerpty" version))
80 (sha256
81 (base32
82 "0za6rr349641wv76ww9l3zcic2xyxrirlxpnzl4296h897648455"))))
83 (build-system python-build-system)
84 (native-inputs
85 `(("python-six" ,python-six)))
86 (home-page "https://github.com/d11wtq/dockerpty")
87 (synopsis "Python library to use the pseudo-TTY of a Docker container")
88 (description "Docker PTY provides the functionality needed to operate the
89pseudo-terminal (PTY) allocated to a Docker container using the Python
90client.")
91 (license license:asl2.0)))
df1f1d69
DT
92
93(define-public docker-compose
94 (package
95 (name "docker-compose")
96 (version "1.5.2")
97 (source
98 (origin
99 (method url-fetch)
100 (uri (pypi-uri "docker-compose" version))
101 (sha256
102 (base32
103 "0ksg7hm2yvc977968dixxisrhcmvskzpcx3pz0v1kazrdqp7xakr"))))
104 (build-system python-build-system)
105 ;; TODO: Tests require running Docker daemon.
106 (arguments '(#:tests? #f))
107 (inputs
108 `(("python-docker-py" ,python-docker-py)
109 ("python-dockerpty" ,python-dockerpty)
110 ("python-docopt" ,python-docopt)
df1f1d69
DT
111 ("python-jsonschema" ,python-jsonschema)
112 ("python-pyyaml" ,python-pyyaml)
113 ("python-requests" ,python-requests-2.7)
df1f1d69
DT
114 ("python-six" ,python-six)
115 ("python-texttable" ,python-texttable)
116 ("python-websocket-client" ,python-websocket-client)))
117 (home-page "https://www.docker.com/")
118 (synopsis "Multi-container orchestration for Docker")
119 (description "Docker Compose is a tool for defining and running
120multi-container Docker applications. A Compose file is used to configure an
121application’s services. Then, using a single command, the containers are
122created and all the services are started as specified in the configuration.")
123 (license license:asl2.0)))
42531fd3
EF
124
125(define-public python-docker-pycreds
126 (package
127 (name "python-docker-pycreds")
128 (version "0.3.0")
129 (source
130 (origin
131 (method url-fetch)
132 (uri (pypi-uri "docker-pycreds" version))
133 (sha256
134 (base32
135 "1zxvam1q22qb0jf48553nnncnfrcp88ag4xa0qmq6vr0imn9a3lb"))))
136 (build-system python-build-system)
137 (arguments
138 `(#:phases
139 (modify-phases %standard-phases
140 (add-after 'unpack 'fix-versioning
141 (lambda _
142 (substitute* "test-requirements.txt"
143 (("3.0.2") ,(package-version python-pytest))
144 (("2.3.1") ,(package-version python-pytest-cov))
145 (("2.4.1") ,(package-version python-flake8)))
146 #t)))))
147 (native-inputs
148 `(("python-flake8" ,python-flake8)
149 ("python-pytest" ,python-pytest)
150 ("python-pytest-cov" ,python-pytest-cov)))
151 (propagated-inputs
152 `(("python-six" ,python-six)))
153 (home-page "https://github.com/shin-/dockerpy-creds")
154 (synopsis
155 "Python bindings for the Docker credentials store API")
156 (description
157 "Docker-Pycreds contains the Python bindings for the docker credentials
158store API. It allows programmers to interact with a Docker registry using
159Python without keeping their credentials in a Docker configuration file.")
160 (license license:asl2.0)))
4e5b8f72
DM
161
162(define-public containerd
163 (package
164 (name "containerd")
26b7d23a 165 (version "1.2.2")
4e5b8f72
DM
166 (source
167 (origin
168 (method git-fetch)
169 (uri (git-reference
170 (url "https://github.com/containerd/containerd.git")
171 (commit (string-append "v" version))))
172 (file-name (git-file-name name version))
173 (sha256
174 (base32
26b7d23a 175 "065snv0s3v3z0ghadlii4w78qnhchcbx2kfdrvm8fk8gb4pkx1ya"))))
4e5b8f72
DM
176 (build-system go-build-system)
177 (arguments
178 `(#:import-path "github.com/containerd/containerd"
4e5b8f72
DM
179 #:phases
180 (modify-phases %standard-phases
181 (add-before 'build 'chdir
182 (lambda _
183 (chdir "src/github.com/containerd/containerd")
184 #t))
185 (add-after 'chdir 'patch-paths
186 (lambda* (#:key inputs outputs #:allow-other-keys)
187 ;; TODO: Patch "socat", "unpigz".
188 (substitute* "./runtime/v1/linux/runtime.go"
189 (("defaultRuntime[ \t]*=.*")
190 (string-append "defaultRuntime = \""
191 (assoc-ref inputs "runc")
192 "/sbin/runc\"\n"))
193 (("defaultShim[ \t]*=.*")
194 (string-append "defaultShim = \""
195 (assoc-ref outputs "out")
196 "/bin/containerd-shim\"\n")))
197 (substitute* "./vendor/github.com/containerd/go-runc/runc.go"
198 (("DefaultCommand[ \t]*=.*")
199 (string-append "DefaultCommand = \""
200 (assoc-ref inputs "runc")
201 "/sbin/runc\"\n")))
8b487bf8
DM
202 (substitute* "vendor/github.com/containerd/continuity/testutil/loopback/loopback_linux.go"
203 (("exec\\.Command\\(\"losetup\"") ; )
204 (string-append "exec.Command(\""
205 (assoc-ref inputs "util-linux")
206 "/sbin/losetup\""))) ;)
4e5b8f72
DM
207 #t))
208 (replace 'build
209 (lambda* (#:key (make-flags '()) #:allow-other-keys)
210 (apply invoke "make" make-flags)))
211 (replace 'install
212 (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
213 (let* ((out (assoc-ref outputs "out")))
214 (apply invoke "make" (string-append "DESTDIR=" out) "install"
215 make-flags)))))))
216 (inputs
217 `(("btrfs-progs" ,btrfs-progs)
218 ("libseccomp" ,libseccomp)
8b487bf8
DM
219 ("runc" ,runc)
220 ("util-linux" ,util-linux)))
4e5b8f72
DM
221 (native-inputs
222 `(("go" ,go)
223 ("pkg-config" ,pkg-config)))
40c7476a 224 (synopsis "Docker container runtime")
4e5b8f72
DM
225 (description "This package provides the container daemon for Docker.
226It includes image transfer and storage, container execution and supervision,
227network attachments.")
228 (home-page "http://containerd.io/")
229 (license license:asl2.0)))
f87ea24a
DM
230
231(define-public docker
232 (package
233 (name "docker")
234 (version %docker-version)
235 (source
236 (origin
237 (method git-fetch)
238 (uri (git-reference
239 (url "https://github.com/docker/engine.git")
240 (commit (string-append "v" version))))
241 (file-name (git-file-name name version))
242 (sha256
243 (base32
ea7cddaa 244 "1zfpk2n8j6gnwbrxrh6d6pj24y60dhbanpf55shrm2yxz54ka36c"))
f87ea24a
DM
245 (patches
246 (search-patches "docker-engine-test-noinstall.patch"
247 "docker-fix-tests.patch"))))
248 (build-system gnu-build-system)
249 (arguments
250 `(#:modules
251 ((guix build gnu-build-system)
252 ((guix build go-build-system) #:prefix go:)
253 (guix build utils))
254 #:imported-modules
255 (,@%gnu-build-system-modules
256 (guix build go-build-system))
257 #:phases
258 (modify-phases %standard-phases
259 (add-after 'unpack 'patch-paths
260 (lambda* (#:key inputs #:allow-other-keys)
261 (substitute* "builder/builder-next/executor_unix.go"
262 (("CommandCandidates:.*runc.*")
263 (string-append "CommandCandidates: []string{\""
264 (assoc-ref inputs "runc")
265 "/sbin/runc\"},\n")))
266 (substitute* "vendor/github.com/containerd/go-runc/runc.go"
267 (("DefaultCommand = .*")
268 (string-append "DefaultCommand = \""
269 (assoc-ref inputs "runc")
270 "/sbin/runc\"\n")))
271 (substitute* "vendor/github.com/containerd/containerd/runtime/v1/linux/runtime.go"
272 (("defaultRuntime[ \t]*=.*")
273 (string-append "defaultRuntime = \""
274 (assoc-ref inputs "runc")
275 "/sbin/runc\"\n"))
276 (("defaultShim[ \t]*=.*")
277 (string-append "defaultShim = \""
278 (assoc-ref inputs "containerd")
279 "/bin/containerd-shim\"\n")))
280 (substitute* "daemon/daemon_unix.go"
281 (("DefaultShimBinary = .*")
282 (string-append "DefaultShimBinary = \""
283 (assoc-ref inputs "containerd")
284 "/bin/containerd-shim\"\n"))
285 (("DefaultRuntimeBinary = .*")
286 (string-append "DefaultRuntimeBinary = \""
287 (assoc-ref inputs "runc")
288 "/sbin/runc\"\n"))
289 (("DefaultRuntimeName = .*")
290 (string-append "DefaultRuntimeName = \""
291 (assoc-ref inputs "runc")
292 "/sbin/runc\"\n")))
293 (substitute* "daemon/config/config.go"
294 (("StockRuntimeName = .*")
295 (string-append "StockRuntimeName = \""
296 (assoc-ref inputs "runc")
297 "/sbin/runc\"\n")))
298 (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go"
299 (("var defaultCommandCandidates = .*")
300 (string-append "var defaultCommandCandidates = []string{\""
301 (assoc-ref inputs "runc") "/sbin/runc\"}")))
302 (let ((source-files (filter (lambda (name)
303 (not (string-contains name "test")))
304 (find-files "." "\\.go$"))))
305 (let-syntax ((substitute-LookPath
306 (lambda (x)
307 (syntax-case x ()
308 ((substitute-LookPath source-text package
309 relative-path)
310 #`(substitute* source-files
311 ((#,(string-append "exec\\.LookPath\\(\""
312 (syntax->datum
313 #'source-text)
314 "\")"))
315 (string-append "\""
316 (assoc-ref inputs package)
317 relative-path
58adcaa1
DM
318 "\", error(nil)")))))))
319 (substitute-Command
320 (lambda (x)
321 (syntax-case x ()
322 ((substitute-LookPath source-text package
323 relative-path)
324 #`(substitute* source-files
325 ((#,(string-append "exec\\.Command\\(\""
326 (syntax->datum
327 #'source-text)
328 "\"")) ; )
329 (string-append "exec.Command(\""
330 (assoc-ref inputs package)
331 relative-path
332 "\"")))))))) ; )
f87ea24a
DM
333 (substitute-LookPath "ps" "procps" "/bin/ps")
334 (substitute-LookPath "mkfs.xfs" "xfsprogs" "/bin/mkfs.xfs")
335 (substitute-LookPath "lvmdiskscan" "lvm2" "/sbin/lvmdiskscan")
336 (substitute-LookPath "pvdisplay" "lvm2" "/sbin/pvdisplay")
337 (substitute-LookPath "blkid" "util-linux" "/sbin/blkid")
338 (substitute-LookPath "unpigz" "pigz" "/bin/unpigz")
339 (substitute-LookPath "iptables" "iptables" "/sbin/iptables")
ea7cddaa 340 (substitute-LookPath "iptables-legacy" "iptables" "/sbin/iptables")
58adcaa1
DM
341 (substitute-LookPath "ip" "iproute2" "/sbin/ip")
342 (substitute-Command "modprobe" "kmod" "/bin/modprobe")
343 (substitute-Command "pvcreate" "lvm2" "/sbin/pvcreate")
344 (substitute-Command "vgcreate" "lvm2" "/sbin/vgcreate")
345 (substitute-Command "lvcreate" "lvm2" "/sbin/lvcreate")
346 (substitute-Command "lvconvert" "lvm2" "/sbin/lvconvert")
347 (substitute-Command "lvchange" "lvm2" "/sbin/lvchange")
348 (substitute-Command "mkfs.xfs" "xfsprogs" "/sbin/mkfs.xfs")
349 (substitute-Command "xfs_growfs" "xfsprogs" "/sbin/xfs_growfs")
350 (substitute-Command "mkfs.ext4" "e2fsprogs" "/sbin/mkfs.ext4")
351 (substitute-Command "tune2fs" "e2fsprogs" "/sbin/tune2fs")
352 (substitute-Command "blkid" "util-linux" "/sbin/blkid")
353 (substitute-Command "resize2fs" "e2fsprogs" "/sbin/resize2fs")
354; docker-mountfrom ??
355; docker
6b6a25d4
DM
356; docker-untar ??
357; docker-applyLayer ??
58adcaa1 358; /usr/bin/uname
58adcaa1
DM
359; grep
360; apparmor_parser
361 (substitute-Command "ps" "procps" "/bin/ps")
362 (substitute-Command "losetup" "util-linux" "/sbin/losetup")
6b6a25d4
DM
363 (substitute-Command "uname" "coreutils" "/bin/uname")
364 (substitute-Command "dbus-launch" "dbus" "/bin/dbus-launch")
365 (substitute-Command "git" "git" "/bin/git"))
65a7e35c
DM
366 ;; Make compilation fail when, in future versions, Docker
367 ;; invokes other programs we don't know about and thus don't
368 ;; substitute.
369 (substitute* source-files
ffcd2827
DM
370 ;; Search for Java in PATH.
371 (("\\<exec\\.Command\\(\"java\"") ; )
372 "xxec.Command(\"java\"") ; )
373 ;; Search for AUFS in PATH (mainline Linux doesn't support it).
374 (("\\<exec\\.Command\\(\"auplink\"") ; )
375 "xxec.Command(\"auplink\"") ; )
376 ;; Fail on other unsubstituted commands.
377 (("\\<exec\\.Command\\(\"([a-zA-Z0-9][a-zA-Z0-9_-]*)\""
378 _ executable) ; )
379 (string-append "exec.Guix_doesnt_want_Command(\""
380 executable "\"")) ;)
381 (("\\<xxec\\.Command")
382 "exec.Command")
383 ;; Search for ZFS in PATH.
384 (("\\<LookPath\\(\"zfs\"\\)") "LooxPath(\"zfs\")")
385 ;; Fail on other unsubstituted LookPaths.
386 (("\\<LookPath\\(\"") "Guix_doesnt_want_LookPath\\(\"") ; ))
387 (("\\<LooxPath") "LookPath")))
f87ea24a
DM
388 #t))
389 (add-after 'patch-paths 'delete-failing-tests
390 (lambda _
391 ;; Needs internet access.
392 (delete-file "builder/remotecontext/git/gitutils_test.go")
393 ;; Permission denied.
394 (delete-file "daemon/graphdriver/devmapper/devmapper_test.go")
395 ;; Operation not permitted (idtools.MkdirAllAndChown).
396 (delete-file "daemon/graphdriver/vfs/vfs_test.go")
397 ;; Timeouts after 5 min.
398 (delete-file "plugin/manager_linux_test.go")
8cd95860
DM
399 ;; Operation not permitted.
400 (delete-file "daemon/graphdriver/overlay/overlay_test.go")
401 (delete-file "daemon/graphdriver/overlay2/overlay_test.go")
f87ea24a
DM
402 #t))
403 (replace 'configure
404 (lambda _
405 (setenv "DOCKER_GITCOMMIT" (string-append "v" ,%docker-version))
406 ;; Automatically use bundled dependencies.
407 ;; TODO: Unbundle - see file "vendor.conf".
408 (setenv "AUTO_GOPATH" "1")
409 ;; Respectively, strip the symbol table and debug
410 ;; information, and the DWARF symbol table.
411 (setenv "LDFLAGS" "-s -w")
412 ;; Make build faster
413 (setenv "GOCACHE" "/tmp")
414 #t))
415 (add-before 'build 'setup-environment
416 (assoc-ref go:%standard-phases 'setup-environment))
417 (replace 'build
418 (lambda _
419 ;; Our LD doesn't like the statically linked relocatable things
420 ;; that go produces, so install the dynamic version of
421 ;; dockerd instead.
422 (invoke "hack/make.sh" "dynbinary")))
423 (replace 'check
424 (lambda _
425 ;; The build process generated a file because the environment
426 ;; variable "AUTO_GOPATH" was set. Use it.
427 (setenv "GOPATH" (string-append (getcwd) "/.gopath"))
428 ;; ".gopath/src/github.com/docker/docker" is a link to the current
429 ;; directory and chdir would canonicalize to that.
430 ;; But go needs to have the uncanonicalized directory name, so
431 ;; store that.
432 (setenv "PWD" (string-append (getcwd)
433 "/.gopath/src/github.com/docker/docker"))
434 (with-directory-excursion ".gopath/src/github.com/docker/docker"
435 (invoke "hack/test/unit"))
436 (setenv "PWD" #f)
437 #t))
438 (replace 'install
439 (lambda* (#:key outputs #:allow-other-keys)
440 (let* ((out (assoc-ref outputs "out"))
441 (out-bin (string-append out "/bin")))
442 (install-file "bundles/dynbinary-daemon/dockerd" out-bin)
443 (install-file "bundles/dynbinary-daemon/dockerd-dev" out-bin)
444 #t))))))
445 (inputs
446 `(("btrfs-progs" ,btrfs-progs)
447 ("containerd" ,containerd) ; for containerd-shim
58adcaa1 448 ("coreutils" ,coreutils)
6b6a25d4 449 ("dbus" ,dbus)
58adcaa1 450 ("e2fsprogs" ,e2fsprogs)
6b6a25d4 451 ("git" ,git)
f87ea24a
DM
452 ("iproute2" ,iproute)
453 ("iptables" ,iptables)
58adcaa1 454 ("kmod" ,kmod)
f87ea24a
DM
455 ("libseccomp" ,libseccomp)
456 ("pigz" ,pigz)
457 ("procps" ,procps)
58adcaa1 458 ("runc" ,runc)
f87ea24a
DM
459 ("util-linux" ,util-linux)
460 ("lvm2" ,lvm2)
461 ("xfsprogs" ,xfsprogs)))
462 (native-inputs
463 `(("eudev" ,eudev) ; TODO: Should be propagated by lvm2 (.pc -> .pc)
464 ("go" ,go)
465 ("pkg-config" ,pkg-config)))
466 (synopsis "Docker container component library, and daemon")
467 (description "This package provides a framework to assemble specialized
468container systems. It includes components for orchestration, image
469management, secret management, configuration management, networking,
470provisioning etc.")
471 (home-page "https://mobyproject.org/")
472 (license license:asl2.0)))
e9b31645
DM
473
474(define-public docker-cli
475 (package
476 (name "docker-cli")
477 (version %docker-version)
478 (source
479 (origin
480 (method git-fetch)
481 (uri (git-reference
482 (url "https://github.com/docker/cli.git")
483 (commit (string-append "v" version))))
484 (file-name (git-file-name name version))
485 (sha256
486 (base32
ea7cddaa 487 "0jzcqh1kqbfyj6ax7z67gihaqgjiz6ddz6rq6k458l68v7zn77r8"))))
e9b31645
DM
488 (build-system go-build-system)
489 (arguments
490 `(#:import-path "github.com/docker/cli"
491 ;; TODO: Tests require a running Docker daemon.
492 #:tests? #f
493 #:phases
494 (modify-phases %standard-phases
495 (add-before 'build 'setup-environment-2
496 (lambda _
497 ;; Respectively, strip the symbol table and debug
498 ;; information, and the DWARF symbol table.
499 (setenv "LDFLAGS" "-s -w")
500
501 ;; Make build reproducible.
502 (setenv "BUILDTIME" "1970-01-01 00:00:01.000000000+00:00")
503 (symlink "src/github.com/docker/cli/scripts" "./scripts")
504 (symlink "src/github.com/docker/cli/docker.Makefile" "./docker.Makefile")
505 #t))
506 (replace 'build
507 (lambda _
508 (invoke "./scripts/build/dynbinary")))
509 (replace 'check
510 (lambda* (#:key make-flags tests? #:allow-other-keys)
511 (setenv "PATH" (string-append (getcwd) "/build:" (getenv "PATH")))
512 (if tests?
513 ;; Use the newly-built docker client for the tests.
514 (with-directory-excursion "src/github.com/docker/cli"
515 ;; TODO: Run test-e2e as well?
516 (apply invoke "make" "-f" "docker.Makefile" "test-unit"
517 (or make-flags '())))
518 #t)))
519 (replace 'install
520 (lambda* (#:key outputs #:allow-other-keys)
521 (let* ((out (assoc-ref outputs "out"))
522 (out-bin (string-append out "/bin")))
523 (chdir "build")
e9b31645
DM
524 (install-file "docker" out-bin)
525 #t))))))
526 (native-inputs
527 `(("go" ,go)
528 ("libltdl" ,libltdl)
529 ("pkg-config" ,pkg-config)))
530 (synopsis "Command line interface to Docker")
531 (description "This package provides a command line interface to Docker.")
17d25019 532 (home-page "https://www.docker.com/")
e9b31645 533 (license license:asl2.0)))
975a953b
MC
534
535(define-public cqfd
536 (package
537 (name "cqfd")
538 (version "5.0.1")
539 (source (origin
540 (method git-fetch)
541 (uri (git-reference
542 (url "https://github.com/savoirfairelinux/cqfd.git")
543 (commit (string-append "v" version))))
544 (file-name (git-file-name name version))
545 (sha256
546 (base32
547 "1z4v16lbpbwd5ykawizdclpryp2k006lbk2mv427a4b3nvcd9wik"))))
548 (build-system gnu-build-system)
549 (arguments
550 ;; The test suite requires a docker daemon and connectivity.
551 `(#:tests? #f
552 #:phases
553 (modify-phases %standard-phases
554 (delete 'configure)
555 (delete 'build)
556 (replace 'install
557 (lambda* (#:key outputs #:allow-other-keys)
558 (let ((out (assoc-ref outputs "out")))
559 ;; Fix the directory of the bash completion.
560 (substitute* "Makefile"
561 (("completionsdir=.*$")
562 (string-append "completionsdir=" out
563 "/etc/bash_completion.d; \\\n")))
564 (invoke "make" "install"
565 (string-append "PREFIX=" out))))))))
566 (home-page "https://github.com/savoirfairelinux/cqfd")
567 (synopsis "Convenience wrapper for Docker")
568 (description "cqfd is a Bash script that provides a quick and convenient
569way to run commands in the ecurrent directory, but within a Docker container
570defined in a per-project configuration file.")
571 (license license:gpl3+)))