1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Stefan Handschuh <handschuh.stefan@googlemail.com>
3 ;;; Copyright © 2015 Kai-Chung Yan <seamlikok@gmail.com>
4 ;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
5 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
6 ;;; Copyright © 2017 Hartmut Goebel <h.goebel@crazy-compilers.com>
7 ;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
8 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages android)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system android-ndk)
32 #:use-module (guix build-system python)
33 #:use-module (guix build-system trivial)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages check)
37 #:use-module (gnu packages compression)
38 #:use-module (gnu packages docker)
39 #:use-module (gnu packages gnupg)
40 #:use-module (gnu packages pcre)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages python-crypto)
43 #:use-module (gnu packages python-web)
44 #:use-module (gnu packages selinux)
45 #:use-module (gnu packages serialization)
46 #:use-module (gnu packages ssh)
47 #:use-module (gnu packages tls)
48 #:use-module (gnu packages version-control)
49 #:use-module (gnu packages virtualization)
50 #:use-module (gnu packages xdisorg)
51 #:use-module (gnu packages linux))
53 (define-public android-make-stub
55 (name "android-make-stub")
61 (url "https://github.com/daym/android-make-stub.git")
62 (commit (string-append "v" version))))
63 (file-name (string-append "android-make-stub-"
67 "0y1b2x96d37n6f1bp6dcx08bn08zac0cylmbfsx6mf2nahc02fhc"))))
68 (build-system gnu-build-system)
70 `(#:tests? #f ; None exist.
72 (modify-phases %standard-phases
76 (lambda* (#:key outputs #:allow-other-keys)
77 (let* ((out (assoc-ref outputs "out")))
78 (invoke "make" (string-append "prefix=" out) "install")
80 (home-page "https://github.com/daym/android-make-stub")
81 (synopsis "Stubs for the @command{make} system of the Android platform")
82 (description "@code{android-make-stub} provides stubs for the
83 @command{make} system of the Android platform. This allows us to
84 use their packages mostly unmodified in our Android NDK build system.")
85 (license license:asl2.0)))
87 (define-public android-googletest
88 (package (inherit googletest)
89 (name "android-googletest")
91 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
93 (modify-phases %standard-phases
94 (add-after 'install 'install-host-libraries
95 (lambda* (#:key outputs #:allow-other-keys)
96 (let* ((out (assoc-ref outputs "out"))
97 (lib (string-append out "/lib")))
98 (symlink "libgtest.so"
99 (string-append lib "/libgtest_host.so"))
100 (symlink "libgmock.so"
101 (string-append lib "/libgmock_host.so"))
104 ;; The Makefiles that we add are largely based on the Debian
105 ;; packages. They are licensed under GPL-2 and have copyright:
106 ;; 2012, Stefan Handschuh <handschuh.stefan@googlemail.com>
107 ;; 2015, Kai-Chung Yan <seamlikok@gmail.com>
108 ;; Big thanks to them for laying the groundwork.
110 ;; The version tag is consistent between all repositories.
111 (define (android-platform-version) "7.1.2_r36")
113 (define (android-platform-system-core version)
117 (url "https://android.googlesource.com/platform/system/core")
118 (commit (string-append "android-" version))))
119 (file-name (string-append "android-platform-system-core-"
120 version "-checkout"))
123 "1krnc2b9zfkzpdgs1dcbji59nszlx2qr723pg89m52622czc06hg"))
125 (search-patches "libbase-use-own-logging.patch"
126 "libbase-fix-includes.patch"
127 "libutils-remove-damaging-includes.patch"
128 "libutils-add-includes.patch"
129 "adb-add-libraries.patch"
130 "libziparchive-add-includes.patch"))))
132 (define (android-platform-system-extras version)
136 (url "https://android.googlesource.com/platform/system/extras")
137 (commit (string-append "android-" version))))
138 (file-name (string-append "android-platform-system-extras-"
139 version "-checkout"))
142 "18130c23ybqcpgjc5v6f8kdbv2xn39hyiaj17dzldjb9rlwzcyy9"))))
144 (define (android-platform-bionic version)
148 (url "https://android.googlesource.com/platform/bionic")
149 (commit (string-append "android-" version))))
150 (file-name (string-append "android-platform-bionic-"
151 version "-checkout"))
154 "15r4s20d7vw022f8vrc3jbghmqwdcqzprl7i2bfvdkz8z76wc1ps"))))
156 (define (android-platform-external version subdirectory checksum)
161 (string-append "https://android.googlesource.com/platform/external/"
163 (commit (string-append "android-" version))))
164 (file-name (string-append "android-platform-system-external-" subdirectory "-"
165 version "-checkout"))
170 (define android-liblog
172 (name "android-liblog")
173 (version (android-platform-version))
174 (source (android-platform-system-core version))
175 (build-system android-ndk-build-system)
177 `(#:make-flags '("LDLIBS=-lpthread")
179 (modify-phases %standard-phases
180 (add-after 'unpack 'enter-source
181 (lambda _ (chdir "liblog") #t))
182 (add-after 'install 'ldconfig
183 (lambda* (#:key outputs #:allow-other-keys)
184 (let ((out (assoc-ref outputs "out")))
185 (symlink "liblog.so.0" (string-append out "/lib/liblog.so"))
187 (home-page "https://developer.android.com/")
188 (synopsis "Logging library from the Android platform.")
189 (description "@code{liblog} represents an interface to the volatile Android
190 Logging system for NDK (Native) applications and libraries and contain
191 interfaces for either writing or reading logs. The log buffers are divided up
192 in Main, System, Radio and Events sub-logs.")
193 (license license:asl2.0)))
195 (define android-libbase
197 (name "android-libbase")
198 (version (android-platform-version))
199 (source (android-platform-system-core version))
200 (build-system android-ndk-build-system)
202 `(#:tests? #f ; Test failure: logging.UNIMPLEMENTED
203 #:make-flags '("CXXFLAGS=-std=gnu++11")
205 (modify-phases %standard-phases
206 (add-after 'unpack 'enter-source
207 (lambda _ (chdir "base") #t)))))
208 (inputs `(("android-liblog" ,android-liblog)))
209 (home-page "https://developer.android.com/")
210 (synopsis "Android platform base library")
211 (description "@code{libbase} is a library in common use by the
212 various Android core host applications.")
213 (license license:asl2.0)))
215 (define android-libcutils
217 (name "android-libcutils")
218 (version (android-platform-version))
219 (source (android-platform-system-core version))
220 (build-system gnu-build-system)
222 `(#:tests? #f ; TODO.
224 (modify-phases %standard-phases
225 (add-after 'unpack 'enter-source
226 (lambda _ (chdir "libcutils") #t))
227 (add-after 'enter-source 'create-Makefile
229 ;; No useful makefile is shipped, so we create one.
230 (with-output-to-file "Makefile"
235 "SOURCES = load_file.o socket_local_client_unix.o"
236 " socket_loopback_client_unix.o socket_network_client_unix.o"
237 " socket_loopback_server_unix.o socket_local_server_unix.o"
238 " sockets_unix.o socket_inaddr_any_server_unix.o"
243 "CXXFLAGS += -std=gnu++11 -fPIC\n"
244 "CPPFLAGS += -Iinclude -I../include\n"
245 "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0\n"
247 "build: $(SOURCES)\n"
248 " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS)"
253 (lambda* (#:key outputs #:allow-other-keys)
254 (let* ((out (assoc-ref outputs "out"))
255 (lib (string-append out "/lib"))
256 (include (string-append out "/include")))
257 (install-file "libcutils.so.0" lib)
258 (with-directory-excursion lib
259 (symlink "libcutils.so.0" "libcutils.so"))
260 (copy-recursively "../include/cutils"
261 (string-append include "/cutils"))
263 (home-page "https://developer.android.com/")
264 (synopsis "Android platform c utils library")
265 (description "@code{libcutils} is a library in common use by the
266 various Android core host applications.")
267 (license license:asl2.0)))
269 (define-public android-libsparse
271 (name "android-libsparse")
272 (version (android-platform-version))
273 (source (android-platform-system-core version))
274 (build-system android-ndk-build-system)
276 `(#:make-flags '("CFLAGS=-Wno-error"
277 "CXXFLAGS=-fpermissive -Wno-error")
279 (modify-phases %standard-phases
280 (add-after 'unpack 'enter-source
281 (lambda _ (chdir "libsparse") #t)))))
284 (home-page "https://developer.android.com/")
285 (synopsis "Android platform sparse library")
286 (description "@code{android-libsparse} is a library in common use by the
287 various Android core host applications.")
288 (license license:asl2.0)))
290 (define-public android-libziparchive
292 (name "android-libziparchive")
293 (version (android-platform-version))
294 (source (android-platform-system-core version))
295 (build-system android-ndk-build-system)
297 `(#:make-flags '("CFLAGS=-Wno-error"
298 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++11")
300 (modify-phases %standard-phases
301 (add-after 'unpack 'enter-source
302 (lambda _ (chdir "libziparchive") #t))
303 (add-before 'check 'setenv
305 (setenv "ziparchive_tests_host_PARAMS" "--test_data_dir=testdata")
307 (add-after 'install 'install-headers
308 (lambda* (#:key inputs outputs #:allow-other-keys)
309 (let ((out (assoc-ref outputs "out")))
310 (copy-recursively "../include/ziparchive"
311 (string-append out "/include/ziparchive"))
316 `(("android-libbase" ,android-libbase)
317 ("android-libutils" ,android-libutils)
318 ("android-liblog" ,android-liblog)))
319 (home-page "https://developer.android.com/")
320 (synopsis "Android platform ZIP library")
321 (description "@code{android-libziparchive} is a library in common use by the
322 various Android core host applications.")
323 (license license:asl2.0)))
328 (version (android-platform-version))
329 (source (android-platform-system-core version))
330 (build-system android-ndk-build-system)
332 `(#:tests? #f ; Test failure: sysdeps_poll.fd_count
334 (list "CFLAGS=-Wno-error"
335 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++14 -D_Nonnull= -D_Nullable= -I ."
336 (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib "
337 "-Wl,-rpath=" (assoc-ref %build-inputs "openssl") "/lib -L ."))
339 (modify-phases %standard-phases
340 (add-after 'unpack 'enter-source
341 (lambda _ (chdir "adb") #t))
342 (add-after 'enter-source 'glibc-compat
344 ;; Include sysmacros.h for "major" and "minor" in Glibc 2.28.
345 (substitute* "usb_linux.cpp"
346 (("#include <sys/types.h>" all)
347 (string-append all "\n#include <sys/sysmacros.h>\n")))
349 (add-after 'enter-source 'make-libs-available
350 (lambda* (#:key inputs outputs #:allow-other-keys)
351 (substitute* "Android.mk"
352 (("libcrypto_static") "libcrypto"))
354 (add-after 'install 'install-headers
355 (lambda* (#:key inputs outputs #:allow-other-keys)
356 (install-file "diagnose_usb.h" (string-append (assoc-ref outputs "out") "/include"))
359 `(("android-libbase" ,android-libbase)
360 ("android-libcutils" ,android-libcutils)
361 ("android-liblog" ,android-liblog)
362 ("openssl" ,openssl)))
363 (home-page "https://developer.android.com/studio/command-line/adb.html")
364 (synopsis "Android Debug Bridge")
366 "@command{adb} is a versatile command line tool that lets you communicate
367 with an emulator instance or connected Android device. It facilitates a variety
368 of device actions, such as installing and debugging apps, and it provides access
369 to a Unix shell that can run commands on the connected device or emulator.")
370 (license license:asl2.0)))
372 (define-public mkbootimg
375 (version (android-platform-version))
377 (inherit (android-platform-system-core version))))
378 (build-system python-build-system)
382 (modify-phases %standard-phases
383 (add-after 'unpack 'enter-source
384 (lambda _ (chdir "mkbootimg") #t))
388 (lambda* (#:key outputs #:allow-other-keys)
389 (let* ((out (assoc-ref outputs "out"))
390 (bin (string-append out "/bin"))
391 (include (string-append out "/include")))
392 (install-file "mkbootimg" bin)
393 (install-file "bootimg.h" include)
395 (home-page "https://developer.android.com/studio/command-line/adb.html")
396 (synopsis "Tool to create Android boot images")
397 (description "This package provides a tool to create Android Boot
399 (license license:asl2.0)))
401 (define-public android-safe-iop
403 (name "android-safe-iop")
404 (version (android-platform-version))
405 (source (android-platform-external version "safe-iop"
406 "1nyyrs463advjhlq8xx1lm37m4g5afv7gy0csxrj7biwwl0v13qw"))
407 (build-system android-ndk-build-system)
409 `(#:make-flags '("CXXFLAGS=-fpermissive -Wno-error")
411 (modify-phases %standard-phases
412 (add-before 'build 'patch-host
414 ;; TODO: Cross-compile.
415 (substitute* "Android.mk"
416 (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY"))
418 (home-page "https://developer.android.com/")
419 (synopsis "Safe integers in C")
420 (description "@code{android-safe-iop} provides a set of functions for
421 performing and checking safe integer operations. Ensure that integer
422 operations do not result in silent overflow.")
423 (license license:bsd-2)))
425 (define-public android-bionic-uapi
427 (name "android-bionic-uapi")
428 (version (android-platform-version))
429 (source (android-platform-bionic version))
430 (build-system android-ndk-build-system)
433 (modify-phases %standard-phases
434 (add-after 'unpack 'enter-source
435 (lambda _ (chdir "libc") #t))
441 (lambda* (#:key outputs #:allow-other-keys)
442 (let* ((out (assoc-ref outputs "out"))
443 (out-sys (string-append out "/include/sys")))
445 (install-file "include/sys/system_properties.h" out-sys)
446 (install-file "include/sys/_system_properties.h" out-sys)
447 (copy-recursively "kernel/uapi" (string-append out "/include"))
449 (home-page "https://developer.android.com/")
450 (synopsis "Android Linux API that is safe for user space")
451 (description "@code{android-bionic-uapi} provides the part of the Linux API
452 that is safe to use for user space. It also includes
453 @code{system_properties.h} and @code{_system_properties.h}.")
454 (license license:asl2.0)))
456 (define-public android-libselinux
458 (name "android-libselinux")
459 (version (android-platform-version))
461 (android-platform-external version "libselinux"
462 "13m2q32gzdcs5d0zj1nwasjy1j8vsxsgbjg7m5sa9lfcjaj7nkm7"))
463 (build-system android-ndk-build-system)
465 ;; See logd/Android.mk for the *_LOG_TAG values.
466 `(#:make-flags (list (string-append "CFLAGS=-Wno-error "
468 "-I core/libpackagelistparser/include "
469 "-DAUDITD_LOG_TAG=1003 "
470 "-DLOGD_LOG_TAG=1004 -D_GNU_SOURCE")
471 "LDFLAGS=-L . -lpcre")
473 (modify-phases %standard-phases
474 (add-after 'unpack-core 'patch-HOST
476 ;; gettid duplicates otherwise.
477 (substitute* "src/procattr.c"
478 (("#ifdef HOST") "#ifdef XXX"))
481 `(("openssl" ,openssl)))
483 `(("android-bionic-uapi" ,android-bionic-uapi)
484 ;; pcre is inlined by our package.
486 (home-page "https://developer.android.com/")
487 (synopsis (package-synopsis libselinux))
488 (description (package-description libselinux))
489 (license (package-license libselinux))))
491 (define-public android-ext4-utils
493 (name "android-ext4-utils")
494 (version (android-platform-version))
495 (source (android-platform-system-extras version))
496 (build-system android-ndk-build-system)
499 (list (string-append "CPPFLAGS="
502 (assoc-ref %build-inputs "android-libselinux")
504 "-I " (assoc-ref %build-inputs "android-libsparse")
506 "-I " (assoc-ref %build-inputs "android-libcutils")
508 "-I " (assoc-ref %build-inputs "android-liblog") "/include "
509 "-I ../core/include")
511 "install-libext4_utils_host.a"
512 (string-append "prefix=" (assoc-ref %outputs "out")))
514 (modify-phases %standard-phases
515 (add-after 'unpack 'unpack-core
516 (lambda* (#:key inputs #:allow-other-keys)
518 (with-directory-excursion "core"
519 (invoke "tar" "axf" (assoc-ref inputs "android-core")
520 "--strip-components=1"))
522 (add-after 'unpack-core 'enter-source
523 (lambda _ (chdir "ext4_utils") #t))
525 (lambda* (#:key inputs outputs #:allow-other-keys)
526 (let ((out (assoc-ref outputs "out")))
527 (copy-recursively "." (string-append out "/include")))
530 `(("android-libcutils" ,android-libcutils)
531 ("android-liblog" ,android-liblog)
532 ("android-libselinux" ,android-libselinux)
533 ("android-libsparse" ,android-libsparse)
536 `(("android-core" ,(android-platform-system-core version))))
537 (home-page "https://developer.android.com/")
538 (synopsis "Android ext4 filesystem utils")
539 (description "@code{android-ext4-utils} is a library in common use by the
541 (license license:asl2.0)))
543 (define-public android-f2fs-utils
545 (name "android-f2fs-utils")
546 (version (android-platform-version))
547 (source (android-platform-system-extras version))
548 (build-system android-ndk-build-system)
551 (modify-phases %standard-phases
552 (add-after 'unpack 'enter-source
553 (lambda _ (chdir "f2fs_utils") #t))
554 (add-after 'install 'install-headers
555 (lambda* (#:key inputs outputs #:allow-other-keys)
556 (copy-recursively "." (string-append (assoc-ref outputs "out")
559 (add-after 'install 'install-shell-scripts
560 (lambda* (#:key outputs #:allow-other-keys)
561 (let* ((out (assoc-ref outputs "out"))
562 (bin (string-append out "/bin")))
563 (patch-shebang "mkf2fsuserimg.sh")
564 (substitute* "mkf2fsuserimg.sh"
565 (("make_f2fs") (string-append bin "/make_f2fs")))
566 (install-file "mkf2fsuserimg.sh" bin)
569 `(("f2fs-tools" ,f2fs-tools-1.7)
570 ("android-libselinux" ,android-libselinux)
571 ("android-libsparse" ,android-libsparse)
572 ("android-libcutils" ,android-libcutils)
574 (home-page "https://developer.android.com/")
575 (synopsis "Android f2fs utils")
576 (description "@code{android-f2fs-utils} is a library in common use by the
577 Android core. It allows the user to create images for the @code{f2fs} Flash
579 (license license:asl2.0)))
581 (define-public android-libutils
583 (name "android-libutils")
584 (version (android-platform-version))
585 (source (android-platform-system-core version))
586 (build-system android-ndk-build-system)
589 #:make-flags '("CXXFLAGS=-std=gnu++11 -Wno-error")
591 (modify-phases %standard-phases
592 (add-after 'unpack 'enter-source
593 (lambda _ (chdir "libutils") #t))
595 (add-after 'install 'install-headers
596 (lambda* (#:key inputs outputs #:allow-other-keys)
597 (copy-recursively "../include/utils" (string-append (assoc-ref outputs "out") "/include/utils")))))))
599 `(("android-safe-iop" ,android-safe-iop)
600 ("android-libcutils" ,android-libcutils)))
602 `(("android-bionic-uapi" ,android-bionic-uapi)
603 ("android-liblog" ,android-liblog)))
604 (home-page "https://developer.android.com/")
605 (synopsis "Android utility library")
606 (description "@code{android-libutils} provides utilities for Android NDK developers.")
607 (license license:asl2.0)))
609 (define-public fastboot
612 (version (android-platform-version))
613 (source (android-platform-system-core version))
614 (build-system android-ndk-build-system)
616 `(#:make-flags (list "CXXFLAGS=-std=gnu++11")
618 (modify-phases %standard-phases
619 (add-after 'unpack 'enter-source
623 (add-after 'enter-source 'patch-source
625 (substitute* "Android.mk"
626 (("libext4_utils_host") "libext4_utils_host libselinux libpcre"))
629 (lambda* (#:key outputs #:allow-other-keys)
630 (let* ((out (assoc-ref outputs "out"))
631 (lib (string-append out "/lib"))
632 (bin (string-append out "/bin")))
633 (install-file "fastboot" bin)
637 ("android-safe-iop" ,android-safe-iop)
638 ("android-ext4-utils" ,android-ext4-utils)
639 ("android-f2fs-utils" ,android-f2fs-utils)
640 ("android-libbase" ,android-libbase)
641 ("android-libcutils" ,android-libcutils)
642 ("android-liblog" ,android-liblog)
643 ("android-libutils" ,android-libutils)
644 ("android-libsparse" ,android-libsparse)
645 ("android-libziparchive" ,android-libziparchive)
646 ("android-libselinux" ,android-libselinux)
648 ("mkbootimg" ,mkbootimg)
652 (home-page "https://developer.android.com/studio/command-line/")
653 (synopsis "Android image flasher")
655 "This package provides @command{fastboot}, a tool to upload file system images to Android devices.")
656 (license license:asl2.0)))
658 (define-public android-udev-rules
660 (name "android-udev-rules")
666 (url "https://github.com/M0Rf30/android-udev-rules")
668 (file-name (string-append name "-" version "-checkout"))
670 (base32 "13gj79nnd04szqlrrzzkdr6wi1fky08pi7x8xfbg0jj3d3v0giah"))))
671 (build-system trivial-build-system)
672 (native-inputs `(("source" ,source)))
674 '(#:modules ((guix build utils))
677 (use-modules (guix build utils))
678 (let ((source (assoc-ref %build-inputs "source")))
679 (install-file (string-append source "/51-android.rules")
680 (string-append %output "/lib/udev/rules.d"))
682 (home-page "https://github.com/M0Rf30/android-udev-rules")
683 (synopsis "udev rules for Android devices")
684 (description "Provides a set of udev rules to allow using Android devices
685 with tools such as @command{adb} and @command{fastboot} without root
686 privileges. This package is intended to be added as a rule to the
687 @code{udev-service-type} in your @code{operating-system} configuration.
688 Additionally, an @code{adbusers} group must be defined and your user added to
691 @emph{Simply installing this package will not have any effect.} It is meant
692 to be passed to the @code{udev} service.")
693 (license license:gpl3+)))
695 (define-public git-repo
703 (url "https://gerrit.googlesource.com/git-repo")
704 (commit (string-append "v" version))))
705 (file-name (string-append "git-repo-" version "-checkout"))
707 (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))
708 (build-system python-build-system)
710 `(#:python ,python-2 ; code says: "Python 3 support is … experimental."
712 (modify-phases %standard-phases
713 (add-before 'build 'set-executable-paths
714 (lambda* (#:key inputs outputs #:allow-other-keys)
715 (let* ((out (assoc-ref outputs "out"))
716 (git (assoc-ref inputs "git"))
717 (gpg (assoc-ref inputs "gnupg"))
718 (ssh (assoc-ref inputs "ssh")))
719 (substitute* '("repo" "git_command.py")
721 (string-append "GIT = '" git "/bin/git' ")))
723 ((" cmd = \\['gpg',")
724 (string-append " cmd = ['" gpg "/bin/gpg',")))
725 (substitute* "git_config.py"
726 ((" command_base = \\['ssh',")
727 (string-append " command_base = ['" ssh "/bin/ssh',")))
729 (add-before 'build 'do-not-clone-this-source
730 (lambda* (#:key outputs #:allow-other-keys)
731 (let* ((out (assoc-ref outputs "out"))
732 (repo-dir (string-append out "/share/" ,name)))
734 (("^def _FindRepo\\(\\):.*")
737 '''Look for a repo installation, starting at the current directory.'''
738 # Use the installed version of git-repo.
739 repo_main = '~a/main.py'
742 while curdir != '/' and curdir != olddir:
743 dot_repo = os.path.join(curdir, repodir)
744 if os.path.isdir(dot_repo):
745 return (repo_main, dot_repo)
748 curdir = os.path.dirname(curdir)
751 # The remaining of this function is dead code. It was used to
752 # find a git-checked-out version in the local project.\n" repo-dir))
753 ;; Neither clone, check out, nor verify the git repository
754 (("(^\\s+)_Clone\\(.*\\)") "")
755 (("(^\\s+)_Checkout\\(.*\\)") "")
756 ((" rev = _Verify\\(.*\\)") " rev = None"))
758 (delete 'build) ; nothing to build
761 (zero? (system* "python" "-m" "nose"))))
763 (lambda* (#:key outputs #:allow-other-keys)
764 (let* ((out (assoc-ref outputs "out"))
765 (bin-dir (string-append out "/bin"))
766 (repo-dir (string-append out "/share/" ,name)))
769 (copy-recursively "." repo-dir)
770 (delete-file-recursively (string-append repo-dir "/tests"))
771 (symlink (string-append repo-dir "/repo")
772 (string-append bin-dir "/repo"))
775 ;; TODO: Add git-remote-persistent-https once it is available in guix
780 `(("nose" ,python2-nose)))
781 (home-page "https://code.google.com/p/git-repo/")
782 (synopsis "Helps to manage many Git repositories.")
783 (description "Repo is a tool built on top of Git. Repo helps manage many
784 Git repositories, does the uploads to revision control systems, and automates
785 parts of the development workflow. Repo is not meant to replace Git, only to
786 make it easier to work with Git. The repo command is an executable Python
787 script that you can put anywhere in your path.")
788 (license license:asl2.0)))
790 (define-public abootimg
797 (uri (string-append "http://http.debian.net/debian/pool/main/a/abootimg/"
798 "abootimg_" version ".orig.tar.gz"))
800 (base32 "0sfc2k011l1ymv97821w89391gnqdh8pp0haz4sdcm5hx0axv2ba"))))
801 (build-system gnu-build-system)
805 (modify-phases %standard-phases
811 (lambda* (#:key outputs #:allow-other-keys)
812 (let* ((out (assoc-ref outputs "out"))
813 (bin (string-append out "/bin")))
814 (install-file "abootimg" bin)
817 `(("libblkid" ,util-linux)))
818 (home-page "https://ac100.grandou.net/abootimg")
819 (synopsis "Tool for manipulating Android Boot Images")
820 (description "This package provides a tool for manipulating old Android
821 Boot Images. @code{abootimg} can work directly on block devices, or, the
822 safest way, on a file image.")
823 (license license:gpl2+)))
825 (define-public python-androguard
827 (name "python-androguard")
831 ;; The pypi release doesn't have the tests, but the tests use
832 ;; packaged binaries, so we skip them.
834 (uri (pypi-uri "androguard" version))
837 "0ndsw00pkyda4i2s3wi5ap8gbk6a9d23xhhxpdbk02padv8sxkfv"))))
838 (build-system python-build-system)
841 (modify-phases %standard-phases
843 ;; Adapted from .travis.yml
845 (invoke "nosetests" "--with-coverage" "--with-timer"
846 "--timer-top-n" "50"))))))
848 `(("python-codecov" ,python-codecov)
849 ("python-coverage" ,python-coverage)
850 ("python-mock" ,python-mock)
851 ("python-nose" ,python-nose)
852 ("python-nose-timer" ,python-nose-timer)))
854 `(("python-asn1crypto" ,python-asn1crypto)
855 ("python-colorama" ,python-colorama)
856 ("python-future" ,python-future)
857 ("python-ipython" ,python-ipython)
858 ("python-lxml" ,python-lxml)
859 ("python-matplotlib" ,python-matplotlib)
860 ("python-networkx" ,python-networkx)
861 ("python-pygments" ,python-pygments)
862 ("python-pyperclip" ,python-pyperclip)))
863 (home-page "https://github.com/androguard/androguard")
864 (synopsis "Python tool to play with Android files")
866 "Androguard is a full Python tool to manipulate Android files. It is
867 useful for reverse engineering, analysis of Android applications and more.")
868 (license license:asl2.0)))
870 (define-public fdroidserver
872 (name "fdroidserver")
877 (uri (pypi-uri "fdroidserver" version))
880 "0n6kkby65qzqdx1jn72grfffvr1w1j1rby5pwm9z8rymmsh8s0pm"))))
881 (build-system python-build-system)
884 (modify-phases %standard-phases
885 (add-after 'unpack 'fix-versioning
887 (substitute* "setup.py"
888 (("0.2.1") ,(package-version python-pyasn1-modules)))
891 `(("python-androguard" ,python-androguard)
892 ("python-apache-libcloud" ,python-apache-libcloud)
893 ("python-clint" ,python-clint)
894 ("python-docker-py" ,python-docker-py)
895 ("python-gitpython" ,python-gitpython)
896 ("python-mwclient" ,python-mwclient)
897 ("python-paramiko" ,python-paramiko)
898 ("python-pillow" ,python-pillow)
899 ("python-pyasn1" ,python-pyasn1)
900 ("python-pyasn1-modules" ,python-pyasn1-modules)
901 ("python-pyyaml" ,python-pyyaml)
902 ("python-qrcode" ,python-qrcode)
903 ("python-ruamel.yaml" ,python-ruamel.yaml)
904 ("python-requests" ,python-requests)
905 ("python-vagrant" ,python-vagrant)))
907 `(("python-babel" ,python-babel)
908 ("python-bcrypt" ,python-bcrypt)
909 ("python-docker-pycreds" ,python-docker-pycreds)
910 ("python-pynacl" ,python-pynacl)
911 ("python-websocket-client" ,python-websocket-client)))
912 (home-page "https://f-droid.org")
913 (synopsis "F-Droid server tools")
915 "The F-Droid server tools provide various scripts and tools that are used
916 to maintain F-Droid, the repository of free Android applications. You can use
917 these same tools to create your own additional or alternative repository for
918 publishing, or to assist in creating, testing and submitting metadata to the
920 (license license:agpl3+)))