From 9e009626bc3f6ef3ef2e6f3aacba87956884c5c3 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Sat, 28 Dec 2024 22:23:13 +0100 Subject: [PATCH] WIP1 --- .github/workflows/ci.yml | 6 ++++-- CMakeLists.txt | 22 ++++++++++++++++++++++ flatpak/net.christianbeier.MultiVNC.yml | 4 ++++ macos/README.md | 2 +- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cff3de0..8fb91f3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,7 @@ jobs: - name: Install MacOS Build Dependencies if: ${{ matrix.os == 'macos-latest' }} run: | - brew uninstall --ignore-dependencies gnutls libgcrypt - brew install wxwidgets + brew install wxwidgets coreutils - name: Install Windows Build Dependencies if: ${{ matrix.os == 'windows-latest' }} uses: johnwason/vcpkg-action@v6 @@ -37,6 +36,9 @@ jobs: pkgs: wxwidgets gettext[tools] triplet: x64-windows token: ${{ github.token }} + - name: Prepare LibreSSL + run: | + ./prepareLibreSSL.sh - name: Build run: | mkdir build diff --git a/CMakeLists.txt b/CMakeLists.txt index 11f88503..929c8092 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,10 +28,32 @@ message("-----wxServDisc-----") set(WXSERVDISC_INSTALL OFF CACHE BOOL "Set to OFF to not include wxservdisc artifacts in install") add_subdirectory(libwxservdisc/src) +# libressl +message("-----LibreSSL-----") +set(LIBRESSL_SKIP_INSTALL ON CACHE BOOL "Skip installation") +set(LIBRESSL_APPS OFF CACHE BOOL "Build apps") +set(LIBRESSL_TESTS OFF CACHE BOOL "Build tests") +set(libssl_src_DIR ${CMAKE_SOURCE_DIR}/libressl) +set(libssl_build_DIR ${CMAKE_BINARY_DIR}/libssl) +# adds a source subdir with specifying a build output dir +add_subdirectory(${libssl_src_DIR} ${libssl_build_DIR}) +# set these variables so Findssl can find the library +set(OPENSSL_SSL_LIBRARY ${libssl_build_DIR}/ssl/libssl.a CACHE FILEPATH "") +set(OPENSSL_CRYPTO_LIBRARY ${libssl_build_DIR}/crypto/libcrypto.a CACHE FILEPATH "") +set(OPENSSL_INCLUDE_DIR ${libssl_src_DIR}/include CACHE PATH "") +# set include directories so dependent code can find the headers +include_directories( + ${CMAKE_BINARY_DIR}/include # generated headers in there + ${libssl_src_DIR}/include +) + # libvncclient message("-----LibVNCClient-----") set(LIBVNCSERVER_INSTALL OFF CACHE BOOL "Set to OFF to not include libvncserver artifacts in install") set(WITH_EXAMPLES OFF CACHE BOOL "Set to OFF to not build libvncserver examples") +# disable looking for GnuTLS and grcypt to only have LibreSSL as above +set(WITH_GNUTLS OFF CACHE BOOL "Search for the GnuTLS secure communications library to support TLS") +set(WITH_GCRYPT OFF CACHE BOOL "Search for Libgcrypt to use as crypto backend") add_subdirectory(libvncserver) diff --git a/flatpak/net.christianbeier.MultiVNC.yml b/flatpak/net.christianbeier.MultiVNC.yml index f1c73a01..61569ba1 100644 --- a/flatpak/net.christianbeier.MultiVNC.yml +++ b/flatpak/net.christianbeier.MultiVNC.yml @@ -39,6 +39,10 @@ modules: buildsystem: cmake-ninja config-opts: - -DCMAKE_BUILD_TYPE=Release + cleanup: + - /lib/libcrypto.a + - /lib/libssl.a + - /lib/libtls.a sources: - type: dir path: .. diff --git a/macos/README.md b/macos/README.md index ca3bcca5..07220ddf 100644 --- a/macos/README.md +++ b/macos/README.md @@ -3,7 +3,7 @@ For the time being, we're building an Intel binary only. Universal builds to come later. - Install build tools: `brew install cmake gettext` -- Install build dependencies: `brew install wxwidgets jpeg-turbo openssl` +- Install build dependencies: `brew install wxwidgets jpeg-turbo` - Building a release app bundle, [signing the app](https://developer.apple.com/documentation/xcode/creating-distribution-signed-code-for-the-mac), [building an installer package for App Store distribution](https://developer.apple.com/documentation/xcode/packaging-mac-software-for-distribution) as well as [validating and uploading the package](https://help.apple.com/asc/appsaltool) is all done by the `build-sign-validate-upload.sh` script.