diff options
Diffstat (limited to 'vcpkg/ports/pkgconf')
| -rw-r--r-- | vcpkg/ports/pkgconf/001-unveil-fixes.patch | 50 | ||||
| -rw-r--r-- | vcpkg/ports/pkgconf/portfile.cmake | 104 | ||||
| -rw-r--r-- | vcpkg/ports/pkgconf/vcpkg.json | 15 |
3 files changed, 169 insertions, 0 deletions
diff --git a/vcpkg/ports/pkgconf/001-unveil-fixes.patch b/vcpkg/ports/pkgconf/001-unveil-fixes.patch new file mode 100644 index 0000000..fb171a6 --- /dev/null +++ b/vcpkg/ports/pkgconf/001-unveil-fixes.patch @@ -0,0 +1,50 @@ +diff --git a/cli/main.c b/cli/main.c +index a1cf90e..3ab2092 100644 +--- a/cli/main.c ++++ b/cli/main.c +@@ -1055,7 +1055,7 @@ unveil_search_paths(const pkgconf_client_t *client, const pkgconf_cross_personal + { + pkgconf_path_t *pn = n->data; + +- if (pkgconf_unveil(pn->path, "r") == -1) ++ if (pkgconf_unveil(pn->path, "r") == -1 && errno != ENOENT) + return false; + } + +@@ -1063,7 +1063,7 @@ unveil_search_paths(const pkgconf_client_t *client, const pkgconf_cross_personal + { + pkgconf_path_t *pn = n->data; + +- if (pkgconf_unveil(pn->path, "r") == -1) ++ if (pkgconf_unveil(pn->path, "r") == -1 && errno != ENOENT) + return false; + } + +@@ -1276,13 +1276,6 @@ main(int argc, char *argv[]) + /* now, bring up the client. settings are preserved since the client is prealloced */ + pkgconf_client_init(&pkg_client, error_handler, NULL, personality); + +- /* unveil the entire search path now that we have loaded the personality data. */ +- if (!unveil_search_paths(&pkg_client, personality)) +- { +- fprintf(stderr, "pkgconf: unveil failed: %s\n", strerror(errno)); +- return EXIT_FAILURE; +- } +- + #ifndef PKGCONF_LITE + if ((want_flags & PKG_MSVC_SYNTAX) == PKG_MSVC_SYNTAX || getenv("PKG_CONFIG_MSVC_SYNTAX") != NULL) + want_render_ops = msvc_renderer_get(); +@@ -1452,6 +1445,13 @@ main(int argc, char *argv[]) + /* at this point, want_client_flags should be set, so build the dir list */ + pkgconf_client_dir_list_build(&pkg_client, personality); + ++ /* unveil the entire search path now that we have loaded the personality data. */ ++ if (!unveil_search_paths(&pkg_client, personality)) ++ { ++ fprintf(stderr, "pkgconf: unveil failed: %s\n", strerror(errno)); ++ return EXIT_FAILURE; ++ } ++ + /* preload any files in PKG_CONFIG_PRELOADED_FILES */ + pkgconf_client_preload_from_environ(&pkg_client, "PKG_CONFIG_PRELOADED_FILES"); + diff --git a/vcpkg/ports/pkgconf/portfile.cmake b/vcpkg/ports/pkgconf/portfile.cmake new file mode 100644 index 0000000..d8c4cc7 --- /dev/null +++ b/vcpkg/ports/pkgconf/portfile.cmake @@ -0,0 +1,104 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO pkgconf/pkgconf
+ REF "pkgconf-${VERSION}"
+ SHA512 53244f372ea21125a1d97c5b89a84299740b55a66165782e807ed23adab3a07408a1547f1f40156e3060359660d07f49846c8b4893beef10ac9440ab7e8611cc
+ HEAD_REF master
+ PATCHES
+ 001-unveil-fixes.patch # https://github.com/pkgconf/pkgconf/pull/430
+)
+
+vcpkg_configure_meson(
+ SOURCE_PATH "${SOURCE_PATH}"
+ NO_PKG_CONFIG
+ OPTIONS
+ -Dtests=disabled
+)
+
+set(systemsuffix "")
+set(architectureprefix "")
+
+set(SYSTEM_LIBDIR "")
+set(PKG_DEFAULT_PATH "")
+set(SYSTEM_INCLUDEDIR "")
+set(PERSONALITY_PATH "personality.d")
+
+if(NOT VCPKG_CROSSCOMPILING)
+ if(VCPKG_TARGET_IS_BSD)
+ set(SYSTEM_INCLUDEDIR "/usr/include")
+ set(SYSTEM_LIBDIR "/usr/lib")
+ if(VCPKG_TARGET_IS_FREEBSD)
+ # These are taken from the FreeBSD port of pkgconf
+ set(PKG_DEFAULT_PATH "/usr/libdata/pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig")
+ elseif(VCPKG_TARGET_IS_OPENBSD)
+ # Based on how new OpenBSD builds their version of pkgconf
+ set(PKG_DEFAULT_PATH "/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/X11R6/lib/pkgconfig:/usr/X11R6/share/pkgconfig")
+ elseif(VCPKG_TARGET_IS_NETBSD)
+ # Based on NetBSD's pkgconf default values
+ set(PKG_DEFAULT_PATH "/usr/pkg/lib/pkgconfig:/usr/pkg/share/pkgconfig:/usr/lib/pkgconfig:/usr/X11R7/lib/pkgconfig")
+ endif()
+ elseif(NOT VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
+ # These defaults are obtained from pkgconf/pkg-config on Ubuntu and OpenSuse
+ # vcpkg cannot do system introspection to obtain/set these values since it would break binary caching.
+ set(SYSTEM_INCLUDEDIR "/usr/include")
+ # System lib dirs will be stripped from -L from the pkg-config output
+ set(SYSTEM_LIBDIR "/lib:/lib/i386-linux-gnu:/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnux32:/lib64:/lib32:/libx32:/usr/lib:/usr/lib/i386-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnux32:/usr/lib64:/usr/lib32:/usr/libx32")
+ set(PKG_DEFAULT_PATH "/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig")
+ set(PERSONALITY_PATH "/usr/share/pkgconfig/personality.d:/etc/pkgconfig/personality.d")
+ elseif(NOT VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "riscv64")
+ # These defaults are obtained from pkgconf/pkg-config on Ubuntu
+ set(SYSTEM_INCLUDEDIR "/usr/include")
+ set(SYSTEM_LIBDIR "/lib:/lib/riscv64-linux-gnu:/usr/lib:/usr/lib/riscv64-linux-gnu")
+ set(PKG_DEFAULT_PATH "/usr/local/lib/riscv64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/riscv64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig")
+ set(PERSONALITY_PATH "/usr/share/pkgconfig/personality.d:/etc/pkgconfig/personality.d")
+ endif()
+endif()
+
+if(DEFINED VCPKG_pkgconf_SYSTEM_LIBDIR)
+ set(SYSTEM_LIBDIR "${VCPKG_pkgconf_SYSTEM_LIBDIR}")
+endif()
+if(DEFINED VCPKG_pkgconf_PKG_DEFAULT_PATH)
+ set(PKG_DEFAULT_PATH "${VCPKG_pkgconf_PKG_DEFAULT_PATH}")
+endif()
+if(DEFINED VCPKG_pkgconf_SYSTEM_INCLUDEDIR)
+ set(SYSTEM_INCLUDEDIR "${VCPKG_pkgconf_SYSTEM_INCLUDEDIR}")
+endif()
+if(DEFINED VCPKG_pkgconf_PERSONALITY_PATH)
+ set(PERSONALITY_PATH "${VCPKG_pkgconf_PERSONALITY_PATH}")
+endif()
+
+
+set(pkgconfig_file "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/libpkgconf/config.h")
+if(EXISTS "${pkgconfig_file}")
+ file(READ "${pkgconfig_file}" contents)
+ string(REGEX REPLACE "#define PKG_DEFAULT_PATH [^\n]+" "#define PKG_DEFAULT_PATH \"${PKG_DEFAULT_PATH}\"" contents "${contents}")
+ string(REGEX REPLACE "#define SYSTEM_INCLUDEDIR [^\n]+" "#define SYSTEM_INCLUDEDIR \"${SYSTEM_INCLUDEDIR}\"" contents "${contents}")
+ string(REGEX REPLACE "#define SYSTEM_LIBDIR [^\n]+" "#define SYSTEM_LIBDIR \"${SYSTEM_LIBDIR}\"" contents "${contents}")
+ string(REGEX REPLACE "#define PERSONALITY_PATH [^\n]+" "#define PERSONALITY_PATH \"${PERSONALITY_PATH}\"" contents "${contents}")
+ file(WRITE "${pkgconfig_file}" "${contents}")
+endif()
+set(pkgconfig_file "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/libpkgconf/config.h")
+if(EXISTS "${pkgconfig_file}")
+ file(READ "${pkgconfig_file}" contents)
+ string(REGEX REPLACE "#define PKG_DEFAULT_PATH [^\n]+" "#define PKG_DEFAULT_PATH \"${PKG_DEFAULT_PATH}\"" contents "${contents}")
+ string(REGEX REPLACE "#define SYSTEM_INCLUDEDIR [^\n]+" "#define SYSTEM_INCLUDEDIR \"${SYSTEM_INCLUDEDIR}\"" contents "${contents}")
+ string(REGEX REPLACE "#define SYSTEM_LIBDIR [^\n]+" "#define SYSTEM_LIBDIR \"${SYSTEM_LIBDIR}\"" contents "${contents}")
+ string(REGEX REPLACE "#define PERSONALITY_PATH [^\n]+" "#define PERSONALITY_PATH \"${PERSONALITY_PATH}\"" contents "${contents}")
+ file(WRITE "${pkgconfig_file}" "${contents}")
+endif()
+
+vcpkg_install_meson()
+vcpkg_fixup_pkgconfig(SKIP_CHECK)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man")
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/pkgconf/libpkgconf/libpkgconf-api.h" "#if defined(PKGCONFIG_IS_STATIC)" "#if 1")
+endif()
+
+vcpkg_copy_tools(TOOL_NAMES bomtool pkgconf AUTO_CLEAN)
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/pkgconf/vcpkg.json b/vcpkg/ports/pkgconf/vcpkg.json new file mode 100644 index 0000000..5567624 --- /dev/null +++ b/vcpkg/ports/pkgconf/vcpkg.json @@ -0,0 +1,15 @@ +{ + "name": "pkgconf", + "version": "2.5.1", + "port-version": 4, + "description": "pkgconf is a program which helps to configure compiler and linker flags for development libraries. It is similar to pkg-config from freedesktop.org.", + "homepage": "https://github.com/pkgconf/pkgconf", + "license": null, + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-tool-meson", + "host": true + } + ] +} |