Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsigcpp: add v3.6.0, v2.12.1 #21954

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions recipes/libsigcpp/2.x.x/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.12.1":
url: "https://ftp2.nluug.nl/windowing/gnome/sources/libsigc++/2.12/libsigc++-2.12.1.tar.xz"
sha256: "a9dbee323351d109b7aee074a9cb89ca3e7bcf8ad8edef1851f4cf359bd50843"
"2.10.8":
url: "https://ftp2.nluug.nl/windowing/gnome/sources/libsigc++/2.10/libsigc++-2.10.8.tar.xz"
sha256: "235a40bec7346c7b82b6a8caae0456353dc06e71f14bc414bcc858af1838719a"
11 changes: 3 additions & 8 deletions recipes/libsigcpp/3.x.x/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
sources:
"3.6.0":
url: "https://ftp.gnome.org/pub/GNOME/sources/libsigc++/3.6/libsigc++-3.6.0.tar.xz"
sha256: "c3d23b37dfd6e39f2e09f091b77b1541fbfa17c4f0b6bf5c89baef7229080e17"
"3.0.7":
url: "https://ftp.gnome.org/pub/GNOME/sources/libsigc++/3.0/libsigc++-3.0.7.tar.xz"
sha256: "bfbe91c0d094ea6bbc6cbd3909b7d98c6561eea8b6d9c0c25add906a6e83d733"
"3.0.0":
url: "https://ftp.gnome.org/pub/GNOME/sources/libsigc++/3.0/libsigc++-3.0.0.tar.xz"
sha256: "50a0855c1eb26e6044ffe888dbe061938ab4241f96d8f3754ea7ead38ab8ed06"
patches:
"3.0.7":
- patch_file: "patches/3.0.7-0001-libsigcpp.patch"
"3.0.0":
- patch_file: "patches/3.0.0-0001-libsigcpp.patch"
30 changes: 16 additions & 14 deletions recipes/libsigcpp/3.x.x/conanfile.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the hook errors, we might want to remove the uncessary doc packaging

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 'long paths' warning for the source folder, but I removed it nevertheless, since it's not required for building.

Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import (
apply_conandata_patches, collect_libs, copy, export_conandata_patches, get,
rename, replace_in_file, rmdir, save
)
from conan.tools.files import collect_libs, copy, get, rename, replace_in_file, rmdir, save
import glob
import os
import textwrap
Expand Down Expand Up @@ -45,9 +42,6 @@ def _minimum_compilers_version(self):
"apple-clang": "10",
}

def export_sources(self):
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand All @@ -64,10 +58,7 @@ def validate(self):
check_min_cppstd(self, self._min_cppstd)

def loose_lt_semver(v1, v2):
lv1 = [int(v) for v in v1.split(".")]
lv2 = [int(v) for v in v2.split(".")]
min_length = min(len(lv1), len(lv2))
return lv1[:min_length] < lv2[:min_length]
return all(int(p1) < int(p2) for p1, p2 in zip(str(v1).split("."), str(v2).split(".")))

minimum_version = self._minimum_compilers_version.get(str(self.settings.compiler), False)
if minimum_version and loose_lt_semver(str(self.settings.compiler.version), minimum_version):
Expand All @@ -76,18 +67,29 @@ def loose_lt_semver(v1, v2):
)

def source(self):
get(self, **self.conan_data["sources"][self.version],
destination=self.source_folder, strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)
# Avoid 'short_paths=True required' warning due to an unused folder
rmdir(self, os.path.join(self.source_folder, "untracked"))

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

def _patch_sources(self):
apply_conandata_patches(self)
if not self.options.shared:
replace_in_file(self, os.path.join(self.source_folder, "sigc++config.h.cmake"),
"define SIGC_DLL 1", "undef SIGC_DLL")
# Disable subdirs
save(self, os.path.join(self.source_folder, "examples", "CMakeLists.txt"), "")
save(self, os.path.join(self.source_folder, "tests", "CMakeLists.txt"), "")
# Enable static builds
cmakelists = os.path.join(self.source_folder, "sigc++", "CMakeLists.txt")
replace_in_file(self, cmakelists, " SHARED ", " ")
# Fix install paths
replace_in_file(self, cmakelists,
'LIBRARY DESTINATION "lib"',
"LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin")


def build(self):
self._patch_sources()
Expand Down
31 changes: 0 additions & 31 deletions recipes/libsigcpp/3.x.x/patches/3.0.0-0001-libsigcpp.patch

This file was deleted.

31 changes: 0 additions & 31 deletions recipes/libsigcpp/3.x.x/patches/3.0.7-0001-libsigcpp.patch

This file was deleted.

6 changes: 4 additions & 2 deletions recipes/libsigcpp/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
versions:
"3.0.7":
"3.6.0":
folder: "3.x.x"
"3.0.0":
"3.0.7":
folder: "3.x.x"
"2.12.1":
folder: "2.x.x"
"2.10.8":
folder: "2.x.x"