0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-03-04 04:48:55 +00:00
Robert Kirkman 7159f656a3 scripts(toolchain): several changes related to $TERMUX_PREFIX/include
- This is the `$TERMUX_PREFIX/include` portion of #21835

- Replace `-I` with `-isystem` in strategic locations: changes the include order of headers in `$TERMUX_PREFIX/include` relative to headers inside the source code of packages currently being built, so that if any headers inside the source code of the package being built have the exact same file names as headers inside `$TERMUX_PREFIX/include`, the headers from inside the source code of the package will be used, instead of the headers from inside `$TERMUX_PREFIX/include`, which would not be correct.
  - Previous discussion was here 3dc455672c (diff-8c775c171f451b21463be103116ad5a4c2d0c54d3fb4ff4b59e987f98fc9c348)
  - Prevents many _potential_ `$TERMUX_PREFIX/include`-related errors (that are often only reproducible when reusing a single docker container to compile multiple packages) in the following packages (and possibly other packages):
    - `nasm`
    - `bitlbee`
    - `emacs`
    - `gdb`
    - `libjxl`
    - `libmediainfo`
    - `maxcso`
    - `nodejs`
    - `pipewire`
    - `rust`
    - `sqlcipher`
    - `tome2`
    - `weggli`
    - `zip`
    - `proxmark3`
    - `handbrake`
  - This include order causes the `$TERMUX_ON_DEVICE_BUILD=false` build codepath to match the behavior of the `clang` binary from the `main/clang` package (i.e. the `$TERMUX_ON_DEVICE_BUILD=true` codepath), which is caused by the `-DDEFAULT_SYSROOT` setting that is built into it:

26a76f7b5d/packages/libllvm/build.sh (L40)

- `simulavr`: the current `simulavr` `build.sh` runs `mv $TERMUX_PREFIX/include ...`, that is not really ideal because it effectively deletes the entire `$TERMUX_PREFIX/include` folder, preventing any other packages that might be built in the same container from using the headers they need from `$TERMUX_PREFIX/include` (and also potentially creating a malformed `simulavr` package `.deb` if any other packages were installed info `$TERMUX_PREFIX` beforehand). This rewrites the `simulavr` package in a way that avoids destroying `$TERMUX_PREFIX/include`.
2025-02-26 12:11:05 +02:00

50 lines
1.7 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://www.ghostscript.com/
TERMUX_PKG_DESCRIPTION="Interpreter for the PostScript language and for PDF"
TERMUX_PKG_LICENSE="AGPL-V3"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="10.03.1"
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs${TERMUX_PKG_VERSION//.}/ghostpdl-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=8ea9dd8768b64576bc4ee2d79611450c9e1edeb686f7824f3bf94b92457b882a
TERMUX_PKG_AUTO_UPDATE=false
TERMUX_PKG_DEPENDS="fontconfig, freetype, jbig2dec, libandroid-support, libc++, libiconv, libidn, libjpeg-turbo, libpng, libtiff, littlecms, openjpeg, zlib"
TERMUX_PKG_BUILD_DEPENDS="libexpat"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
ac_cv_lib_lcms2__cmsCreateMutex=yes
ac_cv_lib_pthread_pthread_create=yes
CCAUX=gcc
--build=$TERMUX_BUILD_TUPLE
--with-arch_h=$TERMUX_PKG_BUILDER_DIR/arch-${TERMUX_ARCH}.h
--disable-cups
--disable-compile-inits
--without-pcl
--without-x
--with-system-libtiff
"
TERMUX_PKG_MAKE_INSTALL_TARGET="install-so install"
termux_step_post_get_source() {
rm -rdf $TERMUX_PKG_SRCDIR/{expat,freetype,jbig2dec,jpeg,lcms2mt,libpng,openjpeg,tiff,zlib}
}
termux_step_pre_configure() {
CPPFLAGS+=" -I${TERMUX_STANDALONE_TOOLCHAIN}/sysroot/usr/include/c++/v1"
if [[ "${TERMUX_ARCH}" == "aarch64" ]]; then
# https://github.com/llvm/llvm-project/issues/74361
# NDK r27: clang++: error: unsupported option '-mfpu=' for target 'aarch64-linux-android24'
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --disable-neon"
fi
}
termux_step_make() {
make -j $TERMUX_PKG_MAKE_PROCESSES \
so all \
${TERMUX_PKG_EXTRA_MAKE_ARGS}
}
termux_step_post_make_install() {
mv $TERMUX_PREFIX/bin/gs{c,}
}