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

libpsl: add v0.21.2, bump deps, simplify patching #22029

Open
wants to merge 3 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
6 changes: 3 additions & 3 deletions recipes/libpsl/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sources:
"0.21.5":
url: "https://github.com/rockdaboot/libpsl/releases/download/0.21.5/libpsl-0.21.5.tar.gz"
sha256: "1dcc9ceae8b128f3c0b3f654decd0e1e891afc6ff81098f227ef260449dae208"
"0.21.1":
url: "https://github.com/rockdaboot/libpsl/releases/download/0.21.1/libpsl-0.21.1.tar.gz"
sha256: "ac6ce1e1fbd4d0254c4ddb9d37f1fa99dec83619c1253328155206b896210d4c"
patches:
"0.21.1":
- patch_file: "patches/0001-0.21.2-meson-no-tests.patch"
28 changes: 18 additions & 10 deletions recipes/libpsl/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from conan import ConanFile
from conan.tools.apple import fix_apple_shared_install_name
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rm, rmdir
from conan.tools.files import copy, get, rm, rmdir, replace_in_file
from conan.tools.gnu import PkgConfigDeps
from conan.tools.layout import basic_layout
from conan.tools.meson import Meson, MesonToolchain
from conan.tools.scm import Version
import os

required_conan_version = ">=1.53.0"
Expand All @@ -30,9 +31,6 @@ class LibPslConan(ConanFile):
"with_idna": "icu",
}

def export_sources(self):
export_conandata_patches(self)

def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
Expand All @@ -48,18 +46,18 @@ def layout(self):

def requirements(self):
if self.options.with_idna == "icu":
self.requires("icu/73.2")
self.requires("icu/74.1")
elif self.options.with_idna == "libidn":
self.requires("libidn/1.36")
elif self.options.with_idna == "libidn2":
self.requires("libidn2/2.3.0")
if self.options.with_idna in ("libidn", "libidn2"):
self.requires("libunistring/0.9.10")
self.requires("libunistring/1.1")

def build_requirements(self):
self.tool_requires("meson/1.2.1")
self.tool_requires("meson/[>=1.2.3 <2]")
if not self.conf.get("tools.gnu:pkg_config", check_type=str):
self.tool_requires("pkgconf/2.0.3")
self.tool_requires("pkgconf/[>=2.2.0 <3]")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
Expand All @@ -76,13 +74,22 @@ def generate(self):
env.generate()
tc = MesonToolchain(self)
tc.project_options["runtime"] = self._idna_option
tc.project_options["builtin"] = self._idna_option
if Version(self.version) >= "0.21.2":
tc.project_options["builtin"] = "true" if self.options.with_idna else "false"
else:
tc.project_options["builtin"] = self._idna_option
if not self.options.shared:
tc.preprocessor_definitions["PSL_STATIC"] = "1"
tc.generate()
deps = PkgConfigDeps(self)
deps.generate()

def _patch_sources(self):
replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('tests')", "")
replace_in_file(self, os.path.join(self.source_folder, "meson.build"), "subdir('fuzz')", "")

def build(self):
apply_conandata_patches(self)
self._patch_sources()
meson = Meson(self)
meson.configure()
meson.build()
Expand All @@ -94,6 +101,7 @@ def package(self):
meson.install()
rm(self, "*.pdb", os.path.join(self.package_folder, "bin"))
rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig"))
rmdir(self, os.path.join(self.package_folder, "share"))
fix_apple_shared_install_name(self)
fix_msvc_libname(self)

Expand Down
11 changes: 0 additions & 11 deletions recipes/libpsl/all/patches/0001-0.21.2-meson-no-tests.patch

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/libpsl/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
versions:
"0.21.5":
folder: "all"
"0.21.1":
folder: "all"
Loading