Skip to content

Commit

Permalink
chore: Package creation with dependencies (hyperion-project#636)
Browse files Browse the repository at this point in the history
* Packages are now created with dependencies

Signed-off-by: Paulchen-Panther <[email protected]>

* Ignore site packages

Signed-off-by: Paulchen-Panther <[email protected]>

* 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 <[email protected]>

* Update to semver version

* Use version file for version management

* Read version file in azure

Co-authored-by: brindosch <[email protected]>
  • Loading branch information
Paulchen-Panther and brindosch committed Feb 16, 2020
1 parent b9ecd0e commit 17a9cd2
Show file tree
Hide file tree
Showing 20 changed files with 272 additions and 113 deletions.
30 changes: 12 additions & 18 deletions .azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ jobs:
- checkout: self # represents the repo where the initial Pipelines YAML file was found
submodules: recursive # set to 'recursive' to get submodules of submodules

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

# build process
Expand All @@ -52,7 +49,7 @@ jobs:
PLATFORM: $(platform)

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

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

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

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

# install dependencies
Expand All @@ -118,7 +112,7 @@ jobs:
PLATFORM: 'osx'

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

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

# create or update github release
- task: GithubRelease@0
Expand Down
12 changes: 6 additions & 6 deletions .ci/ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
mkdir build || exit 1
cd build
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH=/usr/local ../ || exit 2
make -j $(sysctl -n hw.ncpu) package || exit 3
make -j $(sysctl -n hw.ncpu) || exit 3 # Notes: The package creation is currently not supported because of strange errors.
cd ${CI_BUILD_DIR} && source /${CI_BUILD_DIR}/test/testrunner.sh || exit 4
exit 0;
exit 1 || { echo "---> Hyperion compilation failed! Abort"; exit 5; }
Expand All @@ -48,13 +48,13 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
-v "${CI_BUILD_DIR}/deploy:/deploy" \
-v "${CI_BUILD_DIR}:/source:ro" \
hyperionproject/hyperion-ci:$DOCKER_TAG \
/bin/bash -c "mkdir hyperion.ng && cp -r source/. /hyperion.ng &&
cd /hyperion.ng && mkdir build && cd build &&
/bin/bash -c "mkdir hyperion && cp -r source/. /hyperion &&
cd /hyperion && mkdir build && cd build &&
cmake -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDOCKER_PLATFORM=${DOCKER_TAG} ../ || exit 2 &&
make -j $(nproc) package || exit 3 &&
cp /hyperion.ng/build/bin/h* /deploy/ 2>/dev/null || : &&
cp /hyperion.ng/build/Hyperion.NG-* /deploy/ 2>/dev/null || : &&
cd /hyperion.ng && source /hyperion.ng/test/testrunner.sh || exit 4 &&
cp /hyperion/build/bin/h* /deploy/ 2>/dev/null || : &&
cp /hyperion/build/Hyperion-* /deploy/ 2>/dev/null || : &&
cd /hyperion && source /hyperion/test/testrunner.sh || exit 4 &&
exit 0;
exit 1 " || { echo "---> Hyperion compilation failed! Abort"; exit 5; }

Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
52 changes: 13 additions & 39 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
cmake_minimum_required(VERSION 3.0.0)

message( STATUS "CMake Version: ${CMAKE_VERSION}" )

PROJECT(hyperion)

# Parse semantic version of version file
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake)
file (STRINGS "version" HYPERION_VERSION)
SetVersionNumber(HYPERION ${HYPERION_VERSION})

# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
# auto prepare .qrc files
Expand All @@ -21,42 +28,6 @@ endif(CCACHE_FOUND)
set(Python_ADDITIONAL_VERSIONS 3.5)
find_package( PythonInterp 3.5 REQUIRED )

# Read version from version.json
EXECUTE_PROCESS (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/version.py version.json
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE error_code
OUTPUT_VARIABLE RETURN_VERSION
)

