packages: set custom PKG_[CONFIGURE|CMAKE|MESON]_SCRIPT in configure_package()

When setting a custom build script (which must be relative to $PKG_BUILD), the
value should be set in configure_package() so that $PKG_BUILD is known, and also
because the path to the script will be validated prior to calling
pre_configure_$TARGET(), so the script variable must be configured once the pacakge
is sourced.
This commit is contained in:
MilhouseVH 2018-12-18 03:43:28 +00:00
parent c19a3ff780
commit c2281f3c37
3 changed files with 29 additions and 24 deletions

View File

@ -26,7 +26,7 @@ configure_package() {
PKG_CONFIGURE_OPTS_TARGET="--with-cross-build=$PKG_BUILD/.$HOST_NAME \ PKG_CONFIGURE_OPTS_TARGET="--with-cross-build=$PKG_BUILD/.$HOST_NAME \
$PKG_ICU_OPTS" $PKG_ICU_OPTS"
PKG_CONFIGURE_SCRIPT="source/configure" PKG_CONFIGURE_SCRIPT="${PKG_BUILD}/source/configure"
} }
post_makeinstall_target() { post_makeinstall_target() {

View File

@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) # Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="gettext" PKG_NAME="gettext"
PKG_VERSION="0.19.8.1" PKG_VERSION="0.19.8.1"
@ -10,14 +11,16 @@ PKG_URL="http://ftp.gnu.org/pub/gnu/gettext/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_HOST="ccache:host" PKG_DEPENDS_HOST="ccache:host"
PKG_LONGDESC="A program internationalization library and tools." PKG_LONGDESC="A program internationalization library and tools."
PKG_CONFIGURE_SCRIPT="gettext-tools/configure" configure_package() {
PKG_CONFIGURE_SCRIPT="${PKG_BUILD}/gettext-tools/configure"
PKG_CONFIGURE_OPTS_HOST="--enable-static --disable-shared \ PKG_CONFIGURE_OPTS_HOST="--enable-static --disable-shared \
--disable-rpath \ --disable-rpath \
--with-gnu-ld \ --with-gnu-ld \
--disable-java \ --disable-java \
--disable-curses \ --disable-curses \
--with-included-libxml \ --with-included-libxml \
--disable-native-java \ --disable-native-java \
--disable-csharp \ --disable-csharp \
--without-emacs" --without-emacs"
}

View File

@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv) # Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="dvbhdhomerun" PKG_NAME="dvbhdhomerun"
PKG_VERSION="20130704" PKG_VERSION="20130704"
@ -13,7 +14,20 @@ PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="A linux DVB driver for the HDHomeRun TV tuner (http://www.silicondust.com)." PKG_LONGDESC="A linux DVB driver for the HDHomeRun TV tuner (http://www.silicondust.com)."
PKG_IS_KERNEL_PKG="yes" PKG_IS_KERNEL_PKG="yes"
PKG_CMAKE_SCRIPT="userhdhomerun/CMakeLists.txt" configure_package() {
PKG_CMAKE_SCRIPT="${PKG_BUILD}/userhdhomerun/CMakeLists.txt"
}
pre_configure_target() {
# use it here to be sure libhdhomerun is already built
PKG_CMAKE_OPTS_TARGET="-DLIBHDHOMERUN_PATH=$(ls -d $BUILD/libhdhomerun-*/)"
# absolute path
LIBHDHOMERUN_PATH=$(ls -d $BUILD/libhdhomerun-*/)
sed -i "s|SET(LIBHDHOMERUN_PATH .*)|SET(LIBHDHOMERUN_PATH $LIBHDHOMERUN_PATH)|g" ../userhdhomerun/CMakeLists.txt
sed -i "s|/etc/dvbhdhomerun|/tmp/dvbhdhomerun|g" ../userhdhomerun/hdhomerun_tuner.cpp
sed -i "s|/etc/dvbhdhomerun|/tmp/dvbhdhomerun|g" ../userhdhomerun/hdhomerun_controller.cpp
}
pre_make_target() { pre_make_target() {
( cd ../kernel ( cd ../kernel
@ -22,18 +36,6 @@ pre_make_target() {
) )
} }
pre_configure_target() {
# use it here to be sure libhdhomerun is already built
PKG_CMAKE_OPTS_TARGET="-DLIBHDHOMERUN_PATH=$(ls -d $BUILD/libhdhomerun-*/)"
# absolute path
LIBHDHOMERUN_PATH=$(ls -d $BUILD/libhdhomerun-*/)
sed -i "s|SET(LIBHDHOMERUN_PATH .*)|SET(LIBHDHOMERUN_PATH $LIBHDHOMERUN_PATH)|g" ../userhdhomerun/CMakeLists.txt
sed -i "s|/etc/dvbhdhomerun|/tmp/dvbhdhomerun|g" ../userhdhomerun/hdhomerun_tuner.cpp
sed -i "s|/etc/dvbhdhomerun|/tmp/dvbhdhomerun|g" ../userhdhomerun/hdhomerun_controller.cpp
}
makeinstall_target() { makeinstall_target() {
cd $PKG_BUILD cd $PKG_BUILD
mkdir -p $INSTALL/$(get_full_module_dir)/hdhomerun mkdir -p $INSTALL/$(get_full_module_dir)/hdhomerun