Export android-platform-system-core

  • Done
  • quality assurance status badge
Details
3 participants
  • Denis 'GNUtoo' Carikli
  • Julien Lepiller
  • Mathieu Othacehe
Owner
unassigned
Submitted by
Denis 'GNUtoo' Carikli
Severity
normal
D
D
Denis 'GNUtoo' Carikli wrote on 7 Aug 2020 02:44
(address . guix-patches@gnu.org)
20200807024423.1638d242@primarylaptop.localdomain
Hi,

Here are two patches to export android-platform-system-core.

This way it can be used as a dependency like that:
Toggle quote (4 lines)
> (native-inputs
> `(("android-core" ,(android-platform-system-core
> (android-platform-version)))))

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAl8so+gACgkQX138wUF3
4mN1KA/+NoyiqSWdzxoRs8lJ5nPpxL+Gg79a9TT86gWdUPc1QkOA69cZWsHw9EVh
LD07qG+geQxq3LecXB8dv/mNdttDA386EOJjyqTzttR54KwpPnfyhEiv347ktBQ3
5236G+IUCuemC2z2iXLBNCI0kVaW3PU8VtFLouHy5QdGvYcIanaiLpQTH3odriTg
35ua09+m40OZH1RyCoNo1QoIzwVLLNcRHM86tUYg5fvwyEymDk2J6AQZbsrVBF3J
vbptfc330ilpw5nqSI9M5RmXAPVZ8kw6YTDsLglh0HcRQSeXJPBW3oI4eAF61heB
Uarjc/tKBuscoqg91VInBIDtMhKR8gbdAIqQKuJXacDoxYe8QyqW3aWlt5GlQ7BW
CQ3tJXdaunrLDnI8G6Vajsjww0t6MgzgW7NMYzeTepzVPFCERpohgnlHwgt8nlNz
jXqtcZaO/i3pclvNeQB4onWLCsdDsY3D5KmQqXZNlqWuCQh5s0uNrP0Rx7hF5ASv
UZnnpLNzEEZQh4x5T9i/jrA1BjKKRxZvgldxeZrfSNlKozkSvqs1qQRXZKfCaP5z
vR9FWEAMYEYhHdPfmgSVjBwd1yOvorSW7uTrc9CDsoyYNLVOND9P5P414t6oHkSi
eO/hHUlqLhm2zobQIDnWLMYP5vGuDyAthV/tR3a5QBRegnE4rkk=
=jR3f
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 7 Aug 2020 04:10
[PATCH 1/2] gnu: android: Export android-platform-version.
(address . 42734@debbugs.gnu.org)
20200807021027.21817-1-GNUtoo@cyberdimension.org
* gnu/packages/android.scm (android-platform-version): Export it.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
gnu/packages/android.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index f7f3aca4a2..8a094d0827 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -126,7 +126,7 @@ use their packages mostly unmodified in our Android NDK build system.")
;; Big thanks to them for laying the groundwork.
;; The version tag is consistent between all repositories.
-(define (android-platform-version) "7.1.2_r36")
+(define-public (android-platform-version) "7.1.2_r36")
(define (android-platform-system-core version)
(origin
--
2.28.0
D
D
Denis 'GNUtoo' Carikli wrote on 7 Aug 2020 04:10
[PATCH 2/2] gnu: android: Export android-platform-system-core.
(address . 42734@debbugs.gnu.org)
20200807021027.21817-2-GNUtoo@cyberdimension.org
* gnu/packages/android.scm (android-platform-system-core): Export it.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
gnu/packages/android.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index 8a094d0827..544a65d0af 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -128,7 +128,7 @@ use their packages mostly unmodified in our Android NDK build system.")
;; The version tag is consistent between all repositories.
(define-public (android-platform-version) "7.1.2_r36")
-(define (android-platform-system-core version)
+(define-public (android-platform-system-core version)
(origin
(method git-fetch)
(uri (git-reference
--
2.28.0
M
M
Mathieu Othacehe wrote on 7 Aug 2020 10:24
Re: [bug#42734] [PATCH 1/2] gnu: android: Export android-platform-version.
(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)(address . 42734-done@debbugs.gnu.org)
87y2mqoocd.fsf@gnu.org
Hello Denis,

Toggle quote (4 lines)
> ;; The version tag is consistent between all repositories.
> -(define (android-platform-version) "7.1.2_r36")
> +(define-public (android-platform-version) "7.1.2_r36")

We could turn this procedure into a variable.

Anyway, pushed those two patches,

Thanks,

Mathieu
Closed
J
J
Julien Lepiller wrote on 7 Aug 2020 13:33
Re: [bug#42734] Export android-platform-system-core
13A86DDA-5411-495A-B6AC-042A9F932065@lepiller.eu
Unfortunately, android-platform-core should first be fixed to accept a hash as an argument, otherwise any other version will fail. Don't know why we haven't done that before…

On 2020?8?6? 20:44:23 GMT-04:00, Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:
Toggle quote (10 lines)
>Hi,
>
>Here are two patches to export android-platform-system-core.
>
>This way it can be used as a dependency like that:
>> (native-inputs
>> `(("android-core" ,(android-platform-system-core
>> (android-platform-version)))))
>
>Denis.
Attachment: file
D
D
Denis 'GNUtoo' Carikli wrote on 10 Aug 2020 05:19
(name . Julien Lepiller)(address . julien@lepiller.eu)
20200810051949.737d799e@primarylaptop.localdomain
On Fri, 07 Aug 2020 07:33:03 -0400
Julien Lepiller <julien@lepiller.eu> wrote:

