Skip to content

Conversation

@Crivella
Copy link

@Crivella Crivella commented Nov 6, 2025

WIP

Adding the cvmfs client to termux to allow mounting CVMFS remote filesystems.

Currently only feature the client part of it.

This would allow access to a vast variety of repositories with data and/or software stacks

Main drive for this (from my side) is to get EESSI to work on android.
Currently able to mount it and tha from a termux-chroot environment run a few of the demos from https://github.com/EESSI/eessi-demo

Potential issues:

  • SOLVED: when cvmfs compiles its external pacparser dependency, it needs to generate an executable that than writes some header files. This will also dump the length of certain sizeofs into the generated files. When cross-compiling this executable needs to be runnable on the build host, but if the bitness differs between host and target, the compilation will fail afterward due to a precompiler check that the sizeof is what is expected.

@@ -1,5 +1,7 @@
#!/bin/sh

+echo "64compact" > arch
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value was giving errors atleast on arm64, with this it worked on both arm64 and x86_64.

Not sure if this could be generalized

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That isn't gonna work for the 32 bit architectures.
But I don't have good answer for what you'd do about it.
${TERMUX_ARCH_BITS} should be available in the environment during buildtime, so that could be used here.
That will be either 64 or 32 depending on the bitness of the architecture.

@@ -0,0 +1,57 @@
diff --git a/cmake/Modules/Findleveldb.cmake b/cmake/Modules/Findleveldb.cmake
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard setting the values to the one internally compiled.
Was having trouble getting find_package not find the .so that would come with the leveldb package.

Besides the internal patches to this library by CVMFS, i was also having trouble due to the name expected by libcvmfs_fuse for leveldb to be mangled while the one the upstream libleveldb.so are not (so something was going wrong there)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be settable by flag, e.g. -DLEVELDB_LIB_DIR=$TERMUX_PREFIX/lib/leveldb, although I'm not 100% sure that path is correct.

@@ -0,0 +1,13 @@
diff --git a/doc/manpages/CMakeLists.txt b/doc/manpages/CMakeLists.txt
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When cross-compiling help2man cannot use the executables produced to generate the docs.
Could add a check here to do this step in case we are not cross compiling if we really want the man page

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a known issue with packages using help2man.

https://github.com/TomJo2000/termux-packages-prs/blob/a1490ed2909a3d08109540b13e5cf1e3761c8a0e/packages/btop/build.sh#L8-L26

Otherwise, disabling the man pages is fine, we prefer to ship manuals, but if it's not doable when cross compiling that is fine.

Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've clearly put in a ton of work into this package.
Thank you for taking the time to put up with our build system.

I can't seem to find a package request for this project.
So I'll just go through an abbreviated version of the package request checklist below really quick.

Note

For future reference, please consider opening a package request before spending the time to write a package build.

Package requests give us a heads up to evaluate if a package is suitable for packaging in the main Termux repositories.
https://github.com/termux/termux-packages/issues/new?template=02-package-request.yml
If you intend to package

Not all projects will meet out packaging guidelines.
In case this project does not, it may still be suitable for inclusion in the TUR

Packaging policy acknowledgement

  • The project is actively developed.

  • [~] The project has existing packages and is "well known".

  • Licensed under an open source license.

  • Not available through a language package manager: pip, npm, cpan, cargo, etc.

  • [?] Not taking up too much disk space (< 100MiB per architecture, exceptions can be made)

  • Not duplicating the functionality of existing packages.

  • Not serving hacking, malware, phishing, spamming, spying, ddos functionality.

  • I certify that I have read Termux Packaging Policy and understand that my request will be denied if it is found lacking.

I'm not exactly sure what the usecase for this package would be on Termux, and this may be a better fit for the TUR, but I'm not sure if and how the TUR does root packages.
Please do feel free to continue to use this PR for build testing in the meantime.

@@ -1,5 +1,7 @@
#!/bin/sh

+echo "64compact" > arch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That isn't gonna work for the 32 bit architectures.
But I don't have good answer for what you'd do about it.
${TERMUX_ARCH_BITS} should be available in the environment during buildtime, so that could be used here.
That will be either 64 or 32 depending on the bitness of the architecture.

