From: phodina via Guix-patches via <guix-patches@gnu.org>
To: Maxime Devos <maximedevos@telenet.be>
Cc: "Ludovic Courtès" <ludo@gnu.org>,
"51737@debbugs.gnu.org" <51737@debbugs.gnu.org>
Subject: [bug#51737] [PATCH v2 1/7] gnu: Add linux-libre-waydroid.
Date: Mon, 27 Jun 2022 07:07:46 +0000 [thread overview]
Message-ID: <lbP0QVU9mwtTxmuAPngJtIICmV7r53RWXBaW0YM0CuhxCW6_fbcdctV3S9OFH3_yXMX8AuOAZCQLBReEAzGxlBdfKGa7ZNIKUWv23XaHvBA=@protonmail.com> (raw)
In-Reply-To: <b9c645cb175c3642fd40a55ac3cc9622c8ef3524.camel@telenet.be>
[-- Attachment #1: Type: text/plain, Size: 733 bytes --]
Hi Maxime,
>
> > + (string-append "DESTDIR="
> > + #$output))
>
>
> DESTDIR is for staged installation, which Guix doesn't do, so set
> DESTDIR=/ or don't set it at all (maybe PREFIX or prefix is what you
> need to set instead?). Likewise for other packages.
>
> Greetings,
> Maxime.
I packaged it this way as at that time was the simples solution. Now I switched to substitution in Makefile itself.
Also there's fix for waydroid package as I mistakenly send old patch.
Should I also create a service for waydroid + test to check it's running?
----
Petr
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v3-0004-gnu-Add-libgbinder.patch --]
[-- Type: text/x-patch; name=v3-0004-gnu-Add-libgbinder.patch, Size: 3198 bytes --]
From ef52a2ac20b691d3eac6614c94787c8bf2daa523 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 9 Nov 2021 22:41:30 +0100
Subject: [PATCH v3 4/6] gnu: Add libgbinder.
* gnu/packages/glib.scm (libgbinder): New variable.
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 19f69b3a5c..8b91aac41a 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -850,6 +850,61 @@ (define-public glibmm-2.64
(modify-inputs (package-propagated-inputs glibmm)
(replace "libsigc++" libsigc++-2)))))
+(define-public libgbinder
+ (package
+ (name "libgbinder")
+ (version "1.1.23")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mer-hybris/libgbinder")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "12nw2ihd2xhpvdh0jlyacskqmbdxhnrm5pnz30v4mkyg9kz4xhdc"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list (string-append "CC="
+ #$(cc-for-target)))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'fix-pkg-config-in
+ (lambda* _
+ (substitute* "Makefile"
+ (("\\$\\(DESTDIR\\)") #$output)
+ (("usr/") ""))
+ (substitute* "libgbinder.pc.in"
+ (("@libdir@") (string-append #$output "/lib"))
+ (("/usr/include") (string-append #$output
+ "/include")))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev"
+ (string-append "DESTDIR="
+ #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make"
+ (string-append "CC="
+ #$(cc-for-target)))
+ (chdir "..")))))))
+ (native-inputs (list bison flex pkg-config))
+ (inputs (list glib libglibutil))
+ (home-page "https://github.com/mer-hybris/libgbinder")
+ (synopsis "GLib-style interface to binder")
+ (description
+ "This package provides GLib-style interface to binder:
+@enumerate
+@item Integration with GLib event loop
+@item Detection of 32 vs 64 bit kernel at runtime
+@item Asynchronous transactions that don't block the event thread
+@item Stable service manager and low-level transation APIs
+@end enumerate")
+ (license license:bsd-3)))
+
(define-public libglibutil
(package
(name "libglibutil")
--
2.36.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: v3-0002-gnu-Add-linux-libre-arm64-waydroid.patch --]
[-- Type: text/x-patch; name=v3-0002-gnu-Add-linux-libre-arm64-waydroid.patch, Size: 2130 bytes --]
From faedb7a4beb492fd024982655a844fb049ba538d Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 22 Dec 2021 02:35:46 +0100
Subject: [PATCH v3 2/6] gnu: Add linux-libre-arm64-waydroid.
* gnu/packages/linux.scm (linux-libre-arm64-waydroid): New variable.
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 3d58f8a2c6..7c57ec0d68 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1080,6 +1080,33 @@ (define-public linux-libre-arm-omap2plus-4.14
#:defconfig "omap2plus_defconfig"
#:extra-version "arm-omap2plus"))
+(define-public linux-libre-arm64-waydroid
+ (make-linux-libre* linux-libre-version
+ linux-libre-gnu-revision
+ linux-libre-source
+ '("aarch64-linux")
+ #:defconfig "defconfig"
+ #:extra-version "arm64-generic"
+ #:extra-options
+ (append
+ `(;; needed to fix the RTC on rockchip platforms
+ ("CONFIG_RTC_DRV_RK808" . #t)
+ ;; Pinebook display, battery, charger and usb
+ ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
+ ("CONFIG_CHARGER_AXP20X" . m)
+ ("CONFIG_INPUT_AXP20X_PEK" . m)
+ ("CONFIG_CHARGER_AXP20X" . m)
+ ("CONFIG_BATTERY_AXP20X" . m)
+ ("CONFIG_PINCTRL_AXP209" . m)
+ ("CONFIG_AXP20X_POWER" . m)
+ ("CONFIG_AXP20X_ADC" . m)
+ ;; Pinebook PRO battery and sound support
+ ("CONFIG_BATTERY_CW2015" . m)
+ ("CONFIG_CHARGER_GPIO" . m)
+ ("CONFIG_SND_SOC_ES8316" . m))
+ %waydroid-extra-linux-options
+ %default-extra-linux-options)))
+
(define-public linux-libre-arm64-generic
(make-linux-libre* linux-libre-version
linux-libre-gnu-revision
--
2.36.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: v3-0001-gnu-Add-linux-libre-waydroid.patch --]
[-- Type: text/x-patch; name=v3-0001-gnu-Add-linux-libre-waydroid.patch, Size: 1907 bytes --]
From a416098d46b7ca5963d835d2603d9d525f0ca236 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Thu, 11 Nov 2021 19:26:41 +0100
Subject: [PATCH v3 1/6] gnu: Add linux-libre-waydroid.
* gnu/packages/linux.scm (linux-libre-waydroid,
waydroid-extra-linux-options): New variables.
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 9c59d4ef9b..3d58f8a2c6 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -729,6 +729,14 @@ (define %bpf-extra-linux-options
;; kheaders module
("CONFIG_IKHEADERS" . #t)))
+(define %waydroid-extra-linux-options
+ `(;; Modules required for waydroid:
+ ("CONFIG_ASHMEM" . #t)
+ ("CONFIG_ANDROID" . #t)
+ ("CONFIG_ANDROID_BINDER_IPC" . #t)
+ ("CONFIG_ANDROID_BINDERFS" . #t)
+ ("CONFIG_ANDROID_BINDER_DEVICES" . "binder,hwbinder,vndbinder")))
+
(define (config->string options)
(string-join (map (match-lambda
((option . 'm)
@@ -1156,6 +1164,24 @@ (define-public linux-libre-mips64el-fuloong2e
`(("CONFIG_OVERLAY_FS" . m))
%default-extra-linux-options)))
+(define-public linux-libre-waydroid
+ (let ((base-linux-libre
+ (make-linux-libre*
+ linux-libre-version
+ linux-libre-gnu-revision
+ linux-libre-source
+ '("x86_64-linux" "i686-linux" "armhf-linux"
+ "aarch64-linux" "riscv64-linux")
+ #:extra-version "linux"
+ #:configuration-file kernel-config
+ #:extra-options
+ (append %waydroid-extra-linux-options
+ %default-extra-linux-options))))
+ (package
+ (inherit base-linux-libre)
+ (name "linux-libre-waydroid")
+ (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
+
(define-public linux-libre-with-bpf
(let ((base-linux-libre
(make-linux-libre*
--
2.36.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #5: v3-0005-gnu-Add-python-gbinder.patch --]
[-- Type: text/x-patch; name=v3-0005-gnu-Add-python-gbinder.patch, Size: 1775 bytes --]
From fceafa6fefd82d0968781ed03cf5565af76dc7eb Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 10 Nov 2021 01:25:52 +0100
Subject: [PATCH v3 5/6] gnu: Add python-gbinder.
* gnu/packages/glib.scm (python-gbinder): New variable.
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 8b91aac41a..205c24a909 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -952,6 +952,33 @@ (define-public libglibutil
(description "This package provides library of glib utilities.")
(license license:bsd-3)))
+(define-public python-gbinder
+ (package
+ (name "python-gbinder")
+ (version "1.0.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/erfanoabdi/gbinder-python")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0jgblzakjgsy0cj93bmh5gr7qnl2xgsrm0wzc6xjvzry9lrbs360"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (replace 'build
+ (lambda* _
+ (invoke "python" "setup.py" "build_ext"
+ "--inplace" "--cython"))))))
+ (native-inputs (list python-cython pkg-config))
+ (inputs (list glib libgbinder libglibutil))
+ (home-page "https://github.com/erfanoabdi/gbinder-python")
+ (synopsis "Python bindings for libgbinder")
+ (description "This package provides Python bindings for libgbinder.")
+ (license license:gpl3+)))
+
(define-public python-pygobject
(package
(name "python-pygobject")
--
2.36.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: v3-0006-gnu-Add-waydroid.patch --]
[-- Type: text/x-patch; name=v3-0006-gnu-Add-waydroid.patch, Size: 5486 bytes --]
From 1d8491917107f232dac0fe707aebf6a5571fb730 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Wed, 10 Nov 2021 02:21:08 +0100
Subject: [PATCH v3 6/6] gnu: Add waydroid.
* gnu/packages/virtualization.scm (waydroid): New variable.
diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index 4cb83b4d85..2ec37201c9 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -2092,6 +2092,94 @@ (define-public bochs
DOS or Microsoft Windows.")
(license license:lgpl2.0+)))
+(define-public waydroid
+ (package
+ (name "waydroid")
+ (version "1.2.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/waydroid/waydroid")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1ssqlsnhmpzaq2n9rbkfn3d2ml4vmima0az6gakknjc2q6bnpza9"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:phases #~(modify-phases %standard-phases
+ (delete 'build)
+ (delete 'check)
+ (replace 'install
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let* ((lib (string-append #$output
+ "/lib/waydroid")) (tools
+ (string-append
+ lib
+ "/tools"))
+ (data (string-append lib "/data"))
+ (apps (string-append out
+ "/share/applications"))
+ (bin (string-append out "/bin"))
+ (paths-bin #~(map (lambda (input)
+ (string-append
+ #$input "/bin"))
+ '(iptables nftables
+ glibc dnsmasq)))
+ (paths-sbin #$(map (lambda (input)
+ (string-append #$input "/sbin"))
+ '(dnsmasq)))
+ (site (string-append out "/lib/python"
+ #$(version-major+minor
+ (package-version
+ python))
+ "/site-packages")))
+ (mkdir-p tools)
+ (mkdir-p data)
+ (mkdir-p apps)
+ (mkdir-p bin)
+ (copy-recursively "tools" tools)
+ (copy-recursively "data" data)
+ (install-file (string-append data
+ "/Waydroid.desktop")
+ (string-append apps))
+ (substitute* (string-append apps
+ "/Waydroid.desktop")
+ (("/usr") lib))
+ (install-file "waydroid.py" lib)
+ (symlink (string-append lib "/waydroid.py")
+ (string-append bin "/waydroid"))
+ (wrap-program (string-append bin "/waydroid")
+ #~("PYTHONPATH" ":" prefix
+ #$paths-bin))
+ (substitute* (string-append out
+ "/lib/waydroid/data/scripts/waydroid-net.sh")
+ (("/misc") ""))
+ (wrap-program (string-append out
+ "/lib/waydroid/data/scripts/waydroid-net.sh")
+ #~("PATH" ":" prefix
+ #$(append paths-bin paths-sbin)))))))))
+ (inputs (list bash-minimal
+ dnsmasq
+ libgbinder
+ glibc
+ lxc
+ nftables
+ iptables
+ python
+ python-gbinder
+ python-pygobject))
+ (home-page "https://waydro.id")
+ (synopsis "Container-based approach to boot a full Android system")
+ (description
+ "Waydroid uses Linux namespaces @code{(user, pid, uts, net,
+mount, ipc)} to run a full Android system in a container and provide Android
+applications. The Android inside the container has direct access to needed
+underlying hardware. The Android runtime environment ships with a minimal
+customized Android system image based on LineageOS. The used image is
+currently based on Android 11.")
+ (license license:gpl3)))
+
(define-public xen
(package
(name "xen")
--
2.36.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #7: v3-0003-gnu-Add-libglibutil.patch --]
[-- Type: text/x-patch; name=v3-0003-gnu-Add-libglibutil.patch, Size: 3486 bytes --]
From 9f9dbbfed1d8b7f999c92d940740b478d8d082a8 Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 9 Nov 2021 22:34:39 +0100
Subject: [PATCH v3 3/6] gnu: Add libglibutil.
* gnu/packages/glib.scm (libglibutil): New variable.
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index 98267fcee5..19f69b3a5c 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2020 Arthur Margerit <ruhtra.mar@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
+;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -75,6 +76,7 @@ (define-module (gnu packages glib)
#:use-module (guix build-system perl)
#:use-module (guix build-system python)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -848,6 +850,53 @@ (define-public glibmm-2.64
(modify-inputs (package-propagated-inputs glibmm)
(replace "libsigc++" libsigc++-2)))))
+(define-public libglibutil
+ (package
+ (name "libglibutil")
+ (version "1.0.65")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://git.sailfishos.org/mer-core/libglibutil")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0sc8xw5cbxcicipjp6ycbgqppn31lzsll4r9j6b0zxd747dziv54"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list #:make-flags #~(list (string-append "CC="
+ #$(cc-for-target)))
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'remove-usr-prefix
+ (lambda* _
+ (substitute* "libglibutil.pc.in"
+ (("/usr/include") (string-append #$output
+ "/include")))
+ (substitute* "Makefile"
+ (("\\$\\(DESTDIR\\)") #$output)
+ (("usr/") ""))))
+ (add-after 'install 'install-dev
+ (lambda* _
+ (invoke "make" "install-dev"
+ (string-append "DESTDIR="
+ #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (chdir "test")
+ (invoke "make"
+ (string-append "CC="
+ #$(cc-for-target)))
+ (chdir "..")))))))
+ (native-inputs (list pkg-config))
+ (inputs (list glib))
+ (home-page "https://git.sailfishos.org/mer-core/libglibutil")
+ (synopsis "GLib utilites")
+ (description "This package provides library of glib utilities.")
+ (license license:bsd-3)))
+
(define-public python-pygobject
(package
(name "python-pygobject")
--
2.36.1
next prev parent reply other threads:[~2022-06-27 7:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 1:33 [bug#51737] Add Waydroid phodina via Guix-patches via
2021-11-10 1:37 ` [bug#51737] [PATCH 1/4] gnu: Add libglibutil phodina via Guix-patches via
2021-11-10 1:38 ` [bug#51737] [PATCH 2/4] gnu: Add libgbinder phodina via Guix-patches via
2021-11-10 1:38 ` [bug#51737] [PATCH 3/4] gnu: Add python-gbinder phodina via Guix-patches via
2021-11-10 1:39 ` [bug#51737] [PATCH 4/4] gnu: Add waydroid phodina via Guix-patches via
2021-11-15 20:03 ` Liliana Marie Prikler
2021-11-15 22:30 ` phodina via Guix-patches via
2021-12-03 15:00 ` phodina via Guix-patches via
2022-06-25 13:08 ` [bug#51737] [PATCH v2 1/7] gnu: Add linux-libre-waydroid phodina via Guix-patches via
2022-06-25 16:46 ` Maxime Devos
2022-06-27 7:07 ` phodina via Guix-patches via [this message]
2022-07-19 14:56 ` Maxime Devos
2022-07-19 14:57 ` Maxime Devos
2022-10-29 19:28 ` [bug#51737] [PATCH v3 1/8] " phodina via Guix-patches via
2022-10-31 19:30 ` phodina via Guix-patches via
2022-11-01 6:51 ` Liliana Marie Prikler
2022-11-01 7:04 ` Julien Lepiller
2022-11-04 3:03 ` Denis 'GNUtoo' Carikli
2022-11-04 11:38 ` Denis 'GNUtoo' Carikli
2022-11-04 11:51 ` Denis 'GNUtoo' Carikli
2022-11-04 12:26 ` Denis 'GNUtoo' Carikli
2022-11-12 15:54 ` Denis 'GNUtoo' Carikli
2022-12-13 17:48 ` phodina via Guix-patches via
2022-12-15 17:02 ` Denis 'GNUtoo' Carikli
2022-12-13 17:10 ` phodina via Guix-patches via
2022-12-13 18:23 ` Julien Lepiller
2022-12-15 16:38 ` Denis 'GNUtoo' Carikli
2022-12-13 16:49 ` phodina via Guix-patches via
2022-12-15 16:44 ` Denis 'GNUtoo' Carikli
2022-10-18 9:32 ` [bug#51737] Add Waydroid dan
2024-03-20 13:56 ` outlook user
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='lbP0QVU9mwtTxmuAPngJtIICmV7r53RWXBaW0YM0CuhxCW6_fbcdctV3S9OFH3_yXMX8AuOAZCQLBReEAzGxlBdfKGa7ZNIKUWv23XaHvBA=@protonmail.com' \
--to=guix-patches@gnu.org \
--cc=51737@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=maximedevos@telenet.be \
--cc=phodina@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).