libfuse: add first attempt at package
it probably doesn't work in arm and i686
This commit is contained in:
parent
96482ccfdc
commit
7fe3dab96b
10
root-packages/libfuse/build.sh
Normal file
10
root-packages/libfuse/build.sh
Normal file
@ -0,0 +1,10 @@
|
||||
TERMUX_PKG_MAINTINER="Henrik Grimler @Grimler91"
|
||||
TERMUX_PKG_HOMEPAGE=https://github.com/libfuse/libfuse
|
||||
TERMUX_PKG_DESCRIPTION="FUSE (Filesystem in Userspace) is an interface for userspace programs to export a filesystem to the Linux kernel"
|
||||
TERMUX_PKG_VERSION=3.2.6
|
||||
TERMUX_PKG_SHA256=686b98afac4ca322498f68d37d598ae3d07919fe21a4700c76572fae59a6256b
|
||||
TERMUX_PKG_SRCURL=https://github.com/libfuse/libfuse/archive/fuse-${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-Dudevrulesdir=$TERMUX_PREFIX/etc/udev"
|
||||
# Code uses telldir() and seekdir():
|
||||
TERMUX_PKG_API_LEVEL=23
|
||||
# Requires 64bit off_t, we use super-ugly probably none-functioning patch to work around that for now
|
11
root-packages/libfuse/fuse.c.patch
Normal file
11
root-packages/libfuse/fuse.c.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- ../fuse.c.orig 2018-10-13 19:16:53.752578568 +0200
|
||||
+++ ./lib/fuse.c 2018-10-13 19:19:03.135469989 +0200
|
||||
@@ -4754,7 +4754,7 @@
|
||||
{
|
||||
if (lru_enabled(f)) {
|
||||
pthread_mutex_lock(&f->lock);
|
||||
- pthread_cancel(f->prune_thread);
|
||||
+ pthread_kill(f->prune_thread, 0);
|
||||
pthread_mutex_unlock(&f->lock);
|
||||
pthread_join(f->prune_thread, NULL);
|
||||
}
|
17
root-packages/libfuse/fuse_common.h.patch
Normal file
17
root-packages/libfuse/fuse_common.h.patch
Normal file
@ -0,0 +1,17 @@
|
||||
--- ../fuse_common.h.orig 2018-10-13 19:54:21.093146271 +0200
|
||||
+++ ./include/fuse_common.h 2018-10-13 19:57:05.539651897 +0200
|
||||
@@ -759,12 +760,12 @@
|
||||
*
|
||||
* On 32bit systems please add -D_FILE_OFFSET_BITS=64 to your compile flags!
|
||||
*/
|
||||
-
|
||||
+/* This probably introduces problem for arm and i686
|
||||
#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 6) && !defined __cplusplus
|
||||
_Static_assert(sizeof(off_t) == 8, "fuse: off_t must be 64bit");
|
||||
#else
|
||||
struct _fuse_off_t_must_be_64bit_dummy_struct \
|
||||
{ unsigned _fuse_off_t_must_be_64bit:((sizeof(off_t) == 8) ? 1 : -1); };
|
||||
#endif
|
||||
-
|
||||
+*/
|
||||
#endif /* FUSE_COMMON_H_ */
|
21
root-packages/libfuse/fuse_loop_mt.c.patch
Normal file
21
root-packages/libfuse/fuse_loop_mt.c.patch
Normal file
@ -0,0 +1,21 @@
|
||||
--- ../fuse_loop_mt.c.orig 2018-10-13 18:59:55.777282699 +0200
|
||||
+++ ./lib/fuse_loop_mt.c 2018-10-13 22:22:25.057485369 +0200
|
||||
@@ -120,9 +120,7 @@
|
||||
int isforget = 0;
|
||||
int res;
|
||||
|
||||
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||
res = fuse_session_receive_buf_int(mt->se, &w->fbuf, w->ch);
|
||||
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
|
||||
if (res == -EINTR)
|
||||
continue;
|
||||
if (res <= 0) {
|
||||
@@ -330,7 +328,7 @@
|
||||
|
||||
pthread_mutex_lock(&mt.lock);
|
||||
for (w = mt.main.next; w != &mt.main; w = w->next)
|
||||
- pthread_cancel(w->thread_id);
|
||||
+ pthread_kill(w->thread_id, 0);
|
||||
mt.exit = 1;
|
||||
pthread_mutex_unlock(&mt.lock);
|
||||
|
28
root-packages/libfuse/fusermount.c.patch
Normal file
28
root-packages/libfuse/fusermount.c.patch
Normal file
@ -0,0 +1,28 @@
|
||||
--- ../fusermount.c.orig 2018-10-13 19:06:31.957898402 +0200
|
||||
+++ ./util/fusermount.c 2018-10-13 19:13:39.298247332 +0200
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <pwd.h>
|
||||
#include <paths.h>
|
||||
#include <mntent.h>
|
||||
+#include <sys/file.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mount.h>
|
||||
@@ -114,7 +115,7 @@
|
||||
progname, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
- res = lockf(mtablock, F_LOCK, 0);
|
||||
+ res = flock(mtablock, F_LOCK);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "%s: error getting lock: %s\n", progname,
|
||||
strerror(errno));
|
||||
@@ -130,7 +131,7 @@
|
||||
if (mtablock >= 0) {
|
||||
int res;
|
||||
|
||||
- res = lockf(mtablock, F_ULOCK, 0);
|
||||
+ res = flock(mtablock, F_ULOCK);
|
||||
if (res < 0) {
|
||||
fprintf(stderr, "%s: error releasing lock: %s\n",
|
||||
progname, strerror(errno));
|
10
root-packages/libfuse/install_helper.sh.patch
Normal file
10
root-packages/libfuse/install_helper.sh.patch
Normal file
@ -0,0 +1,10 @@
|
||||
--- ../install_helper.sh.orig 2018-10-13 19:35:25.807091492 +0200
|
||||
+++ ./util/install_helper.sh 2018-10-13 19:35:42.210952193 +0200
|
||||
@@ -22,7 +22,6 @@
|
||||
DESTDIR="${DESTDIR%/}"
|
||||
fi
|
||||
|
||||
-chown root:root "${DESTDIR}${bindir}/fusermount3"
|
||||
chmod u+s "${DESTDIR}${bindir}/fusermount3"
|
||||
|
||||
install -D -m 644 "${MESON_SOURCE_ROOT}/util/fuse.conf" \
|
26
root-packages/libfuse/lib-meson.build.patch
Normal file
26
root-packages/libfuse/lib-meson.build.patch
Normal file
@ -0,0 +1,26 @@
|
||||
--- ../lib-meson.build.orig 2018-10-13 18:50:35.614173402 +0200
|
||||
+++ ./lib/meson.build 2018-10-13 19:31:58.316854967 +0200
|
||||
@@ -3,11 +3,8 @@
|
||||
'fuse_signals.c', 'buffer.c', 'cuse_lowlevel.c',
|
||||
'helper.c', 'modules/subdir.c' ]
|
||||
|
||||
-if host_machine.system().startswith('linux')
|
||||
- libfuse_sources += [ 'mount.c', 'mount_util.c' ]
|
||||
-else
|
||||
- libfuse_sources += [ 'mount_bsd.c' ]
|
||||
-endif
|
||||
+libfuse_sources += [ 'mount.c', 'mount_util.c' ]
|
||||
+
|
||||
|
||||
if cfg.get('HAVE_ICONV')
|
||||
libfuse_sources += [ 'modules/iconv.c' ]
|
||||
@@ -22,9 +19,6 @@
|
||||
if host_machine.system().startswith('netbsd')
|
||||
deps += [ cc.find_library('perfuse'),
|
||||
cc.find_library('puffs') ]
|
||||
-else
|
||||
- # Required for clock_gettime before glibc 2.17
|
||||
- deps += cc.find_library('rt')
|
||||
endif
|
||||
|
||||
fusermount_path = join_paths(get_option('prefix'), get_option('bindir'))
|
11
root-packages/libfuse/poll.c.patch
Normal file
11
root-packages/libfuse/poll.c.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- ../poll.c.orig 2018-10-13 19:17:31.400255853 +0200
|
||||
+++ ./example/poll.c 2018-10-13 19:19:54.007034483 +0200
|
||||
@@ -289,7 +289,7 @@
|
||||
|
||||
ret = fuse_main(argc, argv, &fsel_oper, NULL);
|
||||
|
||||
- pthread_cancel(producer);
|
||||
+ pthread_kill(producer, 0);
|
||||
pthread_join(producer, NULL);
|
||||
|
||||
return ret;
|
11
root-packages/libfuse/test_setattr.c.patch
Normal file
11
root-packages/libfuse/test_setattr.c.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- ../test_setattr.c.orig 2018-10-13 19:16:39.896697370 +0200
|
||||
+++ ./test/test_setattr.c 2018-10-13 19:19:37.399176638 +0200
|
||||
@@ -170,7 +170,7 @@
|
||||
test_fs(fuse_opts.mountpoint);
|
||||
|
||||
/* Stop file system */
|
||||
- assert(pthread_cancel(fs_thread) == 0);
|
||||
+ assert(pthread_kill(fs_thread, 0) == 0);
|
||||
|
||||
fuse_session_unmount(se);
|
||||
assert(got_fh == 1);
|
Loading…
Reference in New Issue
Block a user