diff --git a/packages/monetdb/build.sh b/packages/monetdb/build.sh index 5d7f78715..5549bcf61 100644 --- a/packages/monetdb/build.sh +++ b/packages/monetdb/build.sh @@ -3,13 +3,16 @@ TERMUX_PKG_DESCRIPTION="A high-performance database kernel for query-intensive a TERMUX_PKG_LICENSE="MPL-2.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=11.41.13 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://www.monetdb.org/downloads/sources/archive/MonetDB-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=7738e106ac3a39bfb37feb8efa9a050a412fb332ab58c29a8aad23c01ba42197 -TERMUX_PKG_DEPENDS="libbz2, libcurl, libiconv, liblz4, liblzma, libpcreposix, libuuid, libxml2, netcdf-c, openssl, readline, zlib" +TERMUX_PKG_DEPENDS="libandroid-sysv-semaphore, libbz2, libcurl, libiconv, liblz4, liblzma, libpcreposix, libuuid, libxml2, netcdf-c, openssl, readline, zlib" termux_step_post_get_source() { find . -name '*.c' | xargs -n 1 sed -i \ -e 's:"\(/tmp\):"'$TERMUX_PREFIX'\1:g' - cp $TERMUX_PKG_BUILDER_DIR/sys_sem.c gdk/ +} + +termux_step_pre_configure() { + LDFLAGS+=" -landroid-sysv-semaphore" } diff --git a/packages/monetdb/gdk-CMakeLists.txt.patch b/packages/monetdb/gdk-CMakeLists.txt.patch deleted file mode 100644 index 25e4533c9..000000000 --- a/packages/monetdb/gdk-CMakeLists.txt.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/gdk/CMakeLists.txt -+++ b/gdk/CMakeLists.txt -@@ -79,6 +79,7 @@ - gdk_analytic_func.c - gdk_analytic.h - gdk_tracer.c gdk_tracer.h -+ sys_sem.c - PUBLIC - ${gdk_public_headers}) - diff --git a/packages/monetdb/gdk-gdk_interprocess.c.patch b/packages/monetdb/gdk-gdk_interprocess.c.patch index 14413cbab..ffd4159ce 100644 --- a/packages/monetdb/gdk-gdk_interprocess.c.patch +++ b/packages/monetdb/gdk-gdk_interprocess.c.patch @@ -1,6 +1,6 @@ --- a/gdk/gdk_interprocess.c +++ b/gdk/gdk_interprocess.c -@@ -19,14 +19,26 @@ +@@ -19,7 +19,11 @@ #include #include @@ -12,18 +12,3 @@ #include #include #include - #include - #include - #include -+#ifndef __ANDROID__ - #include -+#else -+#include -+#define semid_ds semid64_ds -+int semctl(int, int, int, ...); -+int semget(key_t, int, int); -+int semop(int, struct sembuf *, size_t); -+#endif - #include - - static ATOMIC_TYPE interprocess_unique_id = ATOMIC_VAR_INIT(1); diff --git a/packages/monetdb/sys_sem.c b/packages/monetdb/sys_sem.c deleted file mode 100644 index fad76ac65..000000000 --- a/packages/monetdb/sys_sem.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -#include -#include -#include - -#pragma GCC visibility push(hidden) - -int semtimedop(int id, struct sembuf* ops, size_t op_count, const struct timespec* ts) { -#if defined(SYS_semtimedop) - return syscall(SYS_semtimedop, id, ops, op_count, ts); -#else - return syscall(SYS_ipc, SEMTIMEDOP, id, op_count, 0, ops, ts); -#endif -} - -union semun { - int val; - struct semid_ds *buf; - unsigned short *array; -} semu; - -int semctl(int id, int num, int cmd, ...) { -#if !defined(__LP64__) - // Annoyingly, the kernel requires this for 32-bit but rejects it for 64-bit. - cmd |= IPC_64; -#endif - va_list ap; - va_start(ap, cmd); - union semun arg = va_arg(ap, union semun); - va_end(ap); -#if defined(SYS_semctl) - return syscall(SYS_semctl, id, num, cmd, arg); -#else - return syscall(SYS_ipc, SEMCTL, id, num, cmd, &arg, 0); -#endif -} - -int semget(key_t key, int n, int flags) { -#if defined(SYS_semget) - return syscall(SYS_semget, key, n, flags); -#else - return syscall(SYS_ipc, SEMGET, key, n, flags, 0, 0); -#endif -} - -int semop(int id, struct sembuf* ops, size_t op_count) { - return semtimedop(id, ops, op_count, NULL); -} - -#pragma GCC visibility pop