@@ -0,0 +1,57 @@
diff --git a/cmake/Modules/Findleveldb.cmake b/cmake/Modules/Findleveldb.cmake
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be settable by flag, e.g. -DLEVELDB_LIB_DIR=$TERMUX_PREFIX/lib/leveldb, although I'm not 100% sure that path is correct.

@@ -0,0 +1,13 @@
diff --git a/doc/manpages/CMakeLists.txt b/doc/manpages/CMakeLists.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a known issue with packages using help2man.

https://github.com/TomJo2000/termux-packages-prs/blob/a1490ed2909a3d08109540b13e5cf1e3761c8a0e/packages/btop/build.sh#L8-L26

Otherwise, disabling the man pages is fine, we prefer to ship manuals, but if it's not doable when cross compiling that is fine.

Comment on lines 55 to 59
export TERMUX_HOST_PLATFORM
export TERMUX_PKG_API_LEVEL
export CLANG_TARGET_TRIPLE="${TERMUX_HOST_PLATFORM}${TERMUX_PKG_API_LEVEL}"
export TERMUX_STANDALONE_TOOLCHAIN
export LDFLAGS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $TERMUX_* variables should already be exported.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need atleast TERMUX_STANDALONE_TOOLCHAIN as the --sysroot=${TERMUX_STANDALONE_TOOLCHAIN}/sysroot in 0002-crosscompile-pacparser.patch results in just /sysroot otherwise

I removed the other 2 as they also should not be used anymore after i implemented CLANG_TARGET_TRIPLE

@TomJo2000
Copy link
Member

I think we can definitely consider this package for a packaging policy exception under the "scientific software" (e.g. TERMUX_PKG_GROUPS="science") category.

@Crivella
Copy link
Author

Crivella commented Nov 6, 2025

Thanks for looking into this this quick!
Will do more of the style fixes tomorrow form my WS.

Sorry for not opening a package request beforehand should've definitely done that.

I think we can definitely consider this package for a packaging policy exception under the "scientific software" (e.g. TERMUX_PKG_GROUPS="science") category.

That would be nice.
At the end of things i guess this would fall in a similar category to nfs-utils as it is a tool to mount filesystems.
In this case (AFAIK) they are mostly used to ship data/software in HPC environment and similar.

Also was keeping this as a draft to se if the CVMFS developers would like to chime in on this PR.
We are also exploring to see if there would be the possibility to use this without needing to access /dev/fuse so it could be used from a simple proot environment without needed to actually do the mounting from tsu

@TomJo2000
Copy link
Member

cvmfs isn't something I'd ever heard of before, but such it is with a lot of scientific software I support.

I don't think it should be dismissed out of hand just because it doesn't neatly fit within our standard relevancy criteria.

If someone from upstream wants to chime in packaging feedback is always appreciated and we try not to ship packages in a way their upstream has disapproved of.

@Crivella Crivella mentioned this pull request Nov 6, 2025
8 tasks
@Crivella
Copy link
Author

Crivella commented Nov 7, 2025

The builds on 32 bit systems seems to both be hitting the problem i described as a potential issue

when cvmfs compiles its external pacparser dependency, it needs to generate an executable that than writes some header files. This will also dump the length of certain sizeofs into the generated files. When cross-compiling this executable needs to be runnable on the build host, but if the bitness differs between host and target, the compilation will fail afterward due to a precompiler check that the sizeof is what is expected.

I am really unsure on how to solve that as the sizeofs in the generated headers ends up not matching the checks in the pre-compiler asserts

@robertkirkman
Copy link
Member

The builds on 32 bit systems seems to both be hitting the problem i described as a potential issue

when cvmfs compiles its external pacparser dependency, it needs to generate an executable that than writes some header files. This will also dump the length of certain sizeofs into the generated files. When cross-compiling this executable needs to be runnable on the build host, but if the bitness differs between host and target, the compilation will fail afterward due to a precompiler check that the sizeof is what is expected.

I am really unsure on how to solve that as the sizeofs in the generated headers ends up not matching the checks in the pre-compiler asserts

I am going to debug that next and I will let you know if I know how to solve it or not

