2013-07-19 00:35:52 +00:00
|
|
|
#!/bin/bash
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2018-07-16 18:45:36 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
|
2018-11-02 22:24:35 +00:00
|
|
|
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
2011-01-09 20:26:03 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
. config/options "${1}"
|
2018-12-18 03:43:28 +00:00
|
|
|
|
2022-09-22 15:58:18 +00:00
|
|
|
record_timestamp BUILD_BEGIN
|
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ -z "${1}" ]; then
|
|
|
|
die "usage: ${0} package_name[:<host|target|init|bootstrap>] [parent_pkg]"
|
2018-12-18 03:43:28 +00:00
|
|
|
fi
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ "${1}" = "--all" ]; then
|
|
|
|
if [ -n "${2}" ]; then
|
2019-06-17 17:49:58 +00:00
|
|
|
for build_dir in $(ls -1d ${BUILD_ROOT}/${BUILD_BASE}.*); do
|
2019-06-16 01:45:52 +00:00
|
|
|
load_build_config ${build_dir} && ${SCRIPTS}/build "${2}"
|
2018-02-22 12:11:39 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2018-12-18 03:43:28 +00:00
|
|
|
if [ -z "${PKG_NAME}" ]; then
|
|
|
|
die "$(print_color CLR_ERROR "${1}: no package.mk file found")"
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ -n "${PKG_ARCH}" ]; then
|
|
|
|
listcontains "${PKG_ARCH}" "!${TARGET_ARCH}" && exit 0
|
|
|
|
listcontains "${PKG_ARCH}" "${TARGET_ARCH}" || listcontains "${PKG_ARCH}" "any" || exit 0
|
2014-01-27 13:05:34 +00:00
|
|
|
fi
|
|
|
|
|
2017-10-09 04:25:52 +00:00
|
|
|
if [ "${1//:/}" != "${1}" ]; then
|
|
|
|
TARGET="${1#*:}"
|
|
|
|
else
|
|
|
|
TARGET=
|
|
|
|
fi
|
2018-11-02 22:24:35 +00:00
|
|
|
TARGET="${TARGET:-target}"
|
2019-02-08 17:17:43 +00:00
|
|
|
PARENT_PKG="${2:-${PKG_NAME}:${TARGET}}"
|
|
|
|
|
2019-06-16 00:13:39 +00:00
|
|
|
pkg_lock "${PKG_NAME}:${TARGET}" "build" "${PARENT_PKG}"
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
mkdir -p ${STAMPS}/${PKG_NAME}
|
|
|
|
STAMP=${STAMPS}/${PKG_NAME}/build_${TARGET}
|
|
|
|
if [ -f ${STAMP} ]; then
|
|
|
|
. ${STAMP}
|
2018-04-02 09:09:11 +00:00
|
|
|
PKG_DEEPHASH=$(calculate_stamp)
|
2019-06-16 01:56:30 +00:00
|
|
|
|
|
|
|
if [ "${PKG_DEEPHASH}" = "${STAMP_PKG_DEEPHASH}" -a "${BUILD_WITH_DEBUG}" = "${STAMP_BUILD_WITH_DEBUG}" ]; then
|
2018-12-18 03:43:28 +00:00
|
|
|
# stamp matched: already built, do nothing
|
2019-02-08 17:17:43 +00:00
|
|
|
pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "already built"
|
2018-12-18 03:43:28 +00:00
|
|
|
exit 0
|
2017-05-01 01:45:00 +00:00
|
|
|
fi
|
2019-06-16 01:56:30 +00:00
|
|
|
|
|
|
|
rm -f ${STAMP}
|
2009-03-18 12:02:53 +00:00
|
|
|
fi
|
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
${SCRIPTS}/unpack "${PKG_NAME}" "${PARENT_PKG}"
|
2018-12-18 03:43:28 +00:00
|
|
|
|
|
|
|
# build dependencies, only when PKG_DEPENDS_? is filled
|
|
|
|
unset _pkg_depends
|
2019-06-16 01:45:52 +00:00
|
|
|
case "${TARGET}" in
|
|
|
|
"target") _pkg_depends="${PKG_DEPENDS_TARGET}";;
|
|
|
|
"host") _pkg_depends="${PKG_DEPENDS_HOST}";;
|
|
|
|
"init") _pkg_depends="${PKG_DEPENDS_INIT}";;
|
|
|
|
"bootstrap") _pkg_depends="${PKG_DEPENDS_BOOTSTRAP}";;
|
2018-12-18 03:43:28 +00:00
|
|
|
esac
|
2019-12-29 23:19:58 +00:00
|
|
|
|
|
|
|
if is_sequential_build; then
|
|
|
|
for p in ${_pkg_depends}; do
|
|
|
|
${SCRIPTS}/build "${p}" "${PARENT_PKG}"
|
|
|
|
done
|
|
|
|
fi
|
2018-12-18 03:43:28 +00:00
|
|
|
|
|
|
|
# virtual packages are not built as they only contain dependencies, so dont go further here
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ "${PKG_SECTION}" = "virtual" ]; then
|
2018-12-18 03:43:28 +00:00
|
|
|
PKG_DEEPHASH=$(calculate_stamp)
|
|
|
|
for i in PKG_NAME PKG_DEEPHASH BUILD_WITH_DEBUG; do
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "STAMP_${i}=\"${!i}\"" >> ${STAMP}
|
2018-12-18 03:43:28 +00:00
|
|
|
done
|
|
|
|
|
2019-02-08 17:17:43 +00:00
|
|
|
pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "built"
|
2017-10-27 16:39:14 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2019-02-08 17:17:43 +00:00
|
|
|
# build this package
|
|
|
|
if [ "${BUILD_WITH_DEBUG}" = "yes" ]; then
|
2019-06-16 00:13:39 +00:00
|
|
|
build_msg "CLR_BUILD" "BUILD" "${PKG_NAME} $(print_color "CLR_TARGET" "(${TARGET})") [DEBUG]" "indent"
|
2019-02-08 17:17:43 +00:00
|
|
|
else
|
2019-06-16 00:13:39 +00:00
|
|
|
build_msg "CLR_BUILD" "BUILD" "${PKG_NAME} $(print_color "CLR_TARGET" "(${TARGET})")" "indent"
|
2019-02-08 17:17:43 +00:00
|
|
|
fi
|
|
|
|
|
2019-08-25 12:01:32 +00:00
|
|
|
# setup configure scripts
|
|
|
|
PKG_CONFIGURE_SCRIPT="${PKG_CONFIGURE_SCRIPT:-${PKG_BUILD}/configure}"
|
|
|
|
PKG_CMAKE_SCRIPT="${PKG_CMAKE_SCRIPT:-${PKG_BUILD}/CMakeLists.txt}"
|
|
|
|
PKG_MESON_SCRIPT="${PKG_MESON_SCRIPT:-${PKG_BUILD}/meson.build}"
|
|
|
|
|
|
|
|
# auto detect toolchain
|
|
|
|
_auto_toolchain=""
|
|
|
|
if [ -z "${PKG_TOOLCHAIN}" -o "${PKG_TOOLCHAIN}" = "auto" ]; then
|
|
|
|
if [ -f "${PKG_MESON_SCRIPT}" ]; then
|
|
|
|
PKG_TOOLCHAIN="meson"
|
|
|
|
elif [ -f "${PKG_CMAKE_SCRIPT}" ]; then
|
|
|
|
PKG_TOOLCHAIN="cmake"
|
|
|
|
elif [ -f "${PKG_CONFIGURE_SCRIPT}" ]; then
|
|
|
|
PKG_TOOLCHAIN="configure"
|
|
|
|
elif [ -f "${PKG_BUILD}/Makefile" ]; then
|
|
|
|
PKG_TOOLCHAIN="make"
|
|
|
|
else
|
|
|
|
die "Not possible to detect toolchain automatically. Add PKG_TOOLCHAIN= to package.mk"
|
|
|
|
fi
|
|
|
|
_auto_toolchain=" (auto-detect)"
|
|
|
|
fi
|
|
|
|
if ! listcontains "meson cmake cmake-make configure ninja make autotools manual" "${PKG_TOOLCHAIN}"; then
|
|
|
|
die "$(print_color "CLR_ERROR" "ERROR:") unknown toolchain ${PKG_TOOLCHAIN}"
|
|
|
|
fi
|
|
|
|
build_msg "CLR_TOOLCHAIN" "TOOLCHAIN" "${PKG_TOOLCHAIN}${_auto_toolchain}"
|
|
|
|
|
2021-01-08 16:04:54 +00:00
|
|
|
# check wrong toolchain configuration
|
|
|
|
check_toolchain_config ${TARGET} ${PKG_TOOLCHAIN}
|
|
|
|
|
2019-08-25 12:01:32 +00:00
|
|
|
# setup toolchain
|
2019-08-25 15:49:30 +00:00
|
|
|
setup_toolchain ${TARGET} ${PKG_TOOLCHAIN}
|
2017-10-27 16:39:14 +00:00
|
|
|
|
2018-12-18 03:43:28 +00:00
|
|
|
# configure install directory
|
2019-11-30 11:31:03 +00:00
|
|
|
[ -n "${PKG_INSTALL}" ] && INSTALL="${PKG_INSTALL}" || unset INSTALL
|
|
|
|
|
2018-12-18 03:43:28 +00:00
|
|
|
# remove previous install files
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ -n "${INSTALL}" -a -d "${INSTALL}" ]; then
|
|
|
|
rm -rf "${INSTALL}"
|
2018-12-18 03:43:28 +00:00
|
|
|
fi
|
2017-10-27 16:39:14 +00:00
|
|
|
|
2018-02-19 07:08:48 +00:00
|
|
|
# configure debug build defaults
|
|
|
|
if [ "${BUILD_WITH_DEBUG}" = "yes" ]; then
|
|
|
|
CMAKE_BUILD_TYPE="Debug"
|
|
|
|
MESON_BUILD_TYPE="debug"
|
|
|
|
else
|
|
|
|
CMAKE_BUILD_TYPE="MinSizeRel"
|
|
|
|
MESON_BUILD_TYPE="plain"
|
|
|
|
fi
|
|
|
|
|
2018-12-18 03:43:28 +00:00
|
|
|
CMAKE_GENERATOR_NINJA="-GNinja \
|
|
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
|
|
|
|
2017-10-27 16:39:14 +00:00
|
|
|
# configure TARGET build defaults
|
2019-06-16 01:45:52 +00:00
|
|
|
TARGET_CONFIGURE_OPTS="--host=${TARGET_NAME} \
|
|
|
|
--build=${HOST_NAME} \
|
2017-10-27 16:39:14 +00:00
|
|
|
--prefix=/usr \
|
2017-10-07 19:32:39 +00:00
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--libdir=/usr/lib \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--localstatedir=/var \
|
2017-10-27 16:39:14 +00:00
|
|
|
--disable-static \
|
|
|
|
--enable-shared"
|
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
TARGET_CMAKE_OPTS="-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CONF} \
|
2017-10-27 16:39:14 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2019-06-16 01:45:52 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
|
2017-10-27 16:39:14 +00:00
|
|
|
|
|
|
|
TARGET_MESON_OPTS="--prefix=/usr \
|
|
|
|
--bindir=/usr/bin \
|
|
|
|
--sbindir=/usr/sbin \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--libdir=/usr/lib \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--localstatedir=/var \
|
2019-06-16 01:45:52 +00:00
|
|
|
--buildtype=${MESON_BUILD_TYPE}"
|
2019-09-04 10:07:06 +00:00
|
|
|
if [ ${BUILD_WITH_DEBUG} != yes ] && flag_enabled "strip" "yes"; then
|
|
|
|
TARGET_MESON_OPTS+=" -Dstrip=true"
|
|
|
|
fi
|
|
|
|
|
2017-10-27 16:39:14 +00:00
|
|
|
|
|
|
|
# configure HOST build defaults
|
2019-06-16 01:45:52 +00:00
|
|
|
HOST_CONFIGURE_OPTS="--host=${HOST_NAME} \
|
|
|
|
--build=${HOST_NAME} \
|
|
|
|
--prefix=${TOOLCHAIN} \
|
|
|
|
--bindir=${TOOLCHAIN}/bin \
|
|
|
|
--sbindir=${TOOLCHAIN}/sbin \
|
|
|
|
--sysconfdir=${TOOLCHAIN}/etc \
|
|
|
|
--libexecdir=${TOOLCHAIN}/lib \
|
|
|
|
--localstatedir=${TOOLCHAIN}/var \
|
2017-10-27 16:39:14 +00:00
|
|
|
--disable-static \
|
|
|
|
--enable-shared"
|
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
HOST_CMAKE_OPTS="${CMAKE_GENERATOR} \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CONF} \
|
2021-08-08 09:54:30 +00:00
|
|
|
-DCMAKE_INSTALL_PREFIX=${TOOLCHAIN} \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release"
|
2019-06-16 01:45:52 +00:00
|
|
|
|
|
|
|
HOST_MESON_OPTS="--prefix=${TOOLCHAIN} \
|
|
|
|
--bindir=${TOOLCHAIN}/bin \
|
|
|
|
--sbindir=${TOOLCHAIN}/sbin \
|
|
|
|
--sysconfdir=${TOOLCHAIN}/etc \
|
|
|
|
--libdir=${TOOLCHAIN}/lib \
|
|
|
|
--libexecdir=${TOOLCHAIN}/lib \
|
|
|
|
--localstatedir=${TOOLCHAIN}/var \
|
2018-03-20 21:11:25 +00:00
|
|
|
--buildtype=plain"
|
2017-10-27 16:39:14 +00:00
|
|
|
|
|
|
|
# configure INIT build defaults
|
2019-06-16 01:45:52 +00:00
|
|
|
INIT_CONFIGURE_OPTS="${TARGET_CONFIGURE_OPTS}"
|
|
|
|
INIT_CMAKE_OPTS="${TARGET_CMAKE_OPTS}"
|
|
|
|
INIT_MESON_OPTS="${TARGET_MESON_OPTS}"
|
2017-10-27 16:39:14 +00:00
|
|
|
|
|
|
|
# configure BOOTSTRAP build defaults
|
2019-06-16 01:45:52 +00:00
|
|
|
BOOTSTRAP_CONFIGURE_OPTS="${HOST_CONFIGURE_OPTS}"
|
|
|
|
BOOTSTRAP_CMAKE_OPTS="${HOST_CMAKE_OPTS}"
|
|
|
|
BOOTSTRAP_MESON_OPTS="${HOST_MESON_OPTS}"
|
2017-10-27 16:39:14 +00:00
|
|
|
|
2022-09-22 15:58:18 +00:00
|
|
|
record_timestamp BUILD_START
|
|
|
|
|
2017-10-27 16:39:14 +00:00
|
|
|
# make autoreconf
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ "${PKG_TOOLCHAIN}" = "autotools" ]; then
|
2021-02-16 18:15:04 +00:00
|
|
|
${SCRIPTS}/autoreconf "${PKG_NAME}" "${PARENT_PKG}" $(dirname "${PKG_CONFIGURE_SCRIPT}")
|
2017-10-27 16:39:14 +00:00
|
|
|
fi
|
|
|
|
|
2019-02-08 17:17:43 +00:00
|
|
|
pkg_lock_status "ACTIVE" "${PKG_NAME}:${TARGET}" "build"
|
|
|
|
|
2017-10-27 16:39:14 +00:00
|
|
|
# include build template and build
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call_exists_opt pre_build_${TARGET} && pkg_call
|
2017-10-27 16:39:14 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
# ensure ${PKG_BUILD} is there. (installer? PKG_URL="")
|
2019-06-16 01:56:30 +00:00
|
|
|
mkdir -p "${PKG_BUILD}"
|
2017-10-27 16:39:14 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
cd "${PKG_BUILD}"
|
2017-10-27 16:39:14 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ -f "${PKG_CONFIGURE_SCRIPT}" -o -f "${PKG_CMAKE_SCRIPT}" -o -f "${PKG_MESON_SCRIPT}" ]; then
|
|
|
|
case "${TARGET}" in
|
|
|
|
"target") PKG_REAL_BUILD="${PKG_BUILD}/.${TARGET_NAME}" ;;
|
|
|
|
"host") PKG_REAL_BUILD="${PKG_BUILD}/.${HOST_NAME}" ;;
|
|
|
|
"init") PKG_REAL_BUILD="${PKG_BUILD}/.${TARGET_NAME}-${TARGET}" ;;
|
|
|
|
"bootstrap") PKG_REAL_BUILD="${PKG_BUILD}/.${HOST_NAME}-${TARGET}" ;;
|
2017-10-27 16:39:14 +00:00
|
|
|
esac
|
2019-06-16 01:45:52 +00:00
|
|
|
mkdir -p "${PKG_REAL_BUILD}"
|
|
|
|
cd "${PKG_REAL_BUILD}"
|
2018-11-02 22:24:35 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
MESON_CONF="${PKG_REAL_BUILD}/meson.conf"
|
2017-10-27 16:39:14 +00:00
|
|
|
fi
|
|
|
|
|
2022-12-01 19:07:12 +00:00
|
|
|
# create wrapper scripts in build dir and use them for CC/CXX when
|
|
|
|
# building for host and local-cc build flag is set
|
|
|
|
if [ "${TARGET}" = "host" ] && flag_enabled "local-cc" "no"; then
|
|
|
|
cat > libreelec-local-cc << EOF
|
|
|
|
#!/bin/sh
|
|
|
|
exec ${CC} "\$@"
|
|
|
|
EOF
|
|
|
|
chmod +x libreelec-local-cc
|
|
|
|
export CC=$(pwd)/libreelec-local-cc
|
|
|
|
cat > libreelec-local-cxx << EOF
|
|
|
|
#!/bin/sh
|
|
|
|
exec ${CXX} "\$@"
|
|
|
|
EOF
|
|
|
|
chmod +x libreelec-local-cxx
|
|
|
|
export CXX=$(pwd)/libreelec-local-cxx
|
|
|
|
fi
|
|
|
|
|
2017-10-27 16:39:14 +00:00
|
|
|
# configure
|
2019-12-20 14:47:17 +00:00
|
|
|
if [ -n "${PKG_DEPENDS_CONFIG}" -a -n "${PKG_INSTALL}" ]; then
|
|
|
|
for pkg in ${PKG_DEPENDS_CONFIG}; do
|
|
|
|
for dir in "$(get_install_dir ${pkg})"/{usr/local/,usr/,}{lib/,share/}pkgconfig; do
|
|
|
|
if [ -d "${dir}" ]; then
|
|
|
|
build_msg "CLR_TOOLCHAIN" "PKG_CONFIG_PATH" "${dir}"
|
|
|
|
[ -n "${PKG_CONFIG_PATH}" ] && PKG_CONFIG_PATH+=":"
|
|
|
|
PKG_CONFIG_PATH+="${dir}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
export PKG_CONFIG_PATH
|
|
|
|
fi
|
|
|
|
|
2022-09-22 15:58:18 +00:00
|
|
|
record_timestamp BUILD_CONFIGURE
|
|
|
|
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call_exists_opt pre_configure && pkg_call
|
|
|
|
pkg_call_exists_opt pre_configure_${TARGET} && pkg_call
|
2018-11-28 14:58:22 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
if pkg_call_exists configure_${TARGET}; then
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call
|
2019-01-21 13:15:11 +00:00
|
|
|
else
|
2019-06-16 01:45:52 +00:00
|
|
|
case "${PKG_TOOLCHAIN}:${TARGET}" in
|
2017-10-27 16:39:14 +00:00
|
|
|
# meson builds
|
|
|
|
"meson:target")
|
2019-08-25 12:01:32 +00:00
|
|
|
create_meson_conf_target ${TARGET} ${MESON_CONF}
|
2022-11-16 08:31:15 +00:00
|
|
|
echo "Executing (target): meson setup ${TARGET_MESON_OPTS} --cross-file=${MESON_CONF} ${PKG_MESON_OPTS_TARGET} ${PKG_MESON_SCRIPT%/*}" | tr -s " "
|
|
|
|
CC="${HOST_CC}" CXX="${HOST_CXX}" meson setup ${TARGET_MESON_OPTS} --cross-file=${MESON_CONF} ${PKG_MESON_OPTS_TARGET} ${PKG_MESON_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:host")
|
2019-08-25 12:01:32 +00:00
|
|
|
create_meson_conf_host ${TARGET} ${MESON_CONF}
|
2022-11-16 08:31:15 +00:00
|
|
|
echo "Executing (host): meson setup ${HOST_MESON_OPTS} --native-file=${MESON_CONF} ${PKG_MESON_OPTS_HOST} ${PKG_MESON_SCRIPT%/*}" | tr -s " "
|
|
|
|
meson setup ${HOST_MESON_OPTS} --native-file=${MESON_CONF} ${PKG_MESON_OPTS_HOST} ${PKG_MESON_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:init")
|
2019-08-25 12:01:32 +00:00
|
|
|
create_meson_conf_target ${TARGET} ${MESON_CONF}
|
2022-11-16 08:31:15 +00:00
|
|
|
echo "Executing (init): meson setup ${INIT_MESON_OPTS} --cross-file=${MESON_CONF} ${PKG_MESON_OPTS_INIT} ${PKG_MESON_SCRIPT%/*}" | tr -s " "
|
|
|
|
meson setup ${INIT_MESON_OPTS} --cross-file=${MESON_CONF} ${PKG_MESON_OPTS_INIT} ${PKG_MESON_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:bootstrap")
|
2019-08-25 12:01:32 +00:00
|
|
|
create_meson_conf_host ${TARGET} ${MESON_CONF}
|
2022-11-16 08:31:15 +00:00
|
|
|
echo "Executing (bootstrap): meson setup ${BOOTSTRAP_MESON_OPTS} ----native-file=${MESON_CONF} ${PKG_MESON_OPTS_BOOTSTRAP} ${PKG_MESON_SCRIPT%/*}" | tr -s " "
|
|
|
|
meson setup ${BOOTSTRAP_MESON_OPTS} --native-file=${MESON_CONF} ${PKG_MESON_OPTS_BOOTSTRAP} ${PKG_MESON_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
# cmake builds with ninja
|
|
|
|
"cmake:target")
|
2021-03-12 03:11:00 +00:00
|
|
|
echo "Executing (target): cmake ${CMAKE_GENERATOR_NINJA} ${TARGET_CMAKE_OPTS} ${PKG_CMAKE_OPTS_TARGET} ${PKG_CMAKE_SCRIPT%/*}" | tr -s " "
|
|
|
|
cmake ${CMAKE_GENERATOR_NINJA} ${TARGET_CMAKE_OPTS} ${PKG_CMAKE_OPTS_TARGET} ${PKG_CMAKE_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"cmake:host")
|
2021-03-12 03:11:00 +00:00
|
|
|
echo "Executing (host): cmake ${CMAKE_GENERATOR_NINJA} ${HOST_CMAKE_OPTS} ${PKG_CMAKE_OPTS_HOST} ${PKG_CMAKE_SCRIPT%/*}" | tr -s " "
|
|
|
|
cmake ${CMAKE_GENERATOR_NINJA} ${HOST_CMAKE_OPTS} ${PKG_CMAKE_OPTS_HOST} ${PKG_CMAKE_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"cmake:init")
|
2021-03-12 03:11:00 +00:00
|
|
|
echo "Executing (init): cmake ${CMAKE_GENERATOR_NINJA} ${INIT_CMAKE_OPTS} ${PKG_CMAKE_OPTS_INIT} ${PKG_CMAKE_SCRIPT%/*}" | tr -s " "
|
|
|
|
cmake ${CMAKE_GENERATOR_NINJA} ${INIT_CMAKE_OPTS} ${PKG_CMAKE_OPTS_INIT} ${PKG_CMAKE_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"cmake:bootstrap")
|
2021-03-12 03:11:00 +00:00
|
|
|
echo "Executing (bootstrap): cmake ${CMAKE_GENERATOR_NINJA} ${BOOTSTRAP_CMAKE_OPTS} ${PKG_CMAKE_OPTS_BOOTSTRAP} ${PKG_CMAKE_SCRIPT%/*}" | tr -s " "
|
|
|
|
cmake ${CMAKE_GENERATOR_NINJA} ${BOOTSTRAP_CMAKE_OPTS} ${PKG_CMAKE_OPTS_BOOTSTRAP} ${PKG_CMAKE_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
# cmake builds with make
|
|
|
|
"cmake-make:target")
|
2021-03-12 03:11:00 +00:00
|
|
|
echo "Executing (target): cmake ${TARGET_CMAKE_OPTS} ${PKG_CMAKE_OPTS_TARGET} ${PKG_CMAKE_SCRIPT%/*}" | tr -s " "
|
|
|
|
cmake ${TARGET_CMAKE_OPTS} ${PKG_CMAKE_OPTS_TARGET} ${PKG_CMAKE_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"cmake-make:host")
|
2021-03-12 03:11:00 +00:00
|
|
|
echo "Executing (host): cmake ${HOST_CMAKE_OPTS} ${PKG_CMAKE_OPTS_HOST} ${PKG_CMAKE_SCRIPT%/*}" | tr -s " "
|
|
|
|
cmake ${HOST_CMAKE_OPTS} ${PKG_CMAKE_OPTS_HOST} ${PKG_CMAKE_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"cmake-make:init")
|
2021-03-12 03:11:00 +00:00
|
|
|
echo "Executing (init): cmake ${INIT_CMAKE_OPTS} ${PKG_CMAKE_OPTS_INIT} ${PKG_CMAKE_SCRIPT%/*}" | tr -s " "
|
|
|
|
cmake ${INIT_CMAKE_OPTS} ${PKG_CMAKE_OPTS_INIT} ${PKG_CMAKE_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"cmake-make:bootstrap")
|
2021-03-12 03:11:00 +00:00
|
|
|
echo "Executing (bootstrap): cmake ${BOOTSTRAP_CMAKE_OPTS} ${PKG_CMAKE_OPTS_BOOTSTRAP} ${PKG_CMAKE_SCRIPT%/*}" | tr -s " "
|
|
|
|
cmake ${BOOTSTRAP_CMAKE_OPTS} ${PKG_CMAKE_OPTS_BOOTSTRAP} ${PKG_CMAKE_SCRIPT%/*}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
# configure builds
|
|
|
|
"configure:target"|"autotools:target")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (target): ${PKG_CONFIGURE_SCRIPT} ${TARGET_CONFIGURE_OPTS} ${PKG_CONFIGURE_OPTS_TARGET}" | tr -s " "
|
|
|
|
${PKG_CONFIGURE_SCRIPT} ${TARGET_CONFIGURE_OPTS} ${PKG_CONFIGURE_OPTS_TARGET}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:host"|"autotools:host")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (host): ${PKG_CONFIGURE_SCRIPT} ${HOST_CONFIGURE_OPTS} ${PKG_CONFIGURE_OPTS_HOST}" | tr -s " "
|
|
|
|
${PKG_CONFIGURE_SCRIPT} ${HOST_CONFIGURE_OPTS} ${PKG_CONFIGURE_OPTS_HOST}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:init"|"autotools:init")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (init): ${PKG_CONFIGURE_SCRIPT} ${INIT_CONFIGURE_OPTS} ${PKG_CONFIGURE_OPTS_INIT}" | tr -s " "
|
|
|
|
${PKG_CONFIGURE_SCRIPT} ${INIT_CONFIGURE_OPTS} ${PKG_CONFIGURE_OPTS_INIT}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:bootstrap"|"autotools:bootstrap")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (bootstrap): ${PKG_CONFIGURE_SCRIPT} ${BOOTSTRAP_CONFIGURE_OPTS} ${PKG_CONFIGURE_OPTS_BOOTSTRAP}" | tr -s " "
|
|
|
|
${PKG_CONFIGURE_SCRIPT} ${BOOTSTRAP_CONFIGURE_OPTS} ${PKG_CONFIGURE_OPTS_BOOTSTRAP}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2018-11-28 14:58:22 +00:00
|
|
|
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call_exists_opt post_configure_${TARGET} && pkg_call
|
2013-07-17 04:12:14 +00:00
|
|
|
|
2022-09-22 15:58:18 +00:00
|
|
|
record_timestamp BUILD_MAKE
|
|
|
|
|
2017-10-27 16:39:14 +00:00
|
|
|
# make
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call_exists_opt pre_make_${TARGET} && pkg_call
|
2018-11-28 14:58:22 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
if pkg_call_exists make_${TARGET}; then
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call
|
2019-01-21 13:15:11 +00:00
|
|
|
else
|
2019-06-16 01:45:52 +00:00
|
|
|
case "${PKG_TOOLCHAIN}:${TARGET}" in
|
2017-10-27 16:39:14 +00:00
|
|
|
# ninja based builds
|
|
|
|
"meson:target"|"cmake:target"|"ninja:target")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (target): ninja ${PKG_MAKE_OPTS_TARGET}" | tr -s " "
|
|
|
|
ninja ${NINJA_OPTS} ${PKG_MAKE_OPTS_TARGET}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:host"|"cmake:host"|"ninja:host")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (host): ninja ${PKG_MAKE_OPTS_HOST}" | tr -s " "
|
|
|
|
ninja ${NINJA_OPTS} ${PKG_MAKE_OPTS_HOST}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:init"|"cmake:init"|"ninja:init")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (init): ninja ${PKG_MAKE_OPTS_INIT}" | tr -s " "
|
|
|
|
ninja ${NINJA_OPTS} ${PKG_MAKE_OPTS_INIT}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:bootstrap"|"cmake:bootstrap"|"ninja:bootstrap")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (bootstrap): ninja ${PKG_MAKE_OPTS_BOOTSTRAP}" | tr -s " "
|
|
|
|
ninja ${NINJA_OPTS} ${PKG_MAKE_OPTS_BOOTSTRAP}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
# make based builds
|
|
|
|
"configure:target"|"cmake-make:target"|"autotools:target"|"make:target")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (target): make ${PKG_MAKE_OPTS_TARGET}" | tr -s " "
|
|
|
|
make ${PKG_MAKE_OPTS_TARGET}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:host"|"cmake-make:host"|"autotools:host"|"make:host")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (host): make ${PKG_MAKE_OPTS_HOST}" | tr -s " "
|
|
|
|
make ${PKG_MAKE_OPTS_HOST}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:init"|"cmake-make:init"|"autotools:init"|"make:init")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (init): make ${PKG_MAKE_OPTS_INIT}" | tr -s " "
|
|
|
|
make ${PKG_MAKE_OPTS_INIT}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:bootstrap"|"cmake-make:bootstrap"|"autotools:bootstrap"|"make:bootstrap")
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "Executing (bootstrap): make ${PKG_MAKE_OPTS_BOOTSTRAP}" | tr -s " "
|
|
|
|
make ${PKG_MAKE_OPTS_BOOTSTRAP}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2018-11-28 14:58:22 +00:00
|
|
|
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call_exists_opt post_make_${TARGET} && pkg_call
|
2009-03-18 12:02:53 +00:00
|
|
|
|
2019-02-19 19:03:58 +00:00
|
|
|
# Hack around directly writing/modifying the content of a shared sysroot
|
|
|
|
# by temporarily installing new files to a package specific sysroot
|
2021-07-01 21:42:56 +00:00
|
|
|
export PKG_ORIG_SYSROOT_PREFIX="${SYSROOT_PREFIX}"
|
2019-02-19 19:03:58 +00:00
|
|
|
export SYSROOT_PREFIX="${BUILD}/.sysroot/${PKG_NAME}.${TARGET}"
|
|
|
|
rm -rf "${SYSROOT_PREFIX}"
|
2019-02-22 20:11:11 +00:00
|
|
|
|
|
|
|
# Create common sysroot directories as some packages expect them to exist.
|
|
|
|
# TODO: Fix those packages so we don't need to pre-create directories.
|
2019-02-19 19:03:58 +00:00
|
|
|
for d in /usr/lib /usr/include /usr/bin /usr/lib/pkgconfig; do
|
|
|
|
mkdir -p "${SYSROOT_PREFIX}${d}"
|
|
|
|
done
|
2019-02-08 17:17:43 +00:00
|
|
|
|
2022-09-22 15:58:18 +00:00
|
|
|
record_timestamp BUILD_MAKEINSTALL
|
|
|
|
|
2017-10-27 16:39:14 +00:00
|
|
|
# make install
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call_exists_opt pre_makeinstall_${TARGET} && pkg_call
|
2018-11-28 14:58:22 +00:00
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
if pkg_call_exists makeinstall_${TARGET}; then
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call
|
2019-01-21 13:15:11 +00:00
|
|
|
else
|
2019-12-07 14:48:36 +00:00
|
|
|
flag_enabled "sysroot" "yes" && INSTALL_TO_SYSROOT="yes" || INSTALL_TO_SYSROOT="no"
|
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
case "${PKG_TOOLCHAIN}:${TARGET}" in
|
2017-10-27 16:39:14 +00:00
|
|
|
# ninja based builds
|
|
|
|
"meson:target"|"cmake:target")
|
2019-12-07 14:48:36 +00:00
|
|
|
[ "${INSTALL_TO_SYSROOT}" = "yes" ] && \
|
|
|
|
DESTDIR=${SYSROOT_PREFIX} ninja install ${PKG_MAKEINSTALL_OPTS_TARGET}
|
2019-06-16 01:45:52 +00:00
|
|
|
DESTDIR=${INSTALL} ninja install ${PKG_MAKEINSTALL_OPTS_TARGET}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:host"|"cmake:host")
|
2019-06-16 01:45:52 +00:00
|
|
|
ninja install ${PKG_MAKEINSTALL_OPTS_HOST}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:init"|"cmake:init")
|
2019-06-16 01:45:52 +00:00
|
|
|
DESTDIR=${INSTALL} ninja install ${PKG_MAKEINSTALL_OPTS_INIT}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"meson:bootstrap"|"cmake:bootstrap")
|
2019-06-16 01:45:52 +00:00
|
|
|
ninja install ${PKG_MAKEINSTALL_OPTS_BOOTSTRAP}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
# make based builds
|
|
|
|
"configure:target"|"cmake-make:target"|"autotools:target"|"make:target")
|
2019-12-07 14:48:36 +00:00
|
|
|
[ "${INSTALL_TO_SYSROOT}" = "yes" ] && \
|
|
|
|
make install DESTDIR=${SYSROOT_PREFIX} -j1 ${PKG_MAKEINSTALL_OPTS_TARGET}
|
2019-06-16 01:45:52 +00:00
|
|
|
make install DESTDIR=${INSTALL} ${PKG_MAKEINSTALL_OPTS_TARGET}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:host"|"cmake-make:host"|"autotools:host"|"make:host")
|
2019-06-16 01:45:52 +00:00
|
|
|
make install ${PKG_MAKEINSTALL_OPTS_HOST}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:init"|"cmake-make:init"|"autotools:init"|"make:init")
|
2019-06-16 01:45:52 +00:00
|
|
|
make install DESTDIR=${INSTALL} ${PKG_MAKEINSTALL_OPTS_INIT}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
"configure:bootstrap"|"cmake-make:bootstrap"|"autotools:bootstrap"|"make:bootstrap")
|
2019-06-16 01:45:52 +00:00
|
|
|
make install ${PKG_MAKEINSTALL_OPTS_BOOTSTRAP}
|
2017-10-27 16:39:14 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2018-11-28 14:58:22 +00:00
|
|
|
|
2020-02-13 11:44:31 +00:00
|
|
|
pkg_call_exists_opt post_makeinstall_${TARGET} && pkg_call
|
2017-05-01 01:45:00 +00:00
|
|
|
|
2022-09-22 15:58:18 +00:00
|
|
|
record_timestamp BUILD_COPY_SYSROOT
|
|
|
|
|
2019-02-19 19:03:58 +00:00
|
|
|
# Fixup temporary sysroot references to the shared sysroot
|
|
|
|
for i in $(find "${SYSROOT_PREFIX}/usr/lib" -type f -name "*.la" 2>/dev/null); do
|
|
|
|
sed -e "s:\(['= ]\)/usr:\\1${PKG_ORIG_SYSROOT_PREFIX}/usr:g" -i "${i}"
|
|
|
|
done
|
|
|
|
for i in $(find "${SYSROOT_PREFIX}/usr/bin" -type f -name "*-config" 2>/dev/null); do
|
|
|
|
sed -e "s#${SYSROOT_PREFIX}/usr#${PKG_ORIG_SYSROOT_PREFIX}/usr#g" -i "${i}"
|
2019-02-08 17:17:43 +00:00
|
|
|
done
|
2019-02-19 19:03:58 +00:00
|
|
|
for i in $(find "${SYSROOT_PREFIX}/usr/lib" -type f -name "*.pc" 2>/dev/null); do
|
|
|
|
sed -e "s#${SYSROOT_PREFIX}/usr#${PKG_ORIG_SYSROOT_PREFIX}/usr#g" -i "${i}"
|
|
|
|
done
|
|
|
|
for i in $(find "${SYSROOT_PREFIX}/usr"/{lib,share} -type f -name "*.cmake" 2>/dev/null); do
|
|
|
|
sed -e "s#${SYSROOT_PREFIX}/usr#${PKG_ORIG_SYSROOT_PREFIX}/usr#g" -i "${i}"
|
|
|
|
done
|
2019-02-28 06:19:13 +00:00
|
|
|
for i in $(find "${SYSROOT_PREFIX}" -type l 2>/dev/null); do
|
|
|
|
_tmp="$(readlink -m "${i}")"
|
2019-07-04 19:00:29 +00:00
|
|
|
[[ ${_tmp} =~ ^/usr ]] && _tmp="${SYSROOT_PREFIX}${_tmp}"
|
2019-02-28 06:19:13 +00:00
|
|
|
if [[ ${_tmp} =~ ^${SYSROOT_PREFIX}/ ]]; then
|
2019-07-03 22:18:28 +00:00
|
|
|
ln -sfn "${_tmp/${SYSROOT_PREFIX}\//${PKG_ORIG_SYSROOT_PREFIX}\/}" "${i}"
|
2019-02-28 06:19:13 +00:00
|
|
|
fi
|
|
|
|
done
|
2019-02-19 19:03:58 +00:00
|
|
|
|
|
|
|
# Transfer the new sysroot content to the shared sysroot
|
2020-01-14 18:15:23 +00:00
|
|
|
acquire_update_lock sysroot
|
|
|
|
|
2019-02-19 19:03:58 +00:00
|
|
|
mkdir -p "${PKG_ORIG_SYSROOT_PREFIX}"
|
2019-03-09 22:02:33 +00:00
|
|
|
cp -PRf "${SYSROOT_PREFIX}"/* "${PKG_ORIG_SYSROOT_PREFIX}"
|
2020-01-14 18:15:23 +00:00
|
|
|
|
|
|
|
release_update_lock
|
|
|
|
|
2019-02-19 19:03:58 +00:00
|
|
|
rm -rf "${SYSROOT_PREFIX}"
|
2019-02-08 17:17:43 +00:00
|
|
|
|
2019-02-19 19:03:58 +00:00
|
|
|
export SYSROOT_PREFIX="${PKG_ORIG_SYSROOT_PREFIX}"
|
2019-02-08 17:17:43 +00:00
|
|
|
|
2022-09-22 15:58:18 +00:00
|
|
|
record_timestamp BUILD_CLEANUP_INSTALL
|
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ "${TARGET}" = "target" -o "${TARGET}" = "init" ]; then
|
|
|
|
if [ -d ${INSTALL} ]; then
|
2019-12-12 08:06:53 +00:00
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}man
|
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}share/bash-completion
|
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}share/doc
|
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}share/gtk-doc
|
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}share/info
|
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}share/locale
|
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}share/man
|
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}share/zsh
|
|
|
|
rm -rf ${INSTALL}/{usr/local/,usr/,}var
|
2019-06-16 01:45:52 +00:00
|
|
|
find ${INSTALL} \( -name "*.orig" \
|
2017-10-27 16:39:14 +00:00
|
|
|
-o -name "*.rej" \
|
|
|
|
-o -name "*.in" \
|
|
|
|
-o -name ".git*" \) \
|
|
|
|
-exec rm -f {} \; 2>/dev/null || :
|
2019-06-16 01:45:52 +00:00
|
|
|
find ${INSTALL} -type d -exec rmdir -p {} \; 2>/dev/null || :
|
2017-10-27 16:39:14 +00:00
|
|
|
|
2019-10-24 21:51:28 +00:00
|
|
|
python_fix_abi "${INSTALL}"
|
|
|
|
|
2018-02-19 07:08:48 +00:00
|
|
|
if [ ! "${BUILD_WITH_DEBUG}" = "yes" ]; then
|
2019-06-16 01:45:52 +00:00
|
|
|
${STRIP} $(find ${INSTALL} \
|
2017-10-27 16:39:14 +00:00
|
|
|
-type f -name "*.so*" \
|
|
|
|
! -name "ld-*.so" \
|
|
|
|
! -name "libc-*.so" \
|
|
|
|
! -name "libpthread-*.so" \
|
|
|
|
! -name "libthread_db-*so" \
|
2018-11-02 22:24:35 +00:00
|
|
|
2>/dev/null) 2>/dev/null || :
|
2019-06-16 01:45:52 +00:00
|
|
|
if [ "${TARGET}" = "init" ]; then
|
|
|
|
${STRIP} $(find ${INSTALL} -type f -name "*.so*" 2>/dev/null) 2>/dev/null || :
|
2017-10-27 16:39:14 +00:00
|
|
|
fi
|
2019-06-16 01:45:52 +00:00
|
|
|
${STRIP} $(find ${INSTALL} ! -name "*.so*" ! -name "*.ko" \
|
2018-11-02 22:24:35 +00:00
|
|
|
-type f -executable 2>/dev/null) 2>/dev/null || :
|
2017-05-01 01:45:00 +00:00
|
|
|
fi
|
2017-10-27 16:39:14 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2019-11-30 11:31:03 +00:00
|
|
|
if [ -n "${INSTALL}" -a -d "${INSTALL}" ]; then
|
|
|
|
echo "INFO_PKG_NAME=\"${PKG_NAME}\"" > "${INSTALL}/.libreelec-package"
|
|
|
|
fi
|
|
|
|
|
2019-06-16 01:45:52 +00:00
|
|
|
cd ${ROOT}
|
2017-10-27 16:39:14 +00:00
|
|
|
|
2018-04-02 09:09:11 +00:00
|
|
|
PKG_DEEPHASH=$(calculate_stamp)
|
|
|
|
for i in PKG_NAME PKG_DEEPHASH BUILD_WITH_DEBUG; do
|
2019-06-16 01:45:52 +00:00
|
|
|
echo "STAMP_${i}=\"${!i}\"" >> ${STAMP}
|
2017-10-27 16:39:14 +00:00
|
|
|
done
|
2019-02-08 17:17:43 +00:00
|
|
|
|
|
|
|
pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "built"
|
2022-09-22 15:58:18 +00:00
|
|
|
|
|
|
|
record_timestamp BUILD_END
|
|
|
|
|
|
|
|
if [ -n "${TRACE_BUILD_TIMING}" ]; then
|
|
|
|
(
|
2022-12-06 15:31:17 +00:00
|
|
|
print_color "CLR_AUTOREMOVE" "\nBuild timing details:"
|
|
|
|
print_color "CLR_TARGET" "\n================================\n"
|
2022-09-22 15:58:18 +00:00
|
|
|
show_timestamp_diff "unpack" BUILD_BEGIN BUILD_START
|
|
|
|
show_timestamp_diff "pre-build setup" BUILD_START BUILD_CONFIGURE
|
|
|
|
show_timestamp_diff "configure" BUILD_CONFIGURE BUILD_MAKE
|
|
|
|
show_timestamp_diff "make" BUILD_MAKE BUILD_MAKEINSTALL
|
|
|
|
show_timestamp_diff "make install" BUILD_MAKEINSTALL BUILD_COPY_SYSROOT
|
|
|
|
show_timestamp_diff "copy sysroot" BUILD_COPY_SYSROOT BUILD_CLEANUP_INSTALL
|
|
|
|
show_timestamp_diff "cleanup install" BUILD_CLEANUP_INSTALL BUILD_END
|
2022-12-06 15:31:17 +00:00
|
|
|
print_color "CLR_TARGET" "--------------------------------\n"
|
|
|
|
show_timestamp_diff "total time" BUILD_BEGIN BUILD_END
|
|
|
|
echo -e
|
2022-09-22 15:58:18 +00:00
|
|
|
) >&${VERBOSE_OUT}
|
|
|
|
fi
|