Project

General

Profile

GuixBuildSystem » History » Version 7

Denis 'GNUtoo' Carikli, 09/08/2020 01:36 PM
remove duplicated address (the last modification comment also has a typo)

1 1 Denis 'GNUtoo' Carikli
h1. GuixBuildSystem
2
3 3 Denis 'GNUtoo' Carikli
h2. Use cases
4 2 Denis 'GNUtoo' Carikli
5
Guix can be used for faster testing:
6
* It can build software that uses autotools and Android.mk Makefiles
7
* We might be able to use it to iterate over different Android versions, to test libsamsung-ril changes for various RIL API way faster (without even having to use it in a specific Replicant version, use repo, etc).
8
* It's more self contained than the whole Replicant source code
9
10
TODO:
11
* Import the compilation flags for various Replicant versions like -Werror -Wnounused to make sure that everything is usable in all Replicant versions.
12
* Finish packaging libsamsung-ril
13
* Add more automatic testing either in libsamsung-ipc / libsamsung-ril and or in the unofficial Guix packages.
14
15
h2. Implementation
16
17 1 Denis 'GNUtoo' Carikli
Guix currently uses "android-make-stub":https://github.com/daym/android-make-stub.git to build Android software using Android.mk.
18
19
There are some comments in Guix source code that cross compilation isn't supported for the android-ndk build system.
20
21
Practically speaking it means that Guix won't be able to build any BUILD_SHARED_LIBRARY, BUILD_SHARED_LIBRARY or BUILD_STATIC_EXECUTABLE, however building the HOST_* counterpart works fine.
22
23
To workaround that they simply do replace them in the Android.mk during the build procedude:
24
* BUILD_SHARED_LIBRARY becomes BUILD_HOST_SHARED_LIBRARY
25
* BUILD_SHARED_LIBRARY becomes BUILD_HOST_STATIC_LIBRARY
26
* BUILD_STATIC_EXECUTABLE becomes BUILD_HOST_STATIC_EXECUTABLE
27
28
For instance we have:
29
<pre>
30
   (arguments
31
    `(#:phases
32
      (modify-phases %standard-phases
33
		     (delete 'bootstrap)
34
		     (add-before 'build 'patch-host
35
				 (lambda _
36
				   ;; TODO: Cross-compile.
37
				   (substitute* "Android.mk"
38
						(("BUILD_SHARED_LIBRARY") "BUILD_HOST_SHARED_LIBRARY")
39
						;; (("BUILD_STATIC_LIBRARY") "BUILD_HOST_STATIC_LIBRARY")
40
						;; (("BUILD_STATIC_EXECUTABLE") "BUILD_HOST_STATIC_EXECUTABLE")
41
						)
42
				   #t))
43
		     )))
44
</pre>
45
46
Here the (delete 'bootstrap) is because the build is done in several phases, and here the bootstrap phase wasn't overriden by the android-ndk build system yet. As a result it tried to run autogen.sh. That might be because in libsamsung-ipc there is both an android build system and an autotools based one.
47
48
h2. Example
49
50 5 Denis 'GNUtoo' Carikli
* There is some work in progress to package libsamsung-ril for faster testing: https://git.replicant.us/contrib/GNUtoo/guix/tree/gnu/packages/replicant.scm?h=libsamsung-ril
51 6 Denis 'GNUtoo' Carikli
52
h2. Additional work
53
54
There is some work in progress by Julien Lepiller / roptat to package more Android components (including build systems like blueprint / soong) in this  "android-build.scm":https://framagit.org/tyreunom/guix-android/-/blob/master/android/packages/android-build.scm .