From 780225198d9bb56ad164c3ea15a727715d0cbed3 Mon Sep 17 00:00:00 2001 From: Christian Hohnstaedt Date: Thu, 25 May 2023 13:39:07 +0200 Subject: [PATCH] macos CMake defaults for local arch, SDK and brew-Qt The universal binary with older SDK and aqt-Qt will be built by the release/build-mac.sh script --- CMakeLists.txt | 8 -------- INSTALL.mac | 8 ++++++-- README.md | 8 ++++---- release/build-mac.sh | 19 ++++++++++--------- widgets/XcaWarning.cpp | 1 - 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a2578e4..67cb5e8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,5 @@ cmake_minimum_required(VERSION 3.16.0) -set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64" CACHE STRING "") - project(xca DESCRIPTION "X Certificate and Key management" HOMEPAGE_URL http://xca.hohnstaedt.de @@ -82,12 +80,6 @@ set(QT Qt${QT_VERSION_MAJOR}) find_package(${QT} REQUIRED COMPONENTS Core Widgets Sql Help LinguistTools) message(STATUS "Using ${QT} with version ${QT_VERSION}") -if (${QT_VERSION} VERSION_LESS 6.5.0) - set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14) -else() - set(CMAKE_OSX_DEPLOYMENT_TARGET 11) -endif() - get_target_property(qmake_executable ${QT}::qmake IMPORTED_LOCATION) get_filename_component(_qt_bin_dir "${qmake_executable}" DIRECTORY) diff --git a/INSTALL.mac b/INSTALL.mac index 62424739..e5dcc382 100644 --- a/INSTALL.mac +++ b/INSTALL.mac @@ -1,7 +1,7 @@ # This installation is for building macos 10.13 compatible releases including # database drivers. IOW: For me -brew install python3 cmake +brew install python3 cmake pkg-config # Compile SQL Drivers if necessary: @@ -14,11 +14,15 @@ brew install mariadb-connector-c postgresql unixodbc MYSQL_LIBDIR=$(pkg-config --variable=prefix libmariadb)/lib/mariadb \ MYSQL_INCDIR=$(pkg-config --variable=prefix libmariadb)/include/mariadb/ \ MYSQL_LIBS="-lmariadb" \ - PSQL_PREFIX=$(brew --cellar postgresql)/12.4/ \ + PSQL_PREFIX=$(brew --prefix)/opt/postgresql@14 \ ODBC_PREFIX=$(pkg-config --variable=prefix odbc) make sub-plugins +https://github.com/PostgresApp/PostgresApp/releases/download/v2.6.2/Postgres-2.6.2-14.dmg + + + # Compile OpenSSL #! /bin/sh diff --git a/README.md b/README.md index d57f564a..84384299 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ XCA can be used with Xcode after initializing the directory with: - Install Qt, cmake and the MinGW toolchain ``` aqt install-qt windows desktop 5.15.2 win64_mingw81 - aqt install-tool windows desktop tools\_cmake qt.tools.cmake.win64 - aqt install-tool windows desktop tools\_mingw qt.tools.win64\_mingw810 - aqt install-tool windows desktop tools\_vcredist qt.tools.vcredist_64 + aqt install-tool windows desktop tools_cmake qt.tools.cmake.win64 + aqt install-tool windows desktop tools_mingw qt.tools.win64\_mingw810 + aqt install-tool windows desktop tools_vcredist qt.tools.vcredist_64 ``` - If 7z is missing, install it from the store. `7-Zip File Manager (unofficial)` or from 7-zip.org - Add cmake, MinGW, OpenSSL and Qt5 to your Path @@ -106,4 +106,4 @@ XCA can be used with Xcode after initializing the directory with: - Configure: `cmake -B build -G "MinGW Makefiles" xca` - Make: `cmake --build build -j5` - Create the Portable App: `cmake --build build -t install` -- Build the MSI installer (and the Portable App): `cd build && cpack` +- Build the MSI installer (and the Portable App): `cd build ; cpack` diff --git a/release/build-mac.sh b/release/build-mac.sh index 56b36558..9801b95b 100755 --- a/release/build-mac.sh +++ b/release/build-mac.sh @@ -14,30 +14,31 @@ do_openssl() -mmacosx-version-min="$SDK" make -j $JOBS build_libs && make install_sw ) - PARTS_crypto="$PARTS_crypto ${OSSL}-${arch}/libcrypto.3.dylib" - PARTS_ssl="$PARTS_ssl ${OSSL}-${arch}/libssl.3.dylib" + PARTS_crypto="$PARTS_crypto ${OSSL}-${arch}/libcrypto.${OSSL_MAJOR}.dylib" + PARTS_ssl="$PARTS_ssl ${OSSL}-${arch}/libssl.${OSSL_MAJOR}.dylib" done - rm -f "$INSTALL"/lib/libcrypto.3.dylib "$INSTALL"/lib/libssl.3.dylib - lipo -create -output "$INSTALL_DIR"/lib/libcrypto.3.dylib $PARTS_crypto - lipo -create -output "$INSTALL_DIR"/lib/libssl.3.dylib $PARTS_ssl + rm -f "$INSTALL"/lib/libcrypto.3.dylib "$INSTALL"/lib/libssl.${OSSL_MAJOR}.dylib + lipo -create -output "$INSTALL_DIR"/lib/libcrypto.${OSSL_MAJOR}.dylib $PARTS_crypto + lipo -create -output "$INSTALL_DIR"/lib/libssl.${OSSL_MAJOR}.dylib $PARTS_ssl } -OSSL="openssl-3.0.8" +OSSL_MAJOR="1.1" +OSSL="openssl-1.1.1t" XCA_DIR="$(cd `dirname $0`/.. && pwd)" TOP_DIR="`dirname $XCA_DIR`" BUILDDIR="$TOP_DIR/osx-release" INSTALL_DIR="$TOP_DIR/install" -SDK="10.14" +SDK="11" JOBS=7 test -x $INSTALL_DIR/lib/libcrypto.dylib || (cd $TOP_DIR && do_openssl ) cmake -B "$BUILDDIR" "$XCA_DIR" \ - -DOPENSSL_ROOT_DIR="$INSTALL_DIR" \ -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \ - -DCMAKE_PREFIX_PATH="$TOP_DIR/6.5.0/macos/lib/cmake" + -DCMAKE_PREFIX_PATH="$TOP_DIR/6.5.0/macos/lib/cmake;$INSTALL_DIR" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=$SDK cmake --build "$BUILDDIR" -j$JOBS diff --git a/widgets/XcaWarning.cpp b/widgets/XcaWarning.cpp index 91017657..408e30bc 100644 --- a/widgets/XcaWarning.cpp +++ b/widgets/XcaWarning.cpp @@ -72,7 +72,6 @@ void xcaWarningGui::error(const QString &msg) box.addButton(QMessageBox::Apply, tr("Copy to Clipboard")); box.addButton(QMessageBox::Ok); #if (QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) && defined(Q_OS_MAC)) -#warning MAC_650 box.show(); QCoreApplication::processEvents(QEventLoop::AllEvents); #else