Skip to content

Commit

Permalink
libsystemd: bump to v255, fix extraction of filenames with escaped chars
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Dec 7, 2023
1 parent 39f7397 commit 57dc626
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
15 changes: 4 additions & 11 deletions recipes/libsystemd/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sources:
"254.7":
url: "https://github.com/systemd/systemd-stable/archive/v254.7.tar.gz"
sha256: "9d7b4b21d2db3b16286b9ec6657ba86bd797388c532bdc63862826f6d39fe8cb"
"255":
url: "https://github.com/systemd/systemd-stable/archive/v255.tar.gz"
sha256: "a3eb766ee96eb9f4cc25c2a6c933f3299e1b7ae22e72507dade0a5c86d92534f"
"253.14":
url: "https://github.com/systemd/systemd-stable/archive/v253.14.tar.gz"
sha256: "9c83ac26f691ff2c482659884f01f1155ef5e1bd202204f9e3076a31e54ab155"
Expand Down Expand Up @@ -30,14 +30,7 @@ sources:
url: "https://github.com/systemd/systemd-stable/archive/v246.16.tar.gz"
sha256: "b69f9940d65870f090269a28f1047a633d4b80d0001e091d53a031dd40a822d2"
patches:
"254.7":
- patch_file: "patches/254.7/0002-meson-use-c_args-in-generator-scripts.patch"
patch_source: "https://patch-diff.githubusercontent.com/raw/systemd/systemd/pull/29538"
patch_description: "fixes cross-compilation by passing necessary compiler arguments to generator scripts"
patch_type: "portability"
- patch_file: "patches/253.3/0001-missing_syscalls.py-Replace-unicode-with-ascii.patch"
patch_description: "allow to use meson.build with older versions of Python by replacing utf8 message to ascii message in the helper script"
patch_type: "conan"
"255":
- patch_file: "patches/251.15/0001-Remove-dependency-from-coreutils.patch"
patch_description: "allow to build in environments without 'realpath --relative-to' by replacing it with conan-specific build variable"
patch_type: "conan"
Expand Down
14 changes: 8 additions & 6 deletions recipes/libsystemd/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import os
import re
import tarfile

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, replace_in_file, download, move_folder_contents
from conan.tools.gnu import PkgConfigDeps
from conan.tools.layout import basic_layout
from conan.tools.meson import Meson, MesonToolchain
Expand Down Expand Up @@ -77,7 +78,12 @@ def build_requirements(self):
self.tool_requires("pkgconf/2.1.0")

def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
# Extract using standard Python tools due to Conan's unzip() not handling backslashes in
# 'units/system-systemd\x2dcryptsetup.slice', etc. correctly.
download(self, **self.conan_data["sources"][self.version], filename="sources.tar.gz")
with tarfile.open("sources.tar.gz", "r:gz") as tar:
tar.extractall()
move_folder_contents(self, os.path.join(self.source_folder, f"systemd-stable-{self.version}"), self.source_folder)

@property
def _so_version(self):
Expand Down Expand Up @@ -164,12 +170,8 @@ def generate(self):

def _patch_sources(self):
apply_conandata_patches(self)

meson_build = os.path.join(self.source_folder, "meson.build")
replace_in_file(self, meson_build, "@CONAN_SRC_REL_PATH@", f"'../{self.source_path.name}'")
# Fix an invalid path separator, which breaks with newer Meson versions
replace_in_file(self, os.path.join(self.source_folder, "units", "meson.build"),
r"system-systemd\\x2d", "system-systemd/x2d")

def build(self):
self._patch_sources()
Expand Down
2 changes: 1 addition & 1 deletion recipes/libsystemd/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
versions:
"254.7":
"255":
folder: all
"253.14":
folder: all
Expand Down

0 comments on commit 57dc626

Please sign in to comment.