[libsystemd] add new port (#31150)

* add libsystemd, libcap, libxcrypt

* baseline libsystemd, libcap, libxcrypt

* versions tree libsystemd, libcap, libxcrypt

* licenses for libsystemd, libcap, libxcrypt in vcpkg.json

* update tree for libsystemd, libcap, libxcrypt

* allow restricted header libxcrypt

* tree allow restricted header libxcrypt

* remove message Warning

* use targets exist during configure, instead of configure_file variable to search for zstd

* update git-tree

* add quotes to full paths and remove messages in portfiles

* update git-tree

* remove extra spaces

* update git-tree

* remove extra line

* update git tree

* do configure hack differently and remove cross compile patch and override compiler during build_make

* update git tree

* try either gcc or clang for libcap and specify log file root for each build command

* update git-tree

* libcap use host dependency of self

* libcap update git tree

* libsystemd is LGPL2.1

* update libsystemd git-tree

* change from find_package to find_dependency in unofficial cmake export
of libsystemd

* update libsystemd git-tree

* update libxcrypt

* update git tree libxcrypt

* patch pkgconfig file of libsystemd

* update libsystemd git-tree

* update libsystemd to 254

* update git-tree libsystemd

* * Copy of cap_names.h checked in for cross compilation
* Decouple cap_names.h from libcap.* make targets
* Use vcpkg_cmake_get_vars instead of ENV{CC} etc.
* Remove unnecessary self dependency of libcap
* Update libcap to 1.2.69

* Update git-tree

* cleanup old versions from version jsons
This commit is contained in:
Jón Bjarni 2023-09-20 16:56:16 +00:00 committed by GitHub
parent 280e7673e7
commit 5be487d27a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 321 additions and 0 deletions

56
ports/libcap/cap_names.h Normal file
View File

@ -0,0 +1,56 @@
/*
* DO NOT EDIT: this file is generated automatically from
*
* <uapi/linux/capability.h>
*/
#define __CAP_BITS 41
#define __CAP_NAME_SIZE 23
#ifdef LIBCAP_PLEASE_INCLUDE_ARRAY
#define LIBCAP_CAP_NAMES { \
/* 0 */ "cap_chown", \
/* 1 */ "cap_dac_override", \
/* 2 */ "cap_dac_read_search", \
/* 3 */ "cap_fowner", \
/* 4 */ "cap_fsetid", \
/* 5 */ "cap_kill", \
/* 6 */ "cap_setgid", \
/* 7 */ "cap_setuid", \
/* 8 */ "cap_setpcap", \
/* 9 */ "cap_linux_immutable", \
/* 10 */ "cap_net_bind_service", \
/* 11 */ "cap_net_broadcast", \
/* 12 */ "cap_net_admin", \
/* 13 */ "cap_net_raw", \
/* 14 */ "cap_ipc_lock", \
/* 15 */ "cap_ipc_owner", \
/* 16 */ "cap_sys_module", \
/* 17 */ "cap_sys_rawio", \
/* 18 */ "cap_sys_chroot", \
/* 19 */ "cap_sys_ptrace", \
/* 20 */ "cap_sys_pacct", \
/* 21 */ "cap_sys_admin", \
/* 22 */ "cap_sys_boot", \
/* 23 */ "cap_sys_nice", \
/* 24 */ "cap_sys_resource", \
/* 25 */ "cap_sys_time", \
/* 26 */ "cap_sys_tty_config", \
/* 27 */ "cap_mknod", \
/* 28 */ "cap_lease", \
/* 29 */ "cap_audit_write", \
/* 30 */ "cap_audit_control", \
/* 31 */ "cap_setfcap", \
/* 32 */ "cap_mac_override", \
/* 33 */ "cap_mac_admin", \
/* 34 */ "cap_syslog", \
/* 35 */ "cap_wake_alarm", \
/* 36 */ "cap_block_suspend", \
/* 37 */ "cap_audit_read", \
/* 38 */ "cap_perfmon", \
/* 39 */ "cap_bpf", \
/* 40 */ "cap_checkpoint_restore", \
}
#endif /* LIBCAP_PLEASE_INCLUDE_ARRAY */
/* END OF FILE */

View File

