Skip to content
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

fix(main,x11): fix build ncspot and ncspot-mpris #22791

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions packages/ncspot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ TERMUX_PKG_DESCRIPTION="An ncurses Spotify client written in Rust"
TERMUX_PKG_LICENSE="BSD 2-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.2.1"
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/hrkfdn/ncspot/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=6bd08609a56aa5854a1964c9a872fe58b69a768d7d94c874d40d7a8848241213
TERMUX_PKG_DEPENDS="dbus, pulseaudio"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true

TERMUX_PKG_CONFLICTS="ncspot-mpris"

TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--no-default-features
--features termion_backend,pulseaudio_backend
Expand All @@ -29,4 +27,25 @@ termux_step_pre_configure() {
cargo install --force --locked bindgen-cli@0.69.5

export TARGET_CMAKE_GENERATOR="Ninja"

# Setup subsequent cmake running inside cargo
# Crate used to invoke cmake does not work fine with cross-compilation so we wrap cmake
_CMAKE="$TERMUX_PKG_TMPDIR/bin/cmake"
mkdir -p "$(dirname "$_CMAKE")"

echo "#!$(readlink /proc/$$/exe)" > "$_CMAKE"
echo "echo CMAKE \"\$@\"" >> "$_CMAKE"
echo "[[ \"\$@\" =~ \"--build\" ]] && exec $(command -v cmake) \"\$@\" || \
exec $(command -v cmake) \
-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=\"$TERMUX_STANDALONE_TOOLCHAIN\" \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_SYSTEM_VERSION=$TERMUX_PKG_API_LEVEL \
-DCMAKE_LINKER=\"$TERMUX_STANDALONE_TOOLCHAIN/bin/$LD\" \
-DCMAKE_MAKE_PROGRAM=\"$(command -v ninja)\" \"\$@\"" >> "$_CMAKE"
chmod +x "$_CMAKE"

export PATH="$(dirname "$_CMAKE"):$PATH"
CXXFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
CFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
LDFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
}
25 changes: 22 additions & 3 deletions x11-packages/ncspot-mpris/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ TERMUX_PKG_DESCRIPTION="An ncurses Spotify client written in Rust (with MPRIS su
TERMUX_PKG_LICENSE="BSD 2-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.2.1"
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/hrkfdn/ncspot/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=6bd08609a56aa5854a1964c9a872fe58b69a768d7d94c874d40d7a8848241213
TERMUX_PKG_DEPENDS="dbus, pulseaudio"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true

TERMUX_PKG_CONFLICTS="ncspot"

TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--no-default-features
--features termion_backend,pulseaudio_backend,mpris,notify
Expand All @@ -29,4 +27,25 @@ termux_step_pre_configure() {
cargo install --force --locked bindgen-cli@0.69.5

export TARGET_CMAKE_GENERATOR="Ninja"

# Setup subsequent cmake running inside cargo
# Crate used to invoke cmake does not work fine with cross-compilation so we wrap cmake
_CMAKE="$TERMUX_PKG_TMPDIR/bin/cmake"
mkdir -p "$(dirname "$_CMAKE")"

echo "#!$(readlink /proc/$$/exe)" > "$_CMAKE"
echo "echo CMAKE \"\$@\"" >> "$_CMAKE"
echo "[[ \"\$@\" =~ \"--build\" ]] && exec $(command -v cmake) \"\$@\" || \
exec $(command -v cmake) \
-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=\"$TERMUX_STANDALONE_TOOLCHAIN\" \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_SYSTEM_VERSION=$TERMUX_PKG_API_LEVEL \
-DCMAKE_LINKER=\"$TERMUX_STANDALONE_TOOLCHAIN/bin/$LD\" \
-DCMAKE_MAKE_PROGRAM=\"$(command -v ninja)\" \"\$@\"" >> "$_CMAKE"
chmod +x "$_CMAKE"

export PATH="$(dirname "$_CMAKE"):$PATH"
CXXFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
CFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
LDFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
}
Loading