Skip to content

Commit 5d3ac99

Browse files
Maxythonrobertkirkman
authored andcommitted
Add new variables to properties.sh
- `TERMUX__PREFIX__INCLUDE_SUBDIR` - `TERMUX__PREFIX__LIB_SUBDIR`
1 parent 1184254 commit 5d3ac99

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

build-package.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,9 @@ termux_conf_multilib_vars() {
454454
"x86_64") TERMUX_ARCH="i686";;
455455
*) termux_error_exit "It is impossible to set multilib arch for ${TERMUX_ARCH} arch."
456456
esac
457+
TERMUX__PREFIX__INCLUDE_SUBDIR="$TERMUX__PREFIX__MULTI_INCLUDE_SUBDIR"
457458
TERMUX__PREFIX__INCLUDE_DIR="$TERMUX__PREFIX__MULTI_INCLUDE_DIR"
459+
TERMUX__PREFIX__LIB_SUBDIR="$TERMUX__PREFIX__MULTI_LIB_SUBDIR"
458460
TERMUX__PREFIX__LIB_DIR="$TERMUX__PREFIX__MULTI_LIB_DIR"
459461
}
460462

scripts/build/configure/termux_step_configure_meson.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ termux_step_configure_meson() {
1414
$TERMUX_PKG_BUILDDIR \
1515
--$(test "${TERMUX_PKG_MESON_NATIVE}" = "true" && echo "native-file" || echo "cross-file") $TERMUX_MESON_CROSSFILE \
1616
--prefix $TERMUX_PREFIX \
17-
--libdir $(test "${TERMUX_ARCH}" = "${TERMUX_REAL_ARCH}" && echo "lib" || echo "lib32") \
18-
--includedir $(test "${TERMUX_ARCH}" = "${TERMUX_REAL_ARCH}" && echo "include" || echo "include32") \
17+
--libdir $TERMUX__PREFIX__LIB_SUBDIR \
18+
--includedir $TERMUX__PREFIX__INCLUDE_SUBDIR \
1919
--buildtype ${_meson_buildtype} \
2020
${_meson_stripflag} \
2121
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS \

scripts/build/termux_step_massage.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ termux_step_massage() {
184184
fi
185185

186186
# Remove duplicate headers from `include32/` directory
187-
if [[ -d ./${ADDING_PREFIX}/include32 && -d ${TERMUX__PREFIX__BASE_INCLUDE_DIR} ]]; then
187+
if [[ -d ./${ADDING_PREFIX}/${TERMUX__PREFIX__MULTI_INCLUDE_SUBDIR} && -d ${TERMUX__PREFIX__BASE_INCLUDE_DIR} ]]; then
188188
local hpath
189-
for hpath in $(find ./${ADDING_PREFIX}/include32 -type f); do
190-
local h=$(sed "s|./${ADDING_PREFIX}/include32/||g" <<< "$hpath")
189+
for hpath in $(find ./${ADDING_PREFIX}/${TERMUX__PREFIX__MULTI_INCLUDE_SUBDIR} -type f); do
190+
local h=$(sed "s|./${ADDING_PREFIX}/${TERMUX__PREFIX__MULTI_INCLUDE_SUBDIR}/||g" <<< "$hpath")
191191
if [[ -f "${TERMUX__PREFIX__BASE_INCLUDE_DIR}/${h}" && \
192192
"$(md5sum < "${hpath}")" = "$(md5sum < "${TERMUX__PREFIX__BASE_INCLUDE_DIR}/${h}")" ]]; then
193193
rm "${hpath}"
@@ -196,17 +196,17 @@ termux_step_massage() {
196196
fi
197197

198198
# Configure pkgconfig files for proper multilib-compilation
199-
if [[ -d ./${ADDING_PREFIX}/lib32/pkgconfig ]]; then
199+
if [[ -d ./${ADDING_PREFIX}/${TERMUX__PREFIX__MULTI_LIB_SUBDIR}/pkgconfig ]]; then
200200
local pc
201-
for pc in $(grep -s -r -l "^includedir=.*/include32" ./${ADDING_PREFIX}/lib32/pkgconfig); do
201+
for pc in $(grep -s -r -l "^includedir=.*/${TERMUX__PREFIX__MULTI_INCLUDE_SUBDIR}" ./${ADDING_PREFIX}/${TERMUX__PREFIX__MULTI_LIB_SUBDIR}/pkgconfig); do
202202
local pc_cflags="$(grep '^Cflags:' "${pc}" | awk -F ':' '{printf $2 "\n"}')"
203203
if ! grep -q ' -I' <<< "${pc_cflags}"; then
204204
continue
205205
fi
206206
local pc_multilib_path="$(grep '^includedir=' "${pc}" | sed "s|${TERMUX_PREFIX}|\${prefix}|g" | awk -F '{prefix}/include' '{printf $2}')"
207207
local pc_edit_cflags="$(sed "s|\${includedir}|\${includedir}${pc_multilib_path}|g" <<< "${pc_cflags}")"
208208
local pc_new_cflags="$(tr ' ' '\n' <<< "${pc_edit_cflags}" | sed 's|\({includedir}\)32|\1|gp; s|\(/include\)32|\1|gp; d' | tr '\n' ' ')"
209-
sed -i -e "s|\(^includedir=.*/\)include32\(.*\)|\1include|g" \
209+
sed -i -e "s|\(^includedir=.*/\)${TERMUX__PREFIX__MULTI_INCLUDE_SUBDIR}\(.*\)|\1include|g" \
210210
-e "s|^Cflags:${pc_cflags}$|Cflags:${pc_edit_cflags} ${pc_new_cflags::-1}|g" \
211211
"${pc}"
212212
# Apply the modified pkgconfig to the system for proper multilib-compilation work

scripts/properties.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,13 @@ TERMUX__PREFIX__MULTI_INCLUDE_SUBDIR="include32"
11421142
TERMUX__PREFIX__MULTI_INCLUDE_DIR="$TERMUX__PREFIX/$TERMUX__PREFIX__MULTI_INCLUDE_SUBDIR"
11431143

11441144

1145+
##
1146+
# Termux include subdirectory path under `TERMUX__PREFIX`.
1147+
#
1148+
# Default value: `include`
1149+
##
1150+
TERMUX__PREFIX__INCLUDE_SUBDIR="$TERMUX__PREFIX__BASE_INCLUDE_SUBDIR"
1151+
11451152
##
11461153
# Termux include directory path under `TERMUX__PREFIX`.
11471154
#
@@ -1181,6 +1188,13 @@ TERMUX__PREFIX__MULTI_LIB_SUBDIR="lib32"
11811188
TERMUX__PREFIX__MULTI_LIB_DIR="$TERMUX__PREFIX/$TERMUX__PREFIX__MULTI_LIB_SUBDIR"
11821189

11831190

1191+
##
1192+
# Termux lib subdirectory path under `TERMUX__PREFIX`.
1193+
#
1194+
# Default value: `lib`
1195+
##
1196+
TERMUX__PREFIX__LIB_SUBDIR="$TERMUX__PREFIX__BASE_LIB_SUBDIR"
1197+
11841198
##
11851199
# Termux lib directory path under `TERMUX__PREFIX`.
11861200
#

0 commit comments

Comments
 (0)