Skip to content

Commit

Permalink
qt-advanced-docking-system: Modernize to Conan V2 and add new versions
Browse files Browse the repository at this point in the history
  • Loading branch information
leha-bot committed Sep 30, 2023
1 parent 7407669 commit 57e0fa9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
6 changes: 6 additions & 0 deletions recipes/qt-advanced-docking-system/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
sources:
"4.1.1":
url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/4.1.1.tar.gz"
sha256: "0"
"3.8.4":
url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/3.8.3.tar.gz"
sha256: "0"
"3.8.3":
url: "https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/archive/refs/tags/3.8.3.tar.gz"
sha256: "bd5a9469b755bedf33baefd0b3dda6d167b7917a2888e2794eed5abee7d78f74"
Expand Down
21 changes: 12 additions & 9 deletions recipes/qt-advanced-docking-system/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from conan import ConanFile
from conan.tools.files import copy, get, apply_conandata_patches, export_conandata_patches, replace_in_file, rmdir
from conans import CMake
from conan.tools.cmake import CMake, CMakeDeps, cmake_layout
import os

required_conan_version = ">=1.52.0"
Expand All @@ -26,14 +26,13 @@ class QtADS(ConanFile):
"shared": False,
"fPIC": True,
}
generators = "cmake", "cmake_find_package", "cmake_find_package_multi"
generators = "CMakeDeps"

_cmake = None
_qt_version = "5.15.6"
_qt_version = "6.5.2"

@property
def _source_subfolder(self):
return "source_subfolder"
def layout(self):
cmake_layout(self)

Check failure on line 35 in recipes/qt-advanced-docking-system/all/conanfile.py

View workflow job for this annotation

GitHub Actions / Lint changed conanfile.py (v2 migration)

layout is missing `src_folder` argument which should be to `src`

def export_sources(self):
copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder)
Expand All @@ -52,7 +51,7 @@ def requirements(self):

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

def _configure_cmake(self):
if self._cmake:
Expand All @@ -70,11 +69,15 @@ def _patch_sources(self):
apply_conandata_patches(self)

replace_in_file(self,
f"{self.source_folder}/{self._source_subfolder}/src/ads_globals.cpp",
f"{self.source_folder}/src/ads_globals.cpp",
"#include <qpa/qplatformnativeinterface.h>",
f"#include <{self._qt_version}/QtGui/qpa/qplatformnativeinterface.h>"
)

def generate(self):
tc = CMakeDeps(self)
tc.generate()

def build(self):
self._patch_sources()
cmake = self._configure_cmake()
Expand All @@ -83,7 +86,7 @@ def build(self):
def package(self):
cmake = self._configure_cmake()
cmake.install()
self.copy("LICENSE", dst="licenses", src=self._source_subfolder)
self.copy("LICENSE", dst="licenses", src=self.source_folder)
rmdir(self, os.path.join(self.package_folder, "license"))
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))

Expand Down
4 changes: 4 additions & 0 deletions recipes/qt-advanced-docking-system/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
versions:
"4.1.1":
folder: "all"
"3.8.4":
folder: "all"
"3.8.3":
folder: "all"
"3.8.2":
Expand Down

0 comments on commit 57e0fa9

Please sign in to comment.