Skip to content

Commit

Permalink
Merge pull request #1 from open-vcpkg/qca-qt5
Browse files Browse the repository at this point in the history
Add qca-qt5 port
  • Loading branch information
m-kuhn authored Feb 3, 2024
2 parents 6054c2e + e3f517b commit c288fd0
Show file tree
Hide file tree
Showing 13 changed files with 970 additions and 178 deletions.
33 changes: 33 additions & 0 deletions .github/actions/setup-vcpkg/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Setup Vcpkg
description: Install a full vcpkg environment
inputs:

vcpkgVersion:
description: Enter vcpkg version tag or stable or latest
required: false
default: latest
type: string

vcpkgRoot:
description: Enter VCPKGROOT as vcpkg root path
required: false
default: /usr/local/vcpkg
type: string

vcpkgDownload:
description: Enter VCPKGDOWNLOAD as vcpkg download path
required: false
default: /usr/local/vcpkg-downloads
type: string

runs:
using: composite
steps:
- name: Setup vcpkg
run: |
git clone --depth 1 https://github.com/msclock/features.git /tmp/vcpkg
sudo USERNAME="$USER" VCPKGVERSION="${{ inputs.vcpkgVersion }}" VCPKGROOT="${{ inputs.vcpkgRoot }}" \
VCPKGDOWNLOAD="${{ inputs.vcpkgDownload }}" /tmp/vcpkg/src/vcpkg/install.sh
vcpkg --version
shell: bash
176 changes: 0 additions & 176 deletions .github/workflows/untrustedPR.yml

This file was deleted.

90 changes: 90 additions & 0 deletions .github/workflows/versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format_and_update_ports:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
fetch-depth: 2

- name: Setup vcpkg
uses: ./.github/actions/setup-vcpkg
with:
vcpkgVersion: latest
vcpkgRoot: /usr/local/vcpkg
vcpkgDownload: /usr/local/vcpkg-downloads

- name: Format vcpkg.json
run: |
vcpkg format-manifest --all $(find . -name "vcpkg.json")
- name: Commit format vcpkg.json
uses: stefanzweifel/git-auto-commit-action@v5
if: success()
with:
commit_message: 'ci: format vcpkg configuration'
file_pattern: vcpkg.json

- name: Exit 1 if vcpkg configuration changes have been detected
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: |
exit 1
- name: Detect ports changes against default branch
id: filter-ports
uses: dorny/paths-filter@v2
with:
list-files: shell
filters: |
ports:
- ports/**
- name: Update versions
if: steps.filter-ports.outputs.ports == 'true'
run: |
for dir in ports/* ; do
vcpkg x-add-version ${dir##ports/} --overlay-ports=./ports \
--x-builtin-registry-versions-dir=./versions/ \
--x-builtin-ports-root=./ports
done
- name: Detect versions changes against local
if: steps.filter-ports.outputs.ports == 'true'
id: filter-versions
uses: dorny/paths-filter@v2
with:
list-files: shell
base: HEAD
filters: |
versions:
- versions/**
- name: Get last commit message
if: steps.filter-versions.outputs.versions == 'true'
id: last-commit-message
run: |
echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
- name: Commit versions
if: steps.filter-versions.outputs.versions == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: versions/*
commit_message: Update versions.db
skip_fetch: true
72 changes: 72 additions & 0 deletions ports/qca-qt5/0001-fix-path-for-vcpkg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git "a/CMakeLists.txt" "b/CMakeLists.txt"
index 1f84c2c9e..f72ee9d8d 100644
--- "a/CMakeLists.txt"
+++ "b/CMakeLists.txt"
@@ -58,6 +58,7 @@ set(QCA_SUFFIX "qt5")
if(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC)
set(STATIC_PLUGINS ON)
add_definitions(-DQT_STATICPLUGIN)
+ add_definitions(-DQCA_STATIC)
set(PLUGIN_TYPE "STATIC")
else()
set(PLUGIN_TYPE "MODULE")
@@ -266,10 +267,17 @@ if(DEVELOPER_MODE)
add_definitions(-DDEVELOPER_MODE)

# To prefer plugins from build tree when run qca from build tree
- file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
-"[Paths]
-Plugins=${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}
-")
+ if(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC)
+ file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
+ "[Paths]
+ Plugins=${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}
+ ")
+ else()
+ file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
+ "[Paths]
+ Plugins=${CMAKE_BINARY_DIR}/bin/${QCA_LIB_NAME}
+ ")
+ endif()
endif()

if (APPLE)
@@ -309,7 +317,7 @@ else()
set( qca_CERTSTORE "${CMAKE_CURRENT_SOURCE_DIR}/certs/rootcerts.pem")
# note that INSTALL_FILES targets are relative to the current installation prefix...
if(NOT DEVELOPER_MODE)
- install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/certs")
+ install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/share/qca/certs")
endif()
endif()
message(STATUS "certstore path: " ${qca_CERTSTORE})
@@ -390,10 +398,10 @@ endif()
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/QcaConfig.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake"
- INSTALL_DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE}
+ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}Config.cmake"
+ INSTALL_DESTINATION ${CMAKE_BINARY_DIR}/share/qca/cmake
)
-write_basic_config_version_file("${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion)
+write_basic_config_version_file("${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion)

if(NOT DEVELOPER_MODE)

@@ -461,10 +469,10 @@ if(NOT DEVELOPER_MODE)
endif()
endif()

- install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE} FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake)
+ install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/qca/cmake FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake)
install(FILES
- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake"
- DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE}
+ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}Config.cmake"
+ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake"
+ DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/qca/cmake
)
endif()
Loading

0 comments on commit c288fd0

Please sign in to comment.