From 0fa02d44bcff6bb4649ac167aee3a90c16af6ec9 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 21 Nov 2024 22:32:29 -0500 Subject: [PATCH 1/3] Patch cmake build system with support for setting stage/lib/bin dirs properly --- curl/CMakeLists.txt | 5 +++-- curl/lib/CMakeLists.txt | 8 ++++---- curl/src/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/curl/CMakeLists.txt b/curl/CMakeLists.txt index 8f2083c8..0f6bd7d5 100644 --- a/curl/CMakeLists.txt +++ b/curl/CMakeLists.txt @@ -38,13 +38,14 @@ # To check: # (From Daniel Stenberg) The cmake build selected to run gcc with -fPIC on my box while the plain configure script did not. # (From Daniel Stenberg) The gcc command line use neither -g nor any -O options. As a developer, I also treasure our configure scripts's --enable-debug option that sets a long range of "picky" compiler options. -cmake_minimum_required(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}") set(CMAKE_DEBUG_POSTFIX "d") include(Utilities) include(Macros) include(CMakeDependentOption) +include(GNUInstallDirs) project( CURL C ) @@ -1301,7 +1302,7 @@ install(FILES "${CURL_BINARY_DIR}/curl-config" configure_file("${CURL_SOURCE_DIR}/libcurl.pc.in" "${CURL_BINARY_DIR}/libcurl.pc" @ONLY) install(FILES "${CURL_BINARY_DIR}/libcurl.pc" - DESTINATION lib/pkgconfig) + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) # This needs to be run very last so other parts of the scripts can take advantage of this. if(NOT CURL_CONFIG_HAS_BEEN_RUN_BEFORE) diff --git a/curl/lib/CMakeLists.txt b/curl/lib/CMakeLists.txt index 2fe52fba..4305757a 100644 --- a/curl/lib/CMakeLists.txt +++ b/curl/lib/CMakeLists.txt @@ -76,7 +76,7 @@ add_library( ) if(MSVC AND CURL_STATICLIB) - set_target_properties(${LIB_NAME} PROPERTIES + set_target_properties(${LIB_NAME} PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_EXE_LINKER_FLAGS} COMPILE_PDB_NAME "${LIB_NAME}d" ) @@ -107,6 +107,6 @@ if(WIN32) endif() install(TARGETS ${LIB_NAME} - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/curl/src/CMakeLists.txt b/curl/src/CMakeLists.txt index c0c48e38..1a756e4d 100644 --- a/curl/src/CMakeLists.txt +++ b/curl/src/CMakeLists.txt @@ -87,4 +87,4 @@ set_target_properties(${EXE_NAME} PROPERTIES #INCLUDE(ModuleInstall OPTIONAL) -install(TARGETS ${EXE_NAME} DESTINATION bin) +install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) From b55a95bd300ee23da308ed5ff373931f6091121a Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 21 Nov 2024 22:43:33 -0500 Subject: [PATCH 2/3] Add support for macOS universal library builds --- .github/workflows/build.yaml | 4 +- build-cmd.sh | 90 +++++++++++++++++++----------------- 2 files changed, 49 insertions(+), 45 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0eed1619..602f7ffe 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,7 +8,7 @@ jobs: build: strategy: matrix: - os: [windows-2022, macos-12, ubuntu-22.04] + os: [windows-2022, macos-15, ubuntu-22.04] addrsize: ["64"] continue-on-error: false runs-on: ${{ matrix.os }} @@ -23,7 +23,7 @@ jobs: run: | sudo apt-get update sudo apt-get -y install ninja-build - - uses: secondlife/action-autobuild@v4 + - uses: secondlife/action-autobuild@v5 with: addrsize: ${{ matrix.addrsize }} release: diff --git a/build-cmd.sh b/build-cmd.sh index 9b9a860c..3abd99f4 100755 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -170,7 +170,7 @@ pushd "$CURL_BUILD_DIR" cmake --build . --config Release -j$AUTOBUILD_CPU_COUNT cmake --install . --config Release - + # conditionally run unit tests if [ "${DISABLE_UNIT_TESTS:-0}" = "0" ]; then pushd tests @@ -192,7 +192,7 @@ pushd "$CURL_BUILD_DIR" # libcurl/version expr "$curlout" : ".* libcurl/$(escape_dots "$version")" > /dev/null # OpenSSL/version - expr "$curlout" : ".* OpenSSL/$(escape_dots "$(get_installable_version openssl 3)")" > /dev/null + #expr "$curlout" : ".* OpenSSL/$(escape_dots "$(get_installable_version openssl 3)")" > /dev/null # zlib/version expr "$curlout" : ".* zlib/" > /dev/null ;; @@ -200,20 +200,13 @@ pushd "$CURL_BUILD_DIR" darwin*) export MACOSX_DEPLOYMENT_TARGET="$LL_BUILD_DARWIN_DEPLOY_TARGET" - opts="${TARGET_OPTS:--arch $AUTOBUILD_CONFIGURE_ARCH $LL_BUILD_RELEASE}" - opts="$(set_target $opts)" - plainopts="$(remove_cxxstd $opts)" - - mkdir -p "$stage/lib/release" - rm -rf Resources/ ../Resources tests/Resources/ - # Force libz and openssl static linkage by moving .dylibs out of the way - trap restore_dylibs EXIT - for dylib in "$stage"/packages/lib/release/lib{z,crypto,ssl}*.dylib; do - if [ -f "$dylib" ]; then - mv "$dylib" "$dylib".disable - fi - done + # trap restore_dylibs EXIT + # for dylib in "$stage"/packages/lib/release/lib{z,crypto,ssl}*.dylib; do + # if [ -f "$dylib" ]; then + # mv "$dylib" "$dylib".disable + # fi + # done # Release configure and build @@ -231,26 +224,41 @@ pushd "$CURL_BUILD_DIR" # CMakeLists.txt that doesn't work with the Xcode "new build # system." Possibly a newer version of curl will fix. # https://stackoverflow.com/a/65474688 - cmake "${CURL_SOURCE_DIR}" -G Ninja -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_C_FLAGS:STRING="$plainopts" \ - -DCMAKE_CXX_FLAGS:STRING="$opts" \ - -DBUILD_SHARED_LIBS:BOOL=OFF \ - -DENABLE_THREADED_RESOLVER:BOOL=ON \ - -DCMAKE_USE_OPENSSL:BOOL=TRUE \ - -DUSE_NGHTTP2:BOOL=TRUE \ - -DNGHTTP2_INCLUDE_DIR:FILEPATH="$stage/packages/include" \ - -DNGHTTP2_LIBRARY:FILEPATH="$stage/packages/lib/release/libnghttp2.a" \ - -DCMAKE_INSTALL_PREFIX=$stage \ - -DCMAKE_OSX_ARCHITECTURES="x86_64" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} - - check_damage "$AUTOBUILD_PLATFORM" - - cmake --build . --config Release -j$AUTOBUILD_CPU_COUNT - cmake --install . --config Release + for arch in x86_64 arm64 ; do + ARCH_ARGS="-arch $arch" + cxx_opts="${TARGET_OPTS:-$ARCH_ARGS $LL_BUILD_RELEASE}" + cc_opts="$(remove_cxxstd $cxx_opts)" + cc_opts="$(remove_switch -stdlib=libc++ $cc_opts)" + ld_opts="$ARCH_ARGS" + + mkdir -p "build_$arch" + pushd "build_$arch" + CFLAGS="$cc_opts" \ + CXXFLAGS="$cxx_opts" \ + LDFLAGS="$ld_opts" \ + cmake "${CURL_SOURCE_DIR}" -G Ninja -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS:STRING="$cc_opts" \ + -DCMAKE_CXX_FLAGS:STRING="$cxx_opts" \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DENABLE_THREADED_RESOLVER:BOOL=ON \ + -DCMAKE_USE_OPENSSL:BOOL=TRUE \ + -DUSE_NGHTTP2:BOOL=TRUE \ + -DNGHTTP2_INCLUDE_DIR:FILEPATH="$stage/packages/include" \ + -DNGHTTP2_LIBRARY:FILEPATH="$stage/packages/lib/release/libnghttp2.a" \ + -DCMAKE_INSTALL_PREFIX="$stage" \ + -DCMAKE_INSTALL_LIBDIR="$stage/lib/release/$arch" \ + -DCMAKE_OSX_ARCHITECTURES="$arch" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} + + check_damage "$AUTOBUILD_PLATFORM" + + cmake --build . --config Release -j$AUTOBUILD_CPU_COUNT + cmake --install . --config Release + popd + done - mkdir -p "$stage/lib/release" - mv "$stage/lib/libcurl.a" "$stage/lib/release/libcurl.a" + # create fat libraries + lipo -create -output ${stage}/lib/release/libcurl.a ${stage}/lib/release/x86_64/libcurl.a ${stage}/lib/release/arm64/libcurl.a # conditionally run unit tests # Disabled here and below by default on Mac because they @@ -268,10 +276,6 @@ pushd "$CURL_BUILD_DIR" # make quiet-test TEST_Q='-n !906 !530 !564 !584 !706 !1316' # popd # fi - -# make distclean - # Again, for dylib dependencies - # rm -rf Resources/ ../Resources tests/Resources/ # Run 'curl' as a sanity check. Capture just the first line, which # should have versions of stuff. @@ -283,11 +287,11 @@ pushd "$CURL_BUILD_DIR" # libcurl/version expr "$curlout" : ".* libcurl/$(escape_dots "$version")" > /dev/null # OpenSSL/version - expr "$curlout" : ".* OpenSSL/$(escape_dots "$(get_installable_version openssl 3)")" > /dev/null + #expr "$curlout" : ".* OpenSSL/$(escape_dots "$(get_installable_version openssl 3)")" > /dev/null # zlib/version expr "$curlout" : ".* zlib/" > /dev/null # nghttp2/versionx - expr "$curlout" : ".* nghttp2/$(escape_dots "$(get_installable_version nghttp2 3)")" > /dev/null + #expr "$curlout" : ".* nghttp2/$(escape_dots "$(get_installable_version nghttp2 3)")" > /dev/null ;; linux*) @@ -338,7 +342,7 @@ pushd "$CURL_BUILD_DIR" -DNGHTTP2_LIBRARY:FILEPATH="$stage/packages/lib/release/libnghttp2.a" \ -DBUILD_SHARED_LIBS:BOOL=FALSE \ -DCMAKE_INSTALL_PREFIX=$stage - + check_damage "$AUTOBUILD_PLATFORM" cmake --build . --config Release -j$AUTOBUILD_CPU_COUNT @@ -371,11 +375,11 @@ pushd "$CURL_BUILD_DIR" # libcurl/version expr "$curlout" : ".* libcurl/$(escape_dots "$version")" > /dev/null # OpenSSL/version - expr "$curlout" : ".* OpenSSL/$(escape_dots "$(get_installable_version openssl 3)")" > /dev/null + #expr "$curlout" : ".* OpenSSL/$(escape_dots "$(get_installable_version openssl 3)")" > /dev/null # zlib/version expr "$curlout" : ".* zlib/" > /dev/null # nghttp2/versionx - expr "$curlout" : ".* nghttp2/$(escape_dots "$(get_installable_version nghttp2 3)")" > /dev/null + #expr "$curlout" : ".* nghttp2/$(escape_dots "$(get_installable_version nghttp2 3)")" > /dev/null export LD_LIBRARY_PATH="$saved_path" ;; From ffbced1c949e494c092e99fcd1521f9c3b50f174 Mon Sep 17 00:00:00 2001 From: Rye Date: Thu, 21 Nov 2024 22:35:47 -0500 Subject: [PATCH 3/3] Update zlib-ng to 2.2.2-r1 openssl to 1.1.1w-r2 nghttp2 to 1.64.0 --- autobuild.xml | 120 +++++++++----------------------------------------- 1 file changed, 21 insertions(+), 99 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index f7c9e31b..a453fb40 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -11,65 +11,39 @@ archive hash - 3f3374a5d97803bf78acf20847c2900c7d68ce2b + dd0c79ac49e5e81cd153d44061c044d1db950fdc hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-darwin64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-darwin64-11965382595.tar.zst name darwin64 - linux - - archive - - hash - 079c1a1bdb3ce1cda8ce3d7f75eeced3 - url - http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/9258/41585/nghttp2-1.25.0.509246-linux-509246.tar.bz2 - - name - linux - linux64 archive hash - bd9c211f9f53c04821f0ab0e1268a691926331b6 + 0ba810156e0f1ceee8fcc9f9115b91111323fabd hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-linux64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-linux64-11965382595.tar.zst name linux64 - windows - - archive - - hash - ea16c2b825b69af75c3a64df9e3c24a9021026ca - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.40.0.b1526c6/nghttp2-1.40.0.b1526c6-windows-b1526c6.tar.zst - - name - windows - windows64 archive hash - c23e25a7c47f5233f543a90f1a9ccf4da9282379 + 182e03f4ef36eff082c571c33b13111d4cd6c8dd hash_algorithm sha1 url - https://github.com/secondlife/3p-nghttp2/releases/download/v1.62.1/nghttp2-1.62.1-windows64-10329456052.tar.zst + https://github.com/secondlife/3p-nghttp2/releases/download/v1.64.0-r1/nghttp2-1.64.0-r1-windows64-11965382595.tar.zst name windows64 @@ -83,7 +57,7 @@ Copyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors version - 1.62.1 + 1.64.0-r1 name nghttp2 description @@ -95,82 +69,44 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors platforms - darwin - - archive - - hash - 0a77d56769e6075957f614be6575423e - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/openssl_3p-update-openssl/rev/297168/arch/Darwin/installer/openssl-1.0.1h.297168-darwin-297168.tar.bz2 - - name - darwin - darwin64 archive hash - a20277991043a4a00fb8280a27a41fbd87c4b840 + f6fdad42168b30932384310866642b072465af11 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-darwin64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-darwin64-11965633361.tar.zst name darwin64 - linux - - archive - - hash - f46a601d60b7dbcfde32afc0cb64453e - url - http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/p64_3p-openssl/rev/314227/arch/Linux/installer/openssl-1.0.1h.314227-linux-314227.tar.bz2 - - name - linux - linux64 archive hash - 0f2cd519431b11cacf85971c66c49e5b4d26c56f + 7a5048c806b053768c461d6dbac854324a597ee0 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-linux64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-linux64-11965633361.tar.zst name linux64 - windows - - archive - - hash - dbf2f69a7d73821dbe12288097298924e866e606 - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1q.de53f55/openssl-1.1.1q.de53f55-windows-de53f55.tar.zst - - name - windows - windows64 archive hash - 5e396eedf1492d18126b7281367123c1d64b89aa + 3d16fa02ca44a6a1eeeb7c83d62af2dc8ef2e7e9 hash_algorithm sha1 url - https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r1/openssl-1.1.1w-windows64-10329796904.tar.zst + https://github.com/secondlife/3p-openssl/releases/download/v1.1.1w-r2/openssl-1.1.1w-r2-windows64-11965633361.tar.zst name windows64 @@ -183,7 +119,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved; Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) version - 1.1.1w + 1.1.1w-r2 name openssl description @@ -198,11 +134,11 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - 3a6593c71c59ace76d1349483759fcde4b719a76 + 4d437afc7fc3988cf0c78ed05853a211cc6bf8b8 hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-darwin64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-darwin64-11943461931.tar.zst name darwin64 @@ -212,39 +148,25 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors archive hash - fbadeb0b8c771cb06c0055c9fab6d40c6764dacd + 70c1d8728b85481bd42904c1213ed50264e77be1 hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-linux64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-linux64-11943461931.tar.zst name linux64 - windows - - archive - - hash - 2b5a50b0a3d31a07bc74cb77871ad195eb97c550 - hash_algorithm - sha1 - url - https://github.com/secondlife/3p-zlib-ng/releases/download/v1.2.11.zlib-ng.32fd361/zlib_ng-1.2.11.zlib-ng.32fd361-windows-32fd361.tar.zst - - name - windows - windows64 archive hash - 0094031715662be626f5106ff6c814f4fc3dacfa + f98c30b20120511ecceab8bf1b5eba048b10aade hash_algorithm sha1 url - https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.1-r2/zlib_ng-2.2.1-r2-windows64-10324415171.tar.zst + https://github.com/secondlife/3p-zlib-ng/releases/download/v2.2.2-r1/zlib_ng-2.2.2-dev0.gcaa101e.d20241120-windows64-11943461931.tar.zst name windows64 @@ -257,7 +179,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors copyright Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler version - 2.2.1-r2 + 2.2.2-r1 name zlib-ng canonical_repo