@Crivella
Copy link
Author

Crivella commented Nov 7, 2025

@TomJo2000

That isn't gonna work for the 32 bit architectures.
But I don't have good answer for what you'd do about it.
${TERMUX_ARCH_BITS} should be available in the environment during buildtime, so that could be used here.
That will be either 64 or 32 depending on the bitness of the architecture.

Basically the external source of sha3 contains 3 subfolders (64opt 64compact 32BI) that are selected by setting ARCH=XXX to the XXX subfolder with different source files.

The default of 64opt was failing for missing headers if i recall correctly.
Using 64compact i was able to compile sha3 also on i686 but i can't test the linking + execution due to the error not allowing to compile pacparser
#27139 (comment)

EDIT: Was able to test i686 after the changes suggested in #27139 (comment) and it seems that the 64compact sources also work there

@robertkirkman
Copy link
Member

robertkirkman commented Nov 7, 2025

The builds on 32 bit systems seems to both be hitting the problem i described as a potential issue

when cvmfs compiles its external pacparser dependency, it needs to generate an executable that than writes some header files. This will also dump the length of certain sizeofs into the generated files. When cross-compiling this executable needs to be runnable on the build host, but if the bitness differs between host and target, the compilation will fail afterward due to a precompiler check that the sizeof is what is expected.

I am really unsure on how to solve that as the sizeofs in the generated headers ends up not matching the checks in the pre-compiler asserts

I am going to debug that next and I will let you know if I know how to solve it or not

This changeset appears to enable 32-bit support in your package. Please let me know if you have any questions about it.