Toggle quote (4 lines)
> Unfortunately, android-platform-core should first be fixed to accept
> a hash as an argument, otherwise any other version will fail. Don't
> know why we haven't done that before…

I don't understand what the hash would be here, nor the consequences
you describe. Do you have some pointers on the documentation or source
code that I should read to better understand that?

By the way I find it a bit strange to refer to have to manually extract
android-platform-system-core to be able to refer its include path.

Beside the native-input, this results in the following code:
Toggle quote (17 lines)
> #:make-flags (list (string-append "CFLAGS= "
> "-I core/include "
> [...]))
>
> [...]
>
> #:phases
> (modify-phases %standard-phases
> (add-after 'unpack 'unpack-core
> (lambda* (#:key inputs #:allow-other-keys)
> (mkdir-p "core")
> (with-directory-excursion "core"
> (invoke "tar" "axf" (assoc-ref inputs "android-core")
> "--strip-components=1"))
> #t))
> [...])

Instead of just that:
Toggle quote (5 lines)
> #:make-flags (list (string-append "CFLAGS= "
> "-I " (assoc-ref %build-inputs "android-core")
> "/include "))
> [...]))

Another potential improvement would be to remove the
android-platform-version argument completely and set version to it in
android.mk like that:
Toggle quote (5 lines)
> (define-public (android-platform-system-core
> [...]
> (version (android-platform-version))
> [...]

That would make the native-input look like that:
Toggle quote (4 lines)
> (native-inputs
> `(
> ("android-core" ,android-platform-system-core)))

And if we need the version 9.0.0_r3 we could define a new package:
Toggle quote (5 lines)
> (define-public android-platform-system-core-9
> (package
> (inherit android-platform-system-core)
> (version "9.0.0_r3"))))

and use it:
Toggle quote (4 lines)
> (native-inputs
> `(
> ("android-core" ,android-platform-system-core-9)))

Are both proposal a good idea? Or does it have any downsides that I
didn't think of?

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAl8wvNUACgkQX138wUF3
4mMbew//QWCDdDPwInEmtWTlmecXVoOze13W2YNyGiiokobXtRSh3poXYkmdxAXG
9ytz0AD8kEmGsiUA3iTXzSpeyaU0C9WIvWjpXBP4YgHUyJ8Vw/refwsMxvHR1MrX
suMKektikY0WPShh2NW4VsoaNiWjmrIhbTKtS30FOwO5gECKOYyts2VyTcaQCUTP
cbjPGqOlOIiiZmF6vj0ETGEfJ6YIwmTaJtLEYhYKwMAGKWl6R86btKmT6cEauTyh
ZlzdMyiWf/lxOB6OuCvzNInom9J0kXRdlk0rRsFKfMqLs2upjaGMyFGF9/lmV1O2
0OADkcIfqNGoNj0IgxUCTsvrwvCg4WbqqPmcLQWizQhBgpzLX60eTML1SVM47dar
aISui4m3XywHBmUqfpmpKwxaxPh+VJ4qjF7iTt18D8GucjCDoWyavfT1MjBStZs9
V+QewJ/JRDhhtpOrZbHiHb2PWS//s6NEV2QNzJhEb5gljdwKC7l0FP4c2RF7KWqw
NQBarApNStNXs0MfLmvRqDCCrlIgs5q/tWrXtqIApt92Po428eZ0eBEWunTxjNX+
JIjLgePle2uo0peXRZvVu6oZdfyR9BlVFshyin9VuD0oiB1uDsjo73Ko8jSNbU+B
1mpkyf0aDptp96wmkxd3gY4noutXLDs/l4I2I65pHeOLnxy2FXk=
=/YNc
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 10 Aug 2020 05:27
(name . Julien Lepiller)(address . julien@lepiller.eu)
20200810052750.23795deb@primarylaptop.localdomain
On Mon, 10 Aug 2020 05:19:49 +0200
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:

Toggle quote (20 lines)
> On Fri, 07 Aug 2020 07:33:03 -0400
> Julien Lepiller <julien@lepiller.eu> wrote:
>
> > Unfortunately, android-platform-core should first be fixed to accept
> > a hash as an argument, otherwise any other version will fail. Don't
> > know why we haven't done that before…
>
> I don't understand what the hash would be here, nor the consequences
> you describe. Do you have some pointers on the documentation or source
> code that I should read to better understand that?
>
> By the way I find it a bit strange to refer to have to manually
> extract android-platform-system-core to be able to refer its include
> path.

> Instead of just that:
> > #:make-flags (list (string-append "CFLAGS= "
> > "-I " (assoc-ref %build-inputs "android-core")
> > "/include "))
> > [...]))
One way of doing that would be to create an android-system-core-header
package and reference that.

