GNU bug report logs - #64808
[PATCH] gnu: Add andorid-sdkmanager.

Previous Next

Package: guix-patches;

Reported by: Distopico <distopico <at> riseup.net>

Date: Sun, 23 Jul 2023 18:51:02 UTC

Severity: normal

Tags: patch

Done: Andreas Enge <andreas <at> enge.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64808 in the body.
You can then email your comments to 64808 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to maxim.cournoyer <at> gmail.com, andreas <at> enge.fr, guix-patches <at> gnu.org:
bug#64808; Package guix-patches. (Sun, 23 Jul 2023 18:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Distopico <distopico <at> riseup.net>:
New bug report received and forwarded. Copy sent to maxim.cournoyer <at> gmail.com, andreas <at> enge.fr, guix-patches <at> gnu.org. (Sun, 23 Jul 2023 18:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Distopico <distopico <at> riseup.net>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add andorid-sdkmanager.
Date: Sun, 23 Jul 2023 13:41:32 -0500
A drop-in replacement for sdkmanager from the Android SDK by F-droid project.

* gnu/packages/android.scm (andorid-sdkmanager): New variables.
---
 gnu/packages/android.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index f35c2398bd..24f5fd2893 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2020 Sergey Trofimov <sarg <at> sarg.org.ru>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico <at> riseup.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -721,6 +722,32 @@ (define-public fastboot
      "This package provides @command{fastboot}, a tool to upload file system images to Android devices.")
     (license license:asl2.0)))
 
