dev-util/pkgconf: updated to 1.5.3

- Provides compatibility script for gcc2 main architecture
- Fixed bug where packages using autotools fails to build with pkgconf,
  this is done by folding pkg.m4 back to the main package, causing
  pkgconf to directly conflict with pkgconfig
- Folded _pkgconfig subpackage
This commit is contained in:
Leorize
2018-07-29 22:29:43 +07:00
parent bc6e856f99
commit 5629059dc1
3 changed files with 41 additions and 186 deletions

View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
: "${PKG_CONFIG_LIBDIR:=$(findpaths -c: B_FIND_PATH_DEVELOP_LIB_DIRECTORY pkgconfig):$(findpaths -c: B_FIND_PATH_DATA_DIRECTORY pkgconfig)}"
: "${PKG_CONFIG_SYSTEM_INCLUDE_PATH:=$(findpaths -c: B_FIND_PATH_HEADERS_DIRECTORY)}"
: "${PKG_CONFIG_SYSTEM_LIBRARY_PATH:=$(findpaths -c: B_FIND_PATH_DEVELOP_LIB_DIRECTORY):$(findpaths -c: B_FIND_PATH_LIB_DIRECTORY)}"
export PKG_CONFIG_LIBDIR PKG_CONFIG_SYSTEM_INCLUDE_PATH PKG_CONFIG_SYSTEM_LIBRARY_PATH
${0##*/}-x86 "$@"

View File

@@ -1,164 +0,0 @@
From bd82c5be63b1d14acfaa9b35e78531fe2f5ce5bf Mon Sep 17 00:00:00 2001
From: Leorize <alaviss@users.noreply.github.com>
Date: Tue, 3 Apr 2018 12:46:35 +0700
Subject: libpkgconf: add support for Haiku
client: use BELIBRARIES
On Haiku, BELIBRARIES is the equivalent to LIBRARY_PATH on many other
systems, while LIBRARY_PATH is instead the LD_LIBRARY_PATH of Haiku.
pkg: bootstrap package search paths with Haiku's find_paths
This commit adds build_default_pkgconfig_path. The function appends
to the list given the default pkgconfig paths, and will supersede
get_default_pkgconfig_path
diff --git a/libpkgconf/client.c b/libpkgconf/client.c
index 811e043..a832e83 100644
--- a/libpkgconf/client.c
+++ b/libpkgconf/client.c
@@ -78,7 +78,11 @@ pkgconf_client_init(pkgconf_client_t *client, pkgconf_error_handler_func_t error
pkgconf_path_build_from_environ("PKG_CONFIG_SYSTEM_INCLUDE_PATH", SYSTEM_INCLUDEDIR, &client->filter_includedirs, false);
/* GCC uses these environment variables to define system include paths, so we should check them. */
+#ifdef __HAIKU__
+ pkgconf_path_build_from_environ("BELIBRARIES", NULL, &client->filter_libdirs, false);
+#else
pkgconf_path_build_from_environ("LIBRARY_PATH", NULL, &client->filter_libdirs, false);
+#endif
pkgconf_path_build_from_environ("CPATH", NULL, &client->filter_includedirs, false);
pkgconf_path_build_from_environ("C_INCLUDE_PATH", NULL, &client->filter_includedirs, false);
pkgconf_path_build_from_environ("CPLUS_INCLUDE_PATH", NULL, &client->filter_includedirs, false);
diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c
index 0feb4d6..67b52d7 100644
--- a/libpkgconf/pkg.c
+++ b/libpkgconf/pkg.c
@@ -49,11 +49,12 @@ str_has_suffix(const char *str, const char *suffix)
return !strncasecmp(str + str_len - suf_len, suffix, suf_len);
}
-static inline const char *
-get_default_pkgconfig_path(char *outbuf, size_t outlen)
+static inline void
+build_default_pkgconfig_path(pkgconf_list_t* dirlist)
{
#ifdef _WIN32
char namebuf[MAX_PATH];
+ char outbuf[MAX_PATH];
char *p;
int sizepath = GetModuleFileName(NULL, namebuf, sizeof namebuf);
@@ -65,24 +66,35 @@ get_default_pkgconfig_path(char *outbuf, size_t outlen)
}
p = strrchr(namebuf, '/');
if (p == NULL)
- return PKG_DEFAULT_PATH;
+ pkgconf_path_split(PKG_DEFAULT_PATH, dirlist, true);
*p = '\0';
- pkgconf_strlcpy(outbuf, namebuf, outlen);
- pkgconf_strlcat(outbuf, "/", outlen);
- pkgconf_strlcat(outbuf, "../lib/pkgconfig", outlen);
- pkgconf_strlcat(outbuf, ";", outlen);
- pkgconf_strlcat(outbuf, namebuf, outlen);
- pkgconf_strlcat(outbuf, "/", outlen);
- pkgconf_strlcat(outbuf, "../share/pkgconfig", outlen);
-
- return outbuf;
+ pkgconf_strlcpy(outbuf, namebuf, sizeof outbuf);
+ pkgconf_strlcat(outbuf, "/", sizeof outbuf);
+ pkgconf_strlcat(outbuf, "../lib/pkgconfig", sizeof outbuf);
+ pkgconf_path_add(outbuf, dirlist, true);
+ pkgconf_strlcpy(outbuf, namebuf, sizeof outbuf);
+ pkgconf_strlcat(outbuf, "/", sizeof outbuf);
+ pkgconf_strlcat(outbuf, "../share/pkgconfig", sizeof outbuf);
+ pkgconf_path_add(outbuf, dirlist, true);
+#elif __HAIKU__
+ char **paths;
+ size_t count;
+ if (find_paths(B_FIND_PATH_DEVELOP_LIB_DIRECTORY, "pkgconfig", &paths, &count) == B_OK) {
+ for (size_t i = 0; i < count; i++)
+ pkgconf_path_add(paths[i], dirlist, true);
+ free(paths);
+ paths = NULL;
+ }
+ if (find_paths(B_FIND_PATH_DATA_DIRECTORY, "pkgconfig", &paths, &count) == B_OK) {
+ for (size_t i = 0; i < count; i++)
+ pkgconf_path_add(paths[i], dirlist, true);
+ free(paths);
+ paths = NULL;
+ }
#else
- (void) outbuf;
- (void) outlen;
+ pkgconf_path_split(PKG_DEFAULT_PATH, dirlist, true);
#endif
-
- return PKG_DEFAULT_PATH;
}
static const char *
@@ -117,12 +129,8 @@ pkgconf_pkg_dir_list_build(pkgconf_client_t *client)
{
pkgconf_path_build_from_environ("PKG_CONFIG_PATH", NULL, &client->dir_list, true);
- if (!(client->flags & PKGCONF_PKG_PKGF_ENV_ONLY))
- {
- char pathbuf[PKGCONF_BUFSIZE];
-
- pkgconf_path_build_from_environ("PKG_CONFIG_LIBDIR", get_default_pkgconfig_path(pathbuf, sizeof pathbuf), &client->dir_list, true);
- }
+ if (!(client->flags & PKGCONF_PKG_PKGF_ENV_ONLY) && (pkgconf_path_build_from_environ("PKG_CONFIG_LIBDIR", NULL, &client->dir_list, true)) < 1)
+ build_default_pkgconfig_path(&client->dir_list);
}
typedef void (*pkgconf_pkg_parser_keyword_func_t)(const pkgconf_client_t *client, pkgconf_pkg_t *pkg, const char *keyword, const size_t lineno, const ptrdiff_t offset, char *value);
diff --git a/libpkgconf/stdinc.h b/libpkgconf/stdinc.h
index 3b90853..ca3a7dc 100644
--- a/libpkgconf/stdinc.h
+++ b/libpkgconf/stdinc.h
@@ -53,6 +53,9 @@
#else
# define PATH_DEV_NULL "/dev/null"
# define SIZE_FMT_SPECIFIER "%zu"
+# ifdef __HAIKU__
+# include <FindDirectory.h>
+# endif
# include <dirent.h>
# include <unistd.h>
# include <limits.h>
diff --git a/tests/regress.sh b/tests/regress.sh
index 7da53e6..0e505d3 100755
--- a/tests/regress.sh
+++ b/tests/regress.sh
@@ -79,7 +79,8 @@ variable_body()
keep_system_libs_body()
{
- export PKG_CONFIG_PATH="${selfdir}/lib1" LIBRARY_PATH="/test/local/lib"
+ export PKG_CONFIG_PATH="${selfdir}/lib1"
+ eval export "$LIBRARY_PATH_ENV"="/test/local/lib"
atf_check \
-o inline:"\n" \
pkgconf --libs-only-L cflags-libs-only
diff --git a/tests/test_env.sh.in b/tests/test_env.sh.in
index 229dd00..17ee1f5 100644
--- a/tests/test_env.sh.in
+++ b/tests/test_env.sh.in
@@ -22,10 +22,12 @@ done
#--- end kludge ---
selfdir="@abs_top_srcdir@/tests"
+LIBRARY_PATH_ENV="LIBRARY_PATH"
PATH_SEP=":"
SYSROOT_DIR="${selfdir}/test"
case "$(uname -s)" in
Msys|CYGWIN*) PATH_SEP=";";;
+Haiku) LIBRARY_PATH_ENV="BELIBRARIES";;
esac
prefix="@prefix@"
--
2.16.2