SET( VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+(-[a-zA-Z0-9_]+)?" )
if ( ${RETURN_VERSION} MATCHES ${VERSION_REGEX} )
STRING(REGEX MATCHALL "[0-9]+|-([A-Za-z0-9_]+)" VERSION_PARTS ${RETURN_VERSION} )
LIST( GET VERSION_PARTS 0 VERSION_MAJOR )
LIST( GET VERSION_PARTS 1 VERSION_MINOR )
LIST( GET VERSION_PARTS 2 VERSION_PATCH )
else ( ${RETURN_VERSION} MATCHES ${VERSION_REGEX} )
message( FATAL_ERROR "Failed to parse version.json string properly. ${error_code}" )
endif()

SET( HYPERION_VERSION_MAJOR ${VERSION_MAJOR} )
SET( HYPERION_VERSION_MINOR ${VERSION_MINOR} )
SET( HYPERION_VERSION_PATCH ${VERSION_PATCH} )

# Read channel from version.json
EXECUTE_PROCESS (
COMMAND ${PYTHON_EXECUTABLE} test/jsonchecks/version.py version.json "channel"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
RESULT_VARIABLE error_code
OUTPUT_VARIABLE RETURN_CHANNEL
)

if ( error_code )
message( FATAL_ERROR "Failed to parse version.json string properly. ${error_code}" )
endif()

SET ( HYPERION_VERSION_CHANNEL ${RETURN_CHANNEL} )

# Set build variables
SET ( DEFAULT_AMLOGIC OFF )
SET ( DEFAULT_DISPMANX OFF )
Expand Down Expand Up @@ -285,11 +256,15 @@ endif()
# Use GNU gold linker if available
include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/LDGold.cmake)

# setup -rpath to search for shared libs in BINARY/../libs folder
# Don't create new dynamic tags (RUNPATH)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags")

# setup -rpath to search for shared libs in BINARY/../lib folder
if (UNIX AND NOT APPLE)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:$ORIGIN/../lib")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif ()

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

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

9 changes: 4 additions & 5 deletions HyperionConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@
#define HYPERION_BUILD_ID "${HYPERION_BUILD_ID}"
#define HYPERION_GIT_REMOTE "${HYPERION_GIT_REMOTE}"

#define HYPERION_VERSION_MAJOR "${HYPERION_VERSION_MAJOR}"
#define HYPERION_VERSION_MINOR "${HYPERION_VERSION_MINOR}"
#define HYPERION_VERSION_PATCH "${HYPERION_VERSION_PATCH}"
#define HYPERION_VERSION "${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}"
#define HYPERION_VERSION_CHANNEL "${HYPERION_VERSION_CHANNEL}"
#define HYPERION_VERSION_MAJOR "${HYPERION_VERSION_MAJOR}"
#define HYPERION_VERSION_MINOR "${HYPERION_VERSION_MINOR}"
#define HYPERION_VERSION_PATCH "${HYPERION_VERSION_PATCH}"
#define HYPERION_VERSION "${HYPERION_VERSION}"

#define HYPERION_JSON_VERSION "1.0.0"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Hyperion.NG](https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/assets/webconfig/img/hyperion/hyperionlogo.png)
![Hyperion](https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/assets/webconfig/img/hyperion/hyperionlogo.png)