+(define-public andorid-sdkmanager
+  (package
+    (name "android-sdkmanager")
+    (version "0.6.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "sdkmanager" version ".tar.gz"))
+              (sha256
+               (base32
+                "11as7n2mj3nbqsqb3ivyv9985n73i022s748qvjg36cs8ig50afx"))))
+    (build-system python-build-system)
+    (inputs (list python-requests python-argcomplete python-urllib3))
+    (propagated-inputs (list gnupg))
+    (home-page "https://gitlab.com/fdroid/sdkmanager")
+    (synopsis
+     "Drop-in replacement for sdkmanager from the Android SDK written in Python")
+    (description
+     "This package provides an drop-in replacement for sdkmanager from the Android SDK
+written in Python from fdroid project.  It implements the exact API of the sdkmanager
+command line.  It only deviates from that API if it can be done while being
+100% compatible.
+
+The project also attempts to maintain the same terminal output so it can be compatible
+with things that scrape sdkmanager output.")
+    (license license:agpl3+)))
+
 (define-public android-udev-rules
   (package
     (name "android-udev-rules")

base-commit: 13cb9b302868b5a966a6ae177412c474084f4bf1
-- 
2.41.0




Information forwarded to guix-patches <at> gnu.org:
bug#64808; Package guix-patches. (Mon, 24 Jul 2023 12:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 64808 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Distopico <distopico <at> riseup.net>
Cc: 64808 <at> debbugs.gnu.org, maxim.cournoyer <at> gmail.com
Subject: Re: [bug#64808] [PATCH] gnu: Add andorid-sdkmanager.
Date: Mon, 24 Jul 2023 14:58:37 +0200
[Message part 1 (text/plain, inline)]
Hello,

thanks for the new package!

According to our naming scheme, we should either call it "sdkmanager"
(the upstream name), or "python-sdkmanager" (as a Python library). Given
that it is mainly an executable, I opted for the first one; also since the
second one is a bit misleading (it does not manage SDKs for python).

I have removed the propagated input gnutls; propagated inputs should be
used very sparingly, and so far I did not see where it would be required.

I am not sure the package works. When running
   sdkmanager --sdk_root /tmp/sdk --install
it complains that it has no rights on /opt/android-sdk. I was just guessing
how it works from "sdkmanager --help"; should --sdk_root not set the place
where to install the SDKs?

"sdkmanager --list" does seem to work.

I am attaching a new version of the patch; what do you think?

Andreas

[0001-gnu-Add-sdkmanager.patch (text/plain, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#64808; Package guix-patches. (Mon, 24 Jul 2023 13:06:01 GMT) Full text and rfc822 format available.

Message #11 received at 64808 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Distopico <distopico <at> riseup.net>
Cc: 64808 <at> debbugs.gnu.org, maxim.cournoyer <at> gmail.com
Subject: Re: [bug#64808] [PATCH] gnu: Add andorid-sdkmanager.
Date: Mon, 24 Jul 2023 15:04:52 +0200
Something like this works:
   ANDROID_HOME=/tmp/sdk sdkmanager --install tools
and creates a directory
   /tmp/sdk/tools
with stuff in it.

So if it works for you, I would be happy to push the new package.

Andreas





Information forwarded to guix-patches <at> gnu.org:
bug#64808; Package guix-patches. (Mon, 24 Jul 2023 14:56:02 GMT) Full text and rfc822 format available.

Message #14 received at 64808 <at> debbugs.gnu.org (full text, mbox):

From: Distopico <distopico <at> riseup.net>
To: Andreas Enge <andreas <at> enge.fr>
Cc: 64808 <at> debbugs.gnu.org, maxim.cournoyer <at> gmail.com
Subject: Re: [bug#64808] [PATCH] gnu: Add andorid-sdkmanager.
Date: Mon, 24 Jul 2023 09:51:35 -0500
[Message part 1 (text/plain, inline)]
On 2023-07-24, Andreas Enge <andreas <at> enge.fr> wrote:

> Hello,
>
> thanks for the new package!
>
> According to our naming scheme, we should either call it "sdkmanager"
> (the upstream name), or "python-sdkmanager" (as a Python library). Given
> that it is mainly an executable, I opted for the first one; also since the
> second one is a bit misleading (it does not manage SDKs for python).
>
> I have removed the propagated input gnutls; propagated inputs should be
> used very sparingly, and so far I did not see where it would be required.
>
> I am not sure the package works. When running
>    sdkmanager --sdk_root /tmp/sdk --install
> it complains that it has no rights on /opt/android-sdk. I was just guessing
> how it works from "sdkmanager --help"; should --sdk_root not set the place
> where to install the SDKs?
>
> "sdkmanager --list" does seem to work.
>
> I am attaching a new version of the patch; what do you think?
>
> Andreas
>
> [2. text/plain; 0001-gnu-Add-sdkmanager.patch]...

The name change make sense, thank you and ANDROID_HOME is the way
according with the documentation, but "gnupg" is necessary, if you test
with `--container -N` you will se the error:
`FileNotFoundError: [Errno 2] No such file or directory: 'gpgv'`
after run `sdkmanager --list`, "gpgv" is part of gnupg package, for that
reason I added it in "propagated-inputs". attached a patch with that
change.

[0001-gnu-Add-andorid-sdkmanager.patch (text/x-patch, inline)]
From 60c09ab615cb929be2215adc6b85ce3c8cd3fcfa Mon Sep 17 00:00:00 2001
From: Distopico <distopico <at> riseup.net>
Date: Sun, 23 Jul 2023 13:37:39 -0500
Subject: [PATCH] gnu: Add andorid-sdkmanager.

* gnu/packages/android.scm (sdkmanager): New variables.
---
 gnu/packages/android.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/android.scm b/gnu/packages/android.scm
index f35c2398bd..1d36f9aa7d 100644
--- a/gnu/packages/android.scm
+++ b/gnu/packages/android.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2020 Sergey Trofimov <sarg <at> sarg.org.ru>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv <at> posteo.net>
 ;;; Copyright © 2021 Petr Hodina <phodina <at> protonmail.com>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico <at> riseup.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -52,6 +53,7 @@ (define-module (gnu packages android)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages python)
+  #:use-module (guix build-system pyproject)
   #:use-module (gnu packages python-crypto)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
@@ -721,6 +723,29 @@ (define-public fastboot
      "This package provides @command{fastboot}, a tool to upload file system images to Android devices.")
     (license license:asl2.0)))
 
+(define-public sdkmanager
+  (package
+    (name "sdkmanager")
+    (version "0.6.5")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "sdkmanager" version ".tar.gz"))
+              (sha256
+               (base32
+                "11as7n2mj3nbqsqb3ivyv9985n73i022s748qvjg36cs8ig50afx"))))
+    (build-system pyproject-build-system)
+    (inputs (list python-requests python-argcomplete python-urllib3))
+    (propagated-inputs (list gnupg))
+    (home-page "https://gitlab.com/fdroid/sdkmanager")
+    (synopsis
+     "Replacement for Android sdkmanager written in Python")
+    (description
+     "This package provides a drop-in replacement for sdkmanager from
+the Android SDK.  It is written in Python and part of the F-Droid
+project.  It implements the exact API of the Android sdkmanager command
+line.  The project also attempts to maintain the same terminal output.")
+    (license license:agpl3+)))
+
 (define-public android-udev-rules
   (package
     (name "android-udev-rules")

base-commit: 13cb9b302868b5a966a6ae177412c474084f4bf1
-- 
2.41.0

[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#64808; Package guix-patches. (Mon, 24 Jul 2023 15:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 64808 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Distopico <distopico <at> riseup.net>
Cc: 64808 <at> debbugs.gnu.org, maxim.cournoyer <at> gmail.com
Subject: Re: [bug#64808] [PATCH] gnu: Add andorid-sdkmanager.
Date: Mon, 24 Jul 2023 17:43:27 +0200
[Message part 1 (text/plain, inline)]
Am Mon, Jul 24, 2023 at 09:51:35AM -0500 schrieb Distopico:
> The name change make sense, thank you and ANDROID_HOME is the way
> according with the documentation, but "gnupg" is necessary, if you test
> with `--container -N` you will se the error:
> `FileNotFoundError: [Errno 2] No such file or directory: 'gpgv'`
> after run `sdkmanager --list`, "gpgv" is part of gnupg package, for that
> reason I added it in "propagated-inputs". attached a patch with that
> change.

Ah, I see, of course I did have gnupg in my profile already...
I think a better option is to replace the one occurrence of "gpgv"
in the script by the absolute path to the binary; this also registers
a reference with the package.

Could you test the attached patch, please?

Andreas

[0001-gnu-Add-sdkmanager.patch (text/plain, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#64808; Package guix-patches. (Mon, 24 Jul 2023 17:25:02 GMT) Full text and rfc822 format available.

Message #20 received at 64808 <at> debbugs.gnu.org (full text, mbox):

From: Distopico <distopico <at> riseup.net>
To: Andreas Enge <andreas <at> enge.fr>
Cc: 64808 <at> debbugs.gnu.org, maxim.cournoyer <at> gmail.com
Subject: Re: [bug#64808] [PATCH] gnu: Add andorid-sdkmanager.
Date: Mon, 24 Jul 2023 12:23:44 -0500
That patch works fine from my side, thank you.

On 2023-07-24, Andreas Enge <andreas <at> enge.fr> wrote:

> Am Mon, Jul 24, 2023 at 09:51:35AM -0500 schrieb Distopico:
>> The name change make sense, thank you and ANDROID_HOME is the way
>> according with the documentation, but "gnupg" is necessary, if you test
>> with `--container -N` you will se the error:
>> `FileNotFoundError: [Errno 2] No such file or directory: 'gpgv'`
>> after run `sdkmanager --list`, "gpgv" is part of gnupg package, for that
>> reason I added it in "propagated-inputs". attached a patch with that
>> change.
>
> Ah, I see, of course I did have gnupg in my profile already...
> I think a better option is to replace the one occurrence of "gpgv"
> in the script by the absolute path to the binary; this also registers
> a reference with the package.
>
> Could you test the attached patch, please?
>
> Andreas
>
> [2. text/plain; 0001-gnu-Add-sdkmanager.patch]...





Reply sent to Andreas Enge <andreas <at> enge.fr>:
You have taken responsibility. (Mon, 24 Jul 2023 18:24:02 GMT) Full text and rfc822 format available.

Notification sent to Distopico <distopico <at> riseup.net>:
bug acknowledged by developer. (Mon, 24 Jul 2023 18:24:02 GMT) Full text and rfc822 format available.

Message #25 received at 64808-done <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Distopico <distopico <at> riseup.net>
Cc: maxim.cournoyer <at> gmail.com, 64808-done <at> debbugs.gnu.org
Subject: Re: [bug#64808] [PATCH] gnu: Add andorid-sdkmanager.
Date: Mon, 24 Jul 2023 20:23:17 +0200
Am Mon, Jul 24, 2023 at 12:23:44PM -0500 schrieb Distopico:
> That patch works fine from my side, thank you.

Excellent, thank you, and congratulations for your first package in Guix!
I have just pushed the commit and am closing the issue.

Andreas





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Aug 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 301 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.