Compare commits

...
Author SHA1 Message Date
Tomas Safarik b39d963afe package nanopb with protocol definitions for generator (#804) 2018-09-18 18:44:40 +02:00
Oliver Smith 9fbfc408a7 WIP: package android-rild + dependencies
liblog and libcutils compile so far. broken stuff:
* nanopb is not packaged properly (we'll need to package the whole
  generator folder and run make in it first or something)
* liblog has some external structs, that are not defined, so linking
  an executable against it will not work yet
* libcutils doesn't link right against liblog - when installed, ldd
  can't find the liblog it linked against
* rild needs a lot more work, the libraries don't get generated as
  shared libraries amongst other errors
2018-09-18 18:44:40 +02:00
11 changed files with 360 additions and 0 deletions

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
pkgname=android-libcutils
pkgver=7.0.0_r34
pkgrel=0
pkgdesc="Android low-level utility library"
url="https://github.com/android/platform_system_core"
arch="all"
license="APACHE2"
depends=""
makedepends="bsd-compat-headers android-liblog android-liblog-dev"
options="!check"
source="
android_platform_system_core-$pkgver.tar.gz::https://github.com/android/platform_system_core/archive/android-${pkgver}.tar.gz
Makefile"
_lib="cutils"
subpackages="$pkgname-dev"
builddir="$srcdir"/platform_system_core-android-$pkgver/lib${_lib}
prepare() {
cp "$srcdir"/Makefile "$builddir"
}
build() {
cd "$builddir"
make
}
package() {
# Library
install -Dm644 "${builddir}/lib${_lib}.so" \
"${pkgdir}/usr/lib/android/lib${_lib}.so"
# Header files
mkdir -p "${pkgdir}/usr/include/android/"
cp -r "${srcdir}/platform_system_core-android-${pkgver}/include/${_lib}" \
"${pkgdir}/usr/include/android/"
}
sha512sums="f84d31db61f86c73b8aecbaf788d43b0a2cc984121fd7244a2f7ca2a2a751437b8708acdd27cb86a260162e866c40f6015f14d52beb3a85e9ae2efd6f44b73f3 android_platform_system_core-7.0.0_r34.tar.gz
2aeab8d7267508a7c570a57f771796a9ed8cd7747d3dd33a84535c66331a7f6cf147919e8859f74de27a13d760af7de9f7e69aa688515451a21320603c4c4f4b Makefile"
+62
View File
@@ -0,0 +1,62 @@
LD := gcc
LDFLAGS := -L/usr/lib/android/ -shared
LIBS := -l:liblog.so
CXX := g++
CXXFLAGS := -std=c++14 -Wall -I../include -fPIC
CC := gcc
# char16_t workaround: https://stackoverflow.com/a/22369822
CFLAGS := -Wall -I../include -Dchar16_t=uint16_t -fPIC
# From Android.mk: libcutils_common_sources, libcutils_nonwindows_sources
SRC_C := \
atomic.c \
config_utils.c \
fs_config.c \
canned_fs_config.c \
hashmap.c \
iosched_policy.c \
load_file.c \
native_handle.c \
open_memstream.c \
process_name.c \
record_stream.c \
sched_policy.c \
strdup16to8.c \
strdup8to16.c \
strlcpy.c \
threads.c \
fs.c \
multiuser.c \
socket_inaddr_any_server_unix.c \
socket_local_client_unix.c \
socket_local_server_unix.c \
socket_loopback_client_unix.c \
socket_loopback_server_unix.c \
socket_network_client_unix.c \
str_parms.c
SRC_CPP := \
sockets_unix.cpp \
sockets.cpp
OBJECTS := $(SRC_C:%.c=%.c.o) $(SRC_CPP:%.cpp=%.cpp.o)
all: libcutils.so
%.c.o: %.c
$(info CC $<)
@$(CC) -c -o $@ $< $(CFLAGS)
%.cpp.o: %.cpp
$(info CC $<)
@$(CXX) -c -o $@ $< $(CXXFLAGS)
libcutils.so: $(OBJECTS)
$(info LD $@)
@$(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
.PHONY: clean
clean:
rm -v libcutils.so *.o
+39
View File
@@ -0,0 +1,39 @@
pkgname=android-liblog
pkgver=7.0.0_r34
pkgrel=0
pkgdesc="Android low-level logging library"
url="https://github.com/android/platform_system_core"
arch="all"
license="APACHE2"
depends=""
makedepends="bsd-compat-headers"
options="!check"
source="
android_platform_system_core-$pkgver.tar.gz::https://github.com/android/platform_system_core/archive/android-${pkgver}.tar.gz
Makefile"
_lib="log"
subpackages="$pkgname-dev"
builddir="$srcdir"/platform_system_core-android-$pkgver/lib${_lib}
prepare() {
cp "$srcdir"/Makefile "$builddir"
}
build() {
cd "$builddir"
make
}
package() {
# Library
install -Dm644 "${builddir}/lib${_lib}.so" \
"${pkgdir}/usr/lib/android/lib${_lib}.so"
# Header files
mkdir -p "${pkgdir}/usr/include/android/"
cp -r "${srcdir}/platform_system_core-android-${pkgver}/include/${_lib}" \
"${pkgdir}/usr/include/android/"
}
sha512sums="f84d31db61f86c73b8aecbaf788d43b0a2cc984121fd7244a2f7ca2a2a751437b8708acdd27cb86a260162e866c40f6015f14d52beb3a85e9ae2efd6f44b73f3 android_platform_system_core-7.0.0_r34.tar.gz
967055ff34e1aa66cb76de0374be24810fab8a11b56a11c33fac0a7914def39884b1b6428b4deda5aa13a9f323d556479f25fa351220f2909c9fbfd72ca31a4b Makefile"
+31
View File
@@ -0,0 +1,31 @@
# From Android.mk: liblog_sources, liblog_host_sources, LOCAL_SRC_FILES_linux
SRC_C := \
config_write.c \
event_tag_map.c \
fake_log_device.c \
fake_writer.c \
log_event_list.c \
log_event_write.c \
logger_lock.c \
logger_name.c \
logger_write.c
OBJECTS := $(SRC_C:%.c=%.o)
CC := gcc
LD := gcc
LDFLAGS := -shared
CFLAGS := -Wall -I../include -fPIC
all: liblog.so
%.o: %.c
$(info CC $<)
@$(CC) -c -o $@ $< $(CFLAGS)
liblog.so: $(OBJECTS)
$(info LD $@)
@$(LD) -o $@ $^ $(LDFLAGS)
.PHONY: clean
clean:
rm -v *.o liblog.so
@@ -0,0 +1,24 @@
diff --git a/include/hardware_legacy/power.h b/include/hardware_legacy/power.h
new file mode 100644
index 0000000..5aeb933
--- /dev/null
+++ b/include/hardware_legacy/power.h
@@ -0,0 +1,18 @@
+#pragma once
+// This is a stub for wake locks, so we don't need to compile
+// android_hardware_libhardware_legacy for now.
+
+#include <stdint.h>
+
+enum {
+ PARTIAL_WAKE_LOCK = 1,
+ FULL_WAKE_LOCK = 2
+};
+
+int acquire_wake_lock(int lock, const char* id) {
+ // STUB
+};
+
+int release_wake_lock(const char* id) {
+ // STUB
+};
+54
View File
@@ -0,0 +1,54 @@
# NOTE: 8.x has a more complicated build process:
# https://source.android.com/devices/architecture/hidl-cpp
pkgname=android-ril
pkgver=7.0.0_r34
pkgrel=0
pkgdesc="Radio Interface Layer Daemon"
url="https://github.com/android/platform_hardware_ril"
arch="all"
license="APACHE2"
depends=""
makedepends="nanopb nanopb-dev android-libcutils-dev"
options="!check"
# subpackages="librilutils libril"
source="
$pkgname-$pkgver.tar.gz::https://github.com/android/platform_hardware_ril/archive/android-${pkgver}.tar.gz
rild.initd
Makefile.libril
Makefile.librilutils
Makefile.rild
01_wake_lock_stub.patch
"
builddir="$srcdir"/platform_hardware_ril-android-$pkgver
prepare() {
default_prepare
for i in librilutils libril rild; do
cp "$srcdir"/Makefile.$i "$builddir"/$i/Makefile
done
}
build() {
for i in librilutils libril rild; do
msg "Building $i"
cd "$builddir/$i"
make
done
}
package() {
cd "$builddir"
# OpenRC service
install -Dm755 "$srcdir/rild.initd" "$pkgdir/etc/init.d/rild"
}
sha512sums="7685958bbe628c761f568e0bd85f50ec6f7524945142c870aa1ad9ee5afc7e9db526b6aaa41fad71b584a7a048e1947c73ee8d61d588b0e5da5c8b56a30cc961 android-ril-7.0.0_r34.tar.gz
f6b01eaf37412bfb5748a184f84b619a254d4a0bffc51613f74aef058fcea3f55d2e504ddacdf22463e2fca0ce71edc89be4e7de42fcc3761e2de8fc3a7316d5 rild.initd
e85d424293b2bedc7b144cb29e8a0131b6ee385ec1c688a80b40d6836a93c4886b184c46880d74266f9c0b554be2b3da6c3836f3a6d05703f34c356ef284e970 Makefile.libril
7a8b8da2aec6d91459c1641cf75f7a710b661814a4d447c58a361d67832d5237bbc6945be9a375a286b3137ef6bcd942689c1e0cc8c270b9fff91c2ca0ad1da7 Makefile.librilutils
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e Makefile.rild
5d0d7e79fc0454bf627917a8c9acd801760145c320a082933619f3eeb3f30bd832db7cab7d68f86e3b4217373ee6919365449af78675aea5005c53bb80594c6a 01_wake_lock_stub.patch"
+21
View File
@@ -0,0 +1,21 @@
CXX := g++
CXXFLAGS := -std=c++14 -Wall -g -I../include -I/usr/include/android
LIBS :=
SOURCES := ${wildcard *.cpp}
OBJECTS := $(SOURCES:%.cpp=%.o)
all: libril.so
%.o: %.cpp
@echo CC $<
@$(CXX) -c -o $@ $< $(CXXFLAGS)
libril.so: $(OBJECTS)
@echo LD $@
@$(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS)
.PHONY: clean
clean:
-rm -fv *.o libril.so
+26
View File
@@ -0,0 +1,26 @@
CC := gcc
CFLAGS := -Wall -I../include/ -I. -fPIC
PBSRC := ${wildcard proto/*.proto}
SRC := ${wildcard *.c} $(PBSRC:%.proto=%.pb-c.c)
OBJ := $(SRC:%.c=%.o)
all: librilutils.so.1
%.pb-c.c: %.proto
$(info PROTO $<)
@protoc --nanopb_out=. $<
%.o: %.c
$(info CC $<)
@$(CC) -c -o $@ $< $(CFLAGS)
librilutils.so.1: $(OBJ) $(PBOBJ)
$(info LD $@)
@$(CC) -shared -Wl,-soname,$@.so.1 -o $@.so.1 $^ $(CFLAGS)
.PHONY: clean
clean:
-rm -v *.o *.so proto/*.pb-c.*
View File
Whitespace-only changes.
+18
View File
@@ -0,0 +1,18 @@
#!/sbin/openrc-run
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Purpose License v2
depend() {
}
start() {
ebegin "Starting Radio Interface Layer"
start-stop-daemon --start --quiet --exec /usr/sbin/rild
eend $?
}
stop() {
ebegin "Stopping Radio Interface Layer"
start-stop-daemon --stop --quiet --exec /usr/sbin/rild
eend $?
}
+46
View File
@@ -0,0 +1,46 @@
pkgname=nanopb
pkgver=0.3.9
pkgrel=1
pkgdesc="Protocol Buffers with small code size"
url="https://jpa.kapsi.fi/nanopb"
arch="all"
license="MIT"
depends="py2-protobuf"
makedepends="cmake python2 protobuf"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/nanopb/nanopb/archive/${pkgver}.tar.gz"
options="!check"
builddir="$srcdir"/$pkgname-$pkgver
build() {
cd "$builddir"
cmake -DCMAKE_BUILD_TYPE=Release
make
}
package() {
cd "$builddir"
# Statically linked library
install -Dm644 libprotobuf-nanopb.a "$pkgdir"/usr/lib/libprotobuf-nanopb.a
# Header files
for i in *.h; do
install -Dm644 "$i" "$pkgdir/usr/include/$i"
done
# Protobuf plugin
for i in nanopb_generator.py protoc-gen-nanopb; do
install -Dm755 "generator/$i" "$pkgdir/usr/bin/$i"
done
# Protocol definitions for generator
make -C generator/proto
for i in __init__.py nanopb_pb2.py plugin_pb2.py; do
echo "installing $i"
install -Dm755 "generator/proto/$i" "$pkgdir/usr/lib/python2.7/proto/$i"
done
}
sha512sums="1fa18d69ebfba2a58214beebd31fbbdd1edd71a19978754288adc09be6d5782feeb7bab2916448add2ab5bf7072d377101c7441b3e74619339dc545df3a73275 nanopb-0.3.9.tar.gz"