Does that look like a good idea?

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAl8wvrYACgkQX138wUF3
4mPD8w/+LY9698Fu0iUCKGztzWy2VT4PSikUharw66gwN8FIQI0DWN8bz6dmVPGt
bCfNPsfPSCre1axYxvB1FgMMzR9l40LTAyorw7U1IxgdFBJQTTz8er9ti6AxTUBA
bm4AIK/+Ny5lga4gG4zUmvInaTcmSS6czioZQ3IK/+3LS64zCeTG65+hJB6UUhlz
aCACYu0tvJNO3BC8eC7bahzdMVjKsXuM0PMXxrBfiLpBTMoMVWsngzNIaezfe/9d
pD+k1O/ZO/u5uNz4Z0whHEyeKclMpcQ9rFO5Q6IOeqCMZRUX9nWyd5u5b2/nWywH
pdrviGShrhv8jdudGPE5fVr9xISL65zfWg9LLqmolbdoZlnloEwUDOXe3diE1Aio
99IUKzJEsRy3DXCsS+aLirTaaJla1KsJXAwDQECIBVoD86yhIuI9ed/+551pqaOk
2vltaNA5jfqfl5D0rk0U44B8/wZb4TDGBUmKYSqIawV/y9UeiQlEih0QwzOOI5CH
eEI5Pvc0u+bAEsHZmCK+qu/ejuWYlxQe867VB3eb9IuZH5bttwGFbTzPHVfzh9C5
vi8JAKlRXCGvSlfVz/fS9E3zLybUMgeNqP5ReMLEdPWu8DW3nThqFUJABaJNrCaF
+OfSABm+h3SAJVbpL7tSp8+R9Q0l8uwJkgEHX/3VPBrXVHdwMrk=
=lBBx
-----END PGP SIGNATURE-----


D
D
Denis 'GNUtoo' Carikli wrote on 10 Aug 2020 05:46
(name . Julien Lepiller)(address . julien@lepiller.eu)
20200810054608.511a3dd9@primarylaptop.localdomain
On Mon, 10 Aug 2020 05:27:50 +0200
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:

Toggle quote (4 lines)
> One way of doing that would be to create an android-system-core-header
> package and reference that.
>
> Does that look like a good idea?
I keep sending mails too fast.

Inside the tarball we have:
Toggle quote (5 lines)
> $ ls include/
> android backtrace binderwrapper cutils diskconfig log memtrack
> mincrypt nativebridge netutils private system sysutils usbhost
> utils ziparchive

So that could be spitted somehow.

For instance include/log/ would be packaged in android-liblog for
instance.

