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>
11 ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages android)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system android-ndk)
34 #:use-module (guix build-system python)
35 #:use-module (guix build-system trivial)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages check)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages docker)
41 #:use-module (gnu packages gnupg)
42 #:use-module (gnu packages linux)
43 #:use-module (gnu packages pcre)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages python-crypto)
46 #:use-module (gnu packages python-web)
47 #:use-module (gnu packages python-xyz)
48 #:use-module (gnu packages selinux)
49 #:use-module (gnu packages serialization)
50 #:use-module (gnu packages ssh)
51 #:use-module (gnu packages tls)
52 #:use-module (gnu packages version-control)
53 #:use-module (gnu packages virtualization)
54 #:use-module (gnu packages xdisorg)
55 #:use-module (gnu packages xml))
57 (define-public android-make-stub
59 (name "android-make-stub")
65 (url "https://github.com/daym/android-make-stub.git")
66 (commit (string-append "v" version))))
67 (file-name (string-append "android-make-stub-"
71 "0y1b2x96d37n6f1bp6dcx08bn08zac0cylmbfsx6mf2nahc02fhc"))))
72 (build-system gnu-build-system)
74 `(#:tests? #f ; None exist.
76 (modify-phases %standard-phases
80 (lambda* (#:key outputs #:allow-other-keys)
81 (let* ((out (assoc-ref outputs "out")))
82 (invoke "make" (string-append "prefix=" out) "install")
84 (home-page "https://github.com/daym/android-make-stub")
85 (synopsis "Stubs for the @command{make} system of the Android platform")
86 (description "@code{android-make-stub} provides stubs for the
87 @command{make} system of the Android platform. This allows us to
88 use their packages mostly unmodified in our Android NDK build system.")
89 (license license:asl2.0)))
91 (define-public android-googletest
92 (package (inherit googletest)
93 (name "android-googletest")
99 (url "https://github.com/google/googletest.git")
100 (commit (string-append "release-" version))))
101 (file-name (git-file-name name version))
104 "0bjlljmbf8glnd9qjabx73w6pd7ibv43yiyngqvmvgxsabzr8399"))))
106 `(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")
108 (modify-phases %standard-phases
109 (add-after 'install 'install-host-libraries
110 (lambda* (#:key outputs #:allow-other-keys)
111 (let* ((out (assoc-ref outputs "out"))
112 (lib (string-append out "/lib")))
113 (symlink "libgtest.so"
114 (string-append lib "/libgtest_host.so"))
115 (symlink "libgmock.so"
116 (string-append lib "/libgmock_host.so"))
119 ;; The Makefiles that we add are largely based on the Debian
120 ;; packages. They are licensed under GPL-2 and have copyright:
121 ;; 2012, Stefan Handschuh <handschuh.stefan@googlemail.com>
122 ;; 2015, Kai-Chung Yan <seamlikok@gmail.com>
123 ;; Big thanks to them for laying the groundwork.
125 ;; The version tag is consistent between all repositories.
126 (define (android-platform-version) "7.1.2_r36")
128 (define (android-platform-system-core version)
132 (url "https://android.googlesource.com/platform/system/core")
133 (commit (string-append "android-" version))))
134 (file-name (string-append "android-platform-system-core-"
135 version "-checkout"))
138 "1krnc2b9zfkzpdgs1dcbji59nszlx2qr723pg89m52622czc06hg"))
140 (search-patches "libbase-use-own-logging.patch"
141 "libbase-fix-includes.patch"
142 "libutils-remove-damaging-includes.patch"
143 "libutils-add-includes.patch"
144 "adb-add-libraries.patch"
145 "libziparchive-add-includes.patch"))))
147 (define (android-platform-system-extras version)
151 (url "https://android.googlesource.com/platform/system/extras")
152 (commit (string-append "android-" version))))
153 (file-name (string-append "android-platform-system-extras-"
154 version "-checkout"))
157 "18130c23ybqcpgjc5v6f8kdbv2xn39hyiaj17dzldjb9rlwzcyy9"))))
159 (define (android-platform-bionic version)
163 (url "https://android.googlesource.com/platform/bionic")
164 (commit (string-append "android-" version))))
165 (file-name (string-append "android-platform-bionic-"
166 version "-checkout"))
169 "15r4s20d7vw022f8vrc3jbghmqwdcqzprl7i2bfvdkz8z76wc1ps"))))
171 (define (android-platform-external version subdirectory checksum)
176 (string-append "https://android.googlesource.com/platform/external/"
178 (commit (string-append "android-" version))))
179 (file-name (string-append "android-platform-system-external-" subdirectory "-"
180 version "-checkout"))
185 (define android-liblog
187 (name "android-liblog")
188 (version (android-platform-version))
189 (source (android-platform-system-core version))
190 (build-system android-ndk-build-system)
192 `(#:make-flags '("LDLIBS=-lpthread")
194 (modify-phases %standard-phases
195 (add-after 'unpack 'enter-source
196 (lambda _ (chdir "liblog") #t))
197 (add-after 'install 'ldconfig
198 (lambda* (#:key outputs #:allow-other-keys)
199 (let ((out (assoc-ref outputs "out")))
200 (symlink "liblog.so.0" (string-append out "/lib/liblog.so"))
202 (home-page "https://developer.android.com/")
203 (synopsis "Logging library from the Android platform.")
204 (description "@code{liblog} represents an interface to the volatile Android
205 Logging system for NDK (Native) applications and libraries and contain
206 interfaces for either writing or reading logs. The log buffers are divided up
207 in Main, System, Radio and Events sub-logs.")
208 (license license:asl2.0)))
210 (define android-libbase
212 (name "android-libbase")
213 (version (android-platform-version))
214 (source (android-platform-system-core version))
215 (build-system android-ndk-build-system)
217 `(#:tests? #f ; Test failure: logging.UNIMPLEMENTED
218 #:make-flags '("CXXFLAGS=-std=gnu++11")
220 (modify-phases %standard-phases
221 (add-after 'unpack 'enter-source
222 (lambda _ (chdir "base") #t)))))
223 (inputs `(("android-liblog" ,android-liblog)))
224 (home-page "https://developer.android.com/")
225 (synopsis "Android platform base library")
226 (description "@code{libbase} is a library in common use by the
227 various Android core host applications.")
228 (license license:asl2.0)))
230 (define android-libcutils
232 (name "android-libcutils")
233 (version (android-platform-version))
234 (source (android-platform-system-core version))
235 (build-system gnu-build-system)
237 `(#:tests? #f ; TODO.
239 (modify-phases %standard-phases
240 (add-after 'unpack 'enter-source
241 (lambda _ (chdir "libcutils") #t))
242 (add-after 'enter-source 'create-Makefile
244 ;; No useful makefile is shipped, so we create one.
245 (with-output-to-file "Makefile"
250 "SOURCES = load_file.o socket_local_client_unix.o"
251 " socket_loopback_client_unix.o socket_network_client_unix.o"
252 " socket_loopback_server_unix.o socket_local_server_unix.o"
253 " sockets_unix.o socket_inaddr_any_server_unix.o"
258 "CXXFLAGS += -std=gnu++11 -fPIC\n"
259 "CPPFLAGS += -Iinclude -I../include\n"
260 "LDFLAGS += -shared -Wl,-soname,$(NAME).so.0\n"
262 "build: $(SOURCES)\n"
263 " $(CXX) $^ -o $(NAME).so.0 $(CXXFLAGS) $(CPPFLAGS)"
268 (lambda* (#:key outputs #:allow-other-keys)
269 (let* ((out (assoc-ref outputs "out"))
270 (lib (string-append out "/lib"))
271 (include (string-append out "/include")))
272 (install-file "libcutils.so.0" lib)
273 (with-directory-excursion lib
274 (symlink "libcutils.so.0" "libcutils.so"))
275 (copy-recursively "../include/cutils"
276 (string-append include "/cutils"))
278 (home-page "https://developer.android.com/")
279 (synopsis "Android platform c utils library")
280 (description "@code{libcutils} is a library in common use by the
281 various Android core host applications.")
282 (license license:asl2.0)))
284 (define-public android-libsparse
286 (name "android-libsparse")
287 (version (android-platform-version))
288 (source (android-platform-system-core version))
289 (build-system android-ndk-build-system)
291 `(#:make-flags '("CFLAGS=-Wno-error"
292 "CXXFLAGS=-fpermissive -Wno-error")
294 (modify-phases %standard-phases
295 (add-after 'unpack 'enter-source
296 (lambda _ (chdir "libsparse") #t)))))
299 (home-page "https://developer.android.com/")
300 (synopsis "Android platform sparse library")
301 (description "@code{android-libsparse} is a library in common use by the
302 various Android core host applications.")
303 (license license:asl2.0)))
305 (define-public android-libziparchive
307 (name "android-libziparchive")
308 (version (android-platform-version))
309 (source (android-platform-system-core version))
310 (build-system android-ndk-build-system)
312 `(#:make-flags '("CFLAGS=-Wno-error"
313 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++11")
315 (modify-phases %standard-phases
316 (add-after 'unpack 'enter-source
317 (lambda _ (chdir "libziparchive") #t))
318 (add-before 'check 'setenv
320 (setenv "ziparchive_tests_host_PARAMS" "--test_data_dir=testdata")
322 (add-after 'install 'install-headers
323 (lambda* (#:key inputs outputs #:allow-other-keys)
324 (let ((out (assoc-ref outputs "out")))
325 (copy-recursively "../include/ziparchive"
326 (string-append out "/include/ziparchive"))
331 `(("android-libbase" ,android-libbase)
332 ("android-libutils" ,android-libutils)
333 ("android-liblog" ,android-liblog)))
334 (home-page "https://developer.android.com/")
335 (synopsis "Android platform ZIP library")
336 (description "@code{android-libziparchive} is a library in common use by the
337 various Android core host applications.")
338 (license license:asl2.0)))
343 (version (android-platform-version))
344 (source (android-platform-system-core version))
345 (build-system android-ndk-build-system)
347 `(#:tests? #f ; Test failure: sysdeps_poll.fd_count
349 (list "CFLAGS=-Wno-error"
350 "CXXFLAGS=-fpermissive -Wno-error -std=gnu++14 -D_Nonnull= -D_Nullable= -I ."
351 (string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") "/lib "
352 "-Wl,-rpath=" (assoc-ref %build-inputs "openssl") "/lib -L ."))
354 (modify-phases %standard-phases
355 (add-after 'unpack 'enter-source
356 (lambda _ (chdir "adb") #t))
357 (add-after 'enter-source 'glibc-compat
359 ;; Include sysmacros.h for "major" and "minor" in Glibc 2.28.
360 (substitute* "usb_linux.cpp"
361 (("#include <sys/types.h>" all)
362 (string-append all "\n#include <sys/sysmacros.h>\n")))
364 (add-after 'enter-source 'make-libs-available
365 (lambda* (#:key inputs outputs #:allow-other-keys)
366 (substitute* "Android.mk"
367 (("libcrypto_static") "libcrypto"))
369 (add-after 'install 'install-headers
370 (lambda* (#:key inputs outputs #:allow-other-keys)
371 (install-file "diagnose_usb.h" (string-append (assoc-ref outputs "out") "/include"))
374 `(("android-libbase" ,android-libbase)
375 ("android-libcutils" ,android-libcutils)
376 ("android-liblog" ,android-liblog)
377 ("openssl" ,openssl-1.0)))
378 (home-page "https://developer.android.com/studio/command-line/adb.html")
379 (synopsis "Android Debug Bridge")
381 "@command{adb} is a versatile command line tool that lets you communicate
382 with an emulator instance or connected Android device. It facilitates a variety
383 of device actions, such as installing and debugging apps, and it provides access
384 to a Unix shell that can run commands on the connected device or emulator.")
385 (license license:asl2.0)))
387 (define-public mkbootimg
390 (version (android-platform-version))
392 (inherit (android-platform-system-core version))))
393 (build-system python-build-system)
397 (modify-phases %standard-phases
398 (add-after 'unpack 'enter-source
399 (lambda _ (chdir "mkbootimg") #t))
403 (lambda* (#:key outputs #:allow-other-keys)
404 (let* ((out (assoc-ref outputs "out"))
405 (bin (string-append out "/bin"))
406 (include (string-append out "/include")))
407 (install-file "mkbootimg" bin)
408 (install-file "bootimg.h" include)
410 (home-page "https://developer.android.com/studio/command-line/adb.html")
411 (synopsis "Tool to create Android boot images")
412 (description "This package provides a tool to create Android Boot
414 (license license:asl2.0)))
416 (define-public android-safe-iop
418 (name "android-safe-iop")
419 (version (android-platform-version))
420 (source (android-platform-external version "safe-iop"
421 "1nyyrs463advjhlq8xx1lm37m4g5afv7gy0csxrj7biwwl0v13qw"))
422 (build-system android-ndk-build-system)
424 `(#:make-flags '("CXXFLAGS=-fpermissive -Wno-error")
426 (modify-phases %standard-phases
427 (add-before 'build 'patch-host
429 ;; TODO: Cross-compile.
430 (substitute* "Android.mk"
431 (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY"))
433 (home-page "https://developer.android.com/")
434 (synopsis "Safe integers in C")
435 (description "@code{android-safe-iop} provides a set of functions for
436 performing and checking safe integer operations. Ensure that integer
437 operations do not result in silent overflow.")
438 (license license:bsd-2)))
440 (define-public android-bionic-uapi
442 (name "android-bionic-uapi")
443 (version (android-platform-version))
444 (source (android-platform-bionic version))
445 (build-system android-ndk-build-system)
448 (modify-phases %standard-phases
449 (add-after 'unpack 'enter-source
450 (lambda _ (chdir "libc") #t))
456 (lambda* (#:key outputs #:allow-other-keys)
457 (let* ((out (assoc-ref outputs "out"))
458 (out-sys (string-append out "/include/sys")))
460 (install-file "include/sys/system_properties.h" out-sys)
461 (install-file "include/sys/_system_properties.h" out-sys)
462 (copy-recursively "kernel/uapi" (string-append out "/include"))
464 (home-page "https://developer.android.com/")
465 (synopsis "Android Linux API that is safe for user space")
466 (description "@code{android-bionic-uapi} provides the part of the Linux API
467 that is safe to use for user space. It also includes
468 @code{system_properties.h} and @code{_system_properties.h}.")
469 (license license:asl2.0)))
471 (define-public android-libselinux
473 (name "android-libselinux")
474 (version (android-platform-version))
476 (android-platform-external version "libselinux"
477 "13m2q32gzdcs5d0zj1nwasjy1j8vsxsgbjg7m5sa9lfcjaj7nkm7"))
478 (build-system android-ndk-build-system)
480 ;; See logd/Android.mk for the *_LOG_TAG values.
481 `(#:make-flags (list (string-append "CFLAGS=-Wno-error "
483 "-I core/libpackagelistparser/include "
484 "-DAUDITD_LOG_TAG=1003 "
485 "-DLOGD_LOG_TAG=1004 -D_GNU_SOURCE")
486 "LDFLAGS=-L . -lpcre")
488 (modify-phases %standard-phases
489 (add-after 'unpack-core 'patch-HOST
491 ;; gettid duplicates otherwise.
492 (substitute* "src/procattr.c"
493 (("#ifdef HOST") "#ifdef XXX"))
496 `(("openssl" ,openssl)))
498 `(("android-bionic-uapi" ,android-bionic-uapi)
499 ;; pcre is inlined by our package.
501 (home-page "https://developer.android.com/")
502 (synopsis (package-synopsis libselinux))
503 (description (package-description libselinux))
504 (license (package-license libselinux))))
506 (define-public android-ext4-utils
508 (name "android-ext4-utils")
509 (version (android-platform-version))
510 (source (android-platform-system-extras version))
511 (build-system android-ndk-build-system)
514 (list (string-append "CPPFLAGS="
517 (assoc-ref %build-inputs "android-libselinux")
519 "-I " (assoc-ref %build-inputs "android-libsparse")
521 "-I " (assoc-ref %build-inputs "android-libcutils")
523 "-I " (assoc-ref %build-inputs "android-liblog") "/include "
524 "-I ../core/include")
526 "install-libext4_utils_host.a"
527 (string-append "prefix=" (assoc-ref %outputs "out")))
529 (modify-phases %standard-phases
530 (add-after 'unpack 'unpack-core
531 (lambda* (#:key inputs #:allow-other-keys)
533 (with-directory-excursion "core"
534 (invoke "tar" "axf" (assoc-ref inputs "android-core")
535 "--strip-components=1"))
537 (add-after 'unpack-core 'enter-source
538 (lambda _ (chdir "ext4_utils") #t))
540 (lambda* (#:key inputs outputs #:allow-other-keys)
541 (let ((out (assoc-ref outputs "out")))
542 (copy-recursively "." (string-append out "/include")))
545 `(("android-libcutils" ,android-libcutils)
546 ("android-liblog" ,android-liblog)
547 ("android-libselinux" ,android-libselinux)
548 ("android-libsparse" ,android-libsparse)
551 `(("android-core" ,(android-platform-system-core version))))
552 (home-page "https://developer.android.com/")
553 (synopsis "Android ext4 file system utilities")
554 (description "@code{android-ext4-utils} is a library in common use by the
556 (license license:asl2.0)))
558 (define-public android-f2fs-utils
560 (name "android-f2fs-utils")
561 (version (android-platform-version))
562 (source (android-platform-system-extras version))
563 (build-system android-ndk-build-system)
566 (modify-phases %standard-phases
567 (add-after 'unpack 'enter-source
568 (lambda _ (chdir "f2fs_utils") #t))
569 (add-after 'install 'install-headers
570 (lambda* (#:key inputs outputs #:allow-other-keys)
571 (copy-recursively "." (string-append (assoc-ref outputs "out")
574 (add-after 'install 'install-shell-scripts
575 (lambda* (#:key outputs #:allow-other-keys)
576 (let* ((out (assoc-ref outputs "out"))
577 (bin (string-append out "/bin")))
578 (patch-shebang "mkf2fsuserimg.sh")
579 (substitute* "mkf2fsuserimg.sh"
580 (("make_f2fs") (string-append bin "/make_f2fs")))
581 (install-file "mkf2fsuserimg.sh" bin)
584 `(("f2fs-tools" ,f2fs-tools-1.7)
585 ("android-libselinux" ,android-libselinux)
586 ("android-libsparse" ,android-libsparse)
587 ("android-libcutils" ,android-libcutils)
589 (home-page "https://developer.android.com/")
590 (synopsis "Android f2fs utils")
591 (description "@code{android-f2fs-utils} is a library in common use by the
592 Android core. It allows the user to create images for the @code{f2fs} Flash
594 (license license:asl2.0)))
596 (define-public android-libutils
598 (name "android-libutils")
599 (version (android-platform-version))
600 (source (android-platform-system-core version))
601 (build-system android-ndk-build-system)
604 #:make-flags '("CXXFLAGS=-std=gnu++11 -Wno-error")
606 (modify-phases %standard-phases
607 (add-after 'unpack 'enter-source
608 (lambda _ (chdir "libutils") #t))
610 (add-after 'install 'install-headers
611 (lambda* (#:key inputs outputs #:allow-other-keys)
612 (copy-recursively "../include/utils" (string-append (assoc-ref outputs "out") "/include/utils")))))))
614 `(("android-safe-iop" ,android-safe-iop)
615 ("android-libcutils" ,android-libcutils)))
617 `(("android-bionic-uapi" ,android-bionic-uapi)
618 ("android-liblog" ,android-liblog)))
619 (home-page "https://developer.android.com/")
620 (synopsis "Android utility library")
621 (description "@code{android-libutils} provides utilities for Android NDK developers.")
622 (license license:asl2.0)))
624 (define-public fastboot
627 (version (android-platform-version))
628 (source (android-platform-system-core version))
629 (build-system android-ndk-build-system)
631 `(#:make-flags (list "CXXFLAGS=-std=gnu++11")
633 (modify-phases %standard-phases
634 (add-after 'unpack 'enter-source
638 (add-after 'enter-source 'patch-source
640 (substitute* "Android.mk"
641 (("libext4_utils_host") "libext4_utils_host libselinux libpcre"))
644 (lambda* (#:key outputs #:allow-other-keys)
645 (let* ((out (assoc-ref outputs "out"))
646 (lib (string-append out "/lib"))
647 (bin (string-append out "/bin")))
648 (install-file "fastboot" bin)
652 ("android-safe-iop" ,android-safe-iop)
653 ("android-ext4-utils" ,android-ext4-utils)
654 ("android-f2fs-utils" ,android-f2fs-utils)
655 ("android-libbase" ,android-libbase)
656 ("android-libcutils" ,android-libcutils)
657 ("android-liblog" ,android-liblog)
658 ("android-libutils" ,android-libutils)
659 ("android-libsparse" ,android-libsparse)
660 ("android-libziparchive" ,android-libziparchive)
661 ("android-libselinux" ,android-libselinux)
663 ("mkbootimg" ,mkbootimg)
667 (home-page "https://developer.android.com/studio/command-line/")
668 (synopsis "Android image flasher")
670 "This package provides @command{fastboot}, a tool to upload file system images to Android devices.")
671 (license license:asl2.0)))
673 (define-public android-udev-rules
675 (name "android-udev-rules")
681 (url "https://github.com/M0Rf30/android-udev-rules")
683 (file-name (string-append name "-" version "-checkout"))
685 (base32 "13gj79nnd04szqlrrzzkdr6wi1fky08pi7x8xfbg0jj3d3v0giah"))))
686 (build-system trivial-build-system)
687 (native-inputs `(("source" ,source)))
689 '(#:modules ((guix build utils))
692 (use-modules (guix build utils))
693 (let ((source (assoc-ref %build-inputs "source")))
694 (install-file (string-append source "/51-android.rules")
695 (string-append %output "/lib/udev/rules.d"))
697 (home-page "https://github.com/M0Rf30/android-udev-rules")
698 (synopsis "udev rules for Android devices")
699 (description "Provides a set of udev rules to allow using Android devices
700 with tools such as @command{adb} and @command{fastboot} without root
701 privileges. This package is intended to be added as a rule to the
702 @code{udev-service-type} in your @code{operating-system} configuration.
703 Additionally, an @code{adbusers} group must be defined and your user added to
706 @emph{Simply installing this package will not have any effect.} It is meant
707 to be passed to the @code{udev} service.")
708 (license license:gpl3+)))
710 (define-public git-repo
718 (url "https://gerrit.googlesource.com/git-repo")
719 (commit (string-append "v" version))))
720 (file-name (string-append "git-repo-" version "-checkout"))
722 (base32 "0qp7jqhblv7xblfgpcq4n18dyjdv8shz7r60c3vnjxx2fngkj2jd"))))
723 (build-system python-build-system)
725 `(#:python ,python-2 ; code says: "Python 3 support is … experimental."
727 (modify-phases %standard-phases
728 (add-before 'build 'set-executable-paths
729 (lambda* (#:key inputs outputs #:allow-other-keys)
730 (let* ((out (assoc-ref outputs "out"))
731 (git (assoc-ref inputs "git"))
732 (gpg (assoc-ref inputs "gnupg"))
733 (ssh (assoc-ref inputs "ssh")))
734 (substitute* '("repo" "git_command.py")
736 (string-append "GIT = '" git "/bin/git' ")))
738 ((" cmd = \\['gpg',")
739 (string-append " cmd = ['" gpg "/bin/gpg',")))
740 (substitute* "git_config.py"
741 ((" command_base = \\['ssh',")
742 (string-append " command_base = ['" ssh "/bin/ssh',")))
744 (add-before 'build 'do-not-clone-this-source
745 (lambda* (#:key outputs #:allow-other-keys)
746 (let* ((out (assoc-ref outputs "out"))
747 (repo-dir (string-append out "/share/" ,name)))
749 (("^def _FindRepo\\(\\):.*")
752 '''Look for a repo installation, starting at the current directory.'''
753 # Use the installed version of git-repo.
754 repo_main = '~a/main.py'
757 while curdir != '/' and curdir != olddir:
758 dot_repo = os.path.join(curdir, repodir)
759 if os.path.isdir(dot_repo):
760 return (repo_main, dot_repo)
763 curdir = os.path.dirname(curdir)
766 # The remaining of this function is dead code. It was used to
767 # find a git-checked-out version in the local project.\n" repo-dir))
768 ;; Neither clone, check out, nor verify the git repository
769 (("(^\\s+)_Clone\\(.*\\)") "")
770 (("(^\\s+)_Checkout\\(.*\\)") "")
771 ((" rev = _Verify\\(.*\\)") " rev = None"))
773 (delete 'build) ; nothing to build
776 (invoke "python" "-m" "nose")))
778 (lambda* (#:key outputs #:allow-other-keys)
779 (let* ((out (assoc-ref outputs "out"))
780 (bin-dir (string-append out "/bin"))
781 (repo-dir (string-append out "/share/" ,name)))
784 (copy-recursively "." repo-dir)
785 (delete-file-recursively (string-append repo-dir "/tests"))
786 (symlink (string-append repo-dir "/repo")
787 (string-append bin-dir "/repo"))
790 ;; TODO: Add git-remote-persistent-https once it is available in guix
795 `(("nose" ,python2-nose)))
796 (home-page "https://code.google.com/p/git-repo/")
797 (synopsis "Helps to manage many Git repositories.")
798 (description "Repo is a tool built on top of Git. Repo helps manage many
799 Git repositories, does the uploads to revision control systems, and automates
800 parts of the development workflow. Repo is not meant to replace Git, only to
801 make it easier to work with Git. The repo command is an executable Python
802 script that you can put anywhere in your path.")
803 (license license:asl2.0)))
805 (define-public abootimg
812 (uri (string-append "http://http.debian.net/debian/pool/main/a/abootimg/"
813 "abootimg_" version ".orig.tar.gz"))
815 (base32 "0sfc2k011l1ymv97821w89391gnqdh8pp0haz4sdcm5hx0axv2ba"))))
816 (build-system gnu-build-system)
820 (modify-phases %standard-phases
826 (lambda* (#:key outputs #:allow-other-keys)
827 (let* ((out (assoc-ref outputs "out"))
828 (bin (string-append out "/bin")))
829 (install-file "abootimg" bin)
832 `(("libblkid" ,util-linux)))
833 (home-page "https://ac100.grandou.net/abootimg")
834 (synopsis "Tool for manipulating Android Boot Images")
835 (description "This package provides a tool for manipulating old Android
836 Boot Images. @code{abootimg} can work directly on block devices, or, the
837 safest way, on a file image.")
838 (license license:gpl2+)))
840 (define-public python-androguard
842 (name "python-androguard")
846 ;; The pypi release doesn't have the tests, but the tests use
847 ;; packaged binaries, so we skip them.
849 (uri (pypi-uri "androguard" version))
852 "0ndsw00pkyda4i2s3wi5ap8gbk6a9d23xhhxpdbk02padv8sxkfv"))))
853 (build-system python-build-system)
856 (modify-phases %standard-phases
858 ;; Adapted from .travis.yml
860 (invoke "nosetests" "--with-coverage" "--with-timer"
861 "--timer-top-n" "50"))))))
863 `(("python-codecov" ,python-codecov)
864 ("python-coverage" ,python-coverage)
865 ("python-mock" ,python-mock)
866 ("python-nose" ,python-nose)
867 ("python-nose-timer" ,python-nose-timer)))
869 `(("python-asn1crypto" ,python-asn1crypto)
870 ("python-colorama" ,python-colorama)
871 ("python-future" ,python-future)
872 ("python-ipython" ,python-ipython)
873 ("python-lxml" ,python-lxml)
874 ("python-matplotlib" ,python-matplotlib)
875 ("python-networkx" ,python-networkx)
876 ("python-pygments" ,python-pygments)
877 ("python-pyperclip" ,python-pyperclip)))
878 (home-page "https://github.com/androguard/androguard")
879 (synopsis "Python tool to play with Android files")
881 "Androguard is a full Python tool to manipulate Android files. It is
882 useful for reverse engineering, analysis of Android applications and more.")
883 (license license:asl2.0)))
885 (define-public fdroidserver
887 (name "fdroidserver")
892 (uri (pypi-uri "fdroidserver" version))
895 "0fp7q8faicx6i6wxm717qqaham3jpilb23mvynpz6v73z7hm6wcg"))))
896 (build-system python-build-system)
899 (modify-phases %standard-phases
900 (add-after 'unpack 'fix-versioning
902 (substitute* "setup.py"
903 (("0.2.1") ,(package-version python-pyasn1-modules)))
906 `(("python-androguard" ,python-androguard)
907 ("python-apache-libcloud" ,python-apache-libcloud)
908 ("python-clint" ,python-clint)
909 ("python-defusedxml" ,python-defusedxml)
910 ("python-docker-py" ,python-docker-py)
911 ("python-gitpython" ,python-gitpython)
912 ("python-mwclient" ,python-mwclient)
913 ("python-paramiko" ,python-paramiko)
914 ("python-pillow" ,python-pillow)
915 ("python-pyasn1" ,python-pyasn1)
916 ("python-pyasn1-modules" ,python-pyasn1-modules)
917 ("python-pyyaml" ,python-pyyaml)
918 ("python-qrcode" ,python-qrcode)
919 ("python-ruamel.yaml" ,python-ruamel.yaml)
920 ("python-requests" ,python-requests)
921 ("python-vagrant" ,python-vagrant)))
923 `(("python-babel" ,python-babel)
924 ("python-bcrypt" ,python-bcrypt)
925 ("python-docker-pycreds" ,python-docker-pycreds)
926 ("python-pynacl" ,python-pynacl)
927 ("python-websocket-client" ,python-websocket-client)))
928 (home-page "https://f-droid.org")
929 (synopsis "F-Droid server tools")
931 "The F-Droid server tools provide various scripts and tools that are used
932 to maintain F-Droid, the repository of free Android applications. You can use
933 these same tools to create your own additional or alternative repository for
934 publishing, or to assist in creating, testing and submitting metadata to the
936 (license license:agpl3+)))