Skip to content

Commit

Permalink
Merge pull request #3140 from InuSasha/features/build-root
Browse files Browse the repository at this point in the history
buildsystem: add possibility to move the build paths outside the git …
  • Loading branch information
MilhouseVH committed Jan 8, 2020
2 parents d3323bb + 4bd4f58 commit 06e0928
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# build directorys
/build.*/
/builds
/.fakeroot.*

# automatically downloaded source files
Expand Down
7 changes: 4 additions & 3 deletions config/path
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set -e
SCRIPTS=scripts
PACKAGES=packages
SOURCES=${SOURCES_DIR:-$ROOT/sources}
BUILD_ROOT=${BUILD_DIR:-$ROOT}
BUILD_BASE=build
TARGET_IMG=${TARGET_DIR:-$ROOT/target}
ADDONS=addons
Expand All @@ -20,9 +21,9 @@ set -e
[ -z "${HOST_NAME}" ] && export HOST_NAME="$($LOCAL_CC -dumpmachine)"
TARGET_NAME=$TARGET_GCC_ARCH-libreelec-linux-gnu${TARGET_ABI}

BUILD=$ROOT/$BUILD_BASE.$DISTRONAME-${DEVICE:-$PROJECT}.$TARGET_ARCH-$LIBREELEC_VERSION
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}-${LIBREELEC_VERSION}
if [ "${LIBREELEC_VERSION}" = "devel" ] ; then
BUILD=${BUILD_ROOT}/${BUILD_BASE}.${DISTRONAME}-${DEVICE:-$PROJECT}.${TARGET_ARCH}-${OS_VERSION}-${LIBREELEC_VERSION}
fi

if [ -n "$BUILD_SUFFIX" ]; then
Expand Down
2 changes: 1 addition & 1 deletion packages/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Issue | Level | Meaning |
* 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)
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
```
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fi

if [ "${1}" = "--all" ]; 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}"
done
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/clean
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ clean_package() {
}

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}"
done
elif [ -n "${1}" ]; then
Expand Down
7 changes: 5 additions & 2 deletions tools/dashboard
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#!/bin/bash
#!/bin/bash -e

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)

cd "$(readlink -f "$(dirname "$0")")/.."

if [ -n "${PROJECT}" -a "$1" != "auto" ]; then
# loads project config and sets THREAD_CONTROL
. config/options ""
else
BUILD_PREFIX=$(. config/options "" && echo ${BUILD_ROOT}/${BUILD_BASE})
fi

_find_latest_tcdir() {
Expand All @@ -15,7 +18,7 @@ _find_latest_tcdir() {
if [ -n "${THREAD_CONTROL}" ]; then
echo "${THREAD_CONTROL}"
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
done
fi
Expand Down

0 comments on commit 06e0928

Please sign in to comment.