mirror of
https://github.com/jellyfin/jellyfin-desktop.git
synced 2026-10-26 16:45:24 +00:00
Cleanup build scripts
- remove unused scripts - convert python scripts to cmake - move WindowsSign.cmd to bundle/win
This commit is contained in:
1 parent
3122130450
commit
f1579d322d
27 files changed
+245
-893
No files matched your search
@@ -24,10 +24,8 @@ jobs:
|
||||
cd build
|
||||
cmake -GNinja -DQTROOT=/usr/local/opt/qt@6 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output -DCHECK_FOR_UPDATES=ON -DUSE_STATIC_MPVQT=ON ..
|
||||
ninja install
|
||||
- name: Fix library paths and create dmg
|
||||
- name: Sign and create dmg
|
||||
run: |
|
||||
python3 ./scripts/fix-install-names.py "./build/output/Jellyfin Desktop.app"
|
||||
python3 ./scripts/fix-webengine.py "./build/output/Jellyfin Desktop.app"
|
||||
codesign --force --deep -s - "./build/output/Jellyfin Desktop.app/"
|
||||
brew install create-dmg
|
||||
attempts=0
|
||||
@@ -65,10 +63,8 @@ jobs:
|
||||
cd build
|
||||
cmake -GNinja -DQTROOT=/opt/homebrew/opt/qt@6 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output -DCHECK_FOR_UPDATES=ON -DUSE_STATIC_MPVQT=ON ..
|
||||
ninja install
|
||||
- name: Fix library paths and create dmg
|
||||
- name: Sign and create dmg
|
||||
run: |
|
||||
python3 ./scripts/fix-install-names.py "./build/output/Jellyfin Desktop.app"
|
||||
python3 ./scripts/fix-webengine.py "./build/output/Jellyfin Desktop.app"
|
||||
codesign --force --deep -s - "./build/output/Jellyfin Desktop.app/"
|
||||
brew install create-dmg
|
||||
create-dmg --volname "Jellyfin Desktop" --no-internet-enable "Jellyfin Desktop.dmg" "./build/output/Jellyfin Desktop.app"
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
./download_webclient.sh
|
||||
cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local/ ..
|
||||
make -j4
|
||||
sudo make
|
||||
sudo make install
|
||||
@@ -1,5 +1,14 @@
|
||||
set(app "${CMAKE_INSTALL_PREFIX}/@EXE@")
|
||||
set(weprocess "${app}/Contents/Frameworks/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app")
|
||||
set(framework_path "${app}/Contents/Frameworks")
|
||||
set(weprocess "${framework_path}/QtWebEngineCore.framework/Versions/Current/Helpers/QtWebEngineProcess.app")
|
||||
|
||||
# Determine rpath based on architecture
|
||||
cmake_host_system_information(RESULT arch QUERY OS_PLATFORM)
|
||||
if(arch STREQUAL "arm64")
|
||||
set(rpath_str "/opt/homebrew/lib")
|
||||
else()
|
||||
set(rpath_str "/usr/local/lib")
|
||||
endif()
|
||||
|
||||
set(args ${app})
|
||||
list(APPEND args "-verbose=2")
|
||||
@@ -17,9 +26,152 @@ execute_process(
|
||||
WORKING_DIRECTORY "@QTROOT@/bin"
|
||||
)
|
||||
|
||||
#set(ENTITLEMENTS --entitlements @SOURCE_ROOT@/bundle/osx/Konvergo.entitlements)
|
||||
#set(CODESIGN codesign ${ENTITLEMENTS} --force --sign "Developer ID Application: Plex Inc.")
|
||||
#
|
||||
# fix_install_names: Fix library paths for bundled dylibs/sos
|
||||
#
|
||||
function(fix_lib_dependencies lib framework_libs_var)
|
||||
set(framework_libs ${${framework_libs_var}})
|
||||
|
||||
execute_process(
|
||||
COMMAND otool -L "${lib}"
|
||||
OUTPUT_VARIABLE otool_output
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
string(REPLACE "\n" ";" otool_lines "${otool_output}")
|
||||
|
||||
foreach(line ${otool_lines})
|
||||
string(STRIP "${line}" line)
|
||||
|
||||
# Check if dependency needs fixing
|
||||
set(needs_fix FALSE)
|
||||
if(line MATCHES "^(/usr/local|/opt/homebrew|@rpath|@loader_path)")
|
||||
set(needs_fix TRUE)
|
||||
endif()
|
||||
|
||||
if(needs_fix)
|
||||
# Extract dependency path (remove compatibility version suffix)
|
||||
string(REGEX REPLACE " \\(compatibility.*$" "" dependency_str "${line}")
|
||||
string(STRIP "${dependency_str}" dependency_str)
|
||||
|
||||
# Resolve the actual path
|
||||
if(dependency_str MATCHES "^@rpath/(.+)")
|
||||
set(dep_name "${CMAKE_MATCH_1}")
|
||||
set(resolved_path "${rpath_str}/${dep_name}")
|
||||
elseif(dependency_str MATCHES "^@loader_path/(.+)")
|
||||
get_filename_component(dep_name "${CMAKE_MATCH_1}" NAME)
|
||||
set(resolved_path "${rpath_str}/${dep_name}")
|
||||
else()
|
||||
set(resolved_path "${dependency_str}")
|
||||
endif()
|
||||
|
||||
get_filename_component(dep_name "${resolved_path}" NAME)
|
||||
set(target "@executable_path/../Frameworks/${dep_name}")
|
||||
|
||||
# Copy if not already in Frameworks
|
||||
list(FIND framework_libs "${dep_name}" idx)
|
||||
if(idx EQUAL -1 AND EXISTS "${resolved_path}")
|
||||
message(STATUS "Copying ${resolved_path} to ${framework_path}/${dep_name}")
|
||||
file(COPY "${resolved_path}" DESTINATION "${framework_path}")
|
||||
list(APPEND framework_libs "${dep_name}")
|
||||
set(${framework_libs_var} "${framework_libs}" PARENT_SCOPE)
|
||||
# Queue newly added lib for processing
|
||||
set_property(GLOBAL APPEND PROPERTY LIBS_TO_FIX "${framework_path}/${dep_name}")
|
||||
endif()
|
||||
|
||||
# Fix the path
|
||||
message(STATUS "Fixing ${dependency_str} -> ${target} in ${lib}")
|
||||
execute_process(COMMAND install_name_tool -id "${target}" "${lib}" ERROR_QUIET)
|
||||
execute_process(COMMAND install_name_tool -change "${dependency_str}" "${target}" "${lib}" ERROR_QUIET)
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
# Build initial list of framework libs
|
||||
file(GLOB existing_dylibs "${framework_path}/*.dylib")
|
||||
file(GLOB existing_sos "${framework_path}/*.so")
|
||||
set(framework_libs "")
|
||||
foreach(f ${existing_dylibs} ${existing_sos})
|
||||
get_filename_component(fname "${f}" NAME)
|
||||
list(APPEND framework_libs "${fname}")
|
||||
endforeach()
|
||||
|
||||
# Collect all libs to fix
|
||||
file(GLOB_RECURSE all_dylibs "${app}/*.dylib")
|
||||
file(GLOB_RECURSE all_sos "${app}/*.so")
|
||||
set_property(GLOBAL PROPERTY LIBS_TO_FIX ${all_dylibs} ${all_sos})
|
||||
|
||||
# Process libs iteratively (handles newly discovered deps)
|
||||
set(max_iterations 100)
|
||||
set(iteration 0)
|
||||
while(iteration LESS max_iterations)
|
||||
get_property(libs_to_fix GLOBAL PROPERTY LIBS_TO_FIX)
|
||||
if(NOT libs_to_fix)
|
||||
break()
|
||||
endif()
|
||||
|
||||
# Clear the queue and process
|
||||
set_property(GLOBAL PROPERTY LIBS_TO_FIX "")
|
||||
list(REMOVE_DUPLICATES libs_to_fix)
|
||||
|
||||
foreach(lib ${libs_to_fix})
|
||||
if(EXISTS "${lib}")
|
||||
fix_lib_dependencies("${lib}" framework_libs)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
math(EXPR iteration "${iteration} + 1")
|
||||
endwhile()
|
||||
|
||||
message(STATUS "Library path fixing complete")
|
||||
|
||||
#
|
||||
# fix_webengine: Fix QtWebEngineProcess paths and create Frameworks symlink
|
||||
#
|
||||
set(webengine_link_path "${weprocess}/Contents/Frameworks")
|
||||
set(webengine_bin "${weprocess}/Contents/MacOS/QtWebEngineProcess")
|
||||
|
||||
if(EXISTS "${weprocess}" AND NOT EXISTS "${webengine_link_path}")
|
||||
message(STATUS "Creating Frameworks symlink for QtWebEngineProcess")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink "../../../../../../../Frameworks" "${webengine_link_path}"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EXISTS "${webengine_bin}")
|
||||
execute_process(
|
||||
COMMAND otool -L "${webengine_bin}"
|
||||
OUTPUT_VARIABLE otool_output
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
string(REPLACE "\n" ";" otool_lines "${otool_output}")
|
||||
|
||||
foreach(line ${otool_lines})
|
||||
string(STRIP "${line}" line)
|
||||
|
||||
if(line MATCHES "^(/opt/homebrew|/usr/local)")
|
||||
string(REGEX REPLACE " \\(compatibility.*$" "" dependency_str "${line}")
|
||||
string(STRIP "${dependency_str}" dependency_str)
|
||||
|
||||
# Extract framework path component after /lib
|
||||
string(REGEX REPLACE "^.*/lib" "" framework_suffix "${dependency_str}")
|
||||
set(target "@executable_path/../Frameworks${framework_suffix}")
|
||||
|
||||
message(STATUS "Fixing WebEngine: ${dependency_str} -> ${target}")
|
||||
execute_process(COMMAND install_name_tool -id "${target}" "${webengine_bin}" ERROR_QUIET)
|
||||
execute_process(COMMAND install_name_tool -change "${dependency_str}" "${target}" "${webengine_bin}" ERROR_QUIET)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
message(STATUS "WebEngine path fixing complete")
|
||||
|
||||
#
|
||||
# Code signing (optional)
|
||||
#
|
||||
macro(sign_binary BIN)
|
||||
message(STATUS "Signing: ${BIN}")
|
||||
execute_process(
|
||||
@@ -37,7 +189,7 @@ if(@DO_SIGN@)
|
||||
FOLLOW_SYMLINKS
|
||||
"${app}/*.dylib"
|
||||
)
|
||||
file(GLOB FRAMEWORKS FOLLOW_SYMLINKS LIST_DIRECTORIES true "${app}/Contents/Frameworks/*")
|
||||
file(GLOB FRAMEWORKS FOLLOW_SYMLINKS LIST_DIRECTORIES true "${framework_path}/*")
|
||||
foreach(LIB ${LIBS} ${FRAMEWORKS})
|
||||
sign_binary(${LIB})
|
||||
endforeach(LIB ${LIBS})
|
||||
@@ -48,7 +200,7 @@ if(@DO_SIGN@)
|
||||
|
||||
sign_binary(${app})
|
||||
|
||||
message("Verifing signature")
|
||||
message("Verifying signature")
|
||||
execute_process(
|
||||
COMMAND codesign --verbose=4 --verify "${CMAKE_INSTALL_PREFIX}/@EXE@"
|
||||
RESULT_VARIABLE result
|
||||
@@ -63,4 +215,4 @@ if(@DO_SIGN@)
|
||||
if(NOT ${result} EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to verify binary!")
|
||||
endif(NOT ${result} EQUAL 0)
|
||||
endif(@DO_SIGN@)
|
||||
endif(@DO_SIGN@)
|
||||
@@ -18,7 +18,6 @@ if(DEPENDENCY_TOKEN)
|
||||
BUILD_NUMBER ${DEPS_BUILD_NUMBER}
|
||||
DIRECTORY dir
|
||||
DEPHASH_VAR DEPS_HASH
|
||||
DYLIB_SCRIPT_PATH ${PROJECT_SOURCE_DIR}/scripts/fix-install-names.py
|
||||
TOKEN ${DEPENDENCY_TOKEN}
|
||||
)
|
||||
message("dependencies are: ${dir}")
|
||||
@@ -40,7 +39,6 @@ else(IS_DIRECTORY ${DEPENDENCY_ROOT})
|
||||
endif(IS_DIRECTORY ${DEPENDENCY_ROOT})
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(PythonInterp REQUIRED)
|
||||
|
||||
if(NOT USE_STATIC_MPVQT)
|
||||
find_package(MpvQt REQUIRED)
|
||||
|
||||
@@ -70,7 +70,6 @@ function(download_deps DD_NAME)
|
||||
VARIANT
|
||||
DEPHASH_VAR
|
||||
ARCHSTR
|
||||
DYLIB_SCRIPT_PATH
|
||||
BASE_URL
|
||||
TOKEN)
|
||||
|
||||
@@ -191,19 +190,6 @@ function(download_deps DD_NAME)
|
||||
message(FATAL_ERROR "Failed to unpack deps..")
|
||||
endif(NOT UNPACK_RESULT EQUAL 0)
|
||||
|
||||
if(APPLE AND DD_DYLIB_SCRIPT_PATH)
|
||||
message(STATUS "Fixing install library names...${DEP_DIR}/${DEP_DIRNAME}")
|
||||
execute_process(
|
||||
COMMAND ${DD_DYLIB_SCRIPT_PATH} ${DEP_DIR}/${DEP_DIRNAME}
|
||||
WORKING_DIRECTORY ${DEP_DIR}
|
||||
RESULT_VARIABLE DYLIB_RESULT
|
||||
)
|
||||
if(NOT DYLIB_RESULT EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to run ${DD_DYLIB_SCRIPT_PATH}")
|
||||
endif()
|
||||
message(STATUS "Done")
|
||||
endif()
|
||||
|
||||
if(EXISTS ${DEP_DIR}/${DEP_DIRNAME}/etc)
|
||||
message(STATUS "Removing etc in dependency bundle")
|
||||
file(REMOVE_RECURSE ${DEP_DIR}/${DEP_DIRNAME}/etc)
|
||||
|
||||
@@ -1,311 +0,0 @@
|
||||
# This module can find the International Components for Unicode (ICU) Library
|
||||
#
|
||||
# Requirements:
|
||||
# - CMake >= 2.8.3 (for new version of find_package_handle_standard_args)
|
||||
#
|
||||
# The following variables will be defined for your use:
|
||||
# - ICU_FOUND : were all of your specified components found (include dependencies)?
|
||||
# - ICU_INCLUDE_DIRS : ICU include directory
|
||||
# - ICU_LIBRARIES : ICU libraries
|
||||
# - ICU_VERSION : complete version of ICU (x.y.z)
|
||||
# - ICU_MAJOR_VERSION : major version of ICU
|
||||
# - ICU_MINOR_VERSION : minor version of ICU
|
||||
# - ICU_PATCH_VERSION : patch version of ICU
|
||||
# - ICU_<COMPONENT>_FOUND : were <COMPONENT> found? (FALSE for non specified component if it is not a dependency)
|
||||
#
|
||||
# For windows or non standard installation, define ICU_ROOT variable to point to the root installation of ICU. Two ways:
|
||||
# - run cmake with -DICU_ROOT=<PATH>
|
||||
# - define an environment variable with the same name before running cmake
|
||||
# With cmake-gui, before pressing "Configure":
|
||||
# 1) Press "Add Entry" button
|
||||
# 2) Add a new entry defined as:
|
||||
# - Name: ICU_ROOT
|
||||
# - Type: choose PATH in the selection list
|
||||
# - Press "..." button and select the root installation of ICU
|
||||
#
|
||||
# Example Usage:
|
||||
#
|
||||
# 1. Copy this file in the root of your project source directory
|
||||
# 2. Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt:
|
||||
# set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
|
||||
# 3. Finally call find_package() once, here are some examples to pick from
|
||||
#
|
||||
# Require ICU 4.4 or later
|
||||
# find_package(ICU 4.4 REQUIRED)
|
||||
#
|
||||
# if(ICU_FOUND)
|
||||
# include_directories(${ICU_INCLUDE_DIRS})
|
||||
# add_executable(myapp myapp.c)
|
||||
# target_link_libraries(myapp ${ICU_LIBRARIES})
|
||||
# endif(ICU_FOUND)
|
||||
|
||||
#=============================================================================
|
||||
# Copyright (c) 2011-2013, julp
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#=============================================================================
|
||||
|
||||
########## Private ##########
|
||||
if(NOT DEFINED ICU_PUBLIC_VAR_NS)
|
||||
set(ICU_PUBLIC_VAR_NS "ICU") # Prefix for all ICU relative public variables
|
||||
endif(NOT DEFINED ICU_PUBLIC_VAR_NS)
|
||||
if(NOT DEFINED ICU_PRIVATE_VAR_NS)
|
||||
set(ICU_PRIVATE_VAR_NS "_${ICU_PUBLIC_VAR_NS}") # Prefix for all ICU relative internal variables
|
||||
endif(NOT DEFINED ICU_PRIVATE_VAR_NS)
|
||||
if(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
|
||||
set(PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables
|
||||
endif(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
|
||||
|
||||
function(icudebug _VARNAME)
|
||||
if(${ICU_PUBLIC_VAR_NS}_DEBUG)
|
||||
if(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
|
||||
message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ${${ICU_PUBLIC_VAR_NS}_${_VARNAME}}")
|
||||
else(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
|
||||
message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = <UNDEFINED>")
|
||||
endif(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
|
||||
endif(${ICU_PUBLIC_VAR_NS}_DEBUG)
|
||||
endfunction(icudebug)
|
||||
|
||||
set(${ICU_PRIVATE_VAR_NS}_ROOT "")
|
||||
if(DEFINED ENV{ICU_ROOT})
|
||||
set(${ICU_PRIVATE_VAR_NS}_ROOT "$ENV{ICU_ROOT}")
|
||||
endif(DEFINED ENV{ICU_ROOT})
|
||||
if (DEFINED ICU_ROOT)
|
||||
set(${ICU_PRIVATE_VAR_NS}_ROOT "${ICU_ROOT}")
|
||||
endif(DEFINED ICU_ROOT)
|
||||
|
||||
set(${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES )
|
||||
set(${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES )
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin64")
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib64")
|
||||
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin")
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib")
|
||||
|
||||
set(${ICU_PRIVATE_VAR_NS}_COMPONENTS )
|
||||
# <icu component name> <library name 1> ... <library name N>
|
||||
macro(icu_declare_component _NAME)
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_COMPONENTS ${_NAME})
|
||||
set("${ICU_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN})
|
||||
endmacro(icu_declare_component)
|
||||
|
||||
icu_declare_component(data icudata)
|
||||
icu_declare_component(uc icuuc) # Common and Data libraries
|
||||
icu_declare_component(i18n icui18n icuin) # Internationalization library
|
||||
icu_declare_component(io icuio ustdio) # Stream and I/O Library
|
||||
icu_declare_component(le icule) # Layout library
|
||||
icu_declare_component(lx iculx) # Paragraph Layout library
|
||||
|
||||
########## Public ##########
|
||||
set(${ICU_PUBLIC_VAR_NS}_FOUND TRUE)
|
||||
set(${ICU_PUBLIC_VAR_NS}_LIBRARIES )
|
||||
set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS )
|
||||
set(${ICU_PUBLIC_VAR_NS}_C_FLAGS "")
|
||||
set(${ICU_PUBLIC_VAR_NS}_CXX_FLAGS "")
|
||||
set(${ICU_PUBLIC_VAR_NS}_CPP_FLAGS "")
|
||||
set(${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS "")
|
||||
set(${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS "")
|
||||
set(${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS "")
|
||||
foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
|
||||
string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
|
||||
set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the icu_declare_component macro
|
||||
endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
|
||||
|
||||
# Check components
|
||||
if(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) # uc required at least
|
||||
set(${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
|
||||
else(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
|
||||
list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
|
||||
list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
|
||||
foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
|
||||
if(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
|
||||
message(FATAL_ERROR "Unknown ICU component: ${${ICU_PRIVATE_VAR_NS}_COMPONENT}")
|
||||
endif(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
|
||||
endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
|
||||
endif(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
|
||||
|
||||
# Includes
|
||||
find_path(
|
||||
${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
|
||||
NAMES unicode/utypes.h utypes.h
|
||||
HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
|
||||
PATH_SUFFIXES "include"
|
||||
DOC "Include directories for ICU"
|
||||
)
|
||||
|
||||
if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
|
||||
########## <part to keep synced with tests/version/CMakeLists.txt> ##########
|
||||
if(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h") # ICU >= 4
|
||||
file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
|
||||
elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h") # ICU [2;4[
|
||||
file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
|
||||
elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h") # ICU [1.4;2[
|
||||
file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
|
||||
elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h") # ICU 1.3
|
||||
file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
|
||||
else()
|
||||
message(FATAL_ERROR "ICU version header not found")
|
||||
endif()
|
||||
|
||||
if(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *ICU_VERSION *\"([0-9]+)\".*") # ICU 1.3
|
||||
# [1.3;1.4[ as #define ICU_VERSION "3" (no patch version, ie all 1.3.X versions will be detected as 1.3.0)
|
||||
set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "1")
|
||||
set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_1}")
|
||||
set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
|
||||
elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION_MAJOR_NUM *([0-9]+).*")
|
||||
#
|
||||
# Since version 4.9.1, ICU release version numbering was totaly changed, see:
|
||||
# - http://site.icu-project.org/download/49
|
||||
# - http://userguide.icu-project.org/design#TOC-Version-Numbers-in-ICU
|
||||
#
|
||||
set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
|
||||
string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
|
||||
elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION *\"(([0-9]+)(\\.[0-9]+)*)\".*") # ICU [1.4;1.8[
|
||||
# [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some 1.4.1(?:\.\d)? have releasing error and appears as 1.4.0
|
||||
set(${ICU_PRIVATE_VAR_NS}_FULL_VERSION "${CMAKE_MATCH_1}") # copy CMAKE_MATCH_1, no longer valid on the following if
|
||||
if(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)$")
|
||||
set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
|
||||
set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
|
||||
elseif(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
|
||||
set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
|
||||
set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
|
||||
set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${CMAKE_MATCH_3}")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "failed to detect ICU version")
|
||||
endif()
|
||||
set(${ICU_PUBLIC_VAR_NS}_VERSION "${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_MINOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_PATCH_VERSION}")
|
||||
########## </part to keep synced with tests/version/CMakeLists.txt> ##########
|
||||
|
||||
# Check dependencies (implies pkg-config)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
set(${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
|
||||
foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP})
|
||||
pkg_check_modules(PC_ICU_PRIVATE_VAR_NS "icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET)
|
||||
|
||||
if(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
|
||||
foreach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${PC_ICU_LIBRARIES})
|
||||
string(REGEX REPLACE "^icu" "" ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY})
|
||||
list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
|
||||
endforeach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
|
||||
endif(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
|
||||
endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
|
||||
list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
|
||||
endif(PKG_CONFIG_FOUND)
|
||||
|
||||
# Check libraries
|
||||
foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
|
||||
set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES )
|
||||
set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES )
|
||||
foreach(${ICU_PRIVATE_VAR_NS}_BASE_NAME ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}")
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}")
|
||||
list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}d")
|
||||
endforeach(${ICU_PRIVATE_VAR_NS}_BASE_NAME)
|
||||
|
||||
find_library(
|
||||
${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
|
||||
NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
|
||||
HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
|
||||
PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
|
||||
DOC "Release libraries for ICU"
|
||||
)
|
||||
find_library(
|
||||
${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
|
||||
NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
|
||||
HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
|
||||
PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
|
||||
DOC "Debug libraries for ICU"
|
||||
)
|
||||
|
||||
string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
|
||||
if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # both not found
|
||||
set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE)
|
||||
set("${ICU_PUBLIC_VAR_NS}_FOUND" FALSE)
|
||||
else(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # one or both found
|
||||
set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE)
|
||||
if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # release not found => we are in debug
|
||||
set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
|
||||
elseif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # debug not found => we are in release
|
||||
set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
|
||||
else() # both found
|
||||
set(
|
||||
${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
|
||||
optimized ${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
|
||||
debug ${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
|
||||
)
|
||||
endif()
|
||||
list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
|
||||
endif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
|
||||
endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
|
||||
|
||||
# Try to find out compiler flags
|
||||
find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE icu-config HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT})
|
||||
if(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
|
||||
execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
|
||||
|
||||
# Check find_package arguments
|
||||
include(FindPackageHandleStandardArgs)
|
||||
if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
|
||||
find_package_handle_standard_args(
|
||||
${ICU_PUBLIC_VAR_NS}
|
||||
REQUIRED_VARS ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
|
||||
VERSION_VAR ${ICU_PUBLIC_VAR_NS}_VERSION
|
||||
)
|
||||
else(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
|
||||
find_package_handle_standard_args(${ICU_PUBLIC_VAR_NS} "ICU not found" ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
|
||||
endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
|
||||
else(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
|
||||
if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
|
||||
message(FATAL_ERROR "Could not find ICU include directory")
|
||||
endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
|
||||
endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(
|
||||
${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
|
||||
${ICU_PUBLIC_VAR_NS}_LIBRARIES
|
||||
)
|
||||
|
||||
# IN (args)
|
||||
icudebug("FIND_COMPONENTS")
|
||||
icudebug("FIND_REQUIRED")
|
||||
icudebug("FIND_QUIETLY")
|
||||
icudebug("FIND_VERSION")
|
||||
# OUT
|
||||
# Found
|
||||
icudebug("FOUND")
|
||||
icudebug("UC_FOUND")
|
||||
icudebug("I18N_FOUND")
|
||||
icudebug("IO_FOUND")
|
||||
icudebug("LE_FOUND")
|
||||
icudebug("LX_FOUND")
|
||||
icudebug("DATA_FOUND")
|
||||
# Flags
|
||||
icudebug("C_FLAGS")
|
||||
icudebug("CPP_FLAGS")
|
||||
icudebug("CXX_FLAGS")
|
||||
icudebug("C_SHARED_FLAGS")
|
||||
icudebug("CPP_SHARED_FLAGS")
|
||||
icudebug("CXX_SHARED_FLAGS")
|
||||
# Linking
|
||||
icudebug("INCLUDE_DIRS")
|
||||
icudebug("LIBRARIES")
|
||||
# Version
|
||||
icudebug("MAJOR_VERSION")
|
||||
icudebug("MINOR_VERSION")
|
||||
icudebug("PATCH_VERSION")
|
||||
icudebug("VERSION")
|
||||
@@ -0,0 +1,69 @@
|
||||
# CMake script to generate Qt resources (.qrc) file
|
||||
# Run with: cmake -DOUTPUT=out.qrc -DMAPPINGS="vpath1=rpath1|vpath2=rpath2" -P GenerateQtResources.cmake
|
||||
|
||||
if(NOT DEFINED OUTPUT)
|
||||
message(FATAL_ERROR "OUTPUT not defined")
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED MAPPINGS)
|
||||
message(FATAL_ERROR "MAPPINGS not defined")
|
||||
endif()
|
||||
|
||||
# Convert pipe-delimited string to list
|
||||
string(REPLACE "|" ";" MAPPINGS_LIST "${MAPPINGS}")
|
||||
|
||||
set(qrc_content "<RCC>\n")
|
||||
|
||||
foreach(mapping ${MAPPINGS_LIST})
|
||||
# Split on first =
|
||||
string(FIND "${mapping}" "=" eq_pos)
|
||||
if(eq_pos EQUAL -1)
|
||||
message(FATAL_ERROR "Invalid mapping '${mapping}', expected virtualpath=realpath")
|
||||
endif()
|
||||
|
||||
string(SUBSTRING "${mapping}" 0 ${eq_pos} virtualpath)
|
||||
math(EXPR value_start "${eq_pos} + 1")
|
||||
string(SUBSTRING "${mapping}" ${value_start} -1 realpath)
|
||||
|
||||
if(IS_DIRECTORY "${realpath}")
|
||||
# Recursively add all files from directory
|
||||
file(GLOB_RECURSE dir_files RELATIVE "${realpath}" "${realpath}/*")
|
||||
foreach(file ${dir_files})
|
||||
set(full_virtual "${virtualpath}/${file}")
|
||||
# Normalize path
|
||||
string(REGEX REPLACE "^/+" "" full_virtual "${full_virtual}")
|
||||
string(REGEX REPLACE "/+" "/" full_virtual "${full_virtual}")
|
||||
|
||||
# Split into prefix (directory) and alias (filename)
|
||||
get_filename_component(prefix "/${full_virtual}" DIRECTORY)
|
||||
get_filename_component(alias "${full_virtual}" NAME)
|
||||
|
||||
string(APPEND qrc_content "<qresource prefix=\"${prefix}\">\n")
|
||||
string(APPEND qrc_content " <file alias=\"${alias}\">${realpath}/${file}</file>\n")
|
||||
string(APPEND qrc_content "</qresource>\n")
|
||||
endforeach()
|
||||
else()
|
||||
# Single file
|
||||
string(REGEX REPLACE "^/+" "" virtualpath_clean "${virtualpath}")
|
||||
get_filename_component(prefix "/${virtualpath_clean}" DIRECTORY)
|
||||
get_filename_component(alias "${virtualpath_clean}" NAME)
|
||||
|
||||
string(APPEND qrc_content "<qresource prefix=\"${prefix}\">\n")
|
||||
string(APPEND qrc_content " <file alias=\"${alias}\">${realpath}</file>\n")
|
||||
string(APPEND qrc_content "</qresource>\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
string(APPEND qrc_content "</RCC>")
|
||||
|
||||
# Only write if content changed (prevents unnecessary rebuilds)
|
||||
if(EXISTS "${OUTPUT}")
|
||||
file(READ "${OUTPUT}" existing_content)
|
||||
if("${existing_content}" STREQUAL "${qrc_content}")
|
||||
message(STATUS "resources.qrc unchanged")
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
file(WRITE "${OUTPUT}" "${qrc_content}")
|
||||
message(STATUS "Generated ${OUTPUT}")
|
||||
@@ -1,123 +0,0 @@
|
||||
# - Returns a version string from Git
|
||||
#
|
||||
# These functions force a re-configure on each git commit so that you can
|
||||
# trust the values of the variables in your build system.
|
||||
#
|
||||
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the refspec and sha hash of the current head revision
|
||||
#
|
||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe on the source tree, and adjusting
|
||||
# the output so that it tests false if an error occurs.
|
||||
#
|
||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe --exact-match on the source tree,
|
||||
# and adjusting the output so that it tests false if there was no exact
|
||||
# matching tag.
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
if(__get_git_revision_description)
|
||||
return()
|
||||
endif()
|
||||
set(__get_git_revision_description YES)
|
||||
|
||||
# We must run the following at "include" time, not at function call time,
|
||||
# to find the path to this module rather than the path to a calling list file
|
||||
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
|
||||
function(get_git_head_revision _refspecvar _hashvar)
|
||||
set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}")
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
|
||||
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
|
||||
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
||||
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
|
||||
# We have reached the root directory, we are not in git
|
||||
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
|
||||
endwhile()
|
||||
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
|
||||
if(NOT EXISTS "${GIT_DATA}")
|
||||
file(MAKE_DIRECTORY "${GIT_DATA}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${GIT_DIR}/HEAD")
|
||||
return()
|
||||
endif()
|
||||
set(HEAD_FILE "${GIT_DATA}/HEAD")
|
||||
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
|
||||
|
||||
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
|
||||
"${GIT_DATA}/grabRef.cmake"
|
||||
@ONLY)
|
||||
include("${GIT_DATA}/grabRef.cmake")
|
||||
|
||||
set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
|
||||
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_describe _var)
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
if(NOT hash)
|
||||
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# TODO sanitize
|
||||
#if((${ARGN}" MATCHES "&&") OR
|
||||
# (ARGN MATCHES "||") OR
|
||||
# (ARGN MATCHES "\\;"))
|
||||
# message("Please report the following error to the project!")
|
||||
# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
|
||||
#endif()
|
||||
|
||||
#message(STATUS "Arguments to execute_process: ${ARGN}")
|
||||
|
||||
execute_process(COMMAND
|
||||
"${GIT_EXECUTABLE}"
|
||||
describe
|
||||
${hash}
|
||||
${ARGN}
|
||||
WORKING_DIRECTORY
|
||||
"${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE
|
||||
res
|
||||
OUTPUT_VARIABLE
|
||||
out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "${out}-${res}-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_get_exact_tag _var)
|
||||
git_describe(out --exact-match ${ARGN})
|
||||
set(${_var} "${out}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
@@ -1,38 +0,0 @@
|
||||
#
|
||||
# Internal file for GetGitRevisionDescription.cmake
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
set(HEAD_HASH)
|
||||
|
||||
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
||||
|
||||
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||
if(HEAD_CONTENTS MATCHES "ref")
|
||||
# named branch
|
||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
|
||||
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
set(HEAD_HASH "${HEAD_REF}")
|
||||
endif()
|
||||
else()
|
||||
# detached HEAD
|
||||
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
endif()
|
||||
|
||||
if(NOT HEAD_HASH)
|
||||
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||
endif()
|
||||
@@ -99,13 +99,13 @@ function(wix_light)
|
||||
if(_WL_OUTPUT MATCHES ".*exe")
|
||||
add_custom_command(TARGET ${_WL_TARGET} POST_BUILD
|
||||
COMMAND ${WIX_INSIGNIA} -ib ${_WL_OUTPUT} -o engine.exe
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/scripts/WindowsSign.cmd engine.exe
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/bundle/win/WindowsSign.cmd engine.exe
|
||||
COMMAND ${WIX_INSIGNIA} -ab engine.exe ${_WL_OUTPUT} -o ${_WL_OUTPUT}
|
||||
COMMENT "Doing insignia dance"
|
||||
)
|
||||
endif()
|
||||
add_custom_command(TARGET ${_WL_TARGET} POST_BUILD
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/scripts/WindowsSign.cmd ${_WL_OUTPUT}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/bundle/win/WindowsSign.cmd ${_WL_OUTPUT}
|
||||
COMMENT Signing ${_WL_OUTPUT}
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -31,7 +31,7 @@ git clone --recursive https://github.com/jellyfin/jellyfin-desktop.git --branch
|
||||
|
||||
Install dependencies:
|
||||
```bash
|
||||
sudo apt install autoconf automake build-essential cmake curl g++ git libasound2-dev libcec-dev libegl1-mesa-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgl1-mesa-dev libgnutls28-dev libharfbuzz-dev libpulse-dev libsdl2-dev libtool libuchardet-dev libva-dev libvdpau-dev libx11-dev libxrandr-dev mesa-common-dev meson python3 qml6-module-qtqml-workerscript qml6-module-qtquick-controls qml6-module-qtquick-templates qml6-module-qtquick-window qml6-module-qtwebchannel qml6-module-qtwebengine qml6-module-qtwebengine-controlsdelegates qml6-module-qtwebview qt6-base-private-dev qt6-webengine-private-dev unzip wget yasm zlib1g-dev
|
||||
sudo apt install autoconf automake build-essential cmake curl g++ git libasound2-dev libcec-dev libegl1-mesa-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgl1-mesa-dev libgnutls28-dev libharfbuzz-dev libpulse-dev libsdl2-dev libtool libuchardet-dev libva-dev libvdpau-dev libx11-dev libxrandr-dev mesa-common-dev meson qml6-module-qtqml-workerscript qml6-module-qtquick-controls qml6-module-qtquick-templates qml6-module-qtquick-window qml6-module-qtwebchannel qml6-module-qtwebengine qml6-module-qtwebengine-controlsdelegates qml6-module-qtwebview qt6-base-private-dev qt6-webengine-private-dev unzip wget yasm zlib1g-dev
|
||||
mkdir ~/jmp; cd ~/jmp
|
||||
git clone https://github.com/mpv-player/mpv-build.git
|
||||
cd mpv-build
|
||||
@@ -58,7 +58,7 @@ rm -rf ~/jmp/
|
||||
|
||||
Install dependencies:
|
||||
```bash
|
||||
sudo dnf install autoconf automake libtool freetype-devel libXrandr-devel libvdpau-devel libva-devel mesa-libGL-devel libdrm-devel libX11-devel mesa-libEGL-devel yasm alsa-lib pulseaudio-libs-devel zlib-devel fribidi-devel git gnutls-devel mesa-libGLU-devel SDL2-devel cmake wget python g++ qt-devel libcec-devel qt6-qtbase-devel curl unzip qt6-qtwebchannel-devel qt6-qtwebengine-devel mpv.x86_64 qt6-qtbase.x86_64 meson.noarch ninja-build.x86_64 qt6-qtbase-private-devel mpv-libs.x86_64 mpv-devel qt6-qtdeclarative nasm libatomic libshaderc mpvqt-devel
|
||||
sudo dnf install autoconf automake libtool freetype-devel libXrandr-devel libvdpau-devel libva-devel mesa-libGL-devel libdrm-devel libX11-devel mesa-libEGL-devel yasm alsa-lib pulseaudio-libs-devel zlib-devel fribidi-devel git gnutls-devel mesa-libGLU-devel SDL2-devel cmake wget g++ qt-devel libcec-devel qt6-qtbase-devel curl unzip qt6-qtwebchannel-devel qt6-qtwebengine-devel mpv.x86_64 qt6-qtbase.x86_64 meson.noarch ninja-build.x86_64 qt6-qtbase-private-devel mpv-libs.x86_64 mpv-devel qt6-qtdeclarative nasm libatomic libshaderc mpvqt-devel
|
||||
```
|
||||
|
||||
Build commands for Fedora:
|
||||
@@ -139,12 +139,6 @@ cmake -B build -G Ninja -DUSE_STATIC_MPVQT=ON
|
||||
cmake --build build
|
||||
```
|
||||
|
||||
To create redistributable bundle, some library paths need to be fixed. At the project root directory, run:
|
||||
|
||||
```bash
|
||||
python3 ./scripts/fix-install-names.py "./build/src/Jellyfin Desktop.app"
|
||||
```
|
||||
|
||||
## Log File Location
|
||||
|
||||
- Windows: `%LOCALAPPDATA%\Jellyfin Desktop\logs`
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
start "" "Jellyfin Desktop.exe" "--disable-gpu"
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
The use and distribution terms for this software are covered by the
|
||||
Common Public License 1.0 (http://opensource.org/licenses/cpl1.0.php)
|
||||
which can be found in the file CPL.TXT at the root of this distribution.
|
||||
By using this software in any fashion, you are agreeing to be bound by
|
||||
the terms of this license.
|
||||
|
||||
You must not remove this notice, or any other, from this software.
|
||||
-->
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<UI>
|
||||
<Dialog Id="JellyfinExitDialog" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">
|
||||
<Control Id="Finish" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUIFinish)" />
|
||||
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUICancel)" />
|
||||
<Control Id="Bitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="234" TabSkip="no" Text="!(loc.ExitDialogBitmap)" />
|
||||
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUIBack)" />
|
||||
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
|
||||
<Control Id="Description" Type="Text" X="135" Y="70" Width="220" Height="40" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogDescription)" />
|
||||
<Control Id="Title" Type="Text" X="135" Y="20" Width="220" Height="60" Transparent="yes" NoPrefix="yes" Text="!(loc.ExitDialogTitle)" />
|
||||
<Control Id="OptionalText" Type="Text" X="135" Y="110" Width="220" Height="80" Transparent="yes" NoPrefix="yes" Hidden="yes" Text="[WIXUI_EXITDIALOGOPTIONALTEXT]">
|
||||
<Condition Action="show">WIXUI_EXITDIALOGOPTIONALTEXT AND NOT Installed</Condition>
|
||||
</Control>
|
||||
<!--Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="190" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]">
|
||||
<Condition Action="show">WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed</Condition>
|
||||
</Control-->
|
||||
<Control Id="LaunchCheckBox" Type="CheckBox" X="10" Y="243" Width="170" Height="17" Property="LAUNCHAPPONEXIT" Hidden="yes" CheckBoxValue="1" Text="!(loc.LaunchApplication)">
|
||||
<Condition Action="show">NOT Installed</Condition>
|
||||
</Control>
|
||||
</Dialog>
|
||||
|
||||
<InstallUISequence>
|
||||
<Show Dialog="JellyfinExitDialog" OnExit="success" Overridable="yes" />
|
||||
</InstallUISequence>
|
||||
|
||||
<AdminUISequence>
|
||||
<Show Dialog="JellyfinExitDialog" OnExit="success" Overridable="yes" />
|
||||
</AdminUISequence>
|
||||
</UI>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
File renamed without changes.
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
Vendored
-1
@@ -27,7 +27,6 @@ Build-Depends: debhelper (>= 10),
|
||||
libsdl2-dev,
|
||||
cmake,
|
||||
wget,
|
||||
python3,
|
||||
g++,
|
||||
qt6-webengine-dev,
|
||||
qt6-declarative-dev,
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
./configure \
|
||||
-prefix $HOME/Qt/Qt5.6.0-alpha-konvergo \
|
||||
-opensource \
|
||||
-confirm-license \
|
||||
-nomake tests \
|
||||
-nomake examples \
|
||||
-optimized-qmake \
|
||||
-opengl desktop \
|
||||
-no-feature-bearermanagement \
|
||||
-no-gif \
|
||||
-qt-libpng \
|
||||
-qt-libjpeg \
|
||||
-no-openssl \
|
||||
-securetransport \
|
||||
-qt-pcre \
|
||||
-no-glib \
|
||||
-no-cups \
|
||||
-pch \
|
||||
-no-eglfs \
|
||||
-framework \
|
||||
-release \
|
||||
-force-debug-info \
|
||||
-no-dbus \
|
||||
-skip qtconnectivity \
|
||||
-skip qtdoc \
|
||||
-skip qtgraphicaleffects \
|
||||
-skip qtmultimedia \
|
||||
-skip qtsensors \
|
||||
-skip qtserialport \
|
||||
-skip qt3d
|
||||
@@ -1,57 +0,0 @@
|
||||
#!/usr/bin/python -u
|
||||
#
|
||||
# This creates a Qt resources XML file.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# build-qt-resources.py output.qrc virtualpath1=realpath1 virtualpath2=realpath2 ... virtualpathN=realpathN
|
||||
#
|
||||
# "output.qrc" will be overwritten! Each argument after the output file
|
||||
# consists of a virtual path, which defines the resource prefix, and a real
|
||||
# path (i.e. an actual file system path), which sets the source file or
|
||||
# directory. If the real path is a file, the virtual path sets the full
|
||||
# virtual file name. If the real path is a directory, the directory is
|
||||
# scanned recursively, and all files are added, using the virtual path as
|
||||
# prefix.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import stat
|
||||
import io
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
sys.exit(1)
|
||||
|
||||
result = "<RCC>\n"
|
||||
|
||||
def add_files(virtualpath, filepath):
|
||||
global result
|
||||
|
||||
fstat = os.stat(filepath)
|
||||
if stat.S_ISDIR(fstat.st_mode):
|
||||
for item in os.listdir(filepath):
|
||||
add_files(os.path.join(virtualpath, item), os.path.join(filepath, item))
|
||||
else:
|
||||
dirname, fname = os.path.split(virtualpath)
|
||||
result += (('<qresource prefix=\"%s\">\n' +
|
||||
' <file alias=\"%s\">%s</file>\n' +
|
||||
'</qresource>\n') % (dirname, fname, filepath))
|
||||
|
||||
for item in sys.argv[2:]:
|
||||
virtualpath, filepath = item.split("=", 1)
|
||||
add_files(virtualpath, filepath)
|
||||
|
||||
result += "</RCC>"
|
||||
|
||||
result = result.encode("utf8")
|
||||
|
||||
try:
|
||||
with open(sys.argv[1], "rb") as infile:
|
||||
if infile.read() == result:
|
||||
# They're the same -> prevent cmake from rebuilding resources.
|
||||
sys.exit(0)
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
outfile = open(sys.argv[1], "wb")
|
||||
outfile.write(result)
|
||||
@@ -1,6 +0,0 @@
|
||||
cd %BUILD_DIR% || exit /b
|
||||
|
||||
%CMAKE_DIR%\cmake -DDEPENDENCY_TOKEN=%DEP_SECRET% -DCRASHDUMP_SECRET=%CD_SECRET% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=output -DDEPENDENCY_UNTAR_DIR=c:\jenkins\pmp-deps .. -G Ninja -DCODE_SIGN=ON -DENABLE_CODECS=on || exit /b
|
||||
|
||||
ninja || exit /b
|
||||
ninja windows_package || exit /b
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/usr/bin/env python -u
|
||||
|
||||
# simple script that takes data on stdin and outputs bz2 compressed data
|
||||
# just to avoid having to install bzip2.exe on windows platforms
|
||||
|
||||
import bz2, os, sys
|
||||
|
||||
bufsize=4096
|
||||
|
||||
if __name__ == "__main__":
|
||||
compress = bz2.BZ2Compressor()
|
||||
data = sys.stdin.read(bufsize)
|
||||
while data:
|
||||
cdata = compress.compress(data)
|
||||
if cdata:
|
||||
sys.stdout.write(cdata)
|
||||
data = sys.stdin.read(bufsize)
|
||||
|
||||
cdata = compress.flush()
|
||||
if cdata:
|
||||
sys.stdout.write(cdata)
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
DUMP_SYMS=$1
|
||||
COMPRESS=$2
|
||||
SOURCE=$3
|
||||
TARGET=$4
|
||||
|
||||
echo $SOURCE
|
||||
|
||||
DSYM_ARG=""
|
||||
DSYM_FILE=""
|
||||
BASESOURCE=$(basename "$SOURCE")
|
||||
if [ -e "$BASESOURCE.dSYM" ]; then
|
||||
DSYM_ARG="-g"
|
||||
DSYM_FILE="$BASESOURCE.dSYM"
|
||||
fi
|
||||
|
||||
echo $DUMP_SYMS $DSYM_ARG $DSYM_FILE $SOURCE | $COMPRESS > $TARGET
|
||||
$DUMP_SYMS $DSYM_ARG "$DSYM_FILE" "$SOURCE" | $COMPRESS > "$TARGET"
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf symbols
|
||||
mkdir symbols
|
||||
|
||||
dylibs=$(find lib plugins -type f -name *.dylib)
|
||||
frameworks=$(find lib -type d -name *.framework)
|
||||
|
||||
echo "Dumping symbols for dylibs..."
|
||||
for lib in $dylibs; do
|
||||
libname=$(basename $lib)
|
||||
echo $libname
|
||||
dsymutil -o symbols/$libname.dSYM $lib &>/dev/null
|
||||
~/dump_syms -g symbols/$libname.dSYM $lib 2> /dev/null | xz -9 -e - 1> symbols/$libname.symbols.xz
|
||||
done
|
||||
|
||||
for f in $frameworks; do
|
||||
frameworkname=$(basename $f)
|
||||
frameworkfname="${frameworkname%.*}"
|
||||
ffname="$f/$frameworkfname"
|
||||
if [ -e $ffname ]; then
|
||||
echo $frameworkname
|
||||
dsymutil -o symbols/$frameworkname.dSYM $ffname
|
||||
~/dump_syms -g symbols/$frameworkname.dSYM $ffname 2>/dev/null | xz -9 -e - > symbols/$frameworkname.symbols.xz
|
||||
fi
|
||||
done
|
||||
@@ -1,61 +0,0 @@
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import argparse
|
||||
from collections import deque
|
||||
import subprocess
|
||||
import shutil
|
||||
import platform
|
||||
|
||||
|
||||
def main(argv=tuple(sys.argv[1:])):
|
||||
arg_parser = argparse.ArgumentParser(description='Fix third party library paths in .app bundles.')
|
||||
arg_parser.add_argument('bundle', metavar='BUNDLE', type=str, nargs=1)
|
||||
arguments = arg_parser.parse_args(argv)
|
||||
|
||||
bundle_path = Path(arguments.bundle[0])
|
||||
framework_path = bundle_path / 'Contents' / 'Frameworks'
|
||||
rpath_str = '/usr/local/lib'
|
||||
if platform.machine() == 'arm64':
|
||||
rpath_str = '/opt/homebrew/lib'
|
||||
framework_libs = set(file.name for file in framework_path.glob('*.dylib')).union(set(file.name for file in framework_path.glob('*.so')))
|
||||
libs_to_fix = deque()
|
||||
libs_to_fix.extend(file for file in bundle_path.glob('**/*.dylib'))
|
||||
libs_to_fix.extend(file for file in bundle_path.glob('**/*.so'))
|
||||
while libs_to_fix:
|
||||
lib = libs_to_fix.popleft()
|
||||
# find the dependencies of the library
|
||||
result = subprocess.check_output(['otool', '-L', str(lib.resolve())], stderr=subprocess.STDOUT).decode('utf-8')
|
||||
for dependency in result.splitlines():
|
||||
dependency = dependency.strip().lstrip()
|
||||
if dependency.startswith('/usr/local') or dependency.startswith('/opt/homebrew') or dependency.startswith('@rpath') or dependency.startswith('@loader_path'):
|
||||
# cut off trailing compatibility string
|
||||
dependency_str = dependency.split(' (compatibility')[0].strip()
|
||||
if dependency.startswith('@rpath'):
|
||||
dependency = dependency_str.replace("@rpath", rpath_str)
|
||||
dependency = Path(dependency)
|
||||
elif dependency.startswith('@loader_path'):
|
||||
dependency = dependency_str.replace("@loader_path", rpath_str)
|
||||
dependency = Path(dependency)
|
||||
dependency_name = dependency.name
|
||||
dependency = (Path(rpath_str) / dependency_name).resolve()
|
||||
else:
|
||||
dependency = Path(dependency_str)
|
||||
|
||||
# if somehow macdeployqt didn't copy the lib for us, we do a manual copy
|
||||
if dependency.name not in framework_libs:
|
||||
shutil.copy(str(dependency.resolve()), str((framework_path / dependency.name).resolve()))
|
||||
framework_libs.add(dependency.name)
|
||||
# add the newly added library in to the to fix queue
|
||||
libs_to_fix.append(framework_path / dependency.name)
|
||||
print((framework_path / dependency.name).resolve())
|
||||
print(f'Copied {dependency} to {framework_path / dependency.name}')
|
||||
|
||||
# now we fix the path using install_name_tool
|
||||
target = f'@executable_path/../Frameworks/{dependency.name}'
|
||||
print(f'Fixing dependency {dependency_str} of {lib} to {target}')
|
||||
subprocess.run(['install_name_tool', '-id', target, lib])
|
||||
subprocess.run(['install_name_tool', '-change', dependency_str, target, lib])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,35 +0,0 @@
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import os
|
||||
import argparse
|
||||
from collections import deque
|
||||
import subprocess
|
||||
import shutil
|
||||
|
||||
def main(argv=tuple(sys.argv[1:])):
|
||||
arg_parser = argparse.ArgumentParser(description='Fix third party library paths in .app bundles.')
|
||||
arg_parser.add_argument('bundle', metavar='BUNDLE', type=str, nargs=1)
|
||||
arguments = arg_parser.parse_args(argv)
|
||||
|
||||
bundle_path = Path(arguments.bundle[0])
|
||||
print(bundle_path)
|
||||
webengine_path = bundle_path / 'Contents' / 'Frameworks' / 'QtWebEngineCore.framework' / 'Helpers' / 'QtWebEngineProcess.app'
|
||||
link_path = webengine_path / 'Contents' / 'Frameworks'
|
||||
bin_to_fix = webengine_path / 'Contents' / 'MacOS' / 'QtWebEngineProcess'
|
||||
|
||||
os.symlink('../../../../../../../Frameworks', link_path)
|
||||
|
||||
result = subprocess.check_output(['otool', '-L', str(bin_to_fix.resolve())],stderr=subprocess.STDOUT).decode('utf-8')
|
||||
for dependency in result.splitlines():
|
||||
dependency = dependency.strip().lstrip()
|
||||
if dependency.startswith('/opt/homebrew') or dependency.startswith('/usr/local'):
|
||||
# cut off trailing compatibility string
|
||||
dependency_str = dependency.split(' (compatibility')[0].strip()
|
||||
dependency_framework_str = dependency_str.split('/lib')[1].strip()
|
||||
dependency_framework = Path(dependency_framework_str)
|
||||
target = f'@executable_path/../Frameworks{dependency_framework_str}'
|
||||
subprocess.run(['install_name_tool', '-id', target, bin_to_fix])
|
||||
subprocess.run(['install_name_tool', '-change', dependency_str, target, bin_to_fix])
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,61 +0,0 @@
|
||||
#!/usr/bin/python
|
||||
import subprocess, os, sys, shutil, Queue, fnmatch
|
||||
|
||||
def exec_cmd(args, env={}, supress_output=False):
|
||||
cmd = subprocess.Popen(args, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, env = env)
|
||||
output = ''
|
||||
while True:
|
||||
out = cmd.stdout.read(1)
|
||||
if out == '' and cmd.poll() != None:
|
||||
break
|
||||
if out != '':
|
||||
if not supress_output:
|
||||
sys.stdout.write(out)
|
||||
output += out
|
||||
if cmd.wait() != 0:
|
||||
raise Exception("Command failed: \"%s\"" % " ".join(args), output)
|
||||
return output
|
||||
|
||||
binaries = {}
|
||||
|
||||
def install_libraries(binary):
|
||||
if binaries.has_key(binary): return []
|
||||
binaries[binary] = True
|
||||
other_binaries = []
|
||||
|
||||
out = exec_cmd(["otool", "-L", binary], supress_output=True)
|
||||
for line in out.split('\n'):
|
||||
line = line.strip()
|
||||
if line.find("dylib") != -1 and (line.startswith('@executable_path') or line.find("libQt6") != -1):
|
||||
file = line.split('/')[-1].split(' ')[0]
|
||||
if line.startswith("@executable_path"):
|
||||
src = os.path.join(sys.argv[1], "dependencies/darwin-x86_64/lib", file)
|
||||
else:
|
||||
src = line.split(" (")[0]
|
||||
|
||||
dst = os.path.join(sys.argv[2], "Konvergo.app", "Contents", "Frameworks", file)
|
||||
if os.path.exists(src):
|
||||
if (not os.path.exists(dst) or os.path.getsize(dst) != os.path.getsize(src)):
|
||||
print "-- Installing %s" % file
|
||||
shutil.copyfile(src, dst)
|
||||
|
||||
other_binaries.append(src)
|
||||
|
||||
return other_binaries
|
||||
|
||||
queue = Queue.Queue()
|
||||
|
||||
# Add the top-level binaries.
|
||||
for b in ['Contents/MacOS/Konvergo']:
|
||||
queue.put(os.path.join(sys.argv[2], "Konvergo.app", b))
|
||||
|
||||
for root, dirs, files in os.walk(os.path.join(sys.argv[2], "Konvergo.app", "Contents", "Frameworks", "vlc")):
|
||||
for f in files:
|
||||
path = os.path.join(root, f)
|
||||
queue.put(path)
|
||||
|
||||
while queue.empty() == False:
|
||||
binary = queue.get()
|
||||
other_binaries = install_libraries(binary)
|
||||
for b in other_binaries:
|
||||
queue.put(b)
|
||||
@@ -1,3 +0,0 @@
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PMP_VC_ARCH%
|
||||
c:\msys32\mingw64\bin\gendef.exe - bin\mpv*.dll > bin\mpv-1.def
|
||||
lib /def:bin\mpv-1.def /out:lib\mpv.lib /MACHINE:%PMP_LIB_ARCH%
|
||||
+12
-7
@@ -57,14 +57,20 @@ file(GLOB_RECURSE RESOURCE_FILES ${CMAKE_SOURCE_DIR}/resources/*)
|
||||
file(GLOB_RECURSE NATIVE_FILES ${CMAKE_SOURCE_DIR}/native/*)
|
||||
|
||||
# generate resources.qrc from directory tree listings
|
||||
set(QRC_MAPPINGS
|
||||
"/=${CMAKE_SOURCE_DIR}/resources/"
|
||||
"ui/webview.qml=${CMAKE_SOURCE_DIR}/src/ui/webview.qml"
|
||||
"/web-client/extension=${CMAKE_SOURCE_DIR}/native/"
|
||||
)
|
||||
string(REPLACE ";" "|" QRC_MAPPINGS_STR "${QRC_MAPPINGS}")
|
||||
add_custom_command(OUTPUT resources.qrc
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/build-qt-resources.py
|
||||
${CMAKE_CURRENT_BINARY_DIR}/resources.qrc
|
||||
/=${CMAKE_SOURCE_DIR}/resources/
|
||||
ui/webview.qml=${CMAKE_SOURCE_DIR}/src/ui/webview.qml
|
||||
/web-client/extension=${CMAKE_SOURCE_DIR}/native/
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DOUTPUT=${CMAKE_CURRENT_BINARY_DIR}/resources.qrc
|
||||
"-DMAPPINGS=${QRC_MAPPINGS_STR}"
|
||||
-P ${CMAKE_SOURCE_DIR}/CMakeModules/GenerateQtResources.cmake
|
||||
VERBATIM
|
||||
COMMENT "Creating resources.qrc"
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/scripts/build-qt-resources.py
|
||||
DEPENDS ${CMAKE_SOURCE_DIR}/CMakeModules/GenerateQtResources.cmake
|
||||
${RESOURCE_FILES}
|
||||
${CMAKE_SOURCE_DIR}/src/ui/webview.qml
|
||||
${NATIVE_FILES}
|
||||
@@ -179,7 +185,6 @@ target_link_libraries(jmp_core
|
||||
${EXTRA_LIBS}
|
||||
${X11_LIBRARIES}
|
||||
${X11_Xrandr_LIB}
|
||||
${ICU_LIBRARIES}
|
||||
${CMAKE_THREAD_LIBS_INIT}
|
||||
${RPI_LIBS}
|
||||
${MINIZIP_LIBS}
|
||||
|
||||
Reference in new issue
Block a user