Browse Source

vifm for api 21

android-5
its-pointless 6 years ago
committed by Fredrik Fornwall
parent
commit
4133a77c80
  1. 3
      packages/vifm/build.sh
  2. 11
      packages/vifm/gmux_nix.c.patch
  3. 31
      packages/vifm/lockf.c
  4. 11
      packages/vifm/pthread.c.patch
  5. 11
      packages/vifm/pthread.h.patch

3
packages/vifm/build.sh

@ -1,7 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://vifm.info/
TERMUX_PKG_DESCRIPTION="File manager with vi like keybindings"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_API_LEVEL=24
TERMUX_PKG_REVISION=1
TERMUX_PKG_VERSION=0.10
TERMUX_PKG_SHA256=e5681c9e560e23d9deeec3b5b12e0ccad82612d9592c00407f3dd75cf5066548
TERMUX_PKG_SRCURL=https://github.com/vifm/vifm/archive/v${TERMUX_PKG_VERSION}.tar.gz
@ -15,4 +15,5 @@ termux_step_pre_configure() {
# saved_umask = umask(~0600);
export CFLAGS=${CFLAGS/-D_FORTIFY_SOURCE=2/}
fi
cp $TERMUX_PKG_BUILDER_DIR/lockf.c src/utils/lockf.c
}

11
packages/vifm/gmux_nix.c.patch

@ -0,0 +1,11 @@
--- ../cache/vifm-0.10/src/utils/gmux_nix.c 2018-11-11 15:20:19.000000000 +0000
+++ ./src/utils/gmux_nix.c 2019-01-16 03:17:11.261518251 +0000
@@ -27,7 +27,7 @@
#include "path.h"
#include "str.h"
-
+#include "lockf.c"
/* Data of a single gmux instance. */
struct gmux_t
{

31
packages/vifm/lockf.c

@ -0,0 +1,31 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
int lockf(int fd, int op, off_t size)
{
struct flock l = {
.l_type = F_WRLCK,
.l_whence = SEEK_CUR,
.l_len = size,
};
switch (op) {
case F_TEST:
l.l_type = F_RDLCK;
if (fcntl(fd, F_GETLK, &l) < 0)
return -1;
if (l.l_type == F_UNLCK || l.l_pid == getpid())
return 0;
errno = EACCES;
return -1;
case F_ULOCK:
l.l_type = F_UNLCK;
case F_TLOCK:
return fcntl(fd, F_SETLK, &l);
case F_LOCK:
return fcntl(fd, F_SETLKW, &l);
}
errno = EINVAL;
return -1;
}

11
packages/vifm/pthread.c.patch

@ -0,0 +1,11 @@
--- ../cache/vifm-0.10/src/compat/pthread.c 2018-11-11 15:20:19.000000000 +0000
+++ ./src/compat/pthread.c 2019-01-16 03:08:28.369761090 +0000
@@ -18,7 +18,7 @@
#include "pthread.h"
-#ifdef __APPLE__
+#ifdef __ANDROID__
#include <assert.h> /* assert() */
#include <errno.h> /* EBUSY */

11
packages/vifm/pthread.h.patch

@ -0,0 +1,11 @@
--- ../cache/vifm-0.10/src/compat/pthread.h 2018-11-11 15:20:19.000000000 +0000
+++ ./src/compat/pthread.h 2019-01-16 03:21:20.171148938 +0000
@@ -21,7 +21,7 @@
#include <pthread.h>
-#ifdef __APPLE__
+#ifdef __ANDROID__
typedef int pthread_spinlock_t;
Loading…
Cancel
Save