Skip to content

Commit

Permalink
fix(main/fish): rename tarball version file to avoid conflict with ND…
Browse files Browse the repository at this point in the history
…K internal version file

Progress on termux#21130

This seems to be a completely independent issue from other issues
because it is reproducible in a clean repo using this command:
```
scripts/run-docker.sh ./build-package.sh -I fish
```

I also tried temporarily unapplying the line
`grep -lrw $_TERMUX_TOOLCHAIN_TMPDIR/sysroot/usr/include/c++/v1 -e '<version>' | xargs -n 1 sed -i 's/<version>/\"version\"/g'`
from the end of `termux_setup_toolchain_27b.sh` and deleting the `~/.termux-build/_cache` in case it made any difference,
but at least in my test, it does not seem to make a difference on the fish package (whether or not `#include "version"` or `include <version>` is forced in the toolchain)
so, it seems like the `fish` package itself has to be patched.
  • Loading branch information
robertkirkman committed Oct 31, 2024
1 parent fba6c5e commit d5129cd
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion packages/fish/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="The user-friendly command line shell"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="3.7.1"
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/fish-shell/fish-shell/releases/download/$TERMUX_PKG_VERSION/fish-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=614c9f5643cd0799df391395fa6bbc3649427bb839722ce3b114d3bbc1a3b250
TERMUX_PKG_AUTO_UPDATE=true
Expand All @@ -16,6 +16,23 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
"

termux_step_pre_configure() {
# fish releases tarballs that conflict with the way the toolchain
# currently is by putting a file in the tarball
# named "version" (not visible directly in the source code on github,
# generated by this code in fish's release workflow:
# https://github.com/fish-shell/fish-shell/blob/master/build_tools/make_tarball.sh#L69 )
# and, crucially, also placing the folder containing that file named "version"
# in the include path of building fish (since right next to this in the same folder,
# fish does have a file named "config.h" that it uses)
# here is the upstream, conflicting instance of file in internal llvm
# include path named "version" that is probably what propogates into the NDK's
# equivalent file,
# /home/builder/.termux-build/_cache/android-r27b-api-24-v1/sysroot/usr/include/c++/v1/version
# https://github.com/llvm/llvm-project/blob/main/libcxx/include/version
mv version fish_version
find build_tools -type f -exec sed -i {} \
-e 's/cat version/cat fish_version/g' \
-e 's/test -f version/test -f fish_version/g' \;
CXXFLAGS+=" $CPPFLAGS"
}

Expand Down

0 comments on commit d5129cd

Please sign in to comment.