Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] android-tools: update to 29.0.3.
@ 2019-10-01 10:59 voidlinux-github
  2019-10-01 11:43 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: voidlinux-github @ 2019-10-01 10:59 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

There is a new pull request by Johnnynator against master on the void-packages repository

https://github.com/Johnnynator/void-packages android-tools
https://github.com/void-linux/void-packages/pull/14878

[WIP] android-tools: update to 29.0.3.
None

A patch file from https://github.com/void-linux/void-packages/pull/14878.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-android-tools-14878.patch --]
[-- Type: text/x-diff, Size: 16493 bytes --]

From fa9ac178ae3fe9570d9b4fa6d87ba09c80b1e885 Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 30 Sep 2019 18:26:37 +0300
Subject: [PATCH] android-tools: update to 29.0.3.

---
 srcpkgs/android-tools/patches/gcc-fixes.patch |  30 ---
 srcpkgs/android-tools/patches/glibc.patch     |  23 ++
 .../patches/include-sys-sysmacros.patch       |  10 -
 .../android-tools/patches/musl-fixes.patch    | 199 ------------------
 .../patches/undef__USE_GNU.patch              |  24 ---
 srcpkgs/android-tools/template                |  98 ++-------
 6 files changed, 36 insertions(+), 348 deletions(-)
 delete mode 100644 srcpkgs/android-tools/patches/gcc-fixes.patch
 create mode 100644 srcpkgs/android-tools/patches/glibc.patch
 delete mode 100644 srcpkgs/android-tools/patches/include-sys-sysmacros.patch
 delete mode 100644 srcpkgs/android-tools/patches/musl-fixes.patch
 delete mode 100644 srcpkgs/android-tools/patches/undef__USE_GNU.patch

