diff options
author | Gonzalo Exequiel Pedone | 2024-02-29 19:34:33 -0300 |
---|---|---|
committer | Gonzalo Exequiel Pedone | 2024-02-29 19:34:33 -0300 |
commit | 019d16404b31b8828dea83b3adedef6c2bac3dc7 (patch) | |
tree | 515d61b051e016df47d7dd44a908bae8dd3990e4 | |
download | aur-android-x86-numactl.tar.gz |
New package.
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | 0001-Disable-attach_sysvshm.patch | 40 | ||||
-rw-r--r-- | PKGBUILD | 52 |
4 files changed, 119 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..6e0ae54314d3 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = android-x86-numactl + pkgdesc = Simple NUMA policy support (android) + pkgver = 2.0.18 + pkgrel = 1 + url = https://github.com/numactl/numactl + arch = any + license = GPL-2.0-only + license = LGPL-2.1-only + makedepends = android-configure + depends = android-ndk + options = !strip + options = !buildflags + options = staticlibs + options = !emptydirs + source = https://github.com/numactl/numactl/archive/refs/tags/v2.0.18.tar.gz + source = 0001-Disable-attach_sysvshm.patch + md5sums = 4f90cc917d0055c29d85432e5a536f13 + md5sums = 78f308cfb3a98f68bd3d07eaef7572dd + +pkgname = android-x86-numactl diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..982db4eb4c01 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +pkg +src +*.tar.xz +*.tar.gz +*.tar.bz2 +*.asc +*.sign diff --git a/0001-Disable-attach_sysvshm.patch b/0001-Disable-attach_sysvshm.patch new file mode 100644 index 000000000000..ecd38778d0ee --- /dev/null +++ b/0001-Disable-attach_sysvshm.patch @@ -0,0 +1,40 @@ +--- a/shm.c ++++ b/shm.c +@@ -100,36 +100,7 @@ + /* Attach a sysv style shared memory segment. */ + void attach_sysvshm(char *name, char *opt) + { +- struct shmid_ds s; +- key_t key = sysvkey(name); +- +- shmfd = shmget(key, shmlen, shmflags); +- if (shmfd < 0 && errno == ENOENT) { +- if (shmlen == 0) +- complain( +- "need a --length to create a sysv shared memory segment"); +- fprintf(stderr, +- "numactl: Creating shared memory segment %s id %ld mode %04o length %.fMB\n", +- name, shmid, shmmode, ((double)(shmlen + shmoffset)) / (1024*1024) ); +- shmfd = shmget(key, shmlen + shmoffset, IPC_CREAT|shmmode|shmflags); +- if (shmfd < 0) +- nerror("cannot create shared memory segment"); +- } +- +- if (shmlen == 0) { +- if (shmctl(shmfd, IPC_STAT, &s) < 0) +- err("shmctl IPC_STAT"); +- shmlen = s.shm_segsz; +- } +- +- shmptr = shmat(shmfd, NULL, 0); +- if (shmptr == (void*)-1) +- err("shmat"); +- shmptr += shmoffset; +- +- shm_pagesize = (shmflags & SHM_HUGETLB) ? huge_page_size() : getpagesize(); +- +- check_region(opt); ++ nerror("cannot create shared memory segment"); + } + + /* Attach a shared memory file. */ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..832ae0984ffa --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com> +# Contributor: David Runge <dvzrv@archlinux.org> +# Contributor: Dan McGee <dan@archlinux.org> +# Contributor: Florian Zeitz <florob at babelmonkeys dot de> + +_android_arch=x86 + +pkgname=android-${_android_arch}-numactl +pkgver=2.0.18 +pkgrel=1 +arch=('any') +pkgdesc="Simple NUMA policy support (android)" +url="https://github.com/numactl/numactl" +license=('GPL-2.0-only' + 'LGPL-2.1-only') +depends=('android-ndk') +makedepends=('android-configure') +options=(!strip !buildflags staticlibs !emptydirs) +source=("$url/archive/refs/tags/v$pkgver.tar.gz" + '0001-Disable-attach_sysvshm.patch') +md5sums=('4f90cc917d0055c29d85432e5a536f13' + '78f308cfb3a98f68bd3d07eaef7572dd') + +prepare(){ + cd "${srcdir}/numactl-$pkgver" + source android-env ${_android_arch} + + if [ "${ANDROID_MINIMUM_PLATFORM}" -lt 26 ]; then + patch -Np1 -i ../0001-Disable-attach_sysvshm.patch + fi + + autoreconf -fiv +} + +build() { + cd "${srcdir}/numactl-$pkgver" + source android-env ${_android_arch} + + android-${_android_arch}-configure + make $MAKEFLAGS +} + +package() { + cd "${srcdir}/numactl-$pkgver" + source android-env ${_android_arch} + + make DESTDIR="$pkgdir" install + rm -rf "${pkgdir}/${ANDROID_PREFIX_BIN}" + rm -rf "${pkgdir}/${ANDROID_PREFIX_SHARE}" + ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_PREFIX_LIB}/*.so + ${ANDROID_STRIP} -g "$pkgdir"/${ANDROID_PREFIX_LIB}/*.a +} |