diff mbox series

[bug#64808] gnu: Add andorid-sdkmanager.

Message ID 87ttttnyuf.fsf@riseup.net
State New
Headers show
Series [bug#64808] gnu: Add andorid-sdkmanager. | expand

Commit Message

Distopico July 24, 2023, 2:51 p.m. UTC
On 2023-07-24, Andreas Enge <andreas@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.
diff mbox series

Patch

From 60c09ab615cb929be2215adc6b85ce3c8cd3fcfa Mon Sep 17 00:00:00 2001
From: Distopico <distopico@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@sarg.org.ru>
 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@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