helix: fix libc++_shared not found (#7350)

This commit is contained in:
Aditya Alok 2021-08-20 14:09:59 +05:30 committed by GitHub
parent a6f77d7559
commit 12982f88f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 10 deletions

View File

@ -1,23 +1,43 @@
TERMUX_PKG_HOMEPAGE="https://helix-editor.com/"
TERMUX_PKG_DESCRIPTION="A post-modern modal text editor written in rust"
TERMUX_PKG_LICENSE="MPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_MAINTAINER="@MrAdityaAlok <dev.aditya.alok@gmail.com>"
TERMUX_PKG_VERSION=0.4.1
TERMUX_PKG_SRCURL="https://github.com/helix-editor/helix.git"
TERMUX_PKG_GIT_BRANCH=v$TERMUX_PKG_VERSION
TERMUX_PKG_GIT_BRANCH="v$TERMUX_PKG_VERSION"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_make_install() {
termux_setup_rust
cargo build --jobs $TERMUX_MAKE_PROCESSES --target $CARGO_TARGET_NAME --release
sed -i "s%\@TERMUX_CC\@%${CC}%g" ./helix-syntax/build.rs
cargo build --jobs "${TERMUX_MAKE_PROCESSES}" --target "${CARGO_TARGET_NAME}" --release
cat > "hx" <<- EOF
#!${TERMUX_PREFIX}/bin/sh
HELIX_RUNTIME=${TERMUX_PREFIX}/lib/helix/runtime exec ${TERMUX_PREFIX}/lib/helix/hx "\$@"
EOF
install -Dm755 ./hx $TERMUX_PREFIX/bin/hx
mkdir -p ${TERMUX_PREFIX}/lib/helix
cp -r runtime ${TERMUX_PREFIX}/lib/helix
install -Dm755 -t ${TERMUX_PREFIX}/lib/helix target/${CARGO_TARGET_NAME}/release/hx
HELIX_RUNTIME=${TERMUX_PREFIX}/lib/helix/runtime \\
exec ${TERMUX_PREFIX}/lib/helix/hx "\$@"
EOF
install -Dm755 ./hx "${TERMUX_PREFIX}/bin/hx"
mkdir -p "${TERMUX_PREFIX}/lib/helix"
cp -r runtime "${TERMUX_PREFIX}/lib/helix"
install -Dm755 -t "${TERMUX_PREFIX}/lib/helix" "target/${CARGO_TARGET_NAME}/release/hx"
install -Dm666 -t "${TERMUX_PREFIX}/lib/helix" languages.toml
}
termux_step_create_debscripts() {
cat > postinst <<- EOF
#!${TERMUX_PREFIX}/bin/bash
if ! test -f "${TERMUX_ANDROID_HOME}/.config/helix/languages.toml"; then
mkdir -p "${TERMUX_ANDROID_HOME}/.config/helix"
cp "${TERMUX_PREFIX}/lib/helix/languages.toml" "${TERMUX_ANDROID_HOME}/.config/helix"
echo -e "User modifiable \e[36mlanguages.toml\e[39m file is at ${TERMUX_ANDROID_HOME}/.config/helix"
fi
EOF
}

View File

@ -0,0 +1,23 @@
--- helix/helix-syntax/build.rs 2021-08-19 21:14:05.097999871 +0530
+++ helix-patch/helix-syntax/build.rs 2021-08-19 23:43:08.417999841 +0530
@@ -67,7 +67,7 @@
let mut config = cc::Build::new();
config.cpp(true).opt_level(2).cargo_metadata(false);
let compiler = config.get_compiler();
- let mut command = Command::new(compiler.path());
+ let mut command = Command::new("@TERMUX_CC@");
command.current_dir(src_path);
for (key, value) in compiler.env() {
command.env(key, value);
@@ -89,6 +89,11 @@
} else {
command
.arg("-shared")
+ .arg("-L@TERMUX_PREFIX/lib")
+ .arg("-Wl,-rpath=@TERMUX_PREFIX@/lib")
+ .arg("-lc++")
+ .arg("-lm")
+ .arg("-lc++_shared")
.arg("-fPIC")
.arg("-fno-exceptions")
.arg("-g")