View File

@@ -6,28 +6,47 @@ COPYRIGHT="2011-2018 pkgconf authors"
LICENSE="ISC"
REVISION="1"
SOURCE_URI="https://distfiles.dereferenced.org/pkgconf/pkgconf-$portVersion.tar.xz"
CHECKSUM_SHA256="bab39371d4ab972be1d539a8b10b6cc21f8eafc97f617102e667e82bd32eb234"
PATCHES="pkgconf-$portVersion.patchset"
CHECKSUM_SHA256="d3468308553c94389dadfd10c4d1067269052b5364276a9d24a643c88485f715"
ADDITIONAL_FILES="pkgconf-gcc2.sh"
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
commandSuffix="$secondaryArchSuffix"
if [ "$targetArchitecture" = x86_gcc2 ]; then
if [ "$targetArchitecture" = "x86_gcc2" ]; then
commandSuffix=""
commandBinDir="$prefix/bin"
fi
libVersion="3.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
GLOBAL_WRITABLE_FILES="
$relativeSettingsDir/pkgconfig/personality.d directory
"
PROVIDES="
pkgconf$secondaryArchSuffix = $portVersion
cmd:pkg_config$secondaryArchSuffix = $portVersion
cmd:pkgconf$secondaryArchSuffix = $portVersion
lib:libpkgconf$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
CONFLICTS="
pkgconfig$secondaryArchSuffix
"
if [ "$targetArchitecture" = "x86_gcc2" ]; then
PROVIDES+="
cmd:pkg_config = $portVersion
cmd:pkgconf = $portVersion
"
CONFLICTS+="
pkgconfig
"
fi
PROVIDES_devel="
pkgconf${secondaryArchSuffix}_devel = $portVersion
@@ -37,20 +56,6 @@ REQUIRES_devel="
pkgconf$secondaryArchSuffix == $portVersion base
"
SUMMARY_pkgconfig="$SUMMARY (pkg-config compat symlink)"
DESCRIPTION_pkgconfig="$DESCRIPTION (pkg-config compatibility symlink)"
PROVIDES_pkgconfig="
pkgconf${secondaryArchSuffix}_pkgconfig = $portVersion
cmd:pkg_config$secondaryArchSuffix = $portVersion
"
REQUIRES_pkgconfig="
pkgconf$secondaryArchSuffix == $portVersion base
"
CONFLICTS_pkgconfig="
cmd:pkg_config$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
@@ -65,8 +70,8 @@ BUILD_PREREQUIRES="
"
TEST_REQUIRES="
devel:libatf_c$secondaryArchSuffix
cmd:kyua$commandSuffix
devel:libatf_c$secondaryArchSuffix
"
defineDebugInfoPackage pkgconf$secondaryArchSuffix \
@@ -89,16 +94,21 @@ INSTALL()
install -t "$developDocDir" -m 644 doc/*.rst
ln -s pkgconf "$binDir/pkg-config"
ln -s pkgconf.1 "$manDir/man1/pkg-config.1"
if [ "$targetArchitecture" = "x86_gcc2" ]; then
install -d -m 755 "$commandBinDir"
install -m 755 "$portDir/additional-files/pkgconf-gcc2.sh" \
"$commandBinDir/pkgconf"
ln -s pkgconf "$commandBinDir/pkg-config"
fi
rm -f "$libDir"/*.la
prepareInstalledDevelLib libpkgconf
fixPkgconfig
packageEntries devel \
"$developDir" \
"$dataDir/aclocal" \
"$manDir/man7"
packageEntries pkgconfig "$binDir/pkg-config"
"$developDir"
}
TEST()