Denis.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEeC+d2+Nrp/PU3kkGX138wUF34mMFAl8wwwAACgkQX138wUF3
4mMAIQ//TEEr5xYGvXG9qGmc7U/Ekm9aI9JT2g8spFvIEXo6TxwE6EnjyJwwM8yU
GfX7Zj9Fft/28dyk6qCPQ29SlZj08LS4HwGkfq5/B5/Zr6ZagMIlcq0/QjgCLbiO
Z+XULsMDjs0NZnY3hdkULsJ5ophkbyC4ZPMhkwL2QTU2bV9XTKkzwO92zrtuTn99
HXhXVS+vu5OnZH9mlwbI3fA/8QUP6KrStIW2PxsqFfq1UZUhmF9miQ4gbH+P/BC+
+VI/Z72mr7b4wHK+FfA12LvD4FSjCQ7+gjgH6TfSRIUNk34atWGiw/bZ9u75ZpCD
Op9etk9sbool1/NvJIVZeUZQ6wY/7eMQAY80noYsXCOiWJzgyc8j8zMcU856DZ/E
aPXEpRWjnFKsyFbWQ7otAlIXH2oYqSKDaVQfBrjeSCfmCrRK2MxhRLMdsxsJrUJn
ZdpZ79PuKPgBpqSADiCGb/NxZbyzj+77kscddlEXDKLVncP7sNvunM7ZO+xAuubG
F2cgCG8pSTZk4HYm6RMFJyLvjh1cmJvIwkTLgWWyl1nMyszDiSeIAb6esqlo6vqP
UXzqxdc7IDesqX1NXiOSMb+TpHp6QdRZmDWMJ5/rp6PdlMhsxVJNmx6fd2YZuiH8
TylzSZ3uaK/mkUxb/7l3MFsPFxRVHALR7DGIkw2GhvXXxgUFmpM=
=JRk6
-----END PGP SIGNATURE-----


J
J
Julien Lepiller wrote on 10 Aug 2020 15:50
(name . Denis 'GNUtoo' Carikli)(address . GNUtoo@cyberdimension.org)(address . 42734@debbugs.gnu.org)
C70549E6-836F-4B58-979D-305F6E669AD8@lepiller.eu
I think I confused a few things here. Currently android-platform-system-core is a procedure that takes a version number and returns an origin record (a source). However, that record hard-codes a hash, so if you specify a different version, the source can't be fetcged, as the hash mismatches.

It also includes patches that may not work with other versions, so I'm not sure why we allow to pass a version number in tge first place…

How about this:

android-platform-system-core is renamed to android-platform-system-core-source and takes a version, a hash and a list patch names.

android-platform-system-core is the result of calling this function with the default version, hash anl patch set.

The other source procedures should probably be fixed in the same way.

I also found out that android-liblog didn't install its headers. I'll fix that this evening if I remember.

On 2020?8?9? 23:19:49 GMT-04:00, Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:
Toggle quote (67 lines)
>On Fri, 07 Aug 2020 07:33:03 -0400
>Julien Lepiller <julien@lepiller.eu> wrote:
>
>> Unfortunately, android-platform-core should first be fixed to accept
>> a hash as an argument, otherwise any other version will fail. Don't
>> know why we haven't done that before…
>
>I don't understand what the hash would be here, nor the consequences
>you describe. Do you have some pointers on the documentation or source
>code that I should read to better understand that?
>
>By the way I find it a bit strange to refer to have to manually extract
>
>android-platform-system-core to be able to refer its include path.
>
>Beside the native-input, this results in the following code:
>> #:make-flags (list (string-append "CFLAGS= "
>> "-I core/include "
>> [...]))
>>
>> [...]
>>
>> #:phases
>> (modify-phases %standard-phases
>> (add-after 'unpack 'unpack-core
>> (lambda* (#:key inputs #:allow-other-keys)
>> (mkdir-p "core")
>> (with-directory-excursion "core"
>> (invoke "tar" "axf" (assoc-ref inputs "android-core")
>> "--strip-components=1"))
>> #t))
>> [...])
>
>Instead of just that:
>> #:make-flags (list (string-append "CFLAGS= "
>> "-I " (assoc-ref %build-inputs "android-core")
>> "/include "))
>> [...]))
>
>Another potential improvement would be to remove the
>android-platform-version argument completely and set version to it in
>android.mk like that:
>> (define-public (android-platform-system-core
>> [...]
>> (version (android-platform-version))
>> [...]
>
>That would make the native-input look like that:
>> (native-inputs
>> `(
>> ("android-core" ,android-platform-system-core)))
>
>And if we need the version 9.0.0_r3 we could define a new package:
>> (define-public android-platform-system-core-9
>> (package
>> (inherit android-platform-system-core)
>> (version "9.0.0_r3"))))
>
>and use it:
>> (native-inputs
>> `(
>> ("android-core" ,android-platform-system-core-9)))
>
>Are both proposal a good idea? Or does it have any downsides that I
>didn't think of?
>
>Denis.
Attachment: file
?