Skip to content

Commit 4c3c5ee

Browse files
OpenSSL usage in GitHub artifacts fixed (#1883)
1 parent 26fd6d8 commit 4c3c5ee

File tree

7 files changed

+139
-89
lines changed

7 files changed

+139
-89
lines changed

.github/workflows/windows.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,28 @@ jobs:
7474

7575
- name: 📥 Install latest CMake and Ninja
7676
uses: lukka/get-cmake@latest
77+
with:
78+
cmakeVersion: latestrc
79+
ninjaVersion: latest
7780

7881
- name: 🛠️ Setup MSVC
7982
uses: ilammy/msvc-dev-cmd@v1
8083
with:
8184
arch: ${{ matrix.os.architecture }}
8285

86+
- name: 💾 Download OpenSSL 3.x
87+
uses: ethanjli/[email protected]
88+
with:
89+
url: "https://slproweb.com/download/Win64${{ matrix.os.architecture == 'arm64' && 'ARM' || '' }}OpenSSL-3_5_0.exe"
90+
destination: .\installer\openssl.exe
91+
cache-key: OpenSSL
92+
93+
- name: 📥 Install OpenSSL 3.x
94+
shell: powershell
95+
run: |
96+
Start-Process -FilePath ".\installer\openssl.exe" -ArgumentList "/silent", "/verysilent", "/sp-", "/suppressmsgboxes", "/DIR=C:\OpenSSL" -Wait
97+
echo "OPENSSL_ROOT_DIR=C:\OpenSSL" >> $env:GITHUB_ENV
98+
8399
- name: 💾 Download Pre-Build Dependencies
84100
id: dependencies
85101
uses: ./.github/actions/download-pre-built-deps

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.1
1+
2.1.2-beta.1

cmake/linux/BundleLinux.cmake.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set(PROJECT_NAME "@PROJECT_NAME@")
22
set(QMAKE_EXECUTABLE "@QMAKE_EXECUTABLE@")
33
set(OPENSSL_FOUND @OPENSSL_FOUND@)
4+
set(OPENSSL_LIBRARIES "@OPENSSL_LIBRARIES@")
45
set(PYTHON_MODULES_DIR "@PYTHON_MODULES_DIR@")
56
set(PYTHON_VERSION "@PYTHON_VERSION@")
67
set(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
@@ -54,6 +55,15 @@ foreach(PLUGIN "platforms" "sqldrivers" "imageformats" "tls" "wayland-shell-inte
5455
endif()
5556
endforeach()
5657

58+
# Append the OpenSSL library to the list
59+
if(OPENSSL_FOUND AND NOT OPENSSL_LIBRARIES STREQUAL "")
60+
foreach(openssl_lib ${OPENSSL_LIBRARIES})
61+
collect_dependencies(${openssl_lib} PREREQUISITE_LIBS)
62+
gp_append_unique(PREREQUISITE_LIBS ${openssl_lib})
63+
get_filename_component(file_canonical ${openssl_lib} REALPATH)
64+
gp_append_unique(PREREQUISITE_LIBS ${file_canonical})
65+
endforeach()
66+
endif()
5767

5868
# Copy dependencies to 'share/hyperion/lib'
5969
file(INSTALL FILES ${PREREQUISITE_LIBS} DESTINATION "${CMAKE_INSTALL_PREFIX}/share/hyperion/lib")

cmake/windows/BundleWindows.cmake.in

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,49 @@ if(EXISTS @CMAKE_BINARY_DIR@/bin/@PROJECT_NAME@@CMAKE_EXECUTABLE_SUFFIX@)
6060
list(REMOVE_AT DEPENDENCIES 0 1)
6161
endwhile()
6262

63+
# Copy libssl/libcrypto to 'hyperion'
64+
if(OPENSSL_FOUND)
65+
string(REGEX MATCHALL "[0-9]+" openssl_versions "@OPENSSL_VERSION@")
66+
list(GET openssl_versions 0 openssl_version_major)
67+
list(GET openssl_versions 1 openssl_version_minor)
68+
69+
set(open_ssl_version_suffix)
70+
if(openssl_version_major VERSION_EQUAL 1 AND openssl_version_minor VERSION_EQUAL 1)
71+
set(open_ssl_version_suffix "-1_1")
72+
else()
73+
set(open_ssl_version_suffix "-3")
74+
endif()
75+
76+
if("@CMAKE_SYSTEM_PROCESSOR@" MATCHES "aarch64|ARM64|arm64")
77+
string(APPEND open_ssl_version_suffix "-arm64")
78+
elseif(@CMAKE_SIZEOF_VOID_P@ EQUAL 8)
79+
string(APPEND open_ssl_version_suffix "-x64")
80+
endif()
81+
82+
foreach(comp "ssl" "crypto")
83+
find_file(lib${comp}
84+
NAMES
85+
"lib${comp}${open_ssl_version_suffix}.dll"
86+
PATHS
87+
"@_OPENSSL_ROOT_PATHS@"
88+
HINTS
89+
"@OPENSSL_ROOT_DIR@"
90+
$ENV{OPENSSL_ROOT_DIR}
91+
PATH_SUFFIXES
92+
bin
93+
)
94+
95+
if(lib${comp})
96+
file(INSTALL
97+
FILES
98+
${lib${comp}}
99+
DESTINATION
100+
"${CMAKE_INSTALL_PREFIX}/bin"
101+
)
102+
endif()
103+
endforeach()
104+
endif()
105+
63106
# Create a qt.conf file in 'bin' to override hard-coded search paths in Qt plugins
64107
file(WRITE "${CMAKE_INSTALL_PREFIX}/bin/qt.conf" "[Paths]\nPlugins=../lib/\n")
65108

@@ -68,7 +111,12 @@ if(EXISTS @CMAKE_BINARY_DIR@/bin/@PROJECT_NAME@@CMAKE_EXECUTABLE_SUFFIX@)
68111
get_filename_component(TURBOJPEG_DIR "${TurboJPEG_INCLUDE_DIR}" DIRECTORY)
69112
find_file(TURBOJPEG_SHARED NAMES "turbojpeg.dll" PATHS ${TURBOJPEG_DIR} PATH_SUFFIXES bin)
70113
if(TURBOJPEG_SHARED)
71-
file(INSTALL FILES ${TURBOJPEG_SHARED} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
114+
file(INSTALL
115+
FILES
116+
${TURBOJPEG_SHARED}
117+
DESTINATION
118+
"${CMAKE_INSTALL_PREFIX}/bin"
119+
)
72120
endif()
73121
endif()
74122

doc/development/CompileHowto.md

Lines changed: 53 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ cd $HYPERION_HOME
6161

6262
```console
6363
sudo apt-get update
64-
sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libqt5websockets5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libasound2-dev libturbojpeg0-dev libjpeg-dev libssl-dev libftdi1-dev
64+
sudo apt-get install git cmake build-essential ninja-build qtbase5-dev libqt5serialport5-dev libqt5websockets5-dev libqt5sql5-sqlite libqt5svg5-dev libqt5x11extras5-dev libusb-1.0-0-dev python3-dev libasound2-dev libturbojpeg0-dev libjpeg-dev libssl-dev libftdi1-dev
6565
```
6666

6767
**Ubuntu (22.04+) - Qt6 based**
6868

6969
```console
7070
sudo apt-get update
71-
sudo apt-get install git cmake build-essential qt6-base-dev libqt6serialport6-dev libqt6websockets6-dev libxkbcommon-dev libvulkan-dev libgl1-mesa-dev libusb-1.0-0-dev python3-dev libasound2-dev libturbojpeg0-dev libjpeg-dev libssl-dev pkg-config libftdi1-dev
71+
sudo apt-get install git cmake build-essential ninja-build qt6-base-dev libqt6serialport6-dev libqt6websockets6-dev libxkbcommon-dev libvulkan-dev libgl1-mesa-dev libusb-1.0-0-dev python3-dev libasound2-dev libturbojpeg0-dev libjpeg-dev libssl-dev pkg-config libftdi1-dev
7272
```
7373

7474
**For Linux X11/XCB grabber support**
@@ -110,43 +110,51 @@ See [AUR](https://aur.archlinux.org/packages/?O=0&SeB=nd&K=hyperion&outdated=&SB
110110
The following dependencies are needed to build hyperion.ng on fedora.
111111
```console
112112
sudo dnf -y groupinstall "Development Tools"
113-
sudo dnf install python3-devel qt-devel qt6-qtbase-devel qt6-qtserialport-devel qt6-qtwebsockets-devel xrandr xcb-util-image-devel qt5-qtx11extras-devel alsa-lib-devel turbojpeg-devel libusb-devel xcb-util-devel dbus-devel openssl-devel fedora-packager rpmdevtools gcc libcec-devel libftdi1-dev
113+
sudo dnf install ninja-build python3-devel qt-devel qt6-qtbase-devel qt6-qtserialport-devel qt6-qtwebsockets-devel xrandr xcb-util-image-devel qt5-qtx11extras-devel alsa-lib-devel turbojpeg-devel libusb-devel xcb-util-devel dbus-devel openssl-devel fedora-packager rpmdevtools gcc libcec-devel libftdi1-dev
114114
```
115115
After installing the dependencies, you can continue with the compile instructions later on this page (the more detailed way..).
116116

117117
## macOS
118118
To install on OS X you either need [Homebrew](https://brew.sh/) or [Macport](https://www.macports.org/) but Homebrew is the recommended way to install the packages. To use Homebrew, XCode is required as well, use `brew doctor` to check your install.
119119

120120
First you need to install the dependencies for either the QT5 or QT6 build:
121-
####QT5
121+
#### QT5
122122
```console
123-
brew install git qt@5 python3 cmake libusb [email protected] libftdi pkg-config
123+
brew install git qt@5 ninja python3 cmake libusb [email protected] libftdi pkg-config
124124
```
125-
####QT6
125+
#### QT6
126126
```console
127-
brew install git qt python3 cmake libusb openssl@1.1 libftdi pkg-config
127+
brew install git qt ninja python3 cmake libusb openssl@3 libftdi pkg-config
128128
```
129129

130130
## Windows
131-
We assume a 64bit Windows 10. Install the following;
131+
> [!NOTE]
132+
> When downloading, please remember whether you have an x64 or an ARM64 architecture.
133+
134+
We assume a 64bit Windows 11. Install the following:
132135
- [Git](https://git-scm.com/downloads) (Check: Add to PATH)
133-
- [CMake (Windows win64-x64 installer)](https://cmake.org/download/) (Check: Add to PATH)
136+
- [CMake (Windows Installer)](https://cmake.org/download/) (Check: Add to PATH)
134137
- [Visual Studio 2022 Community Edition](https://visualstudio.microsoft.com/downloads/#visual-studio-community-2022)
135138
- Select 'Desktop development with C++'
136-
- On the right, just select `MSVC v143 VS 2022 C++ x64/x86-Buildtools`, `C++ ATL for latest v143 build tools (x86 & x64)` and latest `Windows 10 SDK`. Everything else is not needed.
137-
- [Win64 OpenSSL v1.1.1w](https://slproweb.com/products/Win32OpenSSL.html) ([direct link](https://slproweb.com/download/Win64OpenSSL-1_1_1w.exe))
138-
- [Python 3 (Windows x86-64 executable installer)](https://www.python.org/downloads/windows/) (Check: Add to PATH and Debug Symbols)
139+
- On the right, just select:
140+
- for x64 architecture: `MSVC v143 VS 2022 C++ x64/x86-Buildtools`, `C++ ATL for latest v143 build tools (x86 & x64)`
141+
- for ARM64 architecture: `MSVC v143 VS 2022 C++ ARM64/ARM64EC-Buildtools`, `C++ ATL for latest v143 build tools (ARM64/ARM64EC)`
142+
- and latest `Windows 11 SDK`.
143+
- Everything else is not needed.
144+
- [Win64 OpenSSL](https://slproweb.com/products/Win32OpenSSL.html)
145+
- [x64 direct link](https://slproweb.com/download/Win64OpenSSL-3_5_0.exe)
146+
- [ARM64 direct link](https://slproweb.com/download/Win64ARMOpenSSL-3_5_0.exe)
147+
- [Python 3 Windows installer (64-bit or ARM64)](https://www.python.org/downloads/windows/) (Check: Add to PATH and Debug Symbols)
139148
- Open a console window and execute `pip install aqtinstall`.
140-
- Now we can download Qt to _C:\Qt_ `mkdir c:\Qt && aqt install -O c:\Qt 5.15.2 windows desktop win64_msvc2019_64`
141-
- QT6.2 requires the [Vulkan SDK](https://vulkan.lunarg.com/sdk/home) to be installed
149+
- Now we can download Qt to _C:\Qt_:
150+
- for x64 architecture: `mkdir c:\Qt && aqt install-qt -O c:\Qt windows desktop 6.8.3 win64_msvc2022_64 -m qtserialport qtwebsockets`
151+
- for ARM64 architecture: `mkdir c:\Qt && aqt install-qt -O c:\Qt windows_arm64 desktop 6.8.3 win64_msvc2022_arm64 -m qtserialport qtwebsockets`
142152
- [libjpeg-turbo SDK for Visual C++](https://sourceforge.net/projects/libjpeg-turbo/files/)
143153
- Download the latest 64bit installer (currently `libjpeg-turbo-3.0.1-vc64.exe`) and install to its default location `C:\libjpeg-turbo64`.
144154

145155
### Optional:
146-
- For DirectX9 grabber:
147-
- [DirectX Software Development Kit](https://www.microsoft.com/en-us/download/details.aspx?id=6812) ([direct link](https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe))
148156
- For package creation:
149-
- [NSIS 3.x](https://sourceforge.net/projects/nsis/files/NSIS%203/) ([direct link](https://sourceforge.net/projects/nsis/files/latest/download))
157+
- [Inno Setup 6.x](https://jrsoftware.org/isinfo.php) ([direct link](https://jrsoftware.org/download.php/is.exe?site=1))
150158

151159
# Compiling and installing Hyperion
152160

@@ -165,14 +173,14 @@ git clone --recursive https://github.com/hyperion-project/hyperion.ng.git hyperi
165173
cd hyperion
166174
mkdir build
167175
cd build
168-
cmake -DCMAKE_BUILD_TYPE=Release ..
169-
make -j $(nproc)
176+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
177+
cmake --build .
170178
if this get stucked and dmesg says out of memory try:
171-
make -j 2
179+
cmake --build . -j 2
172180
# optional: install into your system
173-
sudo make install/strip
181+
sudo cmake --build . --target install/strip
174182
# to uninstall (not very well tested, please keep that in mind)
175-
sudo make uninstall
183+
sudo cmake --build . --target uninstall
176184
# ... or run it from compile directory
177185
bin/hyperiond
178186
# webui is located on localhost:8090 or 8091
@@ -195,83 +203,54 @@ On Windows MSVC2022 set it via the CMakeSettings.json:
195203

196204
## The detailed way (with many comments)
197205

198-
**Download:**
199-
Creates hyperion directory and checkout the code from github
206+
### 1. Download:
207+
Checkout the code from GitHub
200208
```console
201-
export HYPERION_DIR="hyperion"
202-
git clone --recursive --depth 1 https://github.com/hyperion-project/hyperion.ng.git "$HYPERION_DIR"
209+
git clone --recursive --depth 1 https://github.com/hyperion-project/hyperion.ng.git hyperion
203210
```
204211

205-
**Preparations:**
212+
### 2. Prepare:
206213
Change into hyperion folder and create a build folder
207214
```console
208-
cd "$HYPERION_DIR"
215+
cd hyperion
209216
mkdir build
210217
cd build
211218
```
212219

213-
**Generate the make files:**
214-
To generate make files with automatic platform detection and default settings:
215-
This should fit to *RPI, x86, amlogic/wetek:
216-
```console
217-
cmake -DCMAKE_BUILD_TYPE=Release ..
218-
```
219-
220-
*Developers on x86* linux should use:
221-
```console
222-
cmake -DPLATFORM=x11-dev -DCMAKE_BUILD_TYPE=Release ..
223-
```
224-
225-
To use framebuffer instead of dispmanx (for example on the *cubox-i*):
226-
```console
227-
cmake -DENABLE_FB=ON -DCMAKE_BUILD_TYPE=Release ..
228-
```
220+
### 3. Configure:
229221

230-
To generate make files on OS X:
222+
> [!IMPORTANT]
223+
> **Windows** developers may need to use the "x64" or "AMR64" native build tools. \
224+
An easy way to do that is to run the shortcut "Native Tools Command
225+
Prompt" for the architecture/version of Visual Studio that you have installed.
231226

232-
Platform should be auto detected and refer to osx, you can also force osx:
227+
To generate the configuration files with automatic platform detection and default settings:
228+
This should fit to **RPI (arm), x64, Windows, macOS**:
233229
```console
234-
cmake -DPLATFORM=osx -DCMAKE_BUILD_TYPE=Release ..
235-
```
236-
237-
To generate files on Windows (Release+Debug capable):
238-
239-
Platform should be auto detected and refer to windows, you can also force windows:
240-
241-
```posh
242-
# You might need to setup MSVC env first
243-
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
244-
cmake -DPLATFORM=windows -G "Visual Studio 17 2022" ..
230+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
245231
```
246232

247-
**Run make to build Hyperion:**
248-
The `-j $(nproc)` specifies the amount of CPU cores to use.
233+
**Developers** should use:
249234
```console
250-
make -j $(nproc)
235+
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
251236
```
252237

253-
On a mac you can use ``sysctl -n hw.ncpu`` to get the number of available CPU cores to use.
254-
238+
### 4. Make it:
255239
```console
256-
make -j $(sysctl -n hw.ncpu)
240+
ninja
257241
```
258242

259-
On Windows run:
260-
```posh
261-
cmake --build . --config Release -- -maxcpucount
262-
```
263-
Maintainer: To build installer, install [NSIS](https://nsis.sourceforge.io/Main_Page) and set env `VCINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC"`
243+
### 5. Additionals (Linux)
264244

265-
**Install hyperion into your system:**
266-
Copy all necessary files to ``/usr/local/share/hyperion``
245+
**Install hyperion into your system:** \
246+
Copies all required files to ``/usr/local/share/hyperion``
267247
```console
268-
sudo make install/strip
248+
sudo cmake --build . --target install/strip
269249
```
270250

271-
If you want to install into another location call this before installing
272-
251+
**If you want to install into another location call this before installing:**
273252
```console
274-
cmake -DCMAKE_INSTALL_PREFIX=/home/pi/apps ..
253+
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/home/pi/apps ..
275254
```
276255
This will install to ``/home/pi/apps/share/hyperion``
277256

libsrc/webserver/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,6 @@ if(ENABLE_MDNS)
4545
target_link_libraries(webserver mdns)
4646
endif()
4747

48-
find_package(OpenSSL QUIET)
49-
if(OPENSSL_FOUND AND TARGET OpenSSL::SSL AND TARGET OpenSSL::Crypto)
50-
target_link_libraries(webserver
51-
OpenSSL::SSL
52-
OpenSSL::Crypto
53-
)
54-
endif()
55-
5648
if(NOT CMAKE_VERSION VERSION_LESS "3.15")
5749
set_target_properties(webserver PROPERTIES
5850
ADDITIONAL_CLEAN_FILES ${CMAKE_BINARY_DIR}/WebConfig.qrc

src/hyperiond/CMakeLists.txt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
5757
${MACOS_BUNDLE_RESOURCE_FILES}
5858
)
5959

60+
find_package(OpenSSL QUIET)
6061
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS DBus QUIET)
6162
target_link_libraries(${PROJECT_NAME}
6263
commandline
@@ -214,23 +215,27 @@ if(WIN32 AND NOT DEFINED ENV{GITHUB_ACTIONS})
214215
set(open_ssl_version_suffix "-3")
215216
endif()
216217

217-
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
218+
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64|ARM64|arm64")
219+
string(APPEND open_ssl_version_suffix "-arm64")
220+
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
218221
string(APPEND open_ssl_version_suffix "-x64")
219222
endif()
220223

221-
get_filename_component(OPENSSL_DIR "${OPENSSL_INCLUDE_DIR}" DIRECTORY)
222224
foreach(comp "ssl" "crypto")
223-
find_file(${comp}
225+
find_file(lib${comp}
224226
NAMES
225227
"lib${comp}${open_ssl_version_suffix}.dll"
226228
PATHS
227-
${OPENSSL_DIR}
229+
${_OPENSSL_ROOT_PATHS}
230+
HINTS
231+
${OPENSSL_ROOT_DIR}
232+
$ENV{OPENSSL_ROOT_DIR}
228233
PATH_SUFFIXES
229234
bin
230235
)
231236

232237
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
233-
COMMAND ${CMAKE_COMMAND} -E copy ${${comp}} $<TARGET_FILE_DIR:${PROJECT_NAME}>
238+
COMMAND ${CMAKE_COMMAND} -E copy ${lib${comp}} $<TARGET_FILE_DIR:${PROJECT_NAME}>
234239
)
235240
endforeach()
236241
endif()

0 commit comments

Comments
 (0)