[![Dependencies](https://img.shields.io/librariesio/github/hyperion-project/hyperion.ng.svg)](https://github.com/hyperion-project/hyperion.ng/tree/master/dependencies/external)
[![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)
Expand All @@ -9,7 +9,7 @@

## About Hyperion

[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).
[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).

![Screenshot](doc/screenshot.png)

Expand Down
2 changes: 1 addition & 1 deletion bin/create_all_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ make_release()
make -j $(nproc) || exit 1
#strip bin/*
make package -j $(nproc)
mv Hyperion.NG-* ../deploy/${RELEASE}
mv Hyperion-* ../deploy/${RELEASE}
cd ..
bin/create_release.sh . ${RELEASE}
}
Expand Down
2 changes: 1 addition & 1 deletion bin/create_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if ! [ -d "$builddir" ]; then
exit 1
fi

outfile="$repodir/deploy/hyperion.ng_$buildid.tar.gz"
outfile="$repodir/deploy/hyperion_$buildid.tar.gz"
echo create $outfile

tar --create --gzip --absolute-names --show-transformed-names --ignore-failed-read\
Expand Down
14 changes: 7 additions & 7 deletions bin/scripts/docker-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ mkdir $SCRIPT_PATH/deploy >/dev/null 2>&1

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

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

Expand Down
4 changes: 1 addition & 3 deletions cmake/FindGitVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ execute_process( COMMAND sh -c "git remote --verbose | grep origin | grep fetch
STRING ( STRIP "${BUILD_ID}" BUILD_ID )
STRING ( STRIP "${VERSION_ID}" VERSION_ID )
STRING ( STRIP "${GIT_REMOTE_PATH}" GIT_REMOTE_PATH )
SET ( HYPERION_BUILD_ID "${VERSION_ID} (${BUILD_ID})" )
SET ( HYPERION_GIT_REMOTE "${GIT_REMOTE_PATH}" )
SET ( HYPERION_VERSION "${HYPERION_VERSION_CHANNEL} ${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}" )
SET ( HYPERION_BUILD_ID "${VERSION_ID} (${BUILD_ID}) Git Remote: ${GIT_REMOTE_PATH}" )
message ( STATUS "Current Version: ${HYPERION_VERSION}" )
message ( STATUS " - Build: ${HYPERION_BUILD_ID}" )
22 changes: 13 additions & 9 deletions cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ ENDIF()
# Apply to all packages, some of these can be overwritten with generator specific content
# https://cmake.org/cmake/help/v3.5/module/CPack.html

SET ( CPACK_PACKAGE_NAME "Hyperion.NG" )
SET ( CPACK_PACKAGE_NAME "Hyperion" )
SET ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Hyperion is an open source ambient light implementation" )
SET ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md" )

if ( NOT DEFINED DOCKER_PLATFORM )
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion.NG-${HYPERION_VERSION_CHANNEL}.${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}")
else()
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion.NG-${HYPERION_VERSION_CHANNEL}.${HYPERION_VERSION_MAJOR}.${HYPERION_VERSION_MINOR}.${HYPERION_VERSION_PATCH}-${CMAKE_SYSTEM_NAME}-${DOCKER_PLATFORM}")
endif()
IF ( NOT DEFINED DOCKER_PLATFORM )
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion-${HYPERION_VERSION}-${CMAKE_SYSTEM_NAME}")
ELSE()
SET ( CPACK_PACKAGE_FILE_NAME "Hyperion-${HYPERION_VERSION}-${CMAKE_SYSTEM_NAME}-${DOCKER_PLATFORM}")
ENDIF()

SET ( CPACK_PACKAGE_CONTACT "[email protected]")
SET ( CPACK_PACKAGE_EXECUTABLES "hyperiond;Hyperion" )
Expand All @@ -43,21 +43,18 @@ SET ( CPACK_PACKAGE_VERSION_PATCH "${HYPERION_VERSION_PATCH}")
SET ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" )
SET ( CPACK_CREATE_DESKTOP_LINKS "hyperiond;Hyperion" )


# Specific CPack Package Generators
# https://cmake.org/Wiki/CMake:CPackPackageGenerators
# .deb files for apt

SET ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/preinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/cmake/debian/prerm" )
SET ( CPACK_DEBIAN_PACKAGE_DEPENDS "libqt5core5a (>= 5.5.0), libqt5network5 (>= 5.5.0), libqt5gui5 (>= 5.5.0), libqt5serialport5 (>= 5.5.0), libqt5sql5 (>= 5.5.0), libqt5sql5-sqlite (>= 5.5.0), libavahi-core7 (>= 0.6.31), libavahi-compat-libdnssd1 (>= 0.6.31), libusb-1.0-0, libpython3.5, libc6" )
SET ( CPACK_DEBIAN_PACKAGE_SECTION "Miscellaneous" )

# .rpm for rpm
# https://cmake.org/cmake/help/v3.5/module/CPackRPM.html
SET ( CPACK_RPM_PACKAGE_RELEASE 1)
SET ( CPACK_RPM_PACKAGE_LICENSE "MIT")
SET ( CPACK_RPM_PACKAGE_GROUP "Applications")
SET ( CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.5.0, qt5-qtbase-gui >= 5.5.0, qt5-qtserialport >= 5.5.0, avahi-libs >= 0.6.31, avahi-compat-libdns_sd >= 0.6.31, libusbx, python35 >= 3.5.0")
# Notes: This is a dependency list for Fedora 27, different .rpm OSes use different names for their deps
SET ( CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm/preinst" )
SET ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/rpm/postinst" )
Expand All @@ -82,9 +79,16 @@ SET ( CPACK_NSIS_URL_INFO_ABOUT "https://www.hyperion-project.org")

# define the install components
SET ( CPACK_COMPONENTS_ALL "${PLATFORM}" )

SET ( CPACK_COMPONENT_${PLATFORM}_ARCHIVE_FILE "${CPACK_PACKAGE_FILE_NAME}" )
SET ( CPACK_ARCHIVE_COMPONENT_INSTALL ON )

SET ( CPACK_DEBIAN_${PLATFORM}_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.deb" )
SET ( CPACK_DEB_COMPONENT_INSTALL ON )

SET ( CPACK_RPM_${PLATFORM}_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.rpm" )
SET ( CPACK_RPM_COMPONENT_INSTALL ON )

SET ( CPACK_STRIP_FILES ON )

# no code after following line!
Expand Down
16 changes: 16 additions & 0 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function(SetVersionNumber PREFIX VERSION_STRING)

STRING(REGEX MATCHALL "[0-9]+|-([A-Za-z0-9_]+)" VERSION_PARTS ${VERSION_STRING} )
LIST( GET VERSION_PARTS 0 VERSION_MAJOR )
LIST( GET VERSION_PARTS 1 VERSION_MINOR )
LIST( GET VERSION_PARTS 2 VERSION_PATCH )

set(${PREFIX}_VERSION_MAJOR ${VERSION_MAJOR} PARENT_SCOPE)
set(${PREFIX}_VERSION_MINOR ${VERSION_MINOR} PARENT_SCOPE)
set(${PREFIX}_VERSION_PATCH ${VERSION_PATCH} PARENT_SCOPE)

#if(NOT VERSION_PRE MATCHES "stable")
# set(${PREFIX}_VERSION_PRE ${VERSION_PRE} PARENT_SCOPE)
# set( VERSION_PRE_FULL "-${VERSION_PRE}")
#endif()
endfunction()
1 change: 0 additions & 1 deletion libsrc/api/JsonAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,6 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject&, const QString& command, c
QJsonObject hyperion;
hyperion["jsonrpc_version" ] = QString(HYPERION_JSON_VERSION);
hyperion["version" ] = QString(HYPERION_VERSION);
hyperion["channel" ] = QString(HYPERION_VERSION_CHANNEL);
hyperion["build" ] = QString(HYPERION_BUILD_ID);
hyperion["gitremote" ] = QString(HYPERION_GIT_REMOTE);
hyperion["time" ] = QString(__DATE__ " " __TIME__);
Expand Down
13 changes: 13 additions & 0 deletions libsrc/python/PythonInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#include <python/PythonInit.h>
#include <python/PythonUtils.h>

// qt include
#include <QCoreApplication>
#include <QDir>

// modules to init
#include <effectengine/EffectModule.h>

Expand All @@ -16,6 +20,15 @@ PythonInit::PythonInit()
// register modules
EffectModule::registerHyperionExtensionModule();

// set Python module path when exists
const wchar_t *pythonPath = Py_DecodeLocale((QDir::cleanPath(qApp->applicationDirPath() + "/../lib/python")).toLatin1().data(), nullptr);
if(QDir(QString::fromWCharArray(pythonPath)).exists())
{
Py_NoSiteFlag++;
Py_SetPath(pythonPath);
}
delete pythonPath;

// init Python
Debug(Logger::getInstance("DAEMON"), "Initializing Python interpreter");
Py_InitializeEx(0);
Expand Down
2 changes: 1 addition & 1 deletion resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ FILE ( GLOB Hyperion_RESFILES "${CURRENT_SOURCE_DIR}/icons/*" "${CURRENT_SOURCE_
# fill resources.qrc with RESFILES
FOREACH( f ${Hyperion_RESFILES} )
get_filename_component(fname ${f} NAME)
SET(HYPERION_RES "${HYPERION_RES}\n\t\t<file alias=\"${fname}\">${f}</file>")
SET(HYPERION_RES "${HYPERION_RES}\n\t\t<file alias=\"${fname}\">${f}</file>")
ENDFOREACH()

# prep file
Expand Down
Loading

0 comments on commit 17a9cd2

Please sign in to comment.