diff --git a/root-packages/cvmfs/0032-pass-socklen_t-to-accept.patch b/root-packages/cvmfs/0032-pass-socklen_t-to-accept.patch
new file mode 100644
index 0000000000..f54e922d7d
--- /dev/null
+++ b/root-packages/cvmfs/0032-pass-socklen_t-to-accept.patch
@@ -0,0 +1,17 @@
+Fixes error
+mount/mount.cvmfs.cc:222:24: error: no matching function for call to 'accept'
+note: candidate function not viable: no known conversion from 'unsigned int *'
+to 'socklen_t * _Nullable' (aka 'int *') for 3rd argument
+when building for 32-bit Android
+
+--- a/mount/mount.cvmfs.cc
++++ b/mount/mount.cvmfs.cc
+@@ -218,7 +218,7 @@ static int GetExistingFuseFd(const string &fqrn, const string &workspace,
+   int fuse_fd = -1;
+   if (result == "OK") {
+     struct sockaddr_un addr;
+-    unsigned int len = sizeof(addr);
++    socklen_t len = sizeof(addr);
+     const int con_fd = accept(recv_sock_fd,
+                               reinterpret_cast<struct sockaddr *>(&addr), &len);
+     fuse_fd = RecvFdFromSocket(con_fd);
diff --git a/root-packages/cvmfs/build.sh b/root-packages/cvmfs/build.sh
index 62694a779b..2633c7fffa 100644
--- a/root-packages/cvmfs/build.sh
+++ b/root-packages/cvmfs/build.sh
@@ -32,16 +32,16 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
 -DLibArchive_LIBRARY=$TERMUX_PREFIX/lib/libarchive.so
 -DSPARSEHASH_INCLUDE_DIR=$TERMUX_PREFIX/include/sparsehash
 
--DLEVELDB_INCLUDE_DIR=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/include
--DLEVELDB_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/lib/libleveldb.a
--DPACPARSER_INCLUDE_DIR=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/include
--DPACPARSER_LIBRARY=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/lib/libpacparser.a
--DVJSON_INCLUDE_DIRS=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/include
--DVJSON_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/lib/libvjson.a
--DSHA3_INCLUDE_DIRS=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/include
--DSHA3_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/lib/libsha3.a
--DLibcrypto_INCLUDE_DIRS=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/crypto/include
--DLibcrypto_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/crypto/lib/libcrypto.a
+-DLEVELDB_INCLUDE_DIR=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/include
+-DLEVELDB_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/lib/libleveldb.a
+-DPACPARSER_INCLUDE_DIR=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/include
+-DPACPARSER_LIBRARY=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/lib/libpacparser.a
+-DVJSON_INCLUDE_DIRS=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/include
+-DVJSON_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/lib/libvjson.a
+-DSHA3_INCLUDE_DIRS=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/include
+-DSHA3_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/lib/libsha3.a
+-DLibcrypto_INCLUDE_DIRS=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/crypto/include
+-DLibcrypto_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH/arm/armv7-a/}/crypto/lib/libcrypto.a
 "
 
 termux_step_pre_configure () {
@@ -57,4 +57,10 @@ termux_step_pre_configure () {
 	export CLANG_TARGET_TRIPLE="${TERMUX_HOST_PLATFORM}${TERMUX_PKG_API_LEVEL}"
 	export TERMUX_STANDALONE_TOOLCHAIN
 	export LDFLAGS
+
+	patch="$TERMUX_PKG_BUILDER_DIR/crosscompile-pacparser.diff"
+	echo "Applying patch: $(basename "$patch")"
+	test -f "$patch" && sed \
+		-e "s%\@TERMUX_ARCH_BITS\@%${TERMUX_ARCH_BITS}%g" \
+		"$patch" | patch --silent -p1
 }
diff --git a/root-packages/cvmfs/0002-crosscompile-pacparser.patch b/root-packages/cvmfs/crosscompile-pacparser.diff
similarity index 96%
rename from root-packages/cvmfs/0002-crosscompile-pacparser.patch
rename to root-packages/cvmfs/crosscompile-pacparser.diff
index dc725a5a33..802c5304e0 100644
--- a/root-packages/cvmfs/0002-crosscompile-pacparser.patch
+++ b/root-packages/cvmfs/crosscompile-pacparser.diff
@@ -77,7 +77,7 @@ index 55b1a95c5..3acb323d2 100755
  [ -d $static_result_dir ] && rm -fR $static_result_dir
  make $FIX_PYTHON -C src clean -j ${CVMFS_BUILD_EXTERNAL_NJOBS}
 -make $FIX_PYTHON $FIX_COMP CVMFS_BASE_C_FLAGS="$CVMFS_BASE_C_FLAGS" -j1 -C src pacparser.o spidermonkey/libjs.a  # default target runs tests!
-+make $FIX_PYTHON $FIX_COMP CVMFS_BASE_C_FLAGS="$CVMFS_BASE_C_FLAGS" CC="clang" -j1 -C src pacparser.o spidermonkey/libjs.a  # default target runs tests!
++make $FIX_PYTHON $FIX_COMP CVMFS_BASE_C_FLAGS="$CVMFS_BASE_C_FLAGS" CC="clang -m@TERMUX_ARCH_BITS@" -j1 -C src pacparser.o spidermonkey/libjs.a  # default target runs tests!
  echo "finished internal build of libpacparser"
  
  echo "creating static link library for libpacparser..."

I have not tested it at runtime on 32-bit devices beyond very basic trivial invocations, like this. Would you like to test it yourself (which is possible to do on some phones that are otherwise 64-bit by installing the 32-bit ARM build of Termux APK), or would you like me to try to test it? If you would like me to try to test it on one of my 32-bit devices, would it be not too much trouble for you to write some test scripts I could run that you think would effectively test the functionality of the package on 32-bit devices?

~ $ cvmfs2 -V
CernVM-FS version 2.13.3

~ $ uname -a
Linux localhost 3.4.112-Lineage-g716f00ee2e8 #1 SMP PREEMPT Sun Oct 13 11:16:54 CDT 2019 armv7l Android
~ $ 

@Crivella
Copy link
Author

Crivella commented Nov 7, 2025

This changeset appears to enable 32-bit support in your package. Please let me know if you have any questions about it.

Thank you very much. Will try to test it, but also do not mind adding some test scripts

@Crivella
Copy link
Author

Crivella commented Nov 7, 2025

@robertkirkman Again thanks for the help on the 32 bit it is compiling and working now

image

I've been using eessi for testing as this is the platform i work on, but we can also use atlas from the docs of CVMFS

so you wont need the extra public key found in
https://github.com/EESSI/filesystem-layer/releases/download/latest/cvmfs-config-eessi_latest_all.deb

This is the edited config file i use

CVMFS_CACHE_BASE=/data/data/com.termux/files/home/cache
CVMFS_RELOAD_SOCKETS=/data/data/com.termux/files/home/cache
CVMFS_USYSLOG=/data/data/com.termux/files/home/cache/cvmfs.log
CVMFS_CLAIM_OWNERSHIP=yes
CVMFS_SERVER_URL=http://cvmfs-stratum-one.cern.ch/cvmfs/atlas.cern.ch
CVMFS_KEYS_DIR=/data/data/com.termux/files/usr/etc/cvmfs/keys/cern.ch
CVMFS_HTTP_PROXY=DIRECT

and you can mount it whit this set of commands (starting from home)

~> mkdir cache
~> mkdir atlas
~> tsu

TSU ~> ls atlas
# empty dir
TSU ~> cvmfs2 -o config=atlas.conf atlas.cern.ch `realpath atlas`
TSU ~> ls atlas
#  repo  test1
TSU ~> cat atlas/test1
#  test
image

-DSHA3_INCLUDE_DIRS=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/include
-DSHA3_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/lib/libsha3.a
-DLibcrypto_INCLUDE_DIRS=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/crypto/include
-DLibcrypto_LIBRARIES=$TERMUX_PKG_SRCDIR/externals_install.${TERMUX_ARCH}/crypto/lib/libcrypto.a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When applying the 32-bit changes, you missed applying some of the changes I made in this area, sorry if you already noticed that and are already fixing it, I just thought to mention it just in case you didn't notice

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks i had seen it but had not tested yet on the arm target (only i686).
I've added the string replacements and tested the build locally.

On a sidenote do you know if it is possible to emulate arm on an x86 machine?
I am fairly new to android development and i am using android studio to launch the virtual devices, but it seems the QEMU it ships with does not support cross-architecture emulation (atleast not with a basic install)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a sidenote do you know if it is possible to emulate arm on an x86 machine? I am fairly new to android development and i am using android studio to launch the virtual devices, but it seems the QEMU it ships with does not support cross-architecture emulation (atleast not with a basic install)

Yes it is possible, and there are several ways to do it, but the short explanation is that it's difficult and it requires some study of topics that are more advanced than the default Android Studio emulator. That one does not support ARM on x86 machine.

I have created a complete guide for how to emulate ARM Termux on an x86 device in my favorite way (which is not the only way, but it is, in my opinion, a good balance between accuracy and speed). It is here and it is the script named install-termux-docker-inside-qemu-full-system-emulator.sh.

Just running the script directly on a GNU/Linux 64-bit x86 PC should automatically install everything and start the emulator, as long as you installed the necessary dependencies beforehand which are, for example on Debian and Ubuntu, just sudo apt build-dep qemu-system-x86 openssh-client.

https://gist.github.com/robertkirkman/f79441c79811ad263f2f881f7864e793#file-install-termux-docker-inside-qemu-full-system-emulator-sh

@robertkirkman
Copy link
Member

Currently only feature the client part of it.

I was kind of wondering "why does it need to have -DBUILD_SERVER=OFF?"

so, I set -DBUILD_SERVER=ON and compiled it, and I started to fix all the errors that happened.

Here is what I made so far, which makes it completely build with -DBUILD_SERVER=ON:

patch swissknife_sync.cc

libandroid-glob does not support GLOB_ONLYDIR or GLOB_PERIOD,
if the software does not work as a result of removing references to them,
then it means that the software is unfortunately only implemented for glibc
and cannot be used with bionic yet.

--- a/cvmfs/swissknife_sync.cc
+++ b/cvmfs/swissknife_sync.cc
@@ -376,7 +376,7 @@ void swissknife::CommandApplyDirtab::DetermineNestedCatalogCandidates(
     // state
     const std::string &glob_string = i->pathspec.GetGlobString();
     const std::string &glob_string_abs = union_dir_ + glob_string;
-    const int glob_flags = GLOB_ONLYDIR | GLOB_NOSORT | GLOB_PERIOD
+    const int glob_flags = GLOB_NOSORT
                            | GLOB_ALTDIRFUNC;
     glob_t glob_res;
     g_glob_uniondir = new std::string(union_dir_);

Patch acl.cc

Fix error: use of undeclared identifier 'htole16'

--- a/cvmfs/acl.cc
+++ b/cvmfs/acl.cc
@@ -10,6 +10,7 @@
 #include <cassert>
 #include <cstring>
 #include <vector>
+#include <sys/endian.h>
 
 #include "util/posix.h"
 

Add PACKAGES+=" cpio" to scripts/setup-ubuntu.sh

(and to test that temporarily without rebuilding the docker container, scripts/run-docker.sh bash -c "sudo apt update && sudo apt install -y cpio" can be used)

Add maxminddb; to -DBUILTIN_EXTERNALS_LIST

Add libandroid-glob to TERMUX_PKG_DEPENDS and -landroid-glob to LDFLAGS

Put this bulk-patcher command in termux_step_pre_configure()

(it does not patch all other absolute paths that would need to be patched to run the server, but it gets all that are necessary to complete the build without build errors)

	find "${TERMUX_PKG_SRCDIR}" -type f | \
		xargs -n 1 sed -i \
		-e "s|/usr/share|$TERMUX_PREFIX/share|g" \
		-e "s|/etc/logrotate|$TERMUX_PREFIX/etc/logrotate|g" \
		-e "s|/var|$TERMUX_PREFIX/var|g" \
		-e "s|/tmp|$TERMUX_PREFIX/tmp|g"

However, much more additional changes and complicated setup might be required, I'm not sure what else is needed but it would probably be a lot. In particular, there is an incredibly huge script called cvmfs_server, it is filled with absolute paths, I am sure more absolute paths would probably need to be patched, in order to create a completely runnable server setup.

If you are interested in progressing towards that also, then let me know and I might try to help more with any parts that are difficult for you to fix.

@Crivella
Copy link
Author

Crivella commented Nov 7, 2025

I was kind of wondering "why does it need to have -DBUILD_SERVER=OFF?"

Mainly because I was mostly interested in the client functionalities, but also to deal with the problems with one branch of the build at a time.
I guess the usecases of running a CVMFS server from a phone might be less than that of mounting an existing FS, but can give it a shot.
Not 100% sure, but i do not think anything root specific should be required for hosting so that might also get its separate package in the non root- repo

@robertkirkman
Copy link
Member

robertkirkman commented Nov 7, 2025

Mainly because I was mostly interested in the client functionalities, but also to deal with the problems with one branch of the build at a time.
I guess the usecases of running a CVMFS server from a phone might be less than that of mounting an existing FS, but can give it a shot.

yes that's ok, one reason I thought to try it is because you mentioned that you used a termux-chroot installation for part of your test, and I wondered if maybe compiling with -DBUILD_SERVER=ON and making it work, could hypothetically allow removing the requirement for termux-chroot.

If it's too difficult to make work correctly then it can stay disabled.

Not 100% sure, but i do not think anything root specific should be required for hosting so that might also get its separate package in the non root- repo

In my opinion, based on the precedent set by many previous packages, if the package has major functionality that works without root, but other functionality that requires root, the whole package should be in the packages folder instead of the root-packages folder, while packages that are completely useless without root remain in the root-packages folder.

The reason I have been following that practice is because, if I were to find packages that have some functionality that requires root and start moving them into the root-packages folder, a huge number of packages currently in the packages folder would have to be moved to the root-packages folder instead, so in order for there to be some logical consistency to the organization of the packages, it seems to make the most sense to keep root-packages for packages that are completely useless without root.

@Crivella
Copy link
Author

Crivella commented Nov 7, 2025

The termux-chroot is specific to EESSI, as all the software that comes from it is rpathed to /cvmfs/software.eessi.io which is the default location you get when using automount, but i would not say it is something specific to cvmfs itself.

Anyway might give it a try especially if we can get the upstream dev interested, we are in contact on the EESSI slack

@boegel
Copy link

boegel commented Dec 4, 2025

I'd say @vvolkl is the main contact for the CernVM-FS development team currently.
Maybe @jblomer (former project lead for CernVM-FS) is also interested...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants