Refactor/Create APT/DNF Repository (#1648)

This commit is contained in:
Paulchen-Panther
2023-11-16 21:05:56 +01:00
committed by GitHub
parent c9518db597
commit 91270966f9
165 changed files with 1918 additions and 2924 deletions

View File

@@ -14,7 +14,7 @@ macro(DeployMacOS TARGET)
install(CODE "set(PLUGIN_DIR \"${QT_PLUGIN_DIR}\")" COMPONENT "Hyperion")
install(CODE "set(BUILD_DIR \"${CMAKE_BINARY_DIR}\")" COMPONENT "Hyperion")
install(CODE "set(ENABLE_EFFECTENGINE \"${ENABLE_EFFECTENGINE}\")" COMPONENT "Hyperion")
install(CODE [[
file(GET_RUNTIME_DEPENDENCIES
@@ -36,6 +36,7 @@ macro(DeployMacOS TARGET)
FILES "${dependency}"
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib"
TYPE SHARED_LIBRARY
FOLLOW_SYMLINK_CHAIN
)
endif()
endforeach()
@@ -48,7 +49,6 @@ macro(DeployMacOS TARGET)
foreach(PLUGIN "platforms" "sqldrivers" "imageformats")
if(EXISTS ${PLUGIN_DIR}/${PLUGIN})
file(GLOB files "${PLUGIN_DIR}/${PLUGIN}/*")
list(FILTER files EXCLUDE REGEX ".*libqwebp\\.dylib$")
foreach(file ${files})
file(GET_RUNTIME_DEPENDENCIES
EXECUTABLES ${file}
@@ -61,6 +61,7 @@ macro(DeployMacOS TARGET)
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib"
TYPE SHARED_LIBRARY
FILES ${DEPENDENCY}
FOLLOW_SYMLINK_CHAIN
)
endforeach()
@@ -76,25 +77,27 @@ macro(DeployMacOS TARGET)
endif()
endforeach()
include(BundleUtilities)
include(BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}" "${QT_PLUGINS}" "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/lib" IGNORE_ITEM "python;python3;Python;Python3;.Python;.Python3")
if(ENABLE_EFFECTENGINE)
# Detect the Python version and modules directory
find_package(Python3 3.5 REQUIRED)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
set(PYTHON_MODULES_DIR ${Python3_STDLIB})
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
set(PYTHON_MODULES_DIR ${Python_STDLIB})
endif()
MESSAGE("Add Python ${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} to bundle")
MESSAGE("PYTHON_MODULES_DIR: ${PYTHON_MODULES_DIR}")
# Copy Python modules to '/../Frameworks/Python.framework/Versions/Current/lib/PythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
if (PYTHON_MODULES_DIR)
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
file(
COPY ${PYTHON_MODULES_DIR}/
DESTINATION "${CMAKE_INSTALL_PREFIX}/${TARGET_BUNDLE_NAME}/Contents/Frameworks/Python.framework/Versions/Current/lib/python${PYTHON_VERSION_MAJOR_MINOR}"
@@ -167,9 +170,9 @@ macro(DeployLinux TARGET)
# Extract dependencies ignoring the system ones
get_prerequisites(${TARGET_FILE} DEPENDENCIES 0 1 "" "")
message(STATUS "Dependencies for target file: ${DEPENDENCIES}")
# Append symlink and non-symlink dependencies to the list
set(PREREQUISITE_LIBS "")
foreach(DEPENDENCY ${DEPENDENCIES})
@@ -276,15 +279,13 @@ macro(DeployLinux TARGET)
if(ENABLE_EFFECTENGINE)
# Detect the Python version and modules directory
if (NOT CMAKE_VERSION VERSION_LESS "3.12")
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}")
set(PYTHON_MODULES_DIR "${Python3_STDLIB}")
set(PYTHON_MODULES_DIR ${Python3_STDLIB})
else()
find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT)
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(PYTHON_MODULES_DIR ${Python_STDLIB})
endif()
# Copy Python modules to 'share/hyperion/lib/pythonMAJOR.MINOR' and ignore the unnecessary stuff listed below
@@ -381,19 +382,25 @@ macro(DeployWindows TARGET)
list(GET openssl_versions 0 openssl_version_major)
list(GET openssl_versions 1 openssl_version_minor)
set(library_suffix "-${openssl_version_major}_${openssl_version_minor}")
set(open_ssl_version_suffix)
if (openssl_version_major VERSION_EQUAL 1 AND openssl_version_minor VERSION_EQUAL 1)
set(open_ssl_version_suffix "-1_1")
else()
set(open_ssl_version_suffix "-3")
endif()
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
string(APPEND library_suffix "-x64")
string(APPEND open_ssl_version_suffix "-x64")
endif()
find_file(OPENSSL_SSL
NAMES "libssl${library_suffix}.dll"
NAMES "libssl${open_ssl_version_suffix}.dll"
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
NO_DEFAULT_PATH
)
find_file(OPENSSL_CRYPTO
NAMES "libcrypto${library_suffix}.dll"
NAMES "libcrypto${open_ssl_version_suffix}.dll"
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
NO_DEFAULT_PATH
)

View File

@@ -19,4 +19,10 @@ find_package_handle_standard_args(qmdnsengine
REQUIRED_VARS QMDNS_INCLUDE_DIR QMDNS_LIBRARIES
)
mark_as_advanced(QMDNS_INCLUDE_DIR QMDNS_LIBRARIES)
if(QMDNSENGINE_FOUND)
add_library(qmdnsengine STATIC IMPORTED GLOBAL)
set_target_properties(qmdnsengine PROPERTIES
IMPORTED_LOCATION ${QMDNS_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${QMDNS_INCLUDE_DIR}
)
endif()

View File

@@ -1,17 +0,0 @@
option(ENABLE_LDGOLD "Use GNU gold linker" ON)
set(LDGOLD_FOUND FALSE)
if(ENABLE_LDGOLD)
execute_process(COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if(LD_VERSION MATCHES "GNU gold")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold")
set(LDGOLD_FOUND TRUE)
message(STATUS "Linker: GNU gold")
else()
message(STATUS "GNU gold linker is not available, falling back to default system linker")
endif()
else()
message(STATUS "Linker: Default system linker")
endif()

View File

@@ -1,8 +1,8 @@
[Desktop Entry]
Name=Hyperion
GenericName=Hyperion Ambient Lighting
Comment=Hyperion mimics the well known Ambilight from Philips
Icon=/usr/share/pixmaps/hyperion/hyperiond_128.png
Comment=Hyperion is an opensource Bias or Ambient Lighting implementation
Icon=hyperion
Terminal=false
TryExec=hyperiond
Exec=hyperiond

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (c) 2014-2023 Hyperion Project -->
<component type="desktop-application">
<id>com.hyperion-project.hyperion</id>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<name>Hyperion</name>
<summary>The successor to Hyperion aka Hyperion Next Generation.</summary>
<description>
<p>
Hyperion is an opensource Bias or Ambient Lighting implementation which you might know from TV manufacturers.
It supports many LED devices and video grabbers.
</p>
</description>
<url type="homepage">https://hyperion-project.org</url>
<url type="bugtracker">https://github.com/hyperion-project/hyperion.ng/issues</url>
<url type="help">https://hyperion-project.org</url>
<url type="faq">https://docs.hyperion-project.org/</url>
<url type="donation">https://www.paypal.me/HyperionAmbi</url>
<url type="translate">https://poeditor.com/join/project/Y4F6vHRFjA</url>
<releases>
<release version="2.0.15" date="2022-02-19" />
<release version="2.0.14" date="2022-11-27" />
<release version="2.0.13" date="2022-05-22" />
<release version="2.0.12" date="2021-11-21" />
</releases>
<screenshots>
<screenshot type="default">
<caption>The multi language web interface</caption>
<image>https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/doc/screenshot.png</image>
</screenshot>
</screenshots>
<categories>
<category>Application</category>
</categories>
<launchable type="desktop-id">com.hyperion-project.hyperion.desktop</launchable>
<developer_name>Hyperion Project</developer_name>
<update_contact>admin@hyperion-project.org</update_contact>
<content_rating type="oars-1.0" />
</component>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -105,9 +105,9 @@ ln -fs $BINSP/scripts/updateHyperionUser.sh $BINTP/updateHyperionUser 2>/dev/nul
if [ "$IS_UPGRADE" = false ]; then
if hash desktop-file-install 2>/dev/null; then
echo "---> Install Hyperion desktop icons"
mkdir /usr/share/pixmaps/hyperion 2>/dev/null
cp /usr/share/hyperion/desktop/*.png /usr/share/pixmaps/hyperion 2>/dev/null
desktop-file-install /usr/share/hyperion/desktop/hyperiond.desktop 2>/dev/null
cp -R /usr/share/hyperion/icons /usr/share/icons/hicolor 2>/dev/null
cp /usr/share/hyperion/desktop/hyperion.metainfo.xml /usr/share/metainfo/hyperion.metainfo.xml 2>/dev/null
desktop-file-install /usr/share/hyperion/desktop/hyperion.desktop 2>/dev/null
fi
fi
@@ -149,7 +149,7 @@ $REBOOTMESSAGE
echo "-----------------------------------------------------------------------------"
echo "Webpage: www.hyperion-project.org"
echo "Forum: www.hyperion-project.org"
echo "Documenation: docs.hyperion-project.org"
echo "Documentation: docs.hyperion-project.org"
echo "-----------------------------------------------------------------------------"

View File

@@ -59,11 +59,29 @@ fi
# In case we don't use a service kill all instances
killall hyperiond 2> /dev/null
# delete desktop icons; desktop-file-edit is a workaround to hide the entry and delete it afterwards manual.
# TODO Better way for deletion and keep the desktop in sync without logout/login or desktop dependend cmds?
echo "---> Delete Hyperion desktop icons"
desktop-file-edit --set-key=NoDisplay --set-value=true /usr/share/applications/hyperiond.desktop 2> /dev/null
# remove desktop/appstream file
rm -v /usr/share/applications/hyperion* 2> /dev/null
rm -rv /usr/share/pixmaps/hyperion 2> /dev/null
rm -v /usr/share/metainfo/hyperion* 2> /dev/null
# update desktop-database (if exists)
if [ -x /usr/bin/update-desktop-database ]; then
update-desktop-database -q /usr/share/applications
fi
# remove Hyperion icons
for i in 16x16 22x22 24x24 32x32 36x36 48x48 64x64 72x72 96x96 128x128 192x192 256x256 512x512
rm -v usr/share/icons/hicolor/$i/apps/hyperion.png 2> /dev/null
done
# update icon-cache
if [ -e /usr/share/icons/hicolor/icon-theme.cache ] ; then
# touch it, just in case we cannot find the binary...
touch --no-create /usr/share/icons/hicolor
if hash gtk-update-icon-cache 2>/dev/null; then
gtk-update-icon-cache /usr/share/icons/hicolor
fi
# ignore errors
true
fi
exit 0

View File

@@ -52,7 +52,7 @@ SET ( CPACK_PACKAGE_CONTACT "packages@hyperion-project.org")
SET ( CPACK_PACKAGE_VENDOR "hyperion-project")
SET ( CPACK_PACKAGE_EXECUTABLES "hyperiond;Hyperion" )
SET ( CPACK_PACKAGE_INSTALL_DIRECTORY "Hyperion" )
SET ( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/icons/hyperion-icon-32px.png" )
SET ( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/resources/icons/hyperion-32px.png" )
SET ( CPACK_PACKAGE_VERSION_MAJOR "${HYPERION_VERSION_MAJOR}")
SET ( CPACK_PACKAGE_VERSION_MINOR "${HYPERION_VERSION_MINOR}")

View File

@@ -1,15 +0,0 @@
# process a .rc file for windows
# Provides (BINARY_NAME)_WIN_RC_PATH with path to generated file
function(generate_win_rc_file BINARY_NAME)
# target path to store generated files
set(TARGET_PATH ${CMAKE_BINARY_DIR}/win_rc_file/${BINARY_NAME})
# assets
string(REPLACE "/" "\\\\" WIN_RC_ICON_PATH ${CMAKE_SOURCE_DIR}/cmake/nsis/installer.ico)
# configure the rc file
configure_file(
${CMAKE_SOURCE_DIR}/cmake/win/win.rc.in
${TARGET_PATH}/win.rc
)
# provide var for parent scope
set(${BINARY_NAME}_WIN_RC_PATH ${TARGET_PATH}/win.rc PARENT_SCOPE)
endfunction()