Skip to content

Commit c96dbce

Browse files
authored
Update CI dependencies (#154)
1 parent 0cbc5a3 commit c96dbce

File tree

2 files changed

+52
-58
lines changed

2 files changed

+52
-58
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
steps:
3636
- name: Checkout the source
37-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
3838
with:
3939
submodules: recursive
4040
ref: ${{ github.event.pull_request.head.ref }}
@@ -45,12 +45,12 @@ jobs:
4545
sudo xcode-select -switch /Applications/Xcode_${{matrix.build-xcode-version}}.app
4646
4747
- name: Setup python version
48-
uses: actions/setup-python@v1
48+
uses: actions/setup-python@v5
4949
with:
5050
python-version: "3.11"
5151

5252
- name: Start ssh key agent
53-
uses: webfactory/ssh-agent@v0.7.0
53+
uses: webfactory/ssh-agent@v0.9.0
5454
with:
5555
ssh-private-key: ${{ secrets.RULESSUPPORT_DEPLOY_KEY }}
5656

@@ -72,8 +72,8 @@ jobs:
7272
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}
7373
rs_ssh_key: ${{ secrets.RULESSUPPORT_DEPLOY_KEY }}
7474

75-
- name: Linux Mac build
76-
if: "!startsWith(runner.os, 'Windows')"
75+
- name: Linux build
76+
if: startsWith(matrix.os, 'ubuntu')
7777
uses: ManiVaultStudio/github-actions/conan_linuxmac_build@main
7878
with:
7979
conan-compiler: ${{matrix.build-compiler}}
@@ -84,3 +84,18 @@ jobs:
8484
conan-user: ${{secrets.LKEB_UPLOAD_USER}}
8585
conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}}
8686
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}
87+
conan-cc: gcc-${{matrix.build-cversion}}
88+
conan-cxx: g++-${{matrix.build-cversion}}
89+
90+
- name: Mac build
91+
if: startsWith(matrix.os, 'macos')
92+
uses: ManiVaultStudio/github-actions/conan_linuxmac_build@main
93+
with:
94+
conan-compiler: ${{matrix.build-compiler}}
95+
conan-compiler-version: ${{matrix.build-cversion}}
96+
conan-libcxx-version: ${{matrix.build-libcxx}}
97+
conan-build-type: ${{matrix.build-config}}
98+
conan-build-os: ${{matrix.build-os}}
99+
conan-user: ${{secrets.LKEB_UPLOAD_USER}}
100+
conan-password: ${{secrets.LKEB_UPLOAD_USER_PASSWORD}}
101+
conan-pem: ${{secrets.LKEB_UPLOAD_CERT_CHAIN}}

conanfile.py

Lines changed: 32 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,24 @@
22
from conan.tools.cmake import CMakeDeps, CMake, CMakeToolchain
33
from conans.tools import save, load
44
import os
5-
import shutil
65
import pathlib
76
import subprocess
87
from rules_support import PluginBranchInfo
9-
import re
108

11-
def compatibility(os, compiler, compiler_version):
12-
# On macos fallback to zlib apple-clang 13
13-
if os == "Macos" and compiler == "apple-clang" and bool(re.match("14.*", compiler_version)):
14-
print("Compatibility match")
15-
return ["zlib/1.3:compiler.version=13"]
16-
return None
179

1810
class ScatterplotOPluginConan(ConanFile):
1911
"""Class to package ImageLoaderPlugin using conan
2012
2113
Packages both RELEASE and DEBUG.
22-
Uses rules_support (github.com/hdps/rulessupport) to derive
14+
Uses rules_support (github.com/ManiVaultStudio/rulessupport) to derive
2315
versioninfo based on the branch naming convention
24-
as described in https://github.com/hdps/core/wiki/Branch-naming-rules
16+
as described in https://github.com/ManiVaultStudio/core/wiki/Branch-naming-rules
2517
"""
2618

2719
name = "ScatterplotPlugin"
28-
description = """Plugins for displaying scatterplots
29-
in the high-dimensional plugin system (HDPS)."""
20+
description = """Plugins for displaying scatterplots in ManiVaultStudio."""
3021
topics = ("hdps", "plugin", "image data", "loading")
31-
url = "https://github.com/hdps/Scatterplot"
22+
url = "https://github.com/ManiVaultStudio/Scatterplot"
3223
author = "B. van Lew b.van_lew@lumc.nl" # conan recipe author
3324
license = "MIT"
3425

@@ -92,30 +83,29 @@ def generate(self):
9283
generator = "Xcode"
9384
if self.settings.os == "Linux":
9485
generator = "Ninja Multi-Config"
95-
# Use the Qt provided .cmake files
96-
qtpath = pathlib.Path(self.deps_cpp_info["qt"].rootpath)
97-
qt_root = str(list(qtpath.glob("**/Qt6Config.cmake"))[0].parents[3].as_posix())
9886

