mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 19:26:50 +00:00
buildsystem: allow to set BUILD_ROOT via BUILD_DIR
This commit is contained in:
parent
447433da11
commit
4bd4f58dbe
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
# build directorys
|
# build directorys
|
||||||
/build.*/
|
/build.*/
|
||||||
|
/builds
|
||||||
/.fakeroot.*
|
/.fakeroot.*
|
||||||
|
|
||||||
# automatically downloaded source files
|
# automatically downloaded source files
|
||||||
|
@ -8,6 +8,7 @@ set -e
|
|||||||
SCRIPTS=scripts
|
SCRIPTS=scripts
|
||||||
PACKAGES=packages
|
PACKAGES=packages
|
||||||
SOURCES=${SOURCES_DIR:-$ROOT/sources}
|
SOURCES=${SOURCES_DIR:-$ROOT/sources}
|
||||||
|
BUILD_ROOT=${BUILD_DIR:-$ROOT}
|
||||||
BUILD_BASE=build
|
BUILD_BASE=build
|
||||||
TARGET_IMG=${TARGET_DIR:-$ROOT/target}
|
TARGET_IMG=${TARGET_DIR:-$ROOT/target}
|
||||||
ADDONS=addons
|
ADDONS=addons
|
||||||
@ -20,9 +21,9 @@ set -e
|
|||||||
[ -z "${HOST_NAME}" ] && export HOST_NAME="$($LOCAL_CC -dumpmachine)"
|
[ -z "${HOST_NAME}" ] && export HOST_NAME="$($LOCAL_CC -dumpmachine)"
|
||||||
TARGET_NAME=$TARGET_GCC_ARCH-libreelec-linux-gnu${TARGET_ABI}
|
TARGET_NAME=$TARGET_GCC_ARCH-libreelec-linux-gnu${TARGET_ABI}
|
||||||
|
|
||||||
BUILD=$ROOT/$BUILD_BASE.$DISTRONAME-${DEVICE:-$PROJECT}.$TARGET_ARCH-$LIBREELEC_VERSION
|
BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${LIBREELEC_VERSION}
|
||||||
if [ "$LIBREELEC_VERSION" = "devel" ] ; then
|
if [ "${LIBREELEC_VERSION}" = "devel" ] ; then
|
||||||
BUILD=$ROOT/$BUILD_BASE.$DISTRONAME-${DEVICE:-$PROJECT}.$TARGET_ARCH-$OS_VERSION-$LIBREELEC_VERSION
|
BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${OS_VERSION}-${LIBREELEC_VERSION}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$BUILD_SUFFIX" ]; then
|
if [ -n "$BUILD_SUFFIX" ]; then
|
||||||
|
@ -266,7 +266,7 @@ Issue | Level | Meaning |
|
|||||||
* when it extend an existing package, add it there to the `PKG_DEPENDS_TARGET`/`PKG_DEPENDS_HOST` etc.
|
* when it extend an existing package, add it there to the `PKG_DEPENDS_TARGET`/`PKG_DEPENDS_HOST` etc.
|
||||||
* take a look into the path `packages/virtual`, there you should find a virtual packages, that match your new package (misc-packages should be the last option)
|
* take a look into the path `packages/virtual`, there you should find a virtual packages, that match your new package (misc-packages should be the last option)
|
||||||
5. Now you can build your image
|
5. Now you can build your image
|
||||||
* after the build, inside the `build-*` folder you should find a directory with your package name and -version, eg. `widget-1.2.3`.
|
* after the build, inside the `BUILD_DIR` (normally build.*) folder you should find a directory with your package name and -version, eg. `widget-1.2.3`.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
```
|
```
|
||||||
|
@ -12,7 +12,7 @@ fi
|
|||||||
|
|
||||||
if [ "${1}" = "--all" ]; then
|
if [ "${1}" = "--all" ]; then
|
||||||
if [ -n "${2}" ]; then
|
if [ -n "${2}" ]; then
|
||||||
for build_dir in $(ls -1d ${ROOT}/build.*); do
|
for build_dir in $(ls -1d ${BUILD_ROOT}/${BUILD_BASE}.*); do
|
||||||
load_build_config ${build_dir} && ${SCRIPTS}/build "${2}"
|
load_build_config ${build_dir} && ${SCRIPTS}/build "${2}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -35,7 +35,7 @@ clean_package() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if [ "${1}" = "--all" -a -n "${2}" ]; then
|
if [ "${1}" = "--all" -a -n "${2}" ]; then
|
||||||
for build_dir in $(ls -1d "${ROOT}/build."*); do
|
for build_dir in $(ls -1d "${BUILD_ROOT}/${BUILD_BASE}."*); do
|
||||||
load_build_config "${build_dir}" && "${SCRIPTS}/clean" "${2}"
|
load_build_config "${build_dir}" && "${SCRIPTS}/clean" "${2}"
|
||||||
done
|
done
|
||||||
elif [ -n "${1}" ]; then
|
elif [ -n "${1}" ]; then
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
|
|
||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||||
@ -6,7 +6,10 @@
|
|||||||
cd "$(readlink -f "$(dirname "$0")")/.."
|
cd "$(readlink -f "$(dirname "$0")")/.."
|
||||||
|
|
||||||
if [ -n "${PROJECT}" -a "$1" != "auto" ]; then
|
if [ -n "${PROJECT}" -a "$1" != "auto" ]; then
|
||||||
|
# loads project config and sets THREAD_CONTROL
|
||||||
. config/options ""
|
. config/options ""
|
||||||
|
else
|
||||||
|
BUILD_PREFIX=$(. config/options "" && echo ${BUILD_ROOT}/${BUILD_BASE})
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_find_latest_tcdir() {
|
_find_latest_tcdir() {
|
||||||
@ -15,7 +18,7 @@ _find_latest_tcdir() {
|
|||||||
if [ -n "${THREAD_CONTROL}" ]; then
|
if [ -n "${THREAD_CONTROL}" ]; then
|
||||||
echo "${THREAD_CONTROL}"
|
echo "${THREAD_CONTROL}"
|
||||||
else
|
else
|
||||||
for dir in $(ls -1td "${PWD}"/build.*/.threads 2>/dev/null); do
|
for dir in $(ls -1td ${BUILD_PREFIX}.*/.threads 2>/dev/null); do
|
||||||
[ -f "${dir}/parallel.pid" ] && echo "${dir}" && break
|
[ -f "${dir}/parallel.pid" ] && echo "${dir}" && break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user