-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Package: libandroid-posix-semaphore #8993
Conversation
errno = ENAMETOOLONG; | ||
return 0; | ||
} | ||
memcpy(buf, "/data/data/com.termux/files/usr/tmp/sem.", 40); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid hardcode prefix? Preferably use @TERMUX_PREFIX@
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a C source file, not a patch. Seems the shortcut @TERMUX_PREFIX@
can only work on a .patch file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For non-patch files, we have to sed
manually to substitute @TERMUX_PREFIX@
:
termux-packages/packages/liblua54/build.sh
Lines 15 to 17 in e1a6c93
sed -e "s/%VER%/${TERMUX_PKG_VERSION%.*}/g;s/%REL%/${TERMUX_PKG_VERSION}/g" \ | |
-e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|" \ | |
"$TERMUX_PKG_BUILDER_DIR"/lua.pc.in > lua.pc |
This is preferable, but not mandatory I suppose. We have another instance where $TERMUX_PREFIX
is hardcoded:
execl("/data/data/com.termux/files/usr/bin/sh", "sh", "-c", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking on wordexp.c seems like xeffyr was fine with full prefix. Guess this is a go then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is preferable avoid hardcoding it, sed'ing it would be better
# Remove <spawn.h> as it's only for future (later than android-27). | ||
# Remove <zlib.h> and <zconf.h> as we build our own zlib. | ||
# Remove unicode headers provided by libicu. | ||
rm usr/include/{sys/{capability,shm,sem},{glob,iconv,spawn,zlib,zconf}}.h | ||
rm usr/include/{sys/{capability,shm,sem},{glob,iconv,semaphore,spawn,zlib,zconf}}.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure moving this to a separate package won't break building any other packages, or are we going to shift all those packages to listing this one as a dependency eventually? @Grimler91, you may want to chime in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do some test builds and see if anything, or how much, that brakes. Probably more packages need lobandroid-posix-semaphore as dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add this patch into libandroid-support
package rather than split into a sperated package. It would not break other package's dependency.
All/most c++ packages fail with something like
So the header file should probably be made available always. We could either replace the ndk sysroot header with the one from this package or split it into a libandroid-posix-semaphore-dev package and make the build system always install that one |
Actually the Maybe we can add these |
Oh, yes, let's keep it in the ndk/ndk-sysroot in that case. Some packages fail to build even if the header is present in $PREFIX/include (since there is no guarantee |
OK. I will submit a commit. |
Thanks! Semaphore header could probably be moved from ndk-sysroot to libandroid-posix-semaphore to simplify on device builds, but that's something we can fix later. I added a commit to pass PREFIX as compiler flag instead, to avoid it always being hardcoded |
Bionic libc doesn't support
sem_open
,sem_close
andsem_unlink
. This package contains a port of posix named semaphore from musl libc. The mapped file will be created at the temp directory of termux(/data/data/com.termux/files/usr/tmp)
rather than tmpfs(/dev/shm)
.It provides the NDK <semaphore.h> header. So this commit will update the ndk-sysroot package and termux NDK toolchain. Hope that removing <semaphore.h> header from NDK will not cause the compilation failure of many packages.
See also: #8990