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>
10 ;;; Copyright © 2019 Andreas Enge <andreas@enge.fr>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages android)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system android-ndk)
33 #:use-module (guix build-system python)
34 #:use-module (guix build-system trivial)
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages check)
38 #:use-module (gnu packages compression)
39 #:use-module (gnu packages docker)
40 #:use-module (gnu packages gnupg)
41 #:use-module (gnu packages linux)
42 #:use-module (gnu packages pcre)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages python-crypto)
45 #:use-module (gnu packages python-web)
46 #:use-module (gnu packages python-xyz)
47 #:use-module (gnu packages selinux)
48 #:use-module (gnu packages serialization)
49 #:use-module (gnu packages ssh)
50 #:use-module (gnu packages tls)
51 #:use-module (gnu packages version-control)
52 #:use-module (gnu packages virtualization)
53 #:use-module (gnu packages xdisorg)
54 #:use-module (gnu packages xml))
56 (define-public android-make-stub
58 (name "android-make-stub")
64 (url "https://github.com/daym/android-make-stub.git")
65 (commit (string-append "v" version))))
66 (file-name (string-append "android-make-stub-"
70 "0y1b2x96d37n6f1bp6dcx08bn08zac0cylmbfsx6mf2nahc02fhc"))))
71 (build-system gnu-build-system)
73 `(#:tests? #f ; None exist.
75 (modify-phases %standard-phases
79 (lambda* (#:key outputs #:allow-other-keys)
80 (let* ((out (assoc-ref outputs "out")))
81 (invoke "make" (string-append "prefix=" out) "install")
83 (home-page "https://github.com/daym/android-make-stub")
84 (synopsis "Stubs for the @command{make} system of the Android platform")
85 (description "@code{android-make-stub} provides stubs for the
86 @command{make} system of the Android platform. This allows us to
87 use their packages mostly unmodified in our Android NDK build system.")
88 (license license:asl2.0)))
90 (define-public android-googletest
91 (package (inherit googletest)
92 (name "android-googletest")
94 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
96 (modify-phases %standard-phases
97 (add-after 'install 'install-host-libraries
98 (lambda* (#:key outputs #:allow-other-keys)
99 (let* ((out (assoc-ref outputs "out"))
100 (lib (string-append out "/lib")))
101 (symlink "libgtest.so"
102 (string-append lib "/libgtest_host.so"))
103 (symlink "libgmock.so"
104 (string-append lib "/libgmock_host.so"))
107 ;; The Makefiles that we add are largely based on the Debian
108 ;; packages. They are licensed under GPL-2 and have copyright:
109 ;; 2012, Stefan Handschuh <handschuh.stefan@googlemail.com>
110 ;; 2015, Kai-Chung Yan <seamlikok@gmail.com>
111 ;; Big thanks to them for laying the groundwork.
113 ;; The version tag is consistent between all repositories.
114 (define (android-platform-version) "7.1.2_r36")
116 (define (android-platform-system-core version)
120 (url "https://android.googlesource.com/platform/system/core")
121 (commit (string-append "android-" version))))
122 (file-name (string-append "android-platform-system-core-"
123 version "-checkout"))
126 "1krnc2b9zfkzpdgs1dcbji59nszlx2qr723pg89m52622czc06hg"))
128 (search-patches "libbase-use-own-logging.patch"
129 "libbase-fix-includes.patch"
130 "libutils-remove-damaging-includes.patch"
131 "libutils-add-includes.patch"
132 "adb-add-libraries.patch"
133 "libziparchive-add-includes.patch"))))
135 (define (android-platform-system-extras version)
139 (url "https://android.googlesource.com/platform/system/extras")
140 (commit (string-append "android-" version))))
141 (file-name (string-append "android-platform-system-extras-"
142 version "-checkout"))
145 "18130c23ybqcpgjc5v6f8kdbv2xn39hyiaj17dzldjb9rlwzcyy9"))))
147 (define (android-platform-bionic version)
151 (url "https://android.googlesource.com/platform/bionic")
152 (commit (string-append "android-" version))))
153 (file-name (string-append "android-platform-bionic-"
154 version "-checkout"))
157 "15r4s20d7vw022f8vrc3jbghmqwdcqzprl7i2bfvdkz8z76wc1ps"))))
159 (define (android-platform-external version subdirectory checksum)
164 (string-append "https://android.googlesource.com/platform/external/"
166 (commit (string-append "android-" version))))
167 (file-name (string-append "android-platform-system-external-" subdirectory "-"
168 version "-checkout"))
173 (define android-liblog
175 (name "android-liblog")
176 (version (android-platform-version))
177 (source (android-platform-system-core version))
178 (build-system android-ndk-build-system)
180 `(#:make-flags '("LDLIBS=-lpthread")
182 (modify-phases %standard-phases
183 (add-after 'unpack 'enter-source
184 (lambda _ (chdir "liblog") #t))
185 (add-after 'install 'ldconfig
186 (lambda* (#:key outputs #:allow-other-keys)
187 (let ((out (assoc-ref outputs "out")))
188 (symlink "liblog.so.0" (string-append out "/lib/liblog.so"))
190 (home-page "https://developer.android.com/")
191 (synopsis "Logging library from the Android platform.")
192 (description "@code{liblog} represents an interface to the volatile Android
193 Logging system for NDK (Native) applications and libraries and contain
194 interfaces for either writing or reading logs. The log buffers are divided up
195 in Main, System, Radio and Events sub-logs.")
196 (license license:asl2.0)))
198 (define android-libbase
200 (name "android-libbase")
201 (version (android-platform-version))
202 (source (android-platform-system-core version))
203 (build-system android-ndk-build-system)
205 `(#:tests? #f ; Test failure: logging.UNIMPLEMENTED
206 #:make-flags '("CXXFLAGS=-std=gnu++11")
208 (modify-phases %standard-phases
209 (add-after 'unpack 'enter-source
210 (lambda _ (chdir "base") #t)))))
211 (inputs `(("android-liblog" ,android-liblog)))
212 (home-page "https://developer.android.com/")
213 (synopsis "Android platform base library")
214 (description "@code{libbase} is a library in common use by the
215 various Android core host applications.")
216 (license license:asl2.0)))
218 (define android-libcutils
220 (name "android-libcutils")
221 (version (android-platform-version))
222 (source (android-platform-system-core version))
223 (build-system gnu-build-system)
225 `(#:tests? #f ; TODO.
227 (modify-phases %standard-phases
228 (add-after 'unpack 'enter-source
229 (lambda _ (chdir "libcutils") #t))
230 (add-after 'enter-source 'create-Makefile
232 ;; No useful makefile is shipped, so we create one.
233 (with-output-to-file "Makefile"
238 "SOURCES = load_file.o socket_local_client_unix.o"
239 " socket_loopback_client_unix.o socket_network_client_unix.o"
240 " socket_loopback_server_unix.o socket_local_server_unix.o"
241 " sockets_unix.o socket_inaddr_any_server_unix.o"
246 "CXXFLAGS += -std=gnu++11 -fPIC\n"
247 "CPPFLAGS += -Iinclude -I../include\n"
248 "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0\n"
250 "build: $(SOURCES)\n"
251 " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS)"
256 (lambda* (#:key outputs #:allow-other-keys)
257 (let* ((out (assoc-ref outputs "out"))
258 (lib (string-append out "/lib"))
259 (include (string-append out "/include")))
260 (install-file "libcutils.so.0" lib)
261 (with-directory-excursion lib
262 (symlink "libcutils.so.0" "libcutils.so"))
263 (copy-recursively "../include/cutils"
264 (string-append include "/cutils"))
266 (home-page "https://developer.android.com/")
267 (synopsis "Android platform c utils library")
268 (description "@code{libcutils} is a library in common use by the
269 various Android core host applications.")
270 (license license:asl2.0)))
272 (define-public android-libsparse
274 (name "android-libsparse")
275 (version (android-platform-version))
276 (source (android-platform-system-core version))
277 (build-system android-ndk-build-system)
279 `(#:make-flags '("CFLAGS=-Wno-error"
280 "CXXFLAGS=-fpermissive -Wno-error")
282 (modify-phases %standard-phases
283 (add-after 'unpack 'enter-source
284 (lambda _ (chdir "libsparse") #t)))))
287 (home-page "https://developer.android.com/")
288 (synopsis "Android platform sparse library")
289 (description "@code{android-libsparse} is a library in common use by the
290 various Android core host applications.")
291 (license license:asl2.0)))
293 (define-public android-libziparchive
295 (name "android-libziparchive")
296 (version (android-platform-version))
297 (source (android-platform-system-core version))
298 (build-system android-ndk-build-system)
300 `(#:make-flags '("CFLAGS=-Wno-error"
301 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++11")
303 (modify-phases %standard-phases
304 (add-after 'unpack 'enter-source
305 (lambda _ (chdir "libziparchive") #t))
306 (add-before 'check 'setenv
308 (setenv "ziparchive_tests_host_PARAMS" "--test_data_dir=testdata")
310 (add-after 'install 'install-headers
311 (lambda* (#:key inputs outputs #:allow-other-keys)
312 (let ((out (assoc-ref outputs "out")))
313 (copy-recursively "../include/ziparchive"
314 (string-append out "/include/ziparchive"))
319 `(("android-libbase" ,android-libbase)
320 ("android-libutils" ,android-libutils)
321 ("android-liblog" ,android-liblog)))
322 (home-page "https://developer.android.com/")
323 (synopsis "Android platform ZIP library")
324 (description "@code{android-libziparchive} is a library in common use by the
325 various Android core host applications.")
326 (license license:asl2.0)))
331 (version (android-platform-version))
332 (source (android-platform-system-core version))
333 (build-system android-ndk-build-system)
335 `(#:tests? #f ; Test failure: sysdeps_poll.fd_count
337 (list "CFLAGS=-Wno-error"
338 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++14 -D_Nonnull= -D_Nullable= -I ."
339 (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib "
340 "-Wl,-rpath=" (assoc-ref %build-inputs "openssl") "/lib -L ."))
342 (modify-phases %standard-phases
343 (add-after 'unpack 'enter-source
344 (lambda _ (chdir "adb") #t))
345 (add-after 'enter-source 'glibc-compat
347 ;; Include sysmacros.h for "major" and "minor" in Glibc 2.28.
348 (substitute* "usb_linux.cpp"
349 (("#include <sys/types.h>" all)
350 (string-append all "\n#include <sys/sysmacros.h>\n")))
352 (add-after 'enter-source 'make-libs-available
353 (lambda* (#:key inputs outputs #:allow-other-keys)
354 (substitute* "Android.mk"
355 (("libcrypto_static") "libcrypto"))
357 (add-after 'install 'install-headers
358 (lambda* (#:key inputs outputs #:allow-other-keys)
359 (install-file "diagnose_usb.h" (string-append (assoc-ref outputs "out") "/include"))
362 `(("android-libbase" ,android-libbase)
363 ("android-libcutils" ,android-libcutils)
364 ("android-liblog" ,android-liblog)
365 ("openssl" ,openssl-1.0)))
366 (home-page "https://developer.android.com/studio/command-line/adb.html")
367 (synopsis "Android Debug Bridge")
369 "@command{adb} is a versatile command line tool that lets you communicate
370 with an emulator instance or connected Android device. It facilitates a variety
371 of device actions, such as installing and debugging apps, and it provides access
372 to a Unix shell that can run commands on the connected device or emulator.")
373 (license license:asl2.0)))
375 (define-public mkbootimg
378 (version (android-platform-version))
380 (inherit (android-platform-system-core version))))
381 (build-system python-build-system)
385 (modify-phases %standard-phases
386 (add-after 'unpack 'enter-source
387 (lambda _ (chdir "mkbootimg") #t))
391 (lambda* (#:key outputs #:allow-other-keys)
392 (let* ((out (assoc-ref outputs "out"))
393 (bin (string-append out "/bin"))
394 (include (string-append out "/include")))
395 (install-file "mkbootimg" bin)
396 (install-file "bootimg.h" include)
398 (home-page "https://developer.android.com/studio/command-line/adb.html")
399 (synopsis "Tool to create Android boot images")
400 (description "This package provides a tool to create Android Boot
402 (license license:asl2.0)))
404 (define-public android-safe-iop
406 (name "android-safe-iop")
407 (version (android-platform-version))
408 (source (android-platform-external version "safe-iop"
409 "1nyyrs463advjhlq8xx1lm37m4g5afv7gy0csxrj7biwwl0v13qw"))
410 (build-system android-ndk-build-system)
412 `(#:make-flags '("CXXFLAGS=-fpermissive -Wno-error")
414 (modify-phases %standard-phases
415 (add-before 'build 'patch-host
417 ;; TODO: Cross-compile.
418 (substitute* "Android.mk"
419 (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY"))
421 (home-page "https://developer.android.com/")
422 (synopsis "Safe integers in C")
423 (description "@code{android-safe-iop} provides a set of functions for
424 performing and checking safe integer operations. Ensure that integer
425 operations do not result in silent overflow.")
426 (license license:bsd-2)))
428 (define-public android-bionic-uapi
430 (name "android-bionic-uapi")
431 (version (android-platform-version))
432 (source (android-platform-bionic version))
433 (build-system android-ndk-build-system)
436 (modify-phases %standard-phases
437 (add-after 'unpack 'enter-source
438 (lambda _ (chdir "libc") #t))
444 (lambda* (#:key outputs #:allow-other-keys)
445 (let* ((out (assoc-ref outputs "out"))
446 (out-sys (string-append out "/include/sys")))
448 (install-file "include/sys/system_properties.h" out-sys)
449 (install-file "include/sys/_system_properties.h" out-sys)
450 (copy-recursively "kernel/uapi" (string-append out "/include"))
452 (home-page "https://developer.android.com/")
453 (synopsis "Android Linux API that is safe for user space")
454 (description "@code{android-bionic-uapi} provides the part of the Linux API
455 that is safe to use for user space. It also includes
456 @code{system_properties.h} and @code{_system_properties.h}.")
457 (license license:asl2.0)))
459 (define-public android-libselinux
461 (name "android-libselinux")
462 (version (android-platform-version))
464 (android-platform-external version "libselinux"
465 "13m2q32gzdcs5d0zj1nwasjy1j8vsxsgbjg7m5sa9lfcjaj7nkm7"))
466 (build-system android-ndk-build-system)
468 ;; See logd/Android.mk for the *_LOG_TAG values.
469 `(#:make-flags (list (string-append "CFLAGS=-Wno-error "
471 "-I core/libpackagelistparser/include "
472 "-DAUDITD_LOG_TAG=1003 "
473 "-DLOGD_LOG_TAG=1004 -D_GNU_SOURCE")
474 "LDFLAGS=-L . -lpcre")
476 (modify-phases %standard-phases
477 (add-after 'unpack-core 'patch-HOST
479 ;; gettid duplicates otherwise.
480 (substitute* "src/procattr.c"
481 (("#ifdef HOST") "#ifdef XXX"))
484 `(("openssl" ,openssl)))
486 `(("android-bionic-uapi" ,android-bionic-uapi)
487 ;; pcre is inlined by our package.
489 (home-page "https://developer.android.com/")
490 (synopsis (package-synopsis libselinux))
491 (description (package-description libselinux))
492 (license (package-license libselinux))))
494 (define-public android-ext4-utils
496 (name "android-ext4-utils")
497 (version (android-platform-version))
498 (source (android-platform-system-extras version))
499 (build-system android-ndk-build-system)
502 (list (string-append "CPPFLAGS="
505 (assoc-ref %build-inputs "android-libselinux")
507 "-I " (assoc-ref %build-inputs "android-libsparse")
509 "-I " (assoc-ref %build-inputs "android-libcutils")
511 "-I " (assoc-ref %build-inputs "android-liblog") "/include "
512 "-I ../core/include")
514 "install-libext4_utils_host.a"
515 (string-append "prefix=" (assoc-ref %outputs "out")))
517 (modify-phases %standard-phases
518 (add-after 'unpack 'unpack-core
519 (lambda* (#:key inputs #:allow-other-keys)
521 (with-directory-excursion "core"
522 (invoke "tar" "axf" (assoc-ref inputs "android-core")
523 "--strip-components=1"))
525 (add-after 'unpack-core 'enter-source
526 (lambda _ (chdir "ext4_utils") #t))
528 (lambda* (#:key inputs outputs #:allow-other-keys)
529 (let ((out (assoc-ref outputs "out")))
530 (copy-recursively "." (string-append out "/include")))
533 `(("android-libcutils" ,android-libcutils)
534 ("android-liblog" ,android-liblog)
535 ("android-libselinux" ,android-libselinux)
536 ("android-libsparse" ,android-libsparse)
539 `(("android-core" ,(android-platform-system-core version))))
540 (home-page "https://developer.android.com/")
541 (synopsis "Android ext4 file system utilities")
542 (description "@code{android-ext4-utils} is a library in common use by the
544 (license license:asl2.0)))
546 (define-public android-f2fs-utils
548 (name "android-f2fs-utils")
549 (version (android-platform-version))
550 (source (android-platform-system-extras version))
551 (build-system android-ndk-build-system)
554 (modify-phases %standard-phases
555 (add-after 'unpack 'enter-source
556 (lambda _ (chdir "f2fs_utils") #t))
557 (add-after 'install 'install-headers
558 (lambda* (#:key inputs outputs #:allow-other-keys)
559 (copy-recursively "." (string-append (assoc-ref outputs "out")
562 (add-after 'install 'install-shell-scripts
563 (lambda* (#:key outputs #:allow-other-keys)
564 (let* ((out (assoc-ref outputs "out"))
565 (bin (string-append out "/bin")))
566 (patch-shebang "mkf2fsuserimg.sh")
567 (substitute* "mkf2fsuserimg.sh"
568 (("make_f2fs") (string-append bin "/make_f2fs")))
569 (install-file "mkf2fsuserimg.sh" bin)
572 `(("f2fs-tools" ,f2fs-tools-1.7)
573 ("android-libselinux" ,android-libselinux)
574 ("android-libsparse" ,android-libsparse)
575 ("android-libcutils" ,android-libcutils)
577 (home-page "https://developer.android.com/")
578 (synopsis "Android f2fs utils")
579 (description "@code{android-f2fs-utils} is a library in common use by the
580 Android core. It allows the user to create images for the @code{f2fs} Flash
582 (license license:asl2.0)))
584 (define-public android-libutils
586 (name "android-libutils")
587 (version (android-platform-version))
588 (source (android-platform-system-core version))
589 (build-system android-ndk-build-system)
592 #:make-flags '("CXXFLAGS=-std=gnu++11 -Wno-error")
594 (modify-phases %standard-phases
595 (add-after 'unpack 'enter-source
596 (lambda _ (chdir "libutils") #t))
598 (add-after 'install 'install-headers
599 (lambda* (#:key inputs outputs #:allow-other-keys)
600 (copy-recursively "../include/utils" (string-append (assoc-ref outputs "out") "/include/utils")))))))
602 `(("android-safe-iop" ,android-safe-iop)
603 ("android-libcutils" ,android-libcutils)))
605 `(("android-bionic-uapi" ,android-bionic-uapi)
606 ("android-liblog" ,android-liblog)))
607 (home-page "https://developer.android.com/")
608 (synopsis "Android utility library")
609 (description "@code{android-libutils} provides utilities for Android NDK developers.")
610 (license license:asl2.0)))
612 (define-public fastboot
615 (version (android-platform-version))
616 (source (android-platform-system-core version))
617 (build-system android-ndk-build-system)
619 `(#:make-flags (list "CXXFLAGS=-std=gnu++11")
621 (modify-phases %standard-phases
622 (add-after 'unpack 'enter-source
626 (add-after 'enter-source 'patch-source
628 (substitute* "Android.mk"
629 (("libext4_utils_host") "libext4_utils_host libselinux libpcre"))
632 (lambda* (#:key outputs #:allow-other-keys)
633 (let* ((out (assoc-ref outputs "out"))
634 (lib (string-append out "/lib"))
635 (bin (string-append out "/bin")))
636 (install-file "fastboot" bin)
640 ("android-safe-iop" ,android-safe-iop)
641 ("android-ext4-utils" ,android-ext4-utils)
642 ("android-f2fs-utils" ,android-f2fs-utils)
643 ("android-libbase" ,android-libbase)
644 ("android-libcutils" ,android-libcutils)
645 ("android-liblog" ,android-liblog)
646 ("android-libutils" ,android-libutils)
647 ("android-libsparse" ,android-libsparse)
648 ("android-libziparchive" ,android-libziparchive)
649 ("android-libselinux" ,android-libselinux)
651 ("mkbootimg" ,mkbootimg)
655 (home-page "https://developer.android.com/studio/command-line/")
656 (synopsis "Android image flasher")
658 "This package provides @command{fastboot}, a tool to upload file system images to Android devices.")
659 (license license:asl2.0)))
661 (define-public android-udev-rules
663 (name "android-udev-rules")
669 (url "https://github.com/M0Rf30/android-udev-rules")
671 (file-name (string-append name "-" version "-checkout"))
673 (base32 "13gj79nnd04szqlrrzzkdr6wi1fky08pi7x8xfbg0jj3d3v0giah"))))
674 (build-system trivial-build-system)
675 (native-inputs `(("source" ,source)))
677 '(#:modules ((guix build utils))
680 (use-modules (guix build utils))
681 (let ((source (assoc-ref %build-inputs "source")))
682 (install-file (string-append source "/51-android.rules")
683 (string-append %output "/lib/udev/rules.d"))
685 (home-page "https://github.com/M0Rf30/android-udev-rules")
686 (synopsis "udev rules for Android devices")
687 (description "Provides a set of udev rules to allow using Android devices
688 with tools such as @command{adb} and @command{fastboot} without root
689 privileges. This package is intended to be added as a rule to the
690 @code{udev-service-type} in your @code{operating-system} configuration.
691 Additionally, an @code{adbusers} group must be defined and your user added to
694 @emph{Simply installing this package will not have any effect.} It is meant
695 to be passed to the @code{udev} service.")
696 (license license:gpl3+)))
698 (define-public git-repo
706 (url "https://gerrit.googlesource.com/git-repo")
707 (commit (string-append "v" version))))
708 (file-name (string-append "git-repo-" version "-checkout"))
710 (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))
711 (build-system python-build-system)
713 `(#:python ,python-2 ; code says: "Python 3 support is … experimental."
715 (modify-phases %standard-phases
716 (add-before 'build 'set-executable-paths
717 (lambda* (#:key inputs outputs #:allow-other-keys)
718 (let* ((out (assoc-ref outputs "out"))
719 (git (assoc-ref inputs "git"))
720 (gpg (assoc-ref inputs "gnupg"))
721 (ssh (assoc-ref inputs "ssh")))
722 (substitute* '("repo" "git_command.py")
724 (string-append "GIT = '" git "/bin/git' ")))
726 ((" cmd = \\['gpg',")
727 (string-append " cmd = ['" gpg "/bin/gpg',")))
728 (substitute* "git_config.py"
729 ((" command_base = \\['ssh',")
730 (string-append " command_base = ['" ssh "/bin/ssh',")))
732 (add-before 'build 'do-not-clone-this-source
733 (lambda* (#:key outputs #:allow-other-keys)
734 (let* ((out (assoc-ref outputs "out"))
735 (repo-dir (string-append out "/share/" ,name)))
737 (("^def _FindRepo\\(\\):.*")
740 '''Look for a repo installation, starting at the current directory.'''
741 # Use the installed version of git-repo.
742 repo_main = '~a/main.py'
745 while curdir != '/' and curdir != olddir:
746 dot_repo = os.path.join(curdir, repodir)
747 if os.path.isdir(dot_repo):
748 return (repo_main, dot_repo)
751 curdir = os.path.dirname(curdir)
754 # The remaining of this function is dead code. It was used to
755 # find a git-checked-out version in the local project.\n" repo-dir))
756 ;; Neither clone, check out, nor verify the git repository
757 (("(^\\s+)_Clone\\(.*\\)") "")
758 (("(^\\s+)_Checkout\\(.*\\)") "")
759 ((" rev = _Verify\\(.*\\)") " rev = None"))
761 (delete 'build) ; nothing to build
764 (invoke "python" "-m" "nose")))
766 (lambda* (#:key outputs #:allow-other-keys)
767 (let* ((out (assoc-ref outputs "out"))
768 (bin-dir (string-append out "/bin"))
769 (repo-dir (string-append out "/share/" ,name)))
772 (copy-recursively "." repo-dir)
773 (delete-file-recursively (string-append repo-dir "/tests"))
774 (symlink (string-append repo-dir "/repo")
775 (string-append bin-dir "/repo"))
778 ;; TODO: Add git-remote-persistent-https once it is available in guix
783 `(("nose" ,python2-nose)))
784 (home-page "https://code.google.com/p/git-repo/")
785 (synopsis "Helps to manage many Git repositories.")
786 (description "Repo is a tool built on top of Git. Repo helps manage many
787 Git repositories, does the uploads to revision control systems, and automates
788 parts of the development workflow. Repo is not meant to replace Git, only to
789 make it easier to work with Git. The repo command is an executable Python
790 script that you can put anywhere in your path.")
791 (license license:asl2.0)))
793 (define-public abootimg
800 (uri (string-append "http://http.debian.net/debian/pool/main/a/abootimg/"
801 "abootimg_" version ".orig.tar.gz"))
803 (base32 "0sfc2k011l1ymv97821w89391gnqdh8pp0haz4sdcm5hx0axv2ba"))))
804 (build-system gnu-build-system)
808 (modify-phases %standard-phases
814 (lambda* (#:key outputs #:allow-other-keys)
815 (let* ((out (assoc-ref outputs "out"))
816 (bin (string-append out "/bin")))
817 (install-file "abootimg" bin)
820 `(("libblkid" ,util-linux)))
821 (home-page "https://ac100.grandou.net/abootimg")
822 (synopsis "Tool for manipulating Android Boot Images")
823 (description "This package provides a tool for manipulating old Android
824 Boot Images. @code{abootimg} can work directly on block devices, or, the
825 safest way, on a file image.")
826 (license license:gpl2+)))
828 (define-public python-androguard
830 (name "python-androguard")
834 ;; The pypi release doesn't have the tests, but the tests use
835 ;; packaged binaries, so we skip them.
837 (uri (pypi-uri "androguard" version))
840 "0ndsw00pkyda4i2s3wi5ap8gbk6a9d23xhhxpdbk02padv8sxkfv"))))
841 (build-system python-build-system)
844 (modify-phases %standard-phases
846 ;; Adapted from .travis.yml
848 (invoke "nosetests" "--with-coverage" "--with-timer"
849 "--timer-top-n" "50"))))))
851 `(("python-codecov" ,python-codecov)
852 ("python-coverage" ,python-coverage)
853 ("python-mock" ,python-mock)
854 ("python-nose" ,python-nose)
855 ("python-nose-timer" ,python-nose-timer)))
857 `(("python-asn1crypto" ,python-asn1crypto)
858 ("python-colorama" ,python-colorama)
859 ("python-future" ,python-future)
860 ("python-ipython" ,python-ipython)
861 ("python-lxml" ,python-lxml)
862 ("python-matplotlib" ,python-matplotlib)
863 ("python-networkx" ,python-networkx)
864 ("python-pygments" ,python-pygments)
865 ("python-pyperclip" ,python-pyperclip)))
866 (home-page "https://github.com/androguard/androguard")
867 (synopsis "Python tool to play with Android files")
869 "Androguard is a full Python tool to manipulate Android files. It is
870 useful for reverse engineering, analysis of Android applications and more.")
871 (license license:asl2.0)))
873 (define-public fdroidserver
875 (name "fdroidserver")
880 (uri (pypi-uri "fdroidserver" version))
883 "0fp7q8faicx6i6wxm717qqaham3jpilb23mvynpz6v73z7hm6wcg"))))
884 (build-system python-build-system)
887 (modify-phases %standard-phases
888 (add-after 'unpack 'fix-versioning
890 (substitute* "setup.py"
891 (("0.2.1") ,(package-version python-pyasn1-modules)))
894 `(("python-androguard" ,python-androguard)
895 ("python-apache-libcloud" ,python-apache-libcloud)
896 ("python-clint" ,python-clint)
897 ("python-defusedxml" ,python-defusedxml)
898 ("python-docker-py" ,python-docker-py)
899 ("python-gitpython" ,python-gitpython)
900 ("python-mwclient" ,python-mwclient)
901 ("python-paramiko" ,python-paramiko)
902 ("python-pillow" ,python-pillow)
903 ("python-pyasn1" ,python-pyasn1)
904 ("python-pyasn1-modules" ,python-pyasn1-modules)
905 ("python-pyyaml" ,python-pyyaml)
906 ("python-qrcode" ,python-qrcode)
907 ("python-ruamel.yaml" ,python-ruamel.yaml)
908 ("python-requests" ,python-requests)
909 ("python-vagrant" ,python-vagrant)))
911 `(("python-babel" ,python-babel)
912 ("python-bcrypt" ,python-bcrypt)
913 ("python-docker-pycreds" ,python-docker-pycreds)
914 ("python-pynacl" ,python-pynacl)
915 ("python-websocket-client" ,python-websocket-client)))
916 (home-page "https://f-droid.org")
917 (synopsis "F-Droid server tools")
919 "The F-Droid server tools provide various scripts and tools that are used
920 to maintain F-Droid, the repository of free Android applications. You can use
921 these same tools to create your own additional or alternative repository for
922 publishing, or to assist in creating, testing and submitting metadata to the
924 (license license:agpl3+)))