@ -0,0 +1,13 @@
diff --git a/libcap/Makefile b/libcap/Makefile
index f5dde3e..4eb13aa 100644
--- a/libcap/Makefile
+++ b/libcap/Makefile
@@ -25,7 +25,7 @@ CFLAGS += -fPIC
# executable
MAGIC=-Wl,-e,__so_start
-INCLS=libcap.h cap_names.h $(INCS)
+INCLS=libcap.h $(INCS)
GPERF_OUTPUT = _caps_output.gperf
CAPOBJS=$(addsuffix .o, $(CAPFILES))

1
ports/libcap/configure vendored Executable file
View File

@ -0,0 +1 @@
#!/bin/sh

View File

@ -0,0 +1,85 @@
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL git://git.kernel.org/pub/scm/libs/libcap/libcap.git
FETCH_REF "libcap-${VERSION}"
REF 3c7dda330bd9a154bb5b878d31fd591e4951fe17
PATCHES
cap_names.separation.patch
)
# Note: if libcap version is updated, the according cap_names.h should be updated if necessary.
# SKIP_CONFIGURE is broken https://github.com/microsoft/vcpkg/issues/14389
# so we use patch to create empty configure executable
file(COPY "${CMAKE_CURRENT_LIST_DIR}/configure" DESTINATION "${SOURCE_PATH}")
# This needs to be called before configure
vcpkg_cmake_get_vars(cmake_vars_file)
if(VCPKG_CROSSCOMPILING)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/cap_names.h" DESTINATION "${SOURCE_PATH}/libcap/")
endif ()
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
COPY_SOURCE
)
include("${cmake_vars_file}")
list(APPEND libcap_OPTIONS "prefix=${CURRENT_INSTALLED_DIR}" "CC=${VCPKG_DETECTED_CMAKE_C_COMPILER}" "AR=${VCPKG_DETECTED_CMAKE_AR}" "RANLIB=${VCPKG_DETECTED_CMAKE_RANLIB}")
if (NOT VCPKG_CROSSCOMPILING)
# patch decouples cap_names.h target from libcap.* for cross compile compatibility,
# so for host=target build we manually make it
vcpkg_build_make(SUBPATH libcap
BUILD_TARGET cap_names.h
LOGFILE_ROOT "configure"
OPTIONS
${libcap_OPTIONS}
)
endif ()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_build_make(SUBPATH libcap
BUILD_TARGET libcap.a
LOGFILE_ROOT "build"
OPTIONS
${libcap_OPTIONS}
)
else()
vcpkg_build_make(SUBPATH libcap
BUILD_TARGET libcap.so
LOGFILE_ROOT "build"
OPTIONS
${libcap_OPTIONS}
)
endif()
vcpkg_build_make(SUBPATH libcap
BUILD_TARGET libcap.pc
LOGFILE_ROOT "pkgconfig"
OPTIONS
${libcap_OPTIONS}
)
file(INSTALL "${SOURCE_PATH}/libcap/include/" DESTINATION "${CURRENT_PACKAGES_DIR}/include" FILES_MATCHING PATTERN "*.h")
set(BUILD_DIR_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(INSTALL "${BUILD_DIR_RELEASE}/libcap/libcap.a" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
else()
file(INSTALL "${BUILD_DIR_RELEASE}/libcap/libcap.so" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" FOLLOW_SYMLINK_CHAIN)
endif()
set(BUILD_DIR_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(INSTALL "${BUILD_DIR_DEBUG}/libcap/libcap.a" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
else()
file(INSTALL "${BUILD_DIR_DEBUG}/libcap/libcap.so" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" FOLLOW_SYMLINK_CHAIN)
endif()
file(INSTALL "${BUILD_DIR_RELEASE}/libcap/libcap.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
file(INSTALL "${BUILD_DIR_DEBUG}/libcap/libcap.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/License")
vcpkg_fixup_pkgconfig()

14
ports/libcap/vcpkg.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "libcap",
"version": "2.69",
"description": "capability library: includes libcap2 file caps, setcap, getcap and capsh",
"homepage": "https://git.kernel.org/pub/scm/libs/libcap/libcap.git",
"license": "BSD-3-Clause",
"supports": "linux",
"dependencies": [
{
"name": "vcpkg-cmake-get-vars",
"host": true
}
]
}

View File

@ -0,0 +1,11 @@
diff --git a/src/libsystemd/libsystemd.pc.in b/src/libsystemd/libsystemd.pc.in
index da6e4e667e..3786238ccb 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: -lrt
+Requires.private: libcap libcrypt liblz4 liblzma libzstd mount
Cflags: -I${includedir}

View File

@ -0,0 +1,54 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO systemd/systemd
REF "v${VERSION}"
SHA512 84b4d16980fe2e64d5c3c95b9b4fbaad1076f368f493fdd745cbafbe7ce825293384f5fa0b6360ba8188da23c4575e87402fb666a3b71f84ff8b323aba0c07ff
PATCHES
pkgconfig.patch
)
vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-Dstatic-libsystemd=true
-Daudit=false
-Dgcrypt=false
OPTIONS_DEBUG
-Drootprefix=${CURRENT_PACKAGES_DIR}/debug
-Dpkgconfiglibdir={CURRENT_PACKAGES_DIR}/debug
OPTIONS_RELEASE
-Drootprefix=${CURRENT_PACKAGES_DIR}
-Dpkgconfiglibdir={CURRENT_PACKAGES_DIR}
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_build_ninja(
TARGETS libsystemd.a devel
)
else()
vcpkg_build_ninja(
TARGETS libsystemd devel
)
endif()
file(INSTALL "${SOURCE_PATH}/src/systemd" DESTINATION "${CURRENT_PACKAGES_DIR}/include" FILES_MATCHING PATTERN "*.h")
set(BUILD_DIR_RELEASE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(INSTALL "${BUILD_DIR_RELEASE}/libsystemd.a" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
else()
file(INSTALL "${BUILD_DIR_RELEASE}/libsystemd.so" DESTINATION "${CURRENT_PACKAGES_DIR}/lib" FOLLOW_SYMLINK_CHAIN)
endif()
set(BUILD_DIR_DEBUG "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(INSTALL "${BUILD_DIR_DEBUG}/libsystemd.a" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
else()
file(INSTALL "${BUILD_DIR_DEBUG}/libsystemd.so" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" FOLLOW_SYMLINK_CHAIN)
endif()
file(INSTALL "${BUILD_DIR_RELEASE}/src/libsystemd/libsystemd.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
file(INSTALL "${BUILD_DIR_DEBUG}/src/libsystemd/libsystemd.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig")
vcpkg_fixup_pkgconfig()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.LGPL2.1")

View File

@ -0,0 +1,20 @@
{
"name": "libsystemd",
"version": "254",
"description": "Libsystemd",
"homepage": "https://github.com/systemd/systemd",
"license": "LGPL-2.1+",
"supports": "linux",
"dependencies": [
"libcap",
"liblzma",
"libmount",
"libxcrypt",
"lz4",
{
"name": "vcpkg-tool-meson",
"host": true
},
"zstd"
]
}

View File

@ -0,0 +1,20 @@
set(VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS enabled)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO besser82/libxcrypt
REF "v${VERSION}"
SHA512 61e5e393654f37775457474d4170098314879ee79963d423c1c461e80dc5dc74f0c161dd8754f016ce96109167be6c580ad23994fa1d2c38c54b96e602f3aece
)
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSING" "${SOURCE_PATH}/COPYING.LIB")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

View File

@ -0,0 +1,8 @@
{
"name": "libxcrypt",
"version": "4.4.36",
"description": "libxcrypt is a modern library for one-way hashing of passwords. On Linux-based systems, by default libxcrypt will be binary backward compatible with the libcrypt.so.1 shipped as part of the GNU C Library.",
"homepage": "https://github.com/besser82/libxcrypt",
"license": "LGPL-2.1-only",
"supports": "linux"
}

View File

@ -3968,6 +3968,10 @@
"baseline": "0.30",
"port-version": 4
},
"libcap": {
"baseline": "2.69",
"port-version": 0
},
"libcbor": {
"baseline": "0.10.2",
"port-version": 0
@ -4692,6 +4696,10 @@
"baseline": "3.25",
"port-version": 1
},
"libsystemd": {
"baseline": "254",
"port-version": 0
},
"libtar": {
"baseline": "1.2.20",
"port-version": 0
@ -4852,6 +4860,10 @@
"baseline": "0.4.5",
"port-version": 0
},
"libxcrypt": {
"baseline": "4.4.36",
"port-version": 0
},
"libxcvt": {
"baseline": "0.1.2",
"port-version": 0

9
versions/l-/libcap.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "78c061106eac6df0a86b27df684998c780c70008",
"version": "2.69",
"port-version": 0
}
]
}

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "bc87d660ee35fa2665c12cbd8cb80896f21f99af",
"version": "254",
"port-version": 0
}
]
}

View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "85a0274aca1b0c7bf756cb41f77d9dbfc2b6fb78",
"version": "4.4.36",
"port-version": 0
}
]
}