Skip to content

Commit 17a9cd2

Browse files
chore: Package creation with dependencies (#636)
* Packages are now created with dependencies Signed-off-by: Paulchen-Panther <paulchen-panter@protonmail.com> * Ignore site packages Signed-off-by: Paulchen-Panther <paulchen-panter@protonmail.com> * MacOS Package creation disabled * Append the OpenSSL library to the dependency list * - Exit codes and Error message are suppressed when copying files - OpenSSL root directory is set under MacOS - OpenSSL symlinks are attached - Packages and build directory renamed into Hyperion Signed-off-by: Paulchen-Panther <paulchen-panter@protonmail.com> * Update to semver version * Use version file for version management * Read version file in azure Co-authored-by: brindosch <edeltraud70@gmx.de>
1 parent b9ecd0e commit 17a9cd2

File tree

20 files changed

+272
-113
lines changed

20 files changed

+272
-113
lines changed

.azure.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,9 @@ jobs:
3535
- checkout: self # represents the repo where the initial Pipelines YAML file was found
3636
submodules: recursive # set to 'recursive' to get submodules of submodules
3737

38-
# read channel tag in version.json
39-
- task: oneLuckiDevJson2Variable@1
40-
inputs:
41-
jsonFile: 'version.json'
42-
shouldPrefixVariables: true
43-
variablePrefix: 'json'
38+
# read version file
39+
- bash: echo "##vso[task.setvariable variable=semVer]$(grep -oE 'alpha|beta' version)"
40+
workingDirectory: '$(Build.SourcesDirectory)'
4441
displayName: 'Read and generate pipeline variables'
4542

4643
# build process
@@ -52,7 +49,7 @@ jobs:
5249
PLATFORM: $(platform)
5350

5451
# copy files
55-
- bash: 'cp -v deploy/Hyperion.NG-* $(Build.ArtifactStagingDirectory)'
52+
- bash: 'cp -v deploy/Hyperion-* $(Build.ArtifactStagingDirectory) 2>/dev/null || :'
5653
workingDirectory: '$(Build.SourcesDirectory)'
5754
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
5855
displayName: 'Collecting deployable artifacts'
@@ -67,8 +64,8 @@ jobs:
6764

6865
# set release to pre-release
6966
- bash: echo '##vso[task.setvariable variable=preRelease;]true'
70-
condition: and(succeeded(), contains(variables['json.channel'], 'beta'), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
71-
displayName: 'Mark beta as pre-release'
67+
condition: and(succeeded(), or(contains(variables['semVer'], 'alpha'), contains(variables['semVer'], 'beta')), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
68+
displayName: 'Mark alpha or beta as pre-release'
7269

7370
# create or update github release
7471
- task: GithubRelease@0
@@ -99,12 +96,9 @@ jobs:
9996
- checkout: self # represents the repo where the initial Pipelines YAML file was found
10097
submodules: recursive # set to 'recursive' to get submodules of submodules
10198

102-
# read channel tag in version.json
103-
- task: oneLuckiDevJson2Variable@1
104-
inputs:
105-
jsonFile: 'version.json'
106-
shouldPrefixVariables: true
107-
variablePrefix: 'json'
99+
# read version file
100+
- bash: echo "##vso[task.setvariable variable=semVer]$(grep -oE 'alpha|beta' version)"
101+
workingDirectory: '$(Build.SourcesDirectory)'
108102
displayName: 'Read and generate pipeline variables'
109103

110104
# install dependencies
@@ -118,7 +112,7 @@ jobs:
118112
PLATFORM: 'osx'
119113

120114
# copy files
121-
- bash: 'cp -v build/Hyperion.NG-* $(Build.ArtifactStagingDirectory)'
115+
- bash: 'cp -v build/Hyperion-* $(Build.ArtifactStagingDirectory) 2>/dev/null || :'
122116
workingDirectory: '$(Build.SourcesDirectory)'
123117
condition: and(succeeded(), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
124118
displayName: 'Collecting deployable artifacts'
@@ -133,8 +127,8 @@ jobs:
133127

134128
# set release to pre-release
135129
- bash: echo '##vso[task.setvariable variable=preRelease;]true'
136-
condition: and(succeeded(), contains(variables['json.channel'], 'beta'), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
137-
displayName: 'Mark beta as pre-release'
130+
condition: and(succeeded(), or(contains(variables['semVer'], 'alpha'), contains(variables['semVer'], 'beta')), ne(variables['system.pullrequest.isfork'], true), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
131+
displayName: 'Mark alpha or beta as pre-release'
138132

139133
# create or update github release
140134
- task: GithubRelease@0

.ci/ci_build.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
3434
mkdir build || exit 1
3535
cd build
3636
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../ || exit 2
37-
make -j $(sysctl -n hw.ncpu) package || exit 3
37+
make -j $(sysctl -n hw.ncpu) || exit 3 # Notes: The package creation is currently not supported because of strange errors.
3838
cd ${CI_BUILD_DIR} && source /${CI_BUILD_DIR}/test/testrunner.sh || exit 4
3939
exit 0;
4040
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
@@ -48,13 +48,13 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
4848
-v "${CI_BUILD_DIR}/deploy:/deploy" \
4949
-v "${CI_BUILD_DIR}:/source:ro" \
5050
hyperionproject/hyperion-ci:$DOCKER_TAG \
51-
/bin/bash -c "mkdir hyperion.ng && cp -r source/. /hyperion.ng &&
52-
cd /hyperion.ng && mkdir build && cd build &&
51+
/bin/bash -c "mkdir hyperion && cp -r source/. /hyperion &&
52+
cd /hyperion && mkdir build && cd build &&
5353
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDOCKER_PLATFORM=${DOCKER_TAG} ../ || exit 2 &&
5454
make -j $(nproc) package || exit 3 &&
55-
cp /hyperion.ng/build/bin/h* /deploy/ 2>/dev/null || : &&
56-
cp /hyperion.ng/build/Hyperion.NG-* /deploy/ 2>/dev/null || : &&
57-
cd /hyperion.ng && source /hyperion.ng/test/testrunner.sh || exit 4 &&
55+
cp /hyperion/build/bin/h* /deploy/ 2>/dev/null || : &&
56+
cp /hyperion/build/Hyperion-* /deploy/ 2>/dev/null || : &&
57+
cd /hyperion && source /hyperion/test/testrunner.sh || exit 4 &&
5858
exit 0;
5959
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
6060

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

CMakeLists.txt

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
cmake_minimum_required(VERSION 3.0.0)
22

3+
message( STATUS "CMake Version: ${CMAKE_VERSION}" )
4+
35
PROJECT(hyperion)
46

7+
# Parse semantic version of version file
8+
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake)
9+
file (STRINGS "version" HYPERION_VERSION)
10+
SetVersionNumber(HYPERION ${HYPERION_VERSION})
11+
512
# Instruct CMake to run moc automatically when needed.
613
set(CMAKE_AUTOMOC ON)
714
# auto prepare .qrc files
@@ -21,42 +28,6 @@ endif(CCACHE_FOUND)
2128
set(Python_ADDITIONAL_VERSIONS 3.5)
2229
find_package( PythonInterp 3.5 REQUIRED )
2330

24-
# Read version from version.json
25-
EXECUTE_PROCESS (
26-
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/version.py version.json
27-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
28-
RESULT_VARIABLE error_code
29-
OUTPUT_VARIABLE RETURN_VERSION
30-
)
31-
32-
SET( VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+(-[a-zA-Z0-9_]+)?" )
33-
if ( ${RETURN_VERSION} MATCHES ${VERSION_REGEX} )
34-
STRING(REGEX MATCHALL "[0-9]+|-([A-Za-z0-9_]+)" VERSION_PARTS ${RETURN_VERSION} )
35-
LIST( GET VERSION_PARTS 0 VERSION_MAJOR )
36-
LIST( GET VERSION_PARTS 1 VERSION_MINOR )
37-
LIST( GET VERSION_PARTS 2 VERSION_PATCH )
38-
else ( ${RETURN_VERSION} MATCHES ${VERSION_REGEX} )
39-
message( FATAL_ERROR "Failed to parse version.json string properly. ${error_code}" )
40-
endif()
41-
42-
SET( HYPERION_VERSION_MAJOR ${VERSION_MAJOR} )
43-
SET( HYPERION_VERSION_MINOR ${VERSION_MINOR} )
44-
SET( HYPERION_VERSION_PATCH ${VERSION_PATCH} )
45-
46-
# Read channel from version.json
47-
EXECUTE_PROCESS (
48-
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/version.py version.json "channel"
49-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
50-
RESULT_VARIABLE error_code
51-
OUTPUT_VARIABLE RETURN_CHANNEL
52-
)
53-
54-
if ( error_code )
55-
message( FATAL_ERROR "Failed to parse version.json string properly. ${error_code}" )
56-
endif()
57-
58-
SET ( HYPERION_VERSION_CHANNEL ${RETURN_CHANNEL} )
59-
6031
# Set build variables
6132
SET ( DEFAULT_AMLOGIC OFF )
6233
SET ( DEFAULT_DISPMANX OFF )
@@ -285,11 +256,15 @@ endif()
285256
# Use GNU gold linker if available
286257
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/LDGold.cmake)
287258

288-
# setup -rpath to search for shared libs in BINARY/../libs folder
259+
# Don't create new dynamic tags (RUNPATH)
260+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")
261+
262+
# setup -rpath to search for shared libs in BINARY/../lib folder
289263
if (UNIX AND NOT APPLE)
290264
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
291265
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
292-
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
266+
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:$ORIGIN/../lib")
267+
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
293268
endif ()
294269

295270
# add QT5 dependency
@@ -369,4 +344,3 @@ add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_D
369344

370345
# enable make package - no code after this line !
371346
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/packages.cmake)
372-

HyperionConfig.h.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,9 @@
4040
#define HYPERION_BUILD_ID "${HYPERION_BUILD_ID}"
4141
#define HYPERION_GIT_REMOTE "${HYPERION_GIT_REMOTE}"
4242

43-
#define HYPERION_VERSION_MAJOR "${HYPERION_VERSION_MAJOR}"
44-
#define HYPERION_VERSION_MINOR "${HYPERION_VERSION_MINOR}"
45-
#define HYPERION_VERSION_PATCH "${HYPERION_VERSION_PATCH}"
46-
#define HYPERION_VERSION "${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}"
47-
#define HYPERION_VERSION_CHANNEL "${HYPERION_VERSION_CHANNEL}"
43+
#define HYPERION_VERSION_MAJOR "${HYPERION_VERSION_MAJOR}"
44+
#define HYPERION_VERSION_MINOR "${HYPERION_VERSION_MINOR}"
45+
#define HYPERION_VERSION_PATCH "${HYPERION_VERSION_PATCH}"
46+
#define HYPERION_VERSION "${HYPERION_VERSION}"
4847

4948
#define HYPERION_JSON_VERSION "1.0.0"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Hyperion.NG](https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/assets/webconfig/img/hyperion/hyperionlogo.png)
1+
![Hyperion](https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/assets/webconfig/img/hyperion/hyperionlogo.png)
22

33
[![Dependencies](https://img.shields.io/librariesio/github/hyperion-project/hyperion.ng.svg)](https://github.com/hyperion-project/hyperion.ng/tree/master/dependencies/external)
44
[![Azure-Pipeline](https://dev.azure.com/Hyperion-Project/Hyperion.NG/_apis/build/status/Hyperion.NG?branchName=master)](https://dev.azure.com/Hyperion-Project/Hyperion.NG/_build/latest?definitionId=7&branchName=master)
@@ -9,7 +9,7 @@
99

1010
## About Hyperion
1111

12-
[Hyperion.NG](https://github.com/hyperion-project/hyperion.ng) is an opensource [Bias or Ambient Lighting](https://en.wikipedia.org/wiki/Bias_lighting) implementation which you might know from TV manufacturers. It supports many LED devices and video grabbers. The project is still in a beta development stage (no stable release available).
12+
[Hyperion](https://github.com/hyperion-project/hyperion.ng) is an opensource [Bias or Ambient Lighting](https://en.wikipedia.org/wiki/Bias_lighting) implementation which you might know from TV manufacturers. It supports many LED devices and video grabbers. The project is still in a beta development stage (no stable release available).
1313

1414
![Screenshot](doc/screenshot.png)
1515

bin/create_all_releases.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ make_release()
2020
make -j $(nproc) || exit 1
2121
#strip bin/*
2222
make package -j $(nproc)
23-
mv Hyperion.NG-* ../deploy/${RELEASE}
23+
mv Hyperion-* ../deploy/${RELEASE}
2424
cd ..
2525
bin/create_release.sh . ${RELEASE}
2626
}

bin/create_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if ! [ -d "$builddir" ]; then
1515
exit 1
1616
fi
1717

18-
outfile="$repodir/deploy/hyperion.ng_$buildid.tar.gz"
18+
outfile="$repodir/deploy/hyperion_$buildid.tar.gz"
1919
echo create $outfile
2020

2121
tar --create --gzip --absolute-names --show-transformed-names --ignore-failed-read\

bin/scripts/docker-compile.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ mkdir $SCRIPT_PATH/deploy >/dev/null 2>&1
8181

8282
# get Hyperion source, cleanup previous folder
8383
echo "---> Downloading Hyperion source code from ${GIT_REPO_URL}"
84-
sudo rm -fr $SCRIPT_PATH/hyperion.ng >/dev/null 2>&1
85-
git clone --recursive --depth 1 -q $GIT_REPO_URL $SCRIPT_PATH/hyperion.ng || { echo "---> Failed to download Hyperion source code! Abort"; exit 1; }
84+
sudo rm -fr $SCRIPT_PATH/hyperion >/dev/null 2>&1
85+
git clone --recursive --depth 1 -q $GIT_REPO_URL $SCRIPT_PATH/hyperion || { echo "---> Failed to download Hyperion source code! Abort"; exit 1; }
8686

8787
# start compilation
8888
# Remove container after stop
@@ -93,15 +93,15 @@ git clone --recursive --depth 1 -q $GIT_REPO_URL $SCRIPT_PATH/hyperion.ng || { e
9393
echo "---> Startup docker..."
9494
$DOCKER run --rm \
9595
-v "${SCRIPT_PATH}/deploy:/deploy" \
96-
-v "${SCRIPT_PATH}/hyperion.ng:/source:ro" \
96+
-v "${SCRIPT_PATH}/hyperion:/source:ro" \
9797
hyperionproject/hyperion-ci:$BUILD_TARGET \
98-
/bin/bash -c "mkdir hyperion.ng && cp -r /source/. /hyperion.ng &&
99-
cd /hyperion.ng && mkdir build && cd build &&
98+
/bin/bash -c "mkdir hyperion && cp -r /source/. /hyperion &&
99+
cd /hyperion && mkdir build && cd build &&
100100
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. || exit 2 &&
101101
make -j $(nproc) ${PACKAGES} || exit 3 &&
102102
echo '---> Copy binaries and packages to host folder: ${SCRIPT_PATH}/deploy' &&
103-
cp -v /hyperion.ng/build/bin/h* /deploy/ 2>/dev/null || : &&
104-
cp -v /hyperion.ng/build/Hyperion.NG-* /deploy/ 2>/dev/null || : &&
103+
cp -v /hyperion/build/bin/h* /deploy/ 2>/dev/null || : &&
104+
cp -v /hyperion/build/Hyperion-* /deploy/ 2>/dev/null || : &&
105105
exit 0;
106106
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 4; }
107107

cmake/FindGitVersion.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ execute_process( COMMAND sh -c "git remote --verbose | grep origin | grep fetch
66
STRING ( STRIP "${BUILD_ID}" BUILD_ID )
77
STRING ( STRIP "${VERSION_ID}" VERSION_ID )
88
STRING ( STRIP "${GIT_REMOTE_PATH}" GIT_REMOTE_PATH )
9-
SET ( HYPERION_BUILD_ID "${VERSION_ID} (${BUILD_ID})" )
10-
SET ( HYPERION_GIT_REMOTE "${GIT_REMOTE_PATH}" )
11-
SET ( HYPERION_VERSION "${HYPERION_VERSION_CHANNEL} ${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}" )
9+
SET ( HYPERION_BUILD_ID "${VERSION_ID} (${BUILD_ID}) Git Remote: ${GIT_REMOTE_PATH}" )
1210
message ( STATUS "Current Version: ${HYPERION_VERSION}" )
1311
message ( STATUS " - Build: ${HYPERION_BUILD_ID}" )

0 commit comments

Comments
 (0)