From 40090a273044ea45f9eacab5cc5a814f75d7e79e Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Fri, 9 Jan 2026 13:45:21 -0700 Subject: [PATCH 1/3] externpro 25.07.2-6-g59fd9e4 --- .devcontainer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer b/.devcontainer index af6b864abe..59fd9e4638 160000 --- a/.devcontainer +++ b/.devcontainer @@ -1 +1 @@ -Subproject commit af6b864abe2df4237df0d71df82a476c1daab1e5 +Subproject commit 59fd9e4638149f3ac30297adb176aea439de59e9 From ea2e433a726ffe15adb67cf588e54ca099c69e7e Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Fri, 9 Jan 2026 13:46:58 -0700 Subject: [PATCH 2/3] workflows: externpro@25.07.2 cp .devcontainer/.github/wf-templates/xp*.yml .github/workflows --- .github/workflows/xpbuild.yml | 26 ++++++++++---------------- .github/workflows/xprelease.yml | 3 +-- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/xpbuild.yml b/.github/workflows/xpbuild.yml index 169ff5269c..625b2f9326 100644 --- a/.github/workflows/xpbuild.yml +++ b/.github/workflows/xpbuild.yml @@ -1,4 +1,7 @@ name: Build +permissions: + contents: read + pull-requests: write on: push: branches: [ "dev" ] @@ -7,24 +10,15 @@ on: workflow_dispatch: jobs: linux: - uses: externpro/externpro/.github/workflows/build-linux.yml@25.06 - with: - cmake-workflow-preset: Linux - runon: ubuntu-latest - secrets: inherit - linux-arm64: - uses: externpro/externpro/.github/workflows/build-linux.yml@25.06 - with: - cmake-workflow-preset: Linux - runon: ubuntu-24.04-arm + permissions: + contents: read + pull-requests: write + packages: write + uses: externpro/externpro/.github/workflows/build-linux.yml@25.07.2 secrets: inherit macos: - uses: externpro/externpro/.github/workflows/build-macos.yml@25.06 - with: - cmake-workflow-preset: Darwin + uses: externpro/externpro/.github/workflows/build-macos.yml@25.07.2 secrets: inherit windows: - uses: externpro/externpro/.github/workflows/build-windows.yml@25.06 - with: - cmake-workflow-preset: Windows + uses: externpro/externpro/.github/workflows/build-windows.yml@25.07.2 secrets: inherit diff --git a/.github/workflows/xprelease.yml b/.github/workflows/xprelease.yml index 146191466e..fe4c52cd74 100644 --- a/.github/workflows/xprelease.yml +++ b/.github/workflows/xprelease.yml @@ -9,10 +9,9 @@ on: jobs: # Upload build artifacts as release assets release-from-build: - uses: externpro/externpro/.github/workflows/release-from-build.yml@25.06 + uses: externpro/externpro/.github/workflows/release-from-build.yml@25.07.2 with: workflow_run_url: ${{ github.event.inputs.workflow_run_url }} - artifact_pattern: "*.tar.xz" permissions: contents: write id-token: write From b0a0c5a5c5286dbdf71037b2d3add1da47fcb51d Mon Sep 17 00:00:00 2001 From: Scott M Anderson Date: Sat, 10 Jan 2026 09:50:56 -0700 Subject: [PATCH 3/3] cmake: xproinc enhancements and xpExternPackage() also rename XP_ variables to be more generic (CMAKE_) --- CMakeLists.txt | 38 +++++++++++++++++++++----------------- docs/CMakeLists.txt | 2 +- src/CMakeLists.txt | 10 +++++----- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86d109595c..773b2b242e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,22 +41,6 @@ set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake) project(libssh2 C) set(PROJECT_URL "https://www.libssh2.org/") set(PROJECT_DESCRIPTION "The SSH library") -include(GNUInstallDirs) -include(xpflags) -set(targetsFile Libssh2Config) -if(NOT DEFINED XP_INSTALL_CMAKEDIR) - set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake) -endif() -if(DEFINED XP_NAMESPACE) - set(XP_OPT_INSTALL FALSE) - set(nameSpace ${XP_NAMESPACE}::) - xpPackageDevel(TARGETS_FILE ${targetsFile} DEPS openssl zlib - LIBRARIES ${XP_NAMESPACE}::${PROJECT_NAME} - ) -else() - set(XP_OPT_INSTALL TRUE) - set(nameSpace Libssh2::) -endif() if (CMAKE_VERSION VERSION_LESS "3.1") if (CMAKE_C_COMPILER_ID STREQUAL "GNU") @@ -94,6 +78,26 @@ if(NOT LIBSSH2_VERSION OR "${CMAKE_CURRENT_SOURCE_DIR}/include/libssh2.h") endif() +set(targetsFile Libssh2Config) +if(DEFINED XP_NAMESPACE) + xpExternPackage(NAMESPACE ${XP_NAMESPACE} ALIAS_NAMESPACE Libssh2 + TARGETS_FILE ${targetsFile} LIBRARIES ${PROJECT_NAME} + BASE ${PROJECT_NAME}-${LIBSSH2_VERSION_MAJOR}.${LIBSSH2_VERSION_MINOR}.${LIBSSH2_VERSION_PATCH} + XPDIFF "patch" DEPS openssl zlib + WEB "http://www.libssh2.org/" UPSTREAM "github.com/libssh2/libssh2" + DESC "client-side C library implementing SSH2 protocol" + LICENSE "[BSD-3-Clause](http://www.libssh2.org/license.html 'BSD 3-Clause New or Revised License')" + ) + set(CMAKE_OPT_INSTALL FALSE) + set(CMAKE_NAMESPACE ${XP_NAMESPACE}) + set(CMAKE_INSTALL_CMAKEDIR ${XP_INSTALL_CMAKEDIR}) +else() + set(CMAKE_OPT_INSTALL TRUE) + set(CMAKE_NAMESPACE Libssh2) + set(CMAKE_INSTALL_CMAKEDIR lib/cmake/libssh2) +endif() + +include(GNUInstallDirs) install( FILES docs/AUTHORS COPYING docs/HACKING README RELEASE-NOTES NEWS DESTINATION ${CMAKE_INSTALL_DOCDIR}) @@ -122,6 +126,6 @@ set(CPACK_PACKAGE_VERSION_MAJOR ${LIBSSH2_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MINOR ${LIBSSH2_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_PATCH ${LIBSSH2_VERSION_PATCH}) set(CPACK_PACKAGE_VERSION ${LIBSSH2_VERSION}) -if(XP_OPT_INSTALL) +if(CMAKE_OPT_INSTALL) include(CPack) endif() diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 9d505873bb..bf30d3c243 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -207,6 +207,6 @@ set(MAN_PAGES libssh2_version.3) include(GNUInstallDirs) -if(XP_OPT_INSTALL) +if(CMAKE_OPT_INSTALL) install(FILES ${MAN_PAGES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man3) endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8f30081700..cb5e3ac2f0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -394,12 +394,12 @@ set(RUNTIME_DEPENDENCIES ${_RUNTIME_DEPENDENCIES} CACHE INTERNAL ## During package installation, install Libssh2Config.cmake install(EXPORT ${targetsFile} - NAMESPACE ${nameSpace} - DESTINATION ${XP_INSTALL_CMAKEDIR}) + NAMESPACE ${CMAKE_NAMESPACE}:: + DESTINATION ${CMAKE_INSTALL_CMAKEDIR}) ## During build, register directly from build tree # create Libssh2Config.cmake -export(TARGETS libssh2 NAMESPACE ${nameSpace} FILE ${targetsFile}.cmake) +export(TARGETS libssh2 NAMESPACE ${CMAKE_NAMESPACE}:: FILE ${targetsFile}.cmake) export(PACKAGE Libssh2) # register it ## Export a .pc file for client projects not using CMaek @@ -410,7 +410,7 @@ if(PC_LIBS) string(REPLACE ";" " " PC_LIBS "${PC_LIBS}") endif() configure_file(libssh2.pc.in libssh2.pc @ONLY) -if(XP_OPT_INSTALL) +if(CMAKE_OPT_INSTALL) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libssh2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) @@ -429,4 +429,4 @@ write_basic_package_version_file( COMPATIBILITY SameMajorVersion) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/${targetsFile}Version.cmake - DESTINATION ${XP_INSTALL_CMAKEDIR}) + DESTINATION ${CMAKE_INSTALL_CMAKEDIR})