diff options
Diffstat (limited to 'vcpkg/ports/libsystemd')
| -rw-r--r-- | vcpkg/ports/libsystemd/disable-warning-nonnull.patch | 14 | ||||
| -rw-r--r-- | vcpkg/ports/libsystemd/only-libsystemd.patch | 56 | ||||
| -rw-r--r-- | vcpkg/ports/libsystemd/pkgconfig.patch | 25 | ||||
| -rw-r--r-- | vcpkg/ports/libsystemd/portfile.cmake | 78 | ||||
| -rw-r--r-- | vcpkg/ports/libsystemd/vcpkg.json | 24 |
5 files changed, 197 insertions, 0 deletions
diff --git a/vcpkg/ports/libsystemd/disable-warning-nonnull.patch b/vcpkg/ports/libsystemd/disable-warning-nonnull.patch new file mode 100644 index 0000000..1ce5b68 --- /dev/null +++ b/vcpkg/ports/libsystemd/disable-warning-nonnull.patch @@ -0,0 +1,14 @@ +diff --git a/src/basic/memory-util.h b/src/basic/memory-util.h +index 1179513..fc39e06 100644 +--- a/src/basic/memory-util.h ++++ b/src/basic/memory-util.h +@@ -41,7 +41,9 @@ static inline int memcmp_safe(const void *s1, const void *s2, size_t n) { + return 0; + assert(s1); + assert(s2); ++DISABLE_WARNING_NONNULL + return memcmp(s1, s2, n); ++REENABLE_WARNING + } + + /* Compare s1 (length n1) with s2 (length n2) in lexicographic order. */ diff --git a/vcpkg/ports/libsystemd/only-libsystemd.patch b/vcpkg/ports/libsystemd/only-libsystemd.patch new file mode 100644 index 0000000..ab71767 --- /dev/null +++ b/vcpkg/ports/libsystemd/only-libsystemd.patch @@ -0,0 +1,56 @@ +diff --git a/meson.build b/meson.build +index a4730f0..32ec825 100644 +--- a/meson.build ++++ b/meson.build +@@ -2148,12 +2148,11 @@ libsystemd_includes = [basic_includes, include_directories( + includes = [libsystemd_includes, include_directories('src/shared')] + + subdir('po') +-subdir('catalog') ++support_url='https://github.com/microsoft/vcpkg/issues' + subdir('src/fundamental') + subdir('src/basic') + subdir('src/libsystemd') +-subdir('src/shared') +-subdir('src/libudev') ++static_libudev='unused' + + libsystemd = shared_library( + 'systemd', +@@ -2169,7 +2168,8 @@ libsystemd = shared_library( + threads, + userspace], + link_depends : libsystemd_sym, +- install : true, ++ build_by_default : static_libsystemd == 'false', ++ install : static_libsystemd == 'false', + install_tag: 'libsystemd', + install_dir : libdir) + +@@ -2205,6 +2205,8 @@ else + alias_target('libsystemd', libsystemd) + endif + ++if false ++ + libudev = shared_library( + 'udev', + version : libudev_version, +@@ -2940,6 +2942,17 @@ custom_target( + install_dir : testdata_dir, + command : [meson_extract_unit_files, meson.project_build_root()]) + ++else ++ # headers ++ subdir('src/systemd') ++ # subdir man ++ want_html=false ++ want_man=false ++ # subdir shell-completion/* ++ bashcompletiondir='no' ++ zshcompletiondir='no' ++endif ++ + ##################################################################### + + alt_time_epoch = run_command('date', '-Is', '-u', '-d', '@@0@'.format(time_epoch), diff --git a/vcpkg/ports/libsystemd/pkgconfig.patch b/vcpkg/ports/libsystemd/pkgconfig.patch new file mode 100644 index 0000000..8a7b82c --- /dev/null +++ b/vcpkg/ports/libsystemd/pkgconfig.patch @@ -0,0 +1,25 @@ +diff --git a/meson.build b/meson.build +index 687450e..ee4460b 100644 +--- a/meson.build ++++ b/meson.build +@@ -1011,6 +1011,9 @@ threads = dependency('threads') + librt = cc.find_library('rt') + libm = cc.find_library('m') + libdl = cc.find_library('dl') ++conf.set_quoted('PC_RT', librt.found() ? '-lrt' : '') ++conf.set_quoted('PC_M', libm.found() ? '-lm' : '') ++conf.set_quoted('PC_DL', libdl.found() ? '-ldl' : '') + libcrypt = dependency('libcrypt', 'libxcrypt', required : false) + if not libcrypt.found() + # fallback to use find_library() if libcrypt is provided by glibc, e.g. for LibreELEC. +diff --git a/src/libsystemd/libsystemd.pc.in b/src/libsystemd/libsystemd.pc.in +index 3a43ef6..930f16a 100644 +--- a/src/libsystemd/libsystemd.pc.in ++++ b/src/libsystemd/libsystemd.pc.in +@@ -17,4 +17,6 @@ Description: systemd Library + URL: {{PROJECT_URL}} + Version: {{PROJECT_VERSION}} + Libs: -L${libdir} -lsystemd ++Libs.private: {{PC_DL}} {{PC_M}} {{PC_RT}} ++Requires.private: libcap libcrypt liblz4 liblzma libzstd mount + Cflags: -I${includedir} diff --git a/vcpkg/ports/libsystemd/portfile.cmake b/vcpkg/ports/libsystemd/portfile.cmake new file mode 100644 index 0000000..67a6821 --- /dev/null +++ b/vcpkg/ports/libsystemd/portfile.cmake @@ -0,0 +1,78 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO systemd/systemd + REF "v${VERSION}" + SHA512 30331df5eb7a1556da8c017a0e6c07b8b99f0cb31da055c1b86c9b9e6fd7074f7c6746efa3e69711b73af48a15d61a84f35ad6e554d32a23441ba910398f7f65 + PATCHES + disable-warning-nonnull.patch + only-libsystemd.patch + pkgconfig.patch +) + +set(static false) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(static pic) +endif() + +vcpkg_configure_meson( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -Dmode=release + -Dstatic-libsystemd=${static} + -Dtests=false + # disabled capabilites + -Ddns-over-tls=false + -Dtranslations=false + # disabled dependencies + -Dacl=disabled + -Dapparmor=disabled + -Daudit=disabled + -Dblkid=disabled + -Dbpf-framework=disabled + -Dbzip2=disabled + -Ddbus=disabled # tests only + -Delfutils=disabled + -Dfdisk=disabled + -Dgcrypt=disabled + -Dglib=disabled # tests only + -Dgnutls=disabled + -Dkmod=disabled + -Dlibcurl=disabled + -Dlibcryptsetup=disabled + -Dlibfido2=disabled + -Dlibidn=disabled + -Dlibidn2=disabled + -Dlibiptc=disabled + -Dmicrohttpd=disabled + -Dopenssl=disabled + -Dp11kit=disabled + -Dpam=disabled + -Dpcre2=disabled + -Dpolkit=disabled + -Dpwquality=disabled + -Dpasswdqc=disabled + -Dseccomp=disabled + -Dselinux=disabled + -Dtpm2=disabled + -Dxenctrl=disabled + -Dxkbcommon=disabled + -Dzlib=disabled + # enabled dependencies + -Dlz4=enabled + -Dxz=enabled + -Dzstd=enabled + ADDITIONAL_BINARIES + "gperf = ['${CURRENT_HOST_INSTALLED_DIR}/tools/gperf/gperf${HOST_EXECUTABLE_SUFFIX}']" +) + +vcpkg_install_meson() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_fixup_pkgconfig() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSES/README.md" "${SOURCE_PATH}/LICENSE.LGPL2.1" + COMMENT [[ +This port provides libsystemd.so/.a, which is based on sources in +src/basic, src/fundamental, src/systemd and src/libsystemd. +]]) diff --git a/vcpkg/ports/libsystemd/vcpkg.json b/vcpkg/ports/libsystemd/vcpkg.json new file mode 100644 index 0000000..e221a3b --- /dev/null +++ b/vcpkg/ports/libsystemd/vcpkg.json @@ -0,0 +1,24 @@ +{ + "name": "libsystemd", + "version": "257.8", + "description": "Libsystemd", + "homepage": "https://github.com/systemd/systemd", + "license": null, + "supports": "linux", + "dependencies": [ + { + "name": "gperf", + "host": true + }, + "libcap", + "liblzma", + "libmount", + "libxcrypt", + "lz4", + { + "name": "vcpkg-tool-meson", + "host": true + }, + "zstd" + ] +} |