Skip to content

Commit c88c902

Browse files
committed
vcpkg
1 parent 450d3a3 commit c88c902

15 files changed

Lines changed: 254 additions & 154 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,60 @@ jobs:
318318
filename: '.\nuget\*.nupkg'
319319
api-key: ${{ secrets.NUGET_DOT_ORG_API_KEY }}
320320
if: startsWith(github.ref, 'refs/tags/')
321+
##### vcpkg #####
322+
vcpkg:
323+
strategy:
324+
fail-fast: false
325+
matrix:
326+
include:
327+
- {os: debian, codename: bookworm, image_owner: }
328+
# - {os: debian, codename: bookworm, image_owner: i386/, labels: [i386,docker]}
329+
# - {os: debian, codename: bookworm, image_owner: arm32v7/, labels: [ubuntu-24.04-arm]}
330+
# - {os: debian, codename: bookworm, image_owner: arm64v8/, labels: [ubuntu-24.04-arm]}
331+
runs-on: ${{ (matrix.labels == '' && 'ubuntu-latest') || matrix.labels }}
332+
container: ${{ matrix.image_owner }}${{ matrix.os }}:${{ matrix.codename }}
333+
name: vcpkg - linux | ${{ matrix.image_owner }}
334+
steps:
335+
- name: add cppfw deb repo
336+
uses: myci-actions/add-deb-repo@main
337+
with:
338+
repo: deb https://gagis.hopto.org/repo/cppfw/${{ matrix.os }} ${{ matrix.codename }} main
339+
repo-name: cppfw
340+
keys-asc: https://gagis.hopto.org/repo/cppfw/pubkey.gpg
341+
install: myci cmake git curl zip unzip tar nodejs pkg-config libgl1-mesa-dev libglu1-mesa-dev
342+
- name: git clone
343+
uses: myci-actions/checkout@main
344+
- name: install vcpkg
345+
run: |
346+
git clone https://github.com/microsoft/vcpkg.git vcpkg-installation
347+
(cd vcpkg-installation; ./bootstrap-vcpkg.sh)
348+
- name: set VCPKG_ROOT
349+
uses: myci-actions/export-env-var@main
350+
with: {name: VCPKG_ROOT, value: "$(pwd)/vcpkg-installation"}
351+
- name: add VCPKG_ROOT to PATH
352+
uses: myci-actions/export-env-var@main
353+
with: {name: PATH, value: "$PATH:$VCPKG_ROOT"}
354+
- name: prepare vcpkg port
355+
run: |
356+
myci-vcpkg-prepare.sh --vcpkg-dir build/vcpkg --git-ref ${{ github.sha }}
357+
- name: test vcpkg port
358+
run: |
359+
cd build/vcpkg/test
360+
cmake .
361+
make
362+
./test
363+
- name: upload vcpkg logs to artifacts
364+
if: always() # even if previous steps fail, this one needs to be run
365+
uses: actions/upload-artifact@v4
366+
with:
367+
name: vcpkg_logs
368+
path: |
369+
vcpkg-installation/buildtrees/${{ env.PACKAGE_NAME }}/
370+
build/vcpkg/**/*.log
371+
- name: deploy vcpkg port
372+
run: |
373+
myci-deploy-vcpkg.sh --repo cppfw/vcpkg-repo --port-dir build/vcpkg/overlay/${PACKAGE_NAME}
374+
if: startsWith(github.ref, 'refs/tags/')
321375
##### conan - linux #####
322376
conan-linux:
323377
strategy:

build/cmake/CMakeLists.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
cmake_minimum_required(VERSION 3.20)
2+
3+
set(name ruisapp)
4+
project(${name})
5+
6+
# !!! find_package must go after project() declaration !!!
7+
# Otherwise VCPKG does not set the CMAKE_PREFIX_PATH to find packages.
8+
find_package(myci CONFIG REQUIRED)
9+
10+
set(srcs)
11+
myci_add_source_files(srcs
12+
DIRECTORY
13+
../../src/${name}
14+
RECURSIVE
15+
)
16+
17+
myci_declare_library(${name}-opengl
18+
SOURCES
19+
${srcs}
20+
PUBLIC_INCLUDE_DIRECTORIES
21+
../../src
22+
INSTALL_INCLUDE_DIRECTORIES
23+
../../src/${name}
24+
DEPENDENCIES
25+
rasterimage
26+
r4
27+
papki
28+
tml
29+
utki
30+
agg
31+
veg
32+
mikroxml
33+
cssom
34+
svgdom
35+
svgren
36+
ruis
37+
ruis-render-opengl
38+
Freetype
39+
EXTERNAL_DEPENDENCIES
40+
JPEG
41+
GLEW
42+
)

build/conan/conanfile.py

Lines changed: 0 additions & 95 deletions
This file was deleted.

build/conan/test_package/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

build/conan/test_package/conanfile.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

build/conan/test_package/example.cpp

Lines changed: 0 additions & 7 deletions
This file was deleted.

build/emscripten/conan.profile

Lines changed: 0 additions & 10 deletions
This file was deleted.

build/emscripten/conanfile.txt

Lines changed: 0 additions & 11 deletions
This file was deleted.

build/vcpkg/portfile.cmake.in

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
2+
3+
vcpkg_from_github(
4+
OUT_SOURCE_PATH SOURCE_PATH
5+
REPO cppfw/${PORT}
6+
REF $(git_ref)
7+
SHA512 $(archive_hash)
8+
HEAD_REF main
9+
)
10+
11+
vcpkg_cmake_configure(
12+
SOURCE_PATH "${SOURCE_PATH}/build/cmake"
13+
)
14+
15+
vcpkg_cmake_install()
16+
17+
vcpkg_cmake_config_fixup()
18+
19+
# Delete the include directory from the debug installation to prevent overlap.
20+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
21+
22+
# Install the LICENSE file to the package's share directory and rename it to copyright.
23+
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
24+
25+
# Copy the usage instruction file to the package's share directory.
26+
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)

build/vcpkg/test/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
cmake_minimum_required(VERSION 3.10)
2+
3+
set(CMAKE_TOOLCHAIN_FILE $ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake)
4+
5+
project(test)
6+
7+
find_package(utki CONFIG REQUIRED)
8+
find_package(papki CONFIG REQUIRED)
9+
find_package(rasterimage CONFIG REQUIRED)
10+
find_package(r4 CONFIG REQUIRED)
11+
find_package(tml CONFIG REQUIRED)
12+
find_package(agg CONFIG REQUIRED)
13+
find_package(veg CONFIG REQUIRED)
14+
find_package(mikroxml CONFIG REQUIRED)
15+
find_package(cssom CONFIG REQUIRED)
16+
find_package(svgdom CONFIG REQUIRED)
17+
find_package(svgren CONFIG REQUIRED)
18+
find_package(ruis CONFIG REQUIRED)
19+
find_package(ruis-render-opengl CONFIG REQUIRED)
20+
21+
find_package(Freetype CONFIG REQUIRED)
22+
find_package(ZLIB REQUIRED)
23+
find_package(JPEG REQUIRED)
24+
find_package(GLEW REQUIRED)
25+
26+
find_package(ruisapp CONFIG REQUIRED)
27+
28+
add_executable(test main.cpp)
29+
30+
target_link_libraries(test PRIVATE ruisapp::ruisapp)

0 commit comments

Comments
 (0)