9987
tc = CMakeToolchain(self, generator=generator)
100-
if self.settings.os == "Windows" and self.options.shared:
101-
tc.variables["CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS"] = True
102-
if self.settings.os == "Linux" or self.settings.os == "Macos":
103-
tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON"
104-
tc.variables["CMAKE_PREFIX_PATH"] = qt_root
105-
106-
# Set the installation directory for ManiVault based on the MV_INSTALL_DIR environment variable
107-
# or if none is specified, set it to the build/install dir.
108-
if not os.environ.get("MV_INSTALL_DIR", None):
109-
os.environ["MV_INSTALL_DIR"] = os.path.join(self.build_folder, "install")
110-
print("MV_INSTALL_DIR: ", os.environ["MV_INSTALL_DIR"])
111-
self.install_dir = pathlib.Path(os.environ["MV_INSTALL_DIR"]).as_posix()
112-
# Give the installation directory to CMake
113-
tc.variables["MV_INSTALL_DIR"] = self.install_dir
114-
115-
# Find ManiVault with find_package
116-
self.manivault_dir = self.install_dir + '/cmake/mv/'
117-
tc.variables["ManiVault_DIR"] = self.manivault_dir
118-
88+
89+
tc.variables["CMAKE_CXX_STANDARD_REQUIRED"] = "ON"
90+
91+
# Use the Qt provided .cmake files
92+
qt_path = pathlib.Path(self.deps_cpp_info["qt"].rootpath)
93+
qt_cfg = list(qt_path.glob("**/Qt6Config.cmake"))[0]
94+
qt_dir = qt_cfg.parents[0].as_posix()
95+
qt_root = qt_cfg.parents[3].as_posix()
96+
97+
# for Qt >= 6.4.2
98+
#tc.variables["Qt6_DIR"] = qt_dir
99+
100+
# for Qt < 6.4.2
101+
tc.variables["Qt6_ROOT"] = qt_root
102+
103+
# Use the ManiVault .cmake file to find ManiVault with find_package
104+
mv_core_root = self.deps_cpp_info["hdps-core"].rootpath
105+
manivault_dir = pathlib.Path(mv_core_root, "cmake", "mv").as_posix()
106+
print("ManiVault_DIR: ", manivault_dir)
107+
tc.variables["ManiVault_DIR"] = manivault_dir
108+
119109
# Set some build options
120110
tc.variables["MV_UNITY_BUILD"] = "ON"
121111

@@ -128,23 +118,16 @@ def _configure_cmake(self):
128118
return cmake
129119

130120
def build(self):
131-
print("Build OS is : ", self.settings.os)
132-
133-
# The BinNIO plugins expect the HDPS package to be in this install dir
134-
hdps_pkg_root = self.deps_cpp_info["hdps-core"].rootpath
135-
print("Install dir type: ", self.install_dir)
136-
shutil.copytree(hdps_pkg_root, self.install_dir)
121+
print("Build OS is: ", self.settings.os)
137122

138123
cmake = self._configure_cmake()
139124
cmake.build(build_type="Debug")
140-
cmake.install(build_type="Debug")
141-
142-
# cmake_release = self._configure_cmake()
143125
cmake.build(build_type="Release")
144-
cmake.install(build_type="Release")
145126

146127
def package(self):
147-
package_dir = os.path.join(self.build_folder, "package")
128+
package_dir = pathlib.Path(self.build_folder, "package")
129+
debug_dir = package_dir / "Debug"
130+
release_dir = package_dir / "Release"
148131
print("Packaging install dir: ", package_dir)
149132
subprocess.run(
150133
[
@@ -154,7 +137,7 @@ def package(self):
154137
"--config",
155138
"Debug",
156139
"--prefix",
157-
os.path.join(package_dir, "Debug"),
140+
debug_dir,
158141
]
159142
)
160143
subprocess.run(
@@ -165,15 +148,11 @@ def package(self):
165148
"--config",
166149
"Release",
167150
"--prefix",
168-
os.path.join(package_dir, "Release"),
151+
release_dir,
169152
]
170153
)
171154
self.copy(pattern="*", src=package_dir)
172-
# Add the debug support files to the package
173-
# (*.pdb) if building the Visual Studio version
174-
if self.settings.compiler == "Visual Studio":
175-
self.copy("*.pdb", dst="Debug/Plugins", keep_path=False)
176-
155+
177156
def package_info(self):
178157
self.cpp_info.debug.libdirs = ["Debug/lib"]
179158
self.cpp_info.debug.bindirs = ["Debug/Plugins", "Debug"]

0 commit comments

Comments
 (0)