Skip to content

Commit

Permalink
libsigcpp: add v3.6.0, v2.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Dec 26, 2023
1 parent 0e62da4 commit 77b58eb
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 86 deletions.
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"
28 changes: 14 additions & 14 deletions recipes/libsigcpp/3.x.x/conanfile.py
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,27 @@ 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)

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"

0 comments on commit 77b58eb

Please sign in to comment.