diff --git a/srcpkgs/android-tools/patches/gcc-fixes.patch b/srcpkgs/android-tools/patches/gcc-fixes.patch
deleted file mode 100644
index fc0e60fa06e..00000000000
--- a/srcpkgs/android-tools/patches/gcc-fixes.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- core/adb/sysdeps.h
-+++ core/adb/sysdeps.h
-@@ -66,6 +66,11 @@
- #endif
- #endif
- 
-+#ifndef __clang__
-+#define _Nonnull
-+#define _Nullable
-+#endif
-+
- #ifdef _WIN32
- 
- // Clang-only nullability specifiers
---- core/libcutils/include/cutils/trace.h
-+++ core/libcutils/include/cutils/trace.h
-@@ -18,7 +18,13 @@
- #define _LIBS_CUTILS_TRACE_H
- 
- #include <inttypes.h>
-+// https://gcc.gnu.org/PR60932
-+#ifdef __cplusplus
-+#include <atomic>
-+using namespace std;
-+#else
- #include <stdatomic.h>
-+#endif
- #include <stdbool.h>
- #include <stdint.h>
- #include <stdio.h>
diff --git a/srcpkgs/android-tools/patches/glibc.patch b/srcpkgs/android-tools/patches/glibc.patch
new file mode 100644
index 00000000000..399ac3ff0d7
--- /dev/null
+++ b/srcpkgs/android-tools/patches/glibc.patch
@@ -0,0 +1,23 @@
+--- vendor/core/libcutils/include/cutils/threads.h	2019-08-21 20:14:13.000000000 +0300
++++ -	2019-10-01 12:14:10.187934016 +0300
+@@ -33,7 +33,9 @@
+ // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows.
+ //
+ 
++#ifndef __GLIBC__
+ extern pid_t gettid();
++#endif
+ 
+ //
+ // Deprecated: use `_Thread_local` in C or `thread_local` in C++.
+--- vendor/core/libcutils/threads.cpp	2018-10-25 18:22:12.000000000 +0300
++++ -	2019-10-01 12:14:27.548527357 +0300
+@@ -32,7 +32,7 @@
+ #endif
+ 
+ // No definition needed for Android because we'll just pick up bionic's copy.
+-#ifndef __ANDROID__
++#ifndef __GLIBC__
+ pid_t gettid() {
+ #if defined(__APPLE__)
+   uint64_t tid;
diff --git a/srcpkgs/android-tools/patches/include-sys-sysmacros.patch b/srcpkgs/android-tools/patches/include-sys-sysmacros.patch
deleted file mode 100644
index 592473ac93f..00000000000
--- a/srcpkgs/android-tools/patches/include-sys-sysmacros.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- core/adb/client/usb_linux.cpp	2019-01-02 20:03:26.218600891 +0100
-+++ -	2019-01-02 20:03:57.806149467 +0100
-@@ -28,6 +28,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <sys/sysmacros.h>
- #include <sys/ioctl.h>
- #include <sys/time.h>
- #include <sys/types.h>
diff --git a/srcpkgs/android-tools/patches/musl-fixes.patch b/srcpkgs/android-tools/patches/musl-fixes.patch
deleted file mode 100644
index 235ef68854e..00000000000
--- a/srcpkgs/android-tools/patches/musl-fixes.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-Patch has been taken from Arch Linux with some minor modifications for
-needed to build android-tools with musl libc.
-
-diff -upr core.orig/adb/client/usb_libusb.cpp core/adb/client/usb_libusb.cpp
---- core.orig/adb/client/usb_libusb.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/client/usb_libusb.cpp	2018-02-25 10:35:06.661418453 +0100
-@@ -21,6 +21,7 @@
- #include <stdint.h>
- 
- #include <atomic>
-+#include <condition_variable>
- #include <chrono>
- #include <memory>
- #include <mutex>
-@@ -28,7 +29,7 @@
- #include <thread>
- #include <unordered_map>
- 
--#include <libusb/libusb.h>
-+#include <libusb-1.0/libusb.h>
- 
- #include <android-base/file.h>
- #include <android-base/logging.h>
-diff -upr core.orig/adb/diagnose_usb.cpp core/adb/diagnose_usb.cpp
---- core.orig/adb/diagnose_usb.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/diagnose_usb.cpp	2018-02-25 10:35:06.658085109 +0100
-@@ -45,9 +45,7 @@ static std::string GetUdevProblem() {
-         return "";
-     }
- 
--    // getgroups(2) indicates that the GNU group_member(3) may not check the egid so we check it
--    // additionally just to be sure.
--    if (group_member(plugdev_group->gr_gid) || getegid() == plugdev_group->gr_gid) {
-+    if (getegid() == plugdev_group->gr_gid) {
-         // The user is in plugdev so the problem is likely with the udev rules.
-         return "user in plugdev group; are your udev rules wrong?";
-     }
-diff -upr core.orig/adb/sysdeps/posix/network.cpp core/adb/sysdeps/posix/network.cpp
---- core.orig/adb/sysdeps/posix/network.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/sysdeps/posix/network.cpp	2018-02-25 10:35:06.661418453 +0100
-@@ -21,6 +21,7 @@
- #include <sys/socket.h>
- 
- #include <string>
-+#include <string.h>
- 
- #include "adb_unique_fd.h"
- 
-diff -upr core.orig/base/errors_unix.cpp core/base/errors_unix.cpp
---- core.orig/base/errors_unix.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/errors_unix.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -17,6 +17,7 @@
- #include "android-base/errors.h"
- 
- #include <errno.h>
-+#include <string.h>
- 
- namespace android {
- namespace base {
-diff -upr core.orig/base/file.cpp core/base/file.cpp
---- core.orig/base/file.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/file.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -22,6 +22,7 @@
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <unistd.h>
-+#include <string.h>
- 
- #include <memory>
- #include <mutex>
-diff -upr core.orig/base/logging.cpp core/base/logging.cpp
---- core.orig/base/logging.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/logging.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -23,6 +23,7 @@
- #include <fcntl.h>
- #include <libgen.h>
- #include <time.h>
-+#include <string.h>
- 
- // For getprogname(3) or program_invocation_short_name.
- #if defined(__ANDROID__) || defined(__APPLE__)
-@@ -89,7 +90,7 @@ static thread_id GetThreadId() {
- }
- 
- namespace {
--#if defined(__GLIBC__)
-+#if defined(__linux__)
- const char* getprogname() {
-   return program_invocation_short_name;
- }
-diff -upr core.orig/fastboot/fs.cpp core/fastboot/fs.cpp
---- core.orig/fastboot/fs.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/fastboot/fs.cpp	2018-02-25 10:35:06.651418422 +0100
-@@ -108,7 +108,7 @@ static int generate_ext4_image(const cha
-     static constexpr int block_size = 4096;
-     const std::string exec_dir = android::base::GetExecutableDirectory();
- 
--    const std::string mke2fs_path = exec_dir + "/mke2fs";
-+    const std::string mke2fs_path = exec_dir + "/mke2fs.android";
-     std::vector<const char*> mke2fs_args = {mke2fs_path.c_str(), "-t", "ext4", "-b"};
- 
-     std::string block_size_str = std::to_string(block_size);
-diff -upr core.orig/fastboot/socket.cpp core/fastboot/socket.cpp
---- core.orig/fastboot/socket.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/fastboot/socket.cpp	2018-02-25 10:35:06.651418422 +0100
-@@ -28,6 +28,8 @@
- 
- #include "socket.h"
- 
-+#include <sys/select.h>
-+
- #include <android-base/errors.h>
- #include <android-base/stringprintf.h>
- 
-diff -upr core.orig/libsparse/sparse_read.cpp core/libsparse/sparse_read.cpp
---- core.orig/libsparse/sparse_read.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/libsparse/sparse_read.cpp	2018-02-25 10:35:06.621418331 +0100
-@@ -26,6 +26,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string>
-+#include <string.h>
- #include <unistd.h>
- 
- #include <sparse/sparse.h>
-diff -upr selinux.orig/libsepol/src/private.h selinux/libsepol/src/private.h
---- selinux.orig/libsepol/src/private.h	2017-08-13 09:34:17.000000000 +0200
-+++ selinux/libsepol/src/private.h	2018-02-25 10:36:31.765008355 +0100
-@@ -14,7 +14,7 @@
- #endif
- 
- #include <errno.h>
--#include <dso.h>
-+#include "dso.h"
- 
- #ifdef __APPLE__
- #define __BYTE_ORDER  BYTE_ORDER
-diff -upr selinux.orig/libsepol/src/util.c selinux/libsepol/src/util.c
---- selinux.orig/libsepol/src/util.c	2017-08-13 09:34:17.000000000 +0200
-+++ selinux/libsepol/src/util.c	2018-02-25 10:36:31.765008355 +0100
-@@ -27,7 +27,7 @@
- #include <sepol/policydb/flask_types.h>
- #include <sepol/policydb/policydb.h>
- #include <sepol/policydb/util.h>
--#include <dso.h>
-+#include "dso.h"
- 
- struct val_to_name {
- 	unsigned int val;
-diff -upr e2fsprogs.orig/contrib/android/perms.c e2fsprogs/contrib/android/perms.c
---- e2fsprogs.orig/contrib/android/perms.c	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/contrib/android/perms.c	2018-02-25 10:37:13.048466147 +0100
-@@ -5,6 +5,7 @@
- #include "support/nls-enable.h"
- #include <time.h>
- #include <sys/stat.h>
-+#include "private/android_filesystem_capability.h"
- 
- #ifndef XATTR_SELINUX_SUFFIX
- # define XATTR_SELINUX_SUFFIX  "selinux"
-diff -upr e2fsprogs.orig/lib/ext2fs/bitops.h e2fsprogs/lib/ext2fs/bitops.h
---- e2fsprogs.orig/lib/ext2fs/bitops.h	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/lib/ext2fs/bitops.h	2018-02-25 10:37:13.028466087 +0100
-@@ -233,11 +233,11 @@ extern errcode_t ext2fs_find_first_set_g
- #if (__STDC_VERSION__ >= 199901L)
- #define _INLINE_ extern inline
- #else
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #endif
- #else /* !INCLUDE_INLINE FUNCS */
- #if (__STDC_VERSION__ >= 199901L)
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #else /* not C99 */
- #ifdef __GNUC__
- #define _INLINE_ extern __inline__
-diff -upr e2fsprogs.orig/lib/ext2fs/ext2fs.h e2fsprogs/lib/ext2fs/ext2fs.h
---- e2fsprogs.orig/lib/ext2fs/ext2fs.h	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/lib/ext2fs/ext2fs.h	2018-02-25 10:37:13.028466087 +0100
-@@ -53,9 +53,7 @@ extern "C" {
-  */
- #define EXT2_LIB_CURRENT_REV	EXT2_DYNAMIC_REV
- 
--#ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
--#endif
- 
- #include <stdio.h>
- #include <stdlib.h>
-@@ -1736,7 +1734,7 @@ extern const struct ext2_inode *ext2fs_c
- #define _INLINE_ extern
- #else
- #if (__STDC_VERSION__ >= 199901L)
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #else
- #ifdef __GNUC__
- #define _INLINE_ extern __inline__
diff --git a/srcpkgs/android-tools/patches/undef__USE_GNU.patch b/srcpkgs/android-tools/patches/undef__USE_GNU.patch
deleted file mode 100644
index 03fb129c1c1..00000000000
--- a/srcpkgs/android-tools/patches/undef__USE_GNU.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Source: John
-Upstream: No
-Reason: Conflicting declaration of copy_file_range on GLIBC
-
-FAILED: e2fsprogs/misc/create_inode.c.o 
-cc -std=gnu11 -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe     -Ie2fsprogs/lib -Ie2fsprogs/lib/ext2fs -Icore/libsparse/include -c e2fsprogs/misc/create_inode.c -o e2fsprogs/misc/create_inode.c.o
-e2fsprogs/misc/create_inode.c:406:18: error: conflicting types for 'copy_file_range'
- static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
-                  ^~~~~~~~~~~~~~~
-In file included from e2fsprogs/misc/create_inode.c:20:
-/usr/include/unistd.h:1107:9: note: previous declaration of 'copy_file_range' was here
- ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
-         ^~~~~~~~~~~~~~~
-
---- e2fsprogs/misc/create_inode.c	2019-01-02 20:07:51.685424116 +0100
-+++ -	2019-01-02 20:08:17.379127932 +0100
-@@ -17,6 +17,7 @@
- #include <time.h>
- #include <sys/stat.h>
- #include <sys/types.h>
-+#undef __USE_GNU
- #include <unistd.h>
- #include <limits.h> /* for PATH_MAX */
- #ifdef HAVE_ATTR_XATTR_H
diff --git a/srcpkgs/android-tools/template b/srcpkgs/android-tools/template
index 12806884ec0..36ba04b534a 100644
--- a/srcpkgs/android-tools/template
+++ b/srcpkgs/android-tools/template
@@ -1,95 +1,23 @@
 # Template file for 'android-tools'
 pkgname=android-tools
-# NOTE: not all upstream updates has code changes for the parts
-#       of android used by android-tools. Check for diff with:
-#         curl -L http://git.io/vvC0Z | sh -s 5.0.2_r1 5.1.0_r1
-version=9.0.0r45
-revision=2
-archs="x86_64* i686*"
-_distver=${version/r/_r}
-#See https://android.googlesource.com/platform/development/+/refs/tags/android-${_distver}/sdk/plat_tools_source.prop_template
-_apiver="28.0.0 rc1"
-create_wrksrc=yes
-hostmakedepends="ruby cmake ninja perl go"
+version=29.0.3
+revision=1
+archs="armv7l* aarch64* x86_64* i686*"
+build_style=cmake
+configure_args="-DCMAKE_CXX_FLAGS=-D_FILE_OFFSET_BITS=64
+ -DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64"
+hostmakedepends="perl go"
 makedepends="gtest-devel zlib-devel libressl-devel libusb-devel pcre2-devel"
 short_desc="Android platform tools (adb and fastboot)"
 maintainer="John <johnz@posteo.net>"
 license="Apache-2.0, ISC, GPL-2.0-only, MIT"
 homepage="http://developer.android.com/tools/help/adb.html"
-_baseurl=https://android.googlesource.com/platform
-distfiles="
- ${_baseurl}/system/core/+archive/android-${_distver}.tar.gz>core.tar.gz
- ${_baseurl}/system/extras/+archive/android-${_distver}.tar.gz>extras.tar.gz
- ${_baseurl}/external/selinux/+archive/android-${_distver}.tar.gz>selinux.tar.gz
- ${_baseurl}/external/f2fs-tools/+archive/android-${_distver}.tar.gz>f2fs-tools.tar.gz
- ${_baseurl}/external/e2fsprogs/+archive/android-${_distver}.tar.gz>e2fsprogs.tar.gz
- ${_baseurl}/external/avb/+archive/android-${_distver}.tar.gz>avb.tar.gz
- https://boringssl.googlesource.com/boringssl/+archive/3538.tar.gz>boringssl.tar.gz"
-# Contents checksums because the tarballs change with every download
-checksum="@dfaea8c40be4a8bbd1df513ab3516ff88e92430ee0fde399dd7e7e09ec21cd29
- @0a43d228088faabe8b7150fa752c8b0c002503c0d830d8470ecea351f195bbb3
- @9f2b5e379eca4c56e2d422598831bfd7bdf2b7b3c3d011ce513c7603aa46b574
- @f1efc86a1e78521f4754d184d682c1f6660c04f74496913f37cae9e2670db0e8
- @e98509632e865e792dc4b344b0a1ada0662dda7571534fa7c5d1a8902dcfb0f4
- @5c2fcb88154f9b6ffed8d24a069e4bad0a7aea1936be2ce18af972ad8762e09a
- @452e29d95f8da494896e3335931e928d9b7c94500a5793101bb19629cd7dea8c"
+distfiles="https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz"
+checksum=4cf79878356428b290eb5e659e7daebe036cbb99cf8c2dacb92586b2a5f856fc
 
-do_extract() {
-	local tarball p
-	for p in ${distfiles}; do
-		tarball=${p##*>}
-		mkdir -p ${wrksrc}/${tarball/.*}
-		tar -x --no-same-permissions --no-same-owner -f \
-			${XBPS_SRCDISTDIR}/${pkgname}-${version}/${tarball} \
-			-C ${wrksrc}/${tarball/.*}
-	done
-}
-
-pre_configure() {
-	PKGVER="${_apiver}-void-${version}_${revision}" ${FILESDIR}/generate_build.rb > build.ninja
-
-	mkdir -p boringssl/build
-	cd boringssl/build
-
-	# Don't check for CROSS_COMPILING, since i686 container/chroot inside
-	# x86_64 host will failed to build this.
-	if [ "${XBPS_TARGET_MACHINE}" = i686 ] && [ "$(uname -m)" = "x86_64" ]; then
-		boring_ssl_cmake_args="-DCMAKE_TOOLCHAIN_FILE=cross_boring_ssl.cmake"
-		cat > cross_boring_ssl.cmake <<-_EOF
-		SET(CMAKE_SYSTEM_NAME Linux)
-		SET(CMAKE_SYSTEM_VERSION 1)
-		SET(CMAKE_C_COMPILER   ${CC})
-		SET(CMAKE_CXX_COMPILER ${CXX})
-		SET(CMAKE_SYSTEM_PROCESSOR x86)
-		_EOF
-	fi
-
-	cmake -GNinja \
-		-DBUILD_SHARED_LIBS=FALSE \
-		-DCMAKE_BUILD_TYPE=RELEASE \
-		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-		-DCMAKE_C_FLAGS="$CFLAGS" \
-		$boring_ssl_cmake_args \
-		..
-	ninja
-}
-
-do_build() {
-	ninja
-}
-
-do_install() {
-	for i in adb fastboot mke2fs.android e2fsdroid ext2simg \
-		core/mkbootimg/mkbootimg avb/avbtool ;do
-		vbin $i
-	done
-	vlicense boringssl/LICENSE boringssl.LICENSE
-	vlicense boringssl/third_party/fiat/LICENSE fiat.LICENSE
-	vlicense boringssl/third_party/googletest/LICENSE gtest.LICENSE
-	vlicense boringssl/third_party/android-cmake/LICENSE android-cmake.LICENSE
+post_install() {
+	vlicense vendor/boringssl/LICENSE boringssl.LICENSE
+	vlicense vendor/boringssl/third_party/fiat/LICENSE fiat.LICENSE
+	vlicense vendor/boringssl/third_party/googletest/LICENSE gtest.LICENSE
 	vsv adb
 }
-
-# REMARKS:
-# If there is any reason at all that fastboot may not be a position independent
-# executable, please document it here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] android-tools: update to 29.0.3.
  2019-10-01 10:59 [PR PATCH] [WIP] android-tools: update to 29.0.3 voidlinux-github
@ 2019-10-01 11:43 ` voidlinux-github
  2019-10-01 11:43 ` voidlinux-github
  2019-10-05 22:40 ` [PR PATCH] [Merged]: " voidlinux-github
  2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-10-01 11:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

There is an updated pull request by Johnnynator against master on the void-packages repository

https://github.com/Johnnynator/void-packages android-tools
https://github.com/void-linux/void-packages/pull/14878

[WIP] android-tools: update to 29.0.3.
None

A patch file from https://github.com/void-linux/void-packages/pull/14878.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-android-tools-14878.patch --]
[-- Type: text/x-diff, Size: 16368 bytes --]

From 0c01ce45e39f531ab3a218aadcae9548bc52756d Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 30 Sep 2019 18:26:37 +0300
Subject: [PATCH] android-tools: update to 29.0.3.

---
 srcpkgs/android-tools/patches/gcc-fixes.patch |  30 ---
 srcpkgs/android-tools/patches/glibc.patch     |  23 ++
 .../patches/include-sys-sysmacros.patch       |  10 -
 .../android-tools/patches/musl-fixes.patch    | 199 ------------------
 .../patches/undef__USE_GNU.patch              |  24 ---
 srcpkgs/android-tools/template                |  83 ++------
 6 files changed, 37 insertions(+), 332 deletions(-)
 delete mode 100644 srcpkgs/android-tools/patches/gcc-fixes.patch
 create mode 100644 srcpkgs/android-tools/patches/glibc.patch
 delete mode 100644 srcpkgs/android-tools/patches/include-sys-sysmacros.patch
 delete mode 100644 srcpkgs/android-tools/patches/musl-fixes.patch
 delete mode 100644 srcpkgs/android-tools/patches/undef__USE_GNU.patch

diff --git a/srcpkgs/android-tools/patches/gcc-fixes.patch b/srcpkgs/android-tools/patches/gcc-fixes.patch
deleted file mode 100644
index fc0e60fa06e..00000000000
--- a/srcpkgs/android-tools/patches/gcc-fixes.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- core/adb/sysdeps.h
-+++ core/adb/sysdeps.h
-@@ -66,6 +66,11 @@
- #endif
- #endif
- 
-+#ifndef __clang__
-+#define _Nonnull
-+#define _Nullable
-+#endif
-+
- #ifdef _WIN32
- 
- // Clang-only nullability specifiers
---- core/libcutils/include/cutils/trace.h
-+++ core/libcutils/include/cutils/trace.h
-@@ -18,7 +18,13 @@
- #define _LIBS_CUTILS_TRACE_H
- 
- #include <inttypes.h>
-+// https://gcc.gnu.org/PR60932
-+#ifdef __cplusplus
-+#include <atomic>
-+using namespace std;
-+#else
- #include <stdatomic.h>
-+#endif
- #include <stdbool.h>
- #include <stdint.h>
- #include <stdio.h>
diff --git a/srcpkgs/android-tools/patches/glibc.patch b/srcpkgs/android-tools/patches/glibc.patch
new file mode 100644
index 00000000000..399ac3ff0d7
--- /dev/null
+++ b/srcpkgs/android-tools/patches/glibc.patch
@@ -0,0 +1,23 @@
+--- vendor/core/libcutils/include/cutils/threads.h	2019-08-21 20:14:13.000000000 +0300
++++ -	2019-10-01 12:14:10.187934016 +0300
+@@ -33,7 +33,9 @@
+ // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows.
+ //
+ 
++#ifndef __GLIBC__
+ extern pid_t gettid();
++#endif
+ 
+ //
+ // Deprecated: use `_Thread_local` in C or `thread_local` in C++.
+--- vendor/core/libcutils/threads.cpp	2018-10-25 18:22:12.000000000 +0300
++++ -	2019-10-01 12:14:27.548527357 +0300
+@@ -32,7 +32,7 @@
+ #endif
+ 
+ // No definition needed for Android because we'll just pick up bionic's copy.
+-#ifndef __ANDROID__
++#ifndef __GLIBC__
+ pid_t gettid() {
+ #if defined(__APPLE__)
+   uint64_t tid;
diff --git a/srcpkgs/android-tools/patches/include-sys-sysmacros.patch b/srcpkgs/android-tools/patches/include-sys-sysmacros.patch
deleted file mode 100644
index 592473ac93f..00000000000
--- a/srcpkgs/android-tools/patches/include-sys-sysmacros.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- core/adb/client/usb_linux.cpp	2019-01-02 20:03:26.218600891 +0100
-+++ -	2019-01-02 20:03:57.806149467 +0100
-@@ -28,6 +28,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <sys/sysmacros.h>
- #include <sys/ioctl.h>
- #include <sys/time.h>
- #include <sys/types.h>
diff --git a/srcpkgs/android-tools/patches/musl-fixes.patch b/srcpkgs/android-tools/patches/musl-fixes.patch
deleted file mode 100644
index 235ef68854e..00000000000
--- a/srcpkgs/android-tools/patches/musl-fixes.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-Patch has been taken from Arch Linux with some minor modifications for
-needed to build android-tools with musl libc.
-
-diff -upr core.orig/adb/client/usb_libusb.cpp core/adb/client/usb_libusb.cpp
---- core.orig/adb/client/usb_libusb.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/client/usb_libusb.cpp	2018-02-25 10:35:06.661418453 +0100
-@@ -21,6 +21,7 @@
- #include <stdint.h>
- 
- #include <atomic>
-+#include <condition_variable>
- #include <chrono>
- #include <memory>
- #include <mutex>
-@@ -28,7 +29,7 @@
- #include <thread>
- #include <unordered_map>
- 
--#include <libusb/libusb.h>
-+#include <libusb-1.0/libusb.h>
- 
- #include <android-base/file.h>
- #include <android-base/logging.h>
-diff -upr core.orig/adb/diagnose_usb.cpp core/adb/diagnose_usb.cpp
---- core.orig/adb/diagnose_usb.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/diagnose_usb.cpp	2018-02-25 10:35:06.658085109 +0100
-@@ -45,9 +45,7 @@ static std::string GetUdevProblem() {
-         return "";
-     }
- 
--    // getgroups(2) indicates that the GNU group_member(3) may not check the egid so we check it
--    // additionally just to be sure.
--    if (group_member(plugdev_group->gr_gid) || getegid() == plugdev_group->gr_gid) {
-+    if (getegid() == plugdev_group->gr_gid) {
-         // The user is in plugdev so the problem is likely with the udev rules.
-         return "user in plugdev group; are your udev rules wrong?";
-     }
-diff -upr core.orig/adb/sysdeps/posix/network.cpp core/adb/sysdeps/posix/network.cpp
---- core.orig/adb/sysdeps/posix/network.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/sysdeps/posix/network.cpp	2018-02-25 10:35:06.661418453 +0100
-@@ -21,6 +21,7 @@
- #include <sys/socket.h>
- 
- #include <string>
-+#include <string.h>
- 
- #include "adb_unique_fd.h"
- 
-diff -upr core.orig/base/errors_unix.cpp core/base/errors_unix.cpp
---- core.orig/base/errors_unix.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/errors_unix.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -17,6 +17,7 @@
- #include "android-base/errors.h"
- 
- #include <errno.h>
-+#include <string.h>
- 
- namespace android {
- namespace base {
-diff -upr core.orig/base/file.cpp core/base/file.cpp
---- core.orig/base/file.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/file.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -22,6 +22,7 @@
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <unistd.h>
-+#include <string.h>
- 
- #include <memory>
- #include <mutex>
-diff -upr core.orig/base/logging.cpp core/base/logging.cpp
---- core.orig/base/logging.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/logging.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -23,6 +23,7 @@
- #include <fcntl.h>
- #include <libgen.h>
- #include <time.h>
-+#include <string.h>
- 
- // For getprogname(3) or program_invocation_short_name.
- #if defined(__ANDROID__) || defined(__APPLE__)
-@@ -89,7 +90,7 @@ static thread_id GetThreadId() {
- }
- 
- namespace {
--#if defined(__GLIBC__)
-+#if defined(__linux__)
- const char* getprogname() {
-   return program_invocation_short_name;
- }
-diff -upr core.orig/fastboot/fs.cpp core/fastboot/fs.cpp
---- core.orig/fastboot/fs.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/fastboot/fs.cpp	2018-02-25 10:35:06.651418422 +0100
-@@ -108,7 +108,7 @@ static int generate_ext4_image(const cha
-     static constexpr int block_size = 4096;
-     const std::string exec_dir = android::base::GetExecutableDirectory();
- 
--    const std::string mke2fs_path = exec_dir + "/mke2fs";
-+    const std::string mke2fs_path = exec_dir + "/mke2fs.android";
-     std::vector<const char*> mke2fs_args = {mke2fs_path.c_str(), "-t", "ext4", "-b"};
- 
-     std::string block_size_str = std::to_string(block_size);
-diff -upr core.orig/fastboot/socket.cpp core/fastboot/socket.cpp
---- core.orig/fastboot/socket.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/fastboot/socket.cpp	2018-02-25 10:35:06.651418422 +0100
-@@ -28,6 +28,8 @@
- 
- #include "socket.h"
- 
-+#include <sys/select.h>
-+
- #include <android-base/errors.h>
- #include <android-base/stringprintf.h>
- 
-diff -upr core.orig/libsparse/sparse_read.cpp core/libsparse/sparse_read.cpp
---- core.orig/libsparse/sparse_read.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/libsparse/sparse_read.cpp	2018-02-25 10:35:06.621418331 +0100
-@@ -26,6 +26,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string>
-+#include <string.h>
- #include <unistd.h>
- 
- #include <sparse/sparse.h>
-diff -upr selinux.orig/libsepol/src/private.h selinux/libsepol/src/private.h
---- selinux.orig/libsepol/src/private.h	2017-08-13 09:34:17.000000000 +0200
-+++ selinux/libsepol/src/private.h	2018-02-25 10:36:31.765008355 +0100
-@@ -14,7 +14,7 @@
- #endif
- 
- #include <errno.h>
--#include <dso.h>
-+#include "dso.h"
- 
- #ifdef __APPLE__
- #define __BYTE_ORDER  BYTE_ORDER
-diff -upr selinux.orig/libsepol/src/util.c selinux/libsepol/src/util.c
---- selinux.orig/libsepol/src/util.c	2017-08-13 09:34:17.000000000 +0200
-+++ selinux/libsepol/src/util.c	2018-02-25 10:36:31.765008355 +0100
-@@ -27,7 +27,7 @@
- #include <sepol/policydb/flask_types.h>
- #include <sepol/policydb/policydb.h>
- #include <sepol/policydb/util.h>
--#include <dso.h>
-+#include "dso.h"
- 
- struct val_to_name {
- 	unsigned int val;
-diff -upr e2fsprogs.orig/contrib/android/perms.c e2fsprogs/contrib/android/perms.c
---- e2fsprogs.orig/contrib/android/perms.c	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/contrib/android/perms.c	2018-02-25 10:37:13.048466147 +0100
-@@ -5,6 +5,7 @@
- #include "support/nls-enable.h"
- #include <time.h>
- #include <sys/stat.h>
-+#include "private/android_filesystem_capability.h"
- 
- #ifndef XATTR_SELINUX_SUFFIX
- # define XATTR_SELINUX_SUFFIX  "selinux"
-diff -upr e2fsprogs.orig/lib/ext2fs/bitops.h e2fsprogs/lib/ext2fs/bitops.h
---- e2fsprogs.orig/lib/ext2fs/bitops.h	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/lib/ext2fs/bitops.h	2018-02-25 10:37:13.028466087 +0100
-@@ -233,11 +233,11 @@ extern errcode_t ext2fs_find_first_set_g
- #if (__STDC_VERSION__ >= 199901L)
- #define _INLINE_ extern inline
- #else
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #endif
- #else /* !INCLUDE_INLINE FUNCS */
- #if (__STDC_VERSION__ >= 199901L)
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #else /* not C99 */
- #ifdef __GNUC__
- #define _INLINE_ extern __inline__
-diff -upr e2fsprogs.orig/lib/ext2fs/ext2fs.h e2fsprogs/lib/ext2fs/ext2fs.h
---- e2fsprogs.orig/lib/ext2fs/ext2fs.h	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/lib/ext2fs/ext2fs.h	2018-02-25 10:37:13.028466087 +0100
-@@ -53,9 +53,7 @@ extern "C" {
-  */
- #define EXT2_LIB_CURRENT_REV	EXT2_DYNAMIC_REV
- 
--#ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
--#endif
- 
- #include <stdio.h>
- #include <stdlib.h>
-@@ -1736,7 +1734,7 @@ extern const struct ext2_inode *ext2fs_c
- #define _INLINE_ extern
- #else
- #if (__STDC_VERSION__ >= 199901L)
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #else
- #ifdef __GNUC__
- #define _INLINE_ extern __inline__
diff --git a/srcpkgs/android-tools/patches/undef__USE_GNU.patch b/srcpkgs/android-tools/patches/undef__USE_GNU.patch
deleted file mode 100644
index 03fb129c1c1..00000000000
--- a/srcpkgs/android-tools/patches/undef__USE_GNU.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Source: John
-Upstream: No
-Reason: Conflicting declaration of copy_file_range on GLIBC
-
-FAILED: e2fsprogs/misc/create_inode.c.o 
-cc -std=gnu11 -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe     -Ie2fsprogs/lib -Ie2fsprogs/lib/ext2fs -Icore/libsparse/include -c e2fsprogs/misc/create_inode.c -o e2fsprogs/misc/create_inode.c.o
-e2fsprogs/misc/create_inode.c:406:18: error: conflicting types for 'copy_file_range'
- static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
-                  ^~~~~~~~~~~~~~~
-In file included from e2fsprogs/misc/create_inode.c:20:
-/usr/include/unistd.h:1107:9: note: previous declaration of 'copy_file_range' was here
- ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
-         ^~~~~~~~~~~~~~~
-
---- e2fsprogs/misc/create_inode.c	2019-01-02 20:07:51.685424116 +0100
-+++ -	2019-01-02 20:08:17.379127932 +0100
-@@ -17,6 +17,7 @@
- #include <time.h>
- #include <sys/stat.h>
- #include <sys/types.h>
-+#undef __USE_GNU
- #include <unistd.h>
- #include <limits.h> /* for PATH_MAX */
- #ifdef HAVE_ATTR_XATTR_H
diff --git a/srcpkgs/android-tools/template b/srcpkgs/android-tools/template
index 12806884ec0..694c010302b 100644
--- a/srcpkgs/android-tools/template
+++ b/srcpkgs/android-tools/template
@@ -1,56 +1,21 @@
 # Template file for 'android-tools'
 pkgname=android-tools
-# NOTE: not all upstream updates has code changes for the parts
-#       of android used by android-tools. Check for diff with:
-#         curl -L http://git.io/vvC0Z | sh -s 5.0.2_r1 5.1.0_r1
-version=9.0.0r45
-revision=2
-archs="x86_64* i686*"
-_distver=${version/r/_r}
-#See https://android.googlesource.com/platform/development/+/refs/tags/android-${_distver}/sdk/plat_tools_source.prop_template
-_apiver="28.0.0 rc1"
-create_wrksrc=yes
-hostmakedepends="ruby cmake ninja perl go"
+version=29.0.3
+revision=1
+archs="armv7l* aarch64* x86_64* i686*"
+build_style=cmake
+configure_args="-DCMAKE_CXX_FLAGS=-D_FILE_OFFSET_BITS=64
+ -DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64"
+hostmakedepends="perl go"
 makedepends="gtest-devel zlib-devel libressl-devel libusb-devel pcre2-devel"
 short_desc="Android platform tools (adb and fastboot)"
 maintainer="John <johnz@posteo.net>"
 license="Apache-2.0, ISC, GPL-2.0-only, MIT"
 homepage="http://developer.android.com/tools/help/adb.html"
-_baseurl=https://android.googlesource.com/platform
-distfiles="
- ${_baseurl}/system/core/+archive/android-${_distver}.tar.gz>core.tar.gz
- ${_baseurl}/system/extras/+archive/android-${_distver}.tar.gz>extras.tar.gz
- ${_baseurl}/external/selinux/+archive/android-${_distver}.tar.gz>selinux.tar.gz
- ${_baseurl}/external/f2fs-tools/+archive/android-${_distver}.tar.gz>f2fs-tools.tar.gz
- ${_baseurl}/external/e2fsprogs/+archive/android-${_distver}.tar.gz>e2fsprogs.tar.gz
- ${_baseurl}/external/avb/+archive/android-${_distver}.tar.gz>avb.tar.gz
- https://boringssl.googlesource.com/boringssl/+archive/3538.tar.gz>boringssl.tar.gz"
-# Contents checksums because the tarballs change with every download
-checksum="@dfaea8c40be4a8bbd1df513ab3516ff88e92430ee0fde399dd7e7e09ec21cd29
- @0a43d228088faabe8b7150fa752c8b0c002503c0d830d8470ecea351f195bbb3
- @9f2b5e379eca4c56e2d422598831bfd7bdf2b7b3c3d011ce513c7603aa46b574
- @f1efc86a1e78521f4754d184d682c1f6660c04f74496913f37cae9e2670db0e8
- @e98509632e865e792dc4b344b0a1ada0662dda7571534fa7c5d1a8902dcfb0f4
- @5c2fcb88154f9b6ffed8d24a069e4bad0a7aea1936be2ce18af972ad8762e09a
- @452e29d95f8da494896e3335931e928d9b7c94500a5793101bb19629cd7dea8c"
-
-do_extract() {
-	local tarball p
-	for p in ${distfiles}; do
-		tarball=${p##*>}
-		mkdir -p ${wrksrc}/${tarball/.*}
-		tar -x --no-same-permissions --no-same-owner -f \
-			${XBPS_SRCDISTDIR}/${pkgname}-${version}/${tarball} \
-			-C ${wrksrc}/${tarball/.*}
-	done
-}
+distfiles="https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz"
+checksum=4cf79878356428b290eb5e659e7daebe036cbb99cf8c2dacb92586b2a5f856fc
 
 pre_configure() {
-	PKGVER="${_apiver}-void-${version}_${revision}" ${FILESDIR}/generate_build.rb > build.ninja
-
-	mkdir -p boringssl/build
-	cd boringssl/build
-
 	# Don't check for CROSS_COMPILING, since i686 container/chroot inside
 	# x86_64 host will failed to build this.
 	if [ "${XBPS_TARGET_MACHINE}" = i686 ] && [ "$(uname -m)" = "x86_64" ]; then
@@ -62,34 +27,14 @@ pre_configure() {
 		SET(CMAKE_CXX_COMPILER ${CXX})
 		SET(CMAKE_SYSTEM_PROCESSOR x86)
 		_EOF
+		configure_args+=" ${boring_ssl_cmake_args}"
 	fi
 
-	cmake -GNinja \
-		-DBUILD_SHARED_LIBS=FALSE \
-		-DCMAKE_BUILD_TYPE=RELEASE \
-		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-		-DCMAKE_C_FLAGS="$CFLAGS" \
-		$boring_ssl_cmake_args \
-		..
-	ninja
 }
 
-do_build() {
-	ninja
-}
-
-do_install() {
-	for i in adb fastboot mke2fs.android e2fsdroid ext2simg \
-		core/mkbootimg/mkbootimg avb/avbtool ;do
-		vbin $i
-	done
-	vlicense boringssl/LICENSE boringssl.LICENSE
-	vlicense boringssl/third_party/fiat/LICENSE fiat.LICENSE
-	vlicense boringssl/third_party/googletest/LICENSE gtest.LICENSE
-	vlicense boringssl/third_party/android-cmake/LICENSE android-cmake.LICENSE
+post_install() {
+	vlicense vendor/boringssl/LICENSE boringssl.LICENSE
+	vlicense vendor/boringssl/third_party/fiat/LICENSE fiat.LICENSE
+	vlicense vendor/boringssl/third_party/googletest/LICENSE gtest.LICENSE
 	vsv adb
 }
-
-# REMARKS:
-# If there is any reason at all that fastboot may not be a position independent
-# executable, please document it here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] android-tools: update to 29.0.3.
  2019-10-01 10:59 [PR PATCH] [WIP] android-tools: update to 29.0.3 voidlinux-github
  2019-10-01 11:43 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-10-01 11:43 ` voidlinux-github
  2019-10-05 22:40 ` [PR PATCH] [Merged]: " voidlinux-github
  2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-10-01 11:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

There is an updated pull request by Johnnynator against master on the void-packages repository

https://github.com/Johnnynator/void-packages android-tools
https://github.com/void-linux/void-packages/pull/14878

[WIP] android-tools: update to 29.0.3.
None

A patch file from https://github.com/void-linux/void-packages/pull/14878.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-android-tools-14878.patch --]
[-- Type: text/x-diff, Size: 16368 bytes --]

From 0c01ce45e39f531ab3a218aadcae9548bc52756d Mon Sep 17 00:00:00 2001
From: John <johnz@posteo.net>
Date: Mon, 30 Sep 2019 18:26:37 +0300
Subject: [PATCH] android-tools: update to 29.0.3.

---
 srcpkgs/android-tools/patches/gcc-fixes.patch |  30 ---
 srcpkgs/android-tools/patches/glibc.patch     |  23 ++
 .../patches/include-sys-sysmacros.patch       |  10 -
 .../android-tools/patches/musl-fixes.patch    | 199 ------------------
 .../patches/undef__USE_GNU.patch              |  24 ---
 srcpkgs/android-tools/template                |  83 ++------
 6 files changed, 37 insertions(+), 332 deletions(-)
 delete mode 100644 srcpkgs/android-tools/patches/gcc-fixes.patch
 create mode 100644 srcpkgs/android-tools/patches/glibc.patch
 delete mode 100644 srcpkgs/android-tools/patches/include-sys-sysmacros.patch
 delete mode 100644 srcpkgs/android-tools/patches/musl-fixes.patch
 delete mode 100644 srcpkgs/android-tools/patches/undef__USE_GNU.patch

diff --git a/srcpkgs/android-tools/patches/gcc-fixes.patch b/srcpkgs/android-tools/patches/gcc-fixes.patch
deleted file mode 100644
index fc0e60fa06e..00000000000
--- a/srcpkgs/android-tools/patches/gcc-fixes.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- core/adb/sysdeps.h
-+++ core/adb/sysdeps.h
-@@ -66,6 +66,11 @@
- #endif
- #endif
- 
-+#ifndef __clang__
-+#define _Nonnull
-+#define _Nullable
-+#endif
-+
- #ifdef _WIN32
- 
- // Clang-only nullability specifiers
---- core/libcutils/include/cutils/trace.h
-+++ core/libcutils/include/cutils/trace.h
-@@ -18,7 +18,13 @@
- #define _LIBS_CUTILS_TRACE_H
- 
- #include <inttypes.h>
-+// https://gcc.gnu.org/PR60932
-+#ifdef __cplusplus
-+#include <atomic>
-+using namespace std;
-+#else
- #include <stdatomic.h>
-+#endif
- #include <stdbool.h>
- #include <stdint.h>
- #include <stdio.h>
diff --git a/srcpkgs/android-tools/patches/glibc.patch b/srcpkgs/android-tools/patches/glibc.patch
new file mode 100644
index 00000000000..399ac3ff0d7
--- /dev/null
+++ b/srcpkgs/android-tools/patches/glibc.patch
@@ -0,0 +1,23 @@
+--- vendor/core/libcutils/include/cutils/threads.h	2019-08-21 20:14:13.000000000 +0300
++++ -	2019-10-01 12:14:10.187934016 +0300
+@@ -33,7 +33,9 @@
+ // Deprecated: use android::base::GetThreadId instead, which doesn't truncate on Mac/Windows.
+ //
+ 
++#ifndef __GLIBC__
+ extern pid_t gettid();
++#endif
+ 
+ //
+ // Deprecated: use `_Thread_local` in C or `thread_local` in C++.
+--- vendor/core/libcutils/threads.cpp	2018-10-25 18:22:12.000000000 +0300
++++ -	2019-10-01 12:14:27.548527357 +0300
+@@ -32,7 +32,7 @@
+ #endif
+ 
+ // No definition needed for Android because we'll just pick up bionic's copy.
+-#ifndef __ANDROID__
++#ifndef __GLIBC__
+ pid_t gettid() {
+ #if defined(__APPLE__)
+   uint64_t tid;
diff --git a/srcpkgs/android-tools/patches/include-sys-sysmacros.patch b/srcpkgs/android-tools/patches/include-sys-sysmacros.patch
deleted file mode 100644
index 592473ac93f..00000000000
--- a/srcpkgs/android-tools/patches/include-sys-sysmacros.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- core/adb/client/usb_linux.cpp	2019-01-02 20:03:26.218600891 +0100
-+++ -	2019-01-02 20:03:57.806149467 +0100
-@@ -28,6 +28,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
-+#include <sys/sysmacros.h>
- #include <sys/ioctl.h>
- #include <sys/time.h>
- #include <sys/types.h>
diff --git a/srcpkgs/android-tools/patches/musl-fixes.patch b/srcpkgs/android-tools/patches/musl-fixes.patch
deleted file mode 100644
index 235ef68854e..00000000000
--- a/srcpkgs/android-tools/patches/musl-fixes.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-Patch has been taken from Arch Linux with some minor modifications for
-needed to build android-tools with musl libc.
-
-diff -upr core.orig/adb/client/usb_libusb.cpp core/adb/client/usb_libusb.cpp
---- core.orig/adb/client/usb_libusb.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/client/usb_libusb.cpp	2018-02-25 10:35:06.661418453 +0100
-@@ -21,6 +21,7 @@
- #include <stdint.h>
- 
- #include <atomic>
-+#include <condition_variable>
- #include <chrono>
- #include <memory>
- #include <mutex>
-@@ -28,7 +29,7 @@
- #include <thread>
- #include <unordered_map>
- 
--#include <libusb/libusb.h>
-+#include <libusb-1.0/libusb.h>
- 
- #include <android-base/file.h>
- #include <android-base/logging.h>
-diff -upr core.orig/adb/diagnose_usb.cpp core/adb/diagnose_usb.cpp
---- core.orig/adb/diagnose_usb.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/diagnose_usb.cpp	2018-02-25 10:35:06.658085109 +0100
-@@ -45,9 +45,7 @@ static std::string GetUdevProblem() {
-         return "";
-     }
- 
--    // getgroups(2) indicates that the GNU group_member(3) may not check the egid so we check it
--    // additionally just to be sure.
--    if (group_member(plugdev_group->gr_gid) || getegid() == plugdev_group->gr_gid) {
-+    if (getegid() == plugdev_group->gr_gid) {
-         // The user is in plugdev so the problem is likely with the udev rules.
-         return "user in plugdev group; are your udev rules wrong?";
-     }
-diff -upr core.orig/adb/sysdeps/posix/network.cpp core/adb/sysdeps/posix/network.cpp
---- core.orig/adb/sysdeps/posix/network.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/adb/sysdeps/posix/network.cpp	2018-02-25 10:35:06.661418453 +0100
-@@ -21,6 +21,7 @@
- #include <sys/socket.h>
- 
- #include <string>
-+#include <string.h>
- 
- #include "adb_unique_fd.h"
- 
-diff -upr core.orig/base/errors_unix.cpp core/base/errors_unix.cpp
---- core.orig/base/errors_unix.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/errors_unix.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -17,6 +17,7 @@
- #include "android-base/errors.h"
- 
- #include <errno.h>
-+#include <string.h>
- 
- namespace android {
- namespace base {
-diff -upr core.orig/base/file.cpp core/base/file.cpp
---- core.orig/base/file.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/file.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -22,6 +22,7 @@
- #include <sys/stat.h>
- #include <sys/types.h>
- #include <unistd.h>
-+#include <string.h>
- 
- #include <memory>
- #include <mutex>
-diff -upr core.orig/base/logging.cpp core/base/logging.cpp
---- core.orig/base/logging.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/base/logging.cpp	2018-02-25 10:35:06.654751766 +0100
-@@ -23,6 +23,7 @@
- #include <fcntl.h>
- #include <libgen.h>
- #include <time.h>
-+#include <string.h>
- 
- // For getprogname(3) or program_invocation_short_name.
- #if defined(__ANDROID__) || defined(__APPLE__)
-@@ -89,7 +90,7 @@ static thread_id GetThreadId() {
- }
- 
- namespace {
--#if defined(__GLIBC__)
-+#if defined(__linux__)
- const char* getprogname() {
-   return program_invocation_short_name;
- }
-diff -upr core.orig/fastboot/fs.cpp core/fastboot/fs.cpp
---- core.orig/fastboot/fs.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/fastboot/fs.cpp	2018-02-25 10:35:06.651418422 +0100
-@@ -108,7 +108,7 @@ static int generate_ext4_image(const cha
-     static constexpr int block_size = 4096;
-     const std::string exec_dir = android::base::GetExecutableDirectory();
- 
--    const std::string mke2fs_path = exec_dir + "/mke2fs";
-+    const std::string mke2fs_path = exec_dir + "/mke2fs.android";
-     std::vector<const char*> mke2fs_args = {mke2fs_path.c_str(), "-t", "ext4", "-b"};
- 
-     std::string block_size_str = std::to_string(block_size);
-diff -upr core.orig/fastboot/socket.cpp core/fastboot/socket.cpp
---- core.orig/fastboot/socket.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/fastboot/socket.cpp	2018-02-25 10:35:06.651418422 +0100
-@@ -28,6 +28,8 @@
- 
- #include "socket.h"
- 
-+#include <sys/select.h>
-+
- #include <android-base/errors.h>
- #include <android-base/stringprintf.h>
- 
-diff -upr core.orig/libsparse/sparse_read.cpp core/libsparse/sparse_read.cpp
---- core.orig/libsparse/sparse_read.cpp	2017-11-29 19:11:44.000000000 +0100
-+++ core/libsparse/sparse_read.cpp	2018-02-25 10:35:06.621418331 +0100
-@@ -26,6 +26,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <string>
-+#include <string.h>
- #include <unistd.h>
- 
- #include <sparse/sparse.h>
-diff -upr selinux.orig/libsepol/src/private.h selinux/libsepol/src/private.h
---- selinux.orig/libsepol/src/private.h	2017-08-13 09:34:17.000000000 +0200
-+++ selinux/libsepol/src/private.h	2018-02-25 10:36:31.765008355 +0100
-@@ -14,7 +14,7 @@
- #endif
- 
- #include <errno.h>
--#include <dso.h>
-+#include "dso.h"
- 
- #ifdef __APPLE__
- #define __BYTE_ORDER  BYTE_ORDER
-diff -upr selinux.orig/libsepol/src/util.c selinux/libsepol/src/util.c
---- selinux.orig/libsepol/src/util.c	2017-08-13 09:34:17.000000000 +0200
-+++ selinux/libsepol/src/util.c	2018-02-25 10:36:31.765008355 +0100
-@@ -27,7 +27,7 @@
- #include <sepol/policydb/flask_types.h>
- #include <sepol/policydb/policydb.h>
- #include <sepol/policydb/util.h>
--#include <dso.h>
-+#include "dso.h"
- 
- struct val_to_name {
- 	unsigned int val;
-diff -upr e2fsprogs.orig/contrib/android/perms.c e2fsprogs/contrib/android/perms.c
---- e2fsprogs.orig/contrib/android/perms.c	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/contrib/android/perms.c	2018-02-25 10:37:13.048466147 +0100
-@@ -5,6 +5,7 @@
- #include "support/nls-enable.h"
- #include <time.h>
- #include <sys/stat.h>
-+#include "private/android_filesystem_capability.h"
- 
- #ifndef XATTR_SELINUX_SUFFIX
- # define XATTR_SELINUX_SUFFIX  "selinux"
-diff -upr e2fsprogs.orig/lib/ext2fs/bitops.h e2fsprogs/lib/ext2fs/bitops.h
---- e2fsprogs.orig/lib/ext2fs/bitops.h	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/lib/ext2fs/bitops.h	2018-02-25 10:37:13.028466087 +0100
-@@ -233,11 +233,11 @@ extern errcode_t ext2fs_find_first_set_g
- #if (__STDC_VERSION__ >= 199901L)
- #define _INLINE_ extern inline
- #else
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #endif
- #else /* !INCLUDE_INLINE FUNCS */
- #if (__STDC_VERSION__ >= 199901L)
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #else /* not C99 */
- #ifdef __GNUC__
- #define _INLINE_ extern __inline__
-diff -upr e2fsprogs.orig/lib/ext2fs/ext2fs.h e2fsprogs/lib/ext2fs/ext2fs.h
---- e2fsprogs.orig/lib/ext2fs/ext2fs.h	2017-11-29 00:28:33.000000000 +0100
-+++ e2fsprogs/lib/ext2fs/ext2fs.h	2018-02-25 10:37:13.028466087 +0100
-@@ -53,9 +53,7 @@ extern "C" {
-  */
- #define EXT2_LIB_CURRENT_REV	EXT2_DYNAMIC_REV
- 
--#ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
--#endif
- 
- #include <stdio.h>
- #include <stdlib.h>
-@@ -1736,7 +1734,7 @@ extern const struct ext2_inode *ext2fs_c
- #define _INLINE_ extern
- #else
- #if (__STDC_VERSION__ >= 199901L)
--#define _INLINE_ inline
-+#define _INLINE_ static inline
- #else
- #ifdef __GNUC__
- #define _INLINE_ extern __inline__
diff --git a/srcpkgs/android-tools/patches/undef__USE_GNU.patch b/srcpkgs/android-tools/patches/undef__USE_GNU.patch
deleted file mode 100644
index 03fb129c1c1..00000000000
--- a/srcpkgs/android-tools/patches/undef__USE_GNU.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Source: John
-Upstream: No
-Reason: Conflicting declaration of copy_file_range on GLIBC
-
-FAILED: e2fsprogs/misc/create_inode.c.o 
-cc -std=gnu11 -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe     -Ie2fsprogs/lib -Ie2fsprogs/lib/ext2fs -Icore/libsparse/include -c e2fsprogs/misc/create_inode.c -o e2fsprogs/misc/create_inode.c.o
-e2fsprogs/misc/create_inode.c:406:18: error: conflicting types for 'copy_file_range'
- static errcode_t copy_file_range(ext2_filsys fs, int fd, ext2_file_t e2_file,
-                  ^~~~~~~~~~~~~~~
-In file included from e2fsprogs/misc/create_inode.c:20:
-/usr/include/unistd.h:1107:9: note: previous declaration of 'copy_file_range' was here
- ssize_t copy_file_range (int __infd, __off64_t *__pinoff,
-         ^~~~~~~~~~~~~~~
-
---- e2fsprogs/misc/create_inode.c	2019-01-02 20:07:51.685424116 +0100
-+++ -	2019-01-02 20:08:17.379127932 +0100
-@@ -17,6 +17,7 @@
- #include <time.h>
- #include <sys/stat.h>
- #include <sys/types.h>
-+#undef __USE_GNU
- #include <unistd.h>
- #include <limits.h> /* for PATH_MAX */
- #ifdef HAVE_ATTR_XATTR_H
diff --git a/srcpkgs/android-tools/template b/srcpkgs/android-tools/template
index 12806884ec0..694c010302b 100644
--- a/srcpkgs/android-tools/template
+++ b/srcpkgs/android-tools/template
@@ -1,56 +1,21 @@
 # Template file for 'android-tools'
 pkgname=android-tools
-# NOTE: not all upstream updates has code changes for the parts
-#       of android used by android-tools. Check for diff with:
-#         curl -L http://git.io/vvC0Z | sh -s 5.0.2_r1 5.1.0_r1
-version=9.0.0r45
-revision=2
-archs="x86_64* i686*"
-_distver=${version/r/_r}
-#See https://android.googlesource.com/platform/development/+/refs/tags/android-${_distver}/sdk/plat_tools_source.prop_template
-_apiver="28.0.0 rc1"
-create_wrksrc=yes
-hostmakedepends="ruby cmake ninja perl go"
+version=29.0.3
+revision=1
+archs="armv7l* aarch64* x86_64* i686*"
+build_style=cmake
+configure_args="-DCMAKE_CXX_FLAGS=-D_FILE_OFFSET_BITS=64
+ -DCMAKE_C_FLAGS=-D_FILE_OFFSET_BITS=64"
+hostmakedepends="perl go"
 makedepends="gtest-devel zlib-devel libressl-devel libusb-devel pcre2-devel"
 short_desc="Android platform tools (adb and fastboot)"
 maintainer="John <johnz@posteo.net>"
 license="Apache-2.0, ISC, GPL-2.0-only, MIT"
 homepage="http://developer.android.com/tools/help/adb.html"
-_baseurl=https://android.googlesource.com/platform
-distfiles="
- ${_baseurl}/system/core/+archive/android-${_distver}.tar.gz>core.tar.gz
- ${_baseurl}/system/extras/+archive/android-${_distver}.tar.gz>extras.tar.gz
- ${_baseurl}/external/selinux/+archive/android-${_distver}.tar.gz>selinux.tar.gz
- ${_baseurl}/external/f2fs-tools/+archive/android-${_distver}.tar.gz>f2fs-tools.tar.gz
- ${_baseurl}/external/e2fsprogs/+archive/android-${_distver}.tar.gz>e2fsprogs.tar.gz
- ${_baseurl}/external/avb/+archive/android-${_distver}.tar.gz>avb.tar.gz
- https://boringssl.googlesource.com/boringssl/+archive/3538.tar.gz>boringssl.tar.gz"
-# Contents checksums because the tarballs change with every download
-checksum="@dfaea8c40be4a8bbd1df513ab3516ff88e92430ee0fde399dd7e7e09ec21cd29
- @0a43d228088faabe8b7150fa752c8b0c002503c0d830d8470ecea351f195bbb3
- @9f2b5e379eca4c56e2d422598831bfd7bdf2b7b3c3d011ce513c7603aa46b574
- @f1efc86a1e78521f4754d184d682c1f6660c04f74496913f37cae9e2670db0e8
- @e98509632e865e792dc4b344b0a1ada0662dda7571534fa7c5d1a8902dcfb0f4
- @5c2fcb88154f9b6ffed8d24a069e4bad0a7aea1936be2ce18af972ad8762e09a
- @452e29d95f8da494896e3335931e928d9b7c94500a5793101bb19629cd7dea8c"
-
-do_extract() {
-	local tarball p
-	for p in ${distfiles}; do
-		tarball=${p##*>}
-		mkdir -p ${wrksrc}/${tarball/.*}
-		tar -x --no-same-permissions --no-same-owner -f \
-			${XBPS_SRCDISTDIR}/${pkgname}-${version}/${tarball} \
-			-C ${wrksrc}/${tarball/.*}
-	done
-}
+distfiles="https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz"
+checksum=4cf79878356428b290eb5e659e7daebe036cbb99cf8c2dacb92586b2a5f856fc
 
 pre_configure() {
-	PKGVER="${_apiver}-void-${version}_${revision}" ${FILESDIR}/generate_build.rb > build.ninja
-
-	mkdir -p boringssl/build
-	cd boringssl/build
-
 	# Don't check for CROSS_COMPILING, since i686 container/chroot inside
 	# x86_64 host will failed to build this.
 	if [ "${XBPS_TARGET_MACHINE}" = i686 ] && [ "$(uname -m)" = "x86_64" ]; then
@@ -62,34 +27,14 @@ pre_configure() {
 		SET(CMAKE_CXX_COMPILER ${CXX})
 		SET(CMAKE_SYSTEM_PROCESSOR x86)
 		_EOF
+		configure_args+=" ${boring_ssl_cmake_args}"
 	fi
 
-	cmake -GNinja \
-		-DBUILD_SHARED_LIBS=FALSE \
-		-DCMAKE_BUILD_TYPE=RELEASE \
-		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-		-DCMAKE_C_FLAGS="$CFLAGS" \
-		$boring_ssl_cmake_args \
-		..
-	ninja
 }
 
-do_build() {
-	ninja
-}
-
-do_install() {
-	for i in adb fastboot mke2fs.android e2fsdroid ext2simg \
-		core/mkbootimg/mkbootimg avb/avbtool ;do
-		vbin $i
-	done
-	vlicense boringssl/LICENSE boringssl.LICENSE
-	vlicense boringssl/third_party/fiat/LICENSE fiat.LICENSE
-	vlicense boringssl/third_party/googletest/LICENSE gtest.LICENSE
-	vlicense boringssl/third_party/android-cmake/LICENSE android-cmake.LICENSE
+post_install() {
+	vlicense vendor/boringssl/LICENSE boringssl.LICENSE
+	vlicense vendor/boringssl/third_party/fiat/LICENSE fiat.LICENSE
+	vlicense vendor/boringssl/third_party/googletest/LICENSE gtest.LICENSE
 	vsv adb
 }
-
-# REMARKS:
-# If there is any reason at all that fastboot may not be a position independent
-# executable, please document it here.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Merged]: [WIP] android-tools: update to 29.0.3.
  2019-10-01 10:59 [PR PATCH] [WIP] android-tools: update to 29.0.3 voidlinux-github
  2019-10-01 11:43 ` [PR PATCH] [Updated] " voidlinux-github
  2019-10-01 11:43 ` voidlinux-github
@ 2019-10-05 22:40 ` voidlinux-github
  2 siblings, 0 replies; 4+ messages in thread
From: voidlinux-github @ 2019-10-05 22:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

There's a merged pull request on the void-packages repository

[WIP] android-tools: update to 29.0.3.
https://github.com/void-linux/void-packages/pull/14878

Description:
None

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-05 22:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 10:59 [PR PATCH] [WIP] android-tools: update to 29.0.3 voidlinux-github
2019-10-01 11:43 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-01 11:43 ` voidlinux-github
2019-10-05 22:40 ` [PR PATCH] [Merged]: " voidlinux-github

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 NNTP newsgroup(s).