Skip to content

Commit

Permalink
⬆️ Updated conan pkg to work with conan 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherFoxGuy committed Jun 3, 2023
1 parent 34c8b84 commit 3ca4a96
Show file tree
Hide file tree
Showing 17 changed files with 127 additions and 84 deletions.
40 changes: 14 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ jobs:

- name: Install Build tools
if: startsWith(matrix.os, 'windows')
shell: cmake -P {0}
run: |
file(MAKE_DIRECTORY $ENV{BUILD_TOOLS_PATH})
file(DOWNLOAD https://cdn.anotherfoxguy.com/build-tools.zip "$ENV{TMP}/build-tools.zip" SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf "$ENV{TMP}/build-tools.zip" WORKING_DIRECTORY "$ENV{BUILD_TOOLS_PATH}")
run: git clone https://git.anotherfoxguy.com/AnotherFoxGuy/build-tools.git %BUILD_TOOLS_PATH%
shell: cmd

- name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
Expand All @@ -40,8 +37,8 @@ jobs:
- name: Cache conan packages
uses: actions/cache@v3
with:
key: conan-${{ runner.os }}-${{ hashFiles('**/conanfile.txt') }}
path: ~/.conan/
key: conan-${{ runner.os }}-${{ hashFiles('conanfile.py') }}
path: ~/.conan2/

- name: Cache Qt
id: cache-qt
Expand All @@ -65,38 +62,29 @@ jobs:
- name: Run Conan (Windows)
if: startsWith(matrix.os, 'windows')
run: |
mkdir build
cd build
conan config set general.revisions_enabled=1
conan install .. -b missing -pr:b=../tools/conan-profiles/vs-22-release-ninja -pr=../tools/conan-profiles/vs-22-release-ninja
conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f
conan install . -b missing -pr:b=tools/conan-profiles/vs-19-release-ninja -pr=tools/conan-profiles/vs-19-release-ninja
shell: cmd

- name: Run Conan (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir build
cd build
conan config set general.revisions_enabled=1
echo "tools.system.package_manager:mode = install" > ~/.conan/global.conf
echo "tools.system.package_manager:sudo = True" >> ~/.conan/global.conf
conan profile new --detect --force default
conan profile update conf.tools.cmake.cmaketoolchain:generator="Ninja" default
conan profile update settings.compiler.libcxx=libstdc++11 default
conan install .. -s build_type=Release -b missing -pr:b=default
conan profile detect --force
echo "tools.system.package_manager:mode = install" > ~/.conan2/global.conf
echo "tools.system.package_manager:sudo = True" >> ~/.conan2/global.conf
conan remote add ror-conan https://git.anotherfoxguy.com/api/packages/rorbot/conan -f
conan install . -s build_type=Release -b missing -pr:b=default -c tools.cmake.cmaketoolchain:generator="Ninja"
- name: Build
run: |
cd build
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=redist -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW
cmake --preset conan-release -DCMAKE_INSTALL_PREFIX=redist
ninja
- name: Install
run: |
cd build
ninja install
run: ninja install

- name: Upload redist folder
uses: actions/upload-artifact@v3
with:
name: fuel-${{ runner.os }}
path: build/redist
path: redist
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ CMakeLists.txt.user*
*.qm
/build*
.idea/
test-pr
test-pr
_build/
CMakeUserPresets.json
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ if (WIN32)

add_custom_target(
copy_dll
COMMAND ${QT_BIN_DIR}/windeployqt.exe $<TARGET_FILE:${PROJECT_NAME}> --release --no-compiler-runtime --no-opengl-sw
COMMAND ${QT_BIN_DIR}/windeployqt.exe $<TARGET_FILE:${PROJECT_NAME}> --debug --no-compiler-runtime --no-opengl-sw
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

Expand All @@ -197,8 +197,8 @@ if (WIN32)

FetchContent_Declare(
fossil
URL https://fossil-scm.org/home/uv/fossil-w64-2.19.zip
URL_MD5 0156328fa9165ad1f041cafbf49c7cf7
URL https://fossil-scm.org/home/uv/fossil-w64-2.22.zip
URL_MD5 08795c21fb2afd172ecec7fce6de8f43
)
FetchContent_MakeAvailable(fossil)

Expand Down
24 changes: 24 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
from conan import ConanFile
from conan.tools.files import copy


class Fuel(ConanFile):
name = "fuel-scm"
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps"

def requirements(self):
self.requires("qt6keychain/0.14.1@anotherfoxguy/stable")

def generate(self):
for dep in self.dependencies.values():
for f in dep.cpp_info.bindirs:
self.cp_data(f)
for f in dep.cpp_info.libdirs:
self.cp_data(f)

def cp_data(self, src):
bindir = os.path.join(self.build_folder, "bin")
copy(self, "*.dll", src, bindir, False)
copy(self, "*.so*", src, bindir, False)
11 changes: 0 additions & 11 deletions conanfile.txt

This file was deleted.

4 changes: 4 additions & 0 deletions recipes/qtkeychain/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sources:
"0.14.1":
url: "https://github.com/frankosterfeld/qtkeychain/archive/refs/tags/0.14.1.tar.gz"
sha256: "afb2d120722141aca85f8144c4ef017bd74977ed45b80e5d9e9614015dadd60c"
37 changes: 24 additions & 13 deletions recipes/qtkeychain/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.files import get, collect_libs
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout


class QtkeychainConan(ConanFile):
name = "qt6keychain"
version = "0.13.2"
version = "0.14.1"
license = "BSD-3"
author = "Edgar"
url = "https://github.com/AnotherFoxGuy/fuel-scm"
description = "Platform-independent Qt API for storing passwords securely"
settings = "os", "compiler", "build_type", "arch"
options = {"static": [True, False]}
default_options = {"static": False}
scm = {
"type": "git",
"url": "https://github.com/frankosterfeld/qtkeychain.git",
"revision": "v0.13.2"
}

def layout(self):
cmake_layout(self)

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)

def generate(self):
tc = CMakeToolchain(self)
tc.variables["QTKEYCHAIN_STATIC"] = self.options.static
tc.variables["BUILD_WITH_QT6"] = "ON"
tc.variables["BUILD_TEST_APPLICATION"] = "OFF"
tc.variables["CMAKE_PREFIX_PATH"] = "E:/Qt/6.5.0/msvc2019_64"
tc.generate()
deps = CMakeDeps(self)
deps.generate()

def build(self):
cmake = CMake(self)
cmake.definitions["QTKEYCHAIN_STATIC"] = self.options.static
cmake.definitions["BUILD_WITH_QT6"] = "ON"
cmake.definitions["BUILD_TEST_APPLICATION"] = "OFF"
#cmake.definitions["CMAKE_PREFIX_PATH"] = "E:/Qt/6.4.0/msvc2019_64"
cmake.configure()
cmake.build()

Expand All @@ -32,7 +41,9 @@ def package(self):

def package_info(self):
self.cpp_info.set_property("cmake_module_file_name", "Qt6Keychain")
self.cpp_info.set_property("cmake_module_target_name", "Qt6Keychain::Qt6Keychain")
self.cpp_info.set_property(
"cmake_module_target_name", "Qt6Keychain::Qt6Keychain"
)
self.cpp_info.set_property("cmake_file_name", "Qt6Keychain")
self.cpp_info.set_property("cmake_target_name", "Qt6Keychain::Qt6Keychain")
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libs = collect_libs(self)
11 changes: 4 additions & 7 deletions tools/conan-profiles/vs-19-debug
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
compiler=msvc
compiler.version=192
compiler.runtime=dynamic
compiler.runtime_type=Debug
build_type=Debug
[options]
[build_requires]
[env]
8 changes: 4 additions & 4 deletions tools/conan-profiles/vs-19-debug-ninja
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
compiler=msvc
compiler.version=192
compiler.runtime=dynamic
compiler.runtime_type=Debug
build_type=Debug
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
11 changes: 4 additions & 7 deletions tools/conan-profiles/vs-19-release
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
compiler=msvc
compiler.version=192
compiler.runtime=dynamic
compiler.runtime_type=Release
build_type=Release
[options]
[build_requires]
[env]
8 changes: 4 additions & 4 deletions tools/conan-profiles/vs-19-release-ninja
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
compiler=msvc
compiler.version=192
compiler.runtime=dynamic
compiler.runtime_type=Release
build_type=Release
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
5 changes: 1 addition & 4 deletions tools/conan-profiles/vs-19-relwithdebinfo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
build_type=RelWithDebInfo
[options]
[build_requires]
[env]
build_type=RelWithDebInfo
8 changes: 8 additions & 0 deletions tools/conan-profiles/vs-22-debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
os=Windows
arch=x86_64
compiler=msvc
compiler.version=193
compiler.runtime=dynamic
compiler.runtime_type=Debug
build_type=Debug
10 changes: 10 additions & 0 deletions tools/conan-profiles/vs-22-debug-ninja
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[settings]
os=Windows
arch=x86_64
compiler=msvc
compiler.version=193
compiler.runtime=dynamic
compiler.runtime_type=Debug
build_type=Debug
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
8 changes: 8 additions & 0 deletions tools/conan-profiles/vs-22-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
os=Windows
arch=x86_64
compiler=msvc
compiler.version=193
compiler.runtime=dynamic
compiler.runtime_type=Release
build_type=Release
8 changes: 4 additions & 4 deletions tools/conan-profiles/vs-22-release-ninja
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=17
compiler=msvc
compiler.version=193
compiler.runtime=dynamic
compiler.runtime_type=Release
build_type=Release
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
8 changes: 8 additions & 0 deletions tools/conan-profiles/vs-22-relwithdebinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[settings]
os=Windows
arch=x86_64
compiler=msvc
compiler.version=193
compiler.runtime=dynamic
compiler.runtime_type=RelWithDebInfo
build_type=RelWithDebInfo

0 comments on commit 3ca4a96

Please sign in to comment.