pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/devel
Module Name: pkgsrc
Committed By: abs
Date: Sat Sep 21 13:14:58 UTC 2024
Modified Files:
pkgsrc/devel: Makefile
Added Files:
pkgsrc/devel/android-tools-adb: DESCR Makefile PLIST distinfo
pkgsrc/devel/android-tools-adb/files: Makefile
pkgsrc/devel/android-tools-adb/patches: patch-adb__auth__host.c
patch-get__my__path__freebsd.c patch-usb__libusb.c
Log Message:
Import android-tools-adb from pkgsrc-wip
Android Debug Bridge (adb) is a versatile command line tool that
lets you communicate with an emulator instance or connected
Android-powered device.
This package builds the last C version of ADB - from Android 5.x
Updated to the last Android 5.x source - android-5.1.1_r29
To generate a diff of this commit:
cvs rdiff -u -r1.4345 -r1.4346 pkgsrc/devel/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/android-tools-adb/DESCR \
pkgsrc/devel/android-tools-adb/Makefile \
pkgsrc/devel/android-tools-adb/PLIST \
pkgsrc/devel/android-tools-adb/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/devel/android-tools-adb/files/Makefile
cvs rdiff -u -r0 -r1.1 \
pkgsrc/devel/android-tools-adb/patches/patch-adb__auth__host.c \
pkgsrc/devel/android-tools-adb/patches/patch-get__my__path__freebsd.c \
pkgsrc/devel/android-tools-adb/patches/patch-usb__libusb.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/devel/Makefile
diff -u pkgsrc/devel/Makefile:1.4345 pkgsrc/devel/Makefile:1.4346
--- pkgsrc/devel/Makefile:1.4345 Tue Sep 17 22:13:06 2024
+++ pkgsrc/devel/Makefile Sat Sep 21 13:14:58 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4345 2024/09/17 22:13:06 js Exp $
+# $NetBSD: Makefile,v 1.4346 2024/09/21 13:14:58 abs Exp $
#
COMMENT= Development utilities
@@ -130,6 +130,7 @@ SUBDIR+= alire
SUBDIR+= allegro
SUBDIR+= allegro5
SUBDIR+= amtk
+SUBDIR+= android-tools-adb
SUBDIR+= anjuta
SUBDIR+= ant-contrib
SUBDIR+= apache-ant
@@ -3082,8 +3083,8 @@ SUBDIR+= py-test-fixture-config
SUBDIR+= py-test-flake8
SUBDIR+= py-test-forked
SUBDIR+= py-test-freezer
-SUBDIR+= py-test-httpserver
SUBDIR+= py-test-home
+SUBDIR+= py-test-httpserver
SUBDIR+= py-test-isort
SUBDIR+= py-test-lazy-fixture
SUBDIR+= py-test-lazy-fixtures
Added files:
Index: pkgsrc/devel/android-tools-adb/DESCR
diff -u /dev/null pkgsrc/devel/android-tools-adb/DESCR:1.1
--- /dev/null Sat Sep 21 13:14:58 2024
+++ pkgsrc/devel/android-tools-adb/DESCR Sat Sep 21 13:14:58 2024
@@ -0,0 +1,5 @@
+Android Debug Bridge (adb) is a versatile command line tool that
+lets you communicate with an emulator instance or connected
+Android-powered device.
+
+This package builds the last C version of ADB - from Android 5.x
Index: pkgsrc/devel/android-tools-adb/Makefile
diff -u /dev/null pkgsrc/devel/android-tools-adb/Makefile:1.1
--- /dev/null Sat Sep 21 13:14:58 2024
+++ pkgsrc/devel/android-tools-adb/Makefile Sat Sep 21 13:14:58 2024
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile,v 1.1 2024/09/21 13:14:58 abs Exp $
+
+DISTNAME= ${GITHUB_PROJECT}-${GITHUB_TAG}
+PKGNAME= android-tools-adb-${GITHUB_TAG:S:android-::C:_r:.:}
+CATEGORIES= devel
+MASTER_SITES= ${MASTER_SITE_GITHUB:=aosp-mirror/}
+GITHUB_PROJECT= platform_system_core
+GITHUB_TAG= android-5.1.1_r29
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://developer.android.com/tools/help/adb.html
+COMMENT= Android debug bridge command line tool
+LICENSE= apache-2.0
+
+WRKSRC= ${WRKDIR}/${DISTNAME}/adb
+USE_TOOLS+= gmake
+
+CPPFLAGS+= -I${BUILDLINK_PREFIX.libusb1}/include/libusb-1.0
+
+INSTALLATION_DIRS+= bin
+
+post-extract:
+ ${CP} ${FILESDIR}/Makefile ${WRKSRC}
+
+.include "../../devel/libusb1/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/devel/android-tools-adb/PLIST
diff -u /dev/null pkgsrc/devel/android-tools-adb/PLIST:1.1
--- /dev/null Sat Sep 21 13:14:58 2024
+++ pkgsrc/devel/android-tools-adb/PLIST Sat Sep 21 13:14:58 2024
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2024/09/21 13:14:58 abs Exp $
+bin/adb
Index: pkgsrc/devel/android-tools-adb/distinfo
diff -u /dev/null pkgsrc/devel/android-tools-adb/distinfo:1.1
--- /dev/null Sat Sep 21 13:14:58 2024
+++ pkgsrc/devel/android-tools-adb/distinfo Sat Sep 21 13:14:58 2024
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2024/09/21 13:14:58 abs Exp $
+
+BLAKE2s (platform_system_core-android-5.1.1_r29.tar.gz) = 8d3017bca117cf35d84ac85bbea89a868e37e5aebd007fb541d5c124735b3894
+SHA512 (platform_system_core-android-5.1.1_r29.tar.gz) = d5097201dd3b535b5322023a1db6d73a9c263322223219a06c7d718eed71b363e85e6ca99ec97b80636e2e48cd21ba6c819cd2b06152ac2e1da335ef42c49c93
+Size (platform_system_core-android-5.1.1_r29.tar.gz) = 1202607 bytes
+SHA1 (patch-adb__auth__host.c) = f0e559f3643e660960c69cd466cf73ec5078b091
+SHA1 (patch-get__my__path__freebsd.c) = 989e47fea3dbf5f0e2b0bd025a03e0cf3f62df2e
+SHA1 (patch-usb__libusb.c) = bde78b96dd4d037287ea7f839dcfb2c50b7d5b0e
Index: pkgsrc/devel/android-tools-adb/files/Makefile
diff -u /dev/null pkgsrc/devel/android-tools-adb/files/Makefile:1.1
--- /dev/null Sat Sep 21 13:14:58 2024
+++ pkgsrc/devel/android-tools-adb/files/Makefile Sat Sep 21 13:14:58 2024
@@ -0,0 +1,64 @@
+# $FreeBSD: 372832 $
+# $NetBSD: Makefile,v 1.1 2024/09/21 13:14:58 abs Exp $
+
+SRCS+= adb.c
+SRCS+= adb_client.c
+SRCS+= adb_auth_host.c
+SRCS+= commandline.c
+SRCS+= console.c
+SRCS+= file_sync_client.c
+SRCS+= fdevent.c
+ifeq ("${OPSYS}", "FreeBSD")
+SRCS+= get_my_path_freebsd.c
+else ifeq ("${OPSYS}", "DragonFly")
+SRCS+= get_my_path_freebsd.c
+else ifeq ("${OPSYS}", "Darwin")
+SRCS+= get_my_path_darwin.c
+else
+SRCS+= get_my_path_linux.c
+endif
+SRCS+= services.c
+SRCS+= sockets.c
+SRCS+= transport.c
+SRCS+= transport_local.c
+SRCS+= transport_usb.c
+SRCS+= usb_libusb.c
+SRCS+= usb_vendors.c
+
+VPATH+= ../libcutils
+SRCS+= socket_inaddr_any_server.c
+SRCS+= socket_local_client.c
+SRCS+= socket_local_server.c
+SRCS+= socket_loopback_client.c
+SRCS+= socket_loopback_server.c
+SRCS+= socket_network_client.c
+SRCS+= load_file.c
+
+VPATH+= ../libzipfile
+SRCS+= centraldir.c
+SRCS+= zipfile.c
+
+
+CPPFLAGS+= -DADB_HOST=1
+CPPFLAGS+= -DHAVE_FORKEXEC=1
+CPPFLAGS+= -DHAVE_SYMLINKS
+CPPFLAGS+= -DHAVE_TERMIO_H
+CPPFLAGS+= -DHAVE_SYS_SOCKET_H
+CPPFLAGS+= -D_FILE_OFFSET_BITS=64
+CPPFLAGS+= -I.
+CPPFLAGS+= -I../include
+
+LIBS+= -lc -pthread -lz -lcrypto -lusb-1.0
+
+OBJS= $(SRCS:.c=.o)
+
+all: adb
+
+adb: $(OBJS)
+ $(CC) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
+
+install: adb
+ ${BSD_INSTALL_PROGRAM} adb ${DESTDIR}${PREFIX}/bin/
+
+clean:
+ rm -rf $(OBJS) adb
Index: pkgsrc/devel/android-tools-adb/patches/patch-adb__auth__host.c
diff -u /dev/null pkgsrc/devel/android-tools-adb/patches/patch-adb__auth__host.c:1.1
--- /dev/null Sat Sep 21 13:14:58 2024
+++ pkgsrc/devel/android-tools-adb/patches/patch-adb__auth__host.c Sat Sep 21 13:14:58 2024
@@ -0,0 +1,56 @@
+$NetBSD: patch-adb__auth__host.c,v 1.1 2024/09/21 13:14:58 abs Exp $
+
+OpenSSL 1.1.x compatibility.
+Use getter for rsa->n, suggested by
+https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes
+
+--- adb_auth_host.c.orig 2014-10-22 00:46:49.000000000 +0000
++++ adb_auth_host.c
+@@ -50,6 +50,18 @@
+ #define ANDROID_PATH ".android"
+ #define ADB_KEY_FILE "adbkey"
+
++#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER < 0x10100000L
++static inline void RSA_get0_key(const RSA *r,
++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
++{
++ if (n)
++ *n = r->n;
++ if (e)
++ *e = r->e;
++ if (d)
++ *d = r->d;
++}
++#endif
+
+ struct adb_private_key {
+ struct listnode node;
+@@ -73,13 +85,17 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
+ BIGNUM* n = BN_new();
+ BIGNUM* n0inv = BN_new();
+
++ const BIGNUM* getter1;
++ const BIGNUM* getter2;
++
+ if (RSA_size(rsa) != RSANUMBYTES) {
+ ret = 0;
+ goto out;
+ }
+
+ BN_set_bit(r32, 32);
+- BN_copy(n, rsa->n);
++ RSA_get0_key(rsa, &getter1, NULL, NULL);
++ BN_copy(n, getter1);
+ BN_set_bit(r, RSANUMWORDS * 32);
+ BN_mod_sqr(rr, r, n, ctx);
+ BN_div(NULL, rem, n, r32, ctx);
+@@ -93,7 +109,8 @@ static int RSA_to_RSAPublicKey(RSA *rsa,
+ BN_div(n, rem, n, r32, ctx);
+ pkey->n[i] = BN_get_word(rem);
+ }
+- pkey->exponent = BN_get_word(rsa->e);
++ RSA_get0_key(rsa, NULL, &getter2, NULL);
++ pkey->exponent = BN_get_word(getter2);
+
+ out:
+ BN_free(n0inv);
Index: pkgsrc/devel/android-tools-adb/patches/patch-get__my__path__freebsd.c
diff -u /dev/null pkgsrc/devel/android-tools-adb/patches/patch-get__my__path__freebsd.c:1.1
--- /dev/null Sat Sep 21 13:14:58 2024
+++ pkgsrc/devel/android-tools-adb/patches/patch-get__my__path__freebsd.c Sat Sep 21 13:14:58 2024
@@ -0,0 +1,34 @@
+$NetBSD: patch-get__my__path__freebsd.c,v 1.1 2024/09/21 13:14:58 abs Exp $
+
+Use sysctl rather than /proc
+
+--- get_my_path_freebsd.c.orig 2014-10-22 00:46:49.000000000 +0000
++++ get_my_path_freebsd.c
+@@ -18,19 +18,18 @@
+ */
+
+ #include <sys/types.h>
++#include <sys/sysctl.h>
+ #include <unistd.h>
+-#include <limits.h>
+-#include <stdio.h>
+
+ void
+ get_my_path(char *exe, size_t maxLen)
+ {
+- char proc[64];
++ int mib[4] = {
++ CTL_KERN,
++ KERN_PROC,
++ KERN_PROC_PATHNAME,
++ getpid()
++ };
+
+- snprintf(proc, sizeof(proc), "/proc/%d/file", getpid());
+-
+- int err = readlink(proc, exe, maxLen - 1);
+-
+- exe[err > 0 ? err : 0] = '\0';
++ sysctl(mib, 4, exe, &maxLen, NULL, 0);
+ }
+-
Index: pkgsrc/devel/android-tools-adb/patches/patch-usb__libusb.c
diff -u /dev/null pkgsrc/devel/android-tools-adb/patches/patch-usb__libusb.c:1.1
--- /dev/null Sat Sep 21 13:14:58 2024
+++ pkgsrc/devel/android-tools-adb/patches/patch-usb__libusb.c Sat Sep 21 13:14:58 2024
@@ -0,0 +1,66 @@
+$NetBSD: patch-usb__libusb.c,v 1.1 2024/09/21 13:14:58 abs Exp $
+
+Patch for chnages libusb interface
+
+--- usb_libusb.c.orig 2014-10-22 00:46:49.000000000 +0000
++++ usb_libusb.c
+@@ -37,7 +37,7 @@
+ #define TRACE_TAG TRACE_USB
+ #include "adb.h"
+
+-static adb_mutex_t usb_lock = ADB_MUTEX_INITIALIZER;
++ADB_MUTEX_DEFINE( usb_lock );
+ static libusb_context *ctx = NULL;
+
+ struct usb_handle
+@@ -246,8 +246,8 @@ void usb_kick(struct usb_handle *h)
+ }
+
+ int
+-check_usb_interface(libusb_interface *interface,
+- libusb_device_descriptor *desc,
++check_usb_interface(struct libusb_interface *interface,
++ struct libusb_device_descriptor *desc,
+ struct usb_handle *uh)
+ {
+ int e;
+@@ -257,7 +257,7 @@ check_usb_interface(libusb_interface *in
+ return -1;
+ }
+
+- libusb_interface_descriptor *idesc = &interface->altsetting[0];
++ const struct libusb_interface_descriptor *idesc = &interface->altsetting[0];
+
+ if (idesc->bNumEndpoints != 2) {
+ D("check_usb_interface(): Interface have not 2 endpoints, ignoring\n");
+@@ -265,7 +265,7 @@ check_usb_interface(libusb_interface *in
+ }
+
+ for (e = 0; e < idesc->bNumEndpoints; e++) {
+- libusb_endpoint_descriptor *edesc = &idesc->endpoint[e];
++ const struct libusb_endpoint_descriptor *edesc = &idesc->endpoint[e];
+
+ if (edesc->bmAttributes != LIBUSB_TRANSFER_TYPE_BULK) {
+ D("check_usb_interface(): Endpoint (%u) is not bulk (%u), ignoring\n",
+@@ -304,8 +304,8 @@ check_usb_interface(libusb_interface *in
+ }
+
+ int
+-check_usb_interfaces(libusb_config_descriptor *config,
+- libusb_device_descriptor *desc, struct usb_handle *uh)
++check_usb_interfaces(struct libusb_config_descriptor *config,
++ struct libusb_device_descriptor *desc, struct usb_handle *uh)
+ {
+ int i;
+
+@@ -382,8 +382,8 @@ check_device(libusb_device *dev)
+ int found = -1;
+ char serial[256] = {0};
+
+- libusb_device_descriptor desc;
+- libusb_config_descriptor *config = NULL;
++ struct libusb_device_descriptor desc;
++ struct libusb_config_descriptor *config = NULL;
+
+ int r = libusb_get_device_descriptor(dev, &desc);
+
Home |
Main Index |
Thread Index |
Old Index