2016-12-27 16:00:08 +01:00
|
|
|
From aa6bbc09e68426592faf722630fe92b6ede75bc8 Mon Sep 17 00:00:00 2001
|
2015-11-02 22:57:04 +01:00
|
|
|
From: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
|
|
|
Date: Mon, 2 Nov 2015 18:38:00 -0300
|
|
|
|
Subject: [PATCH] Fix all-variables sysroot prefix problem
|
|
|
|
|
|
|
|
According to the pkg-config specifications (or rather documentation)
|
|
|
|
only the -L/-I directory entries should be sysroot-prefixed.
|
|
|
|
|
|
|
|
We also need to prefix the mapdir/sdkdir variables since they're used by
|
|
|
|
xorg and expected that way.
|
|
|
|
|
|
|
|
Also allow prefixing for includedir and libdir since in some silly cases
|
|
|
|
the directories may be requested barebones via pkg-config
|
|
|
|
--variable=includedir libfool for example.
|
|
|
|
|
|
|
|
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
|
2016-12-27 16:00:08 +01:00
|
|
|
|
|
|
|
Added pkgdatadir to the list of to-be-prefixed variables.
|
|
|
|
|
|
|
|
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
2015-11-02 22:57:04 +01:00
|
|
|
---
|
2016-12-27 16:00:08 +01:00
|
|
|
main.c | 19 ++++++++++++++-----
|
|
|
|
1 file changed, 14 insertions(+), 5 deletions(-)
|
2015-11-02 22:57:04 +01:00
|
|
|
|
|
|
|
diff --git a/main.c b/main.c
|
2016-12-27 16:00:08 +01:00
|
|
|
index 6947126..ce5e18f 100644
|
2015-11-02 22:57:04 +01:00
|
|
|
--- a/main.c
|
|
|
|
+++ b/main.c
|
2016-12-27 16:00:08 +01:00
|
|
|
@@ -313,9 +313,13 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
|
2015-11-02 22:57:04 +01:00
|
|
|
memset(req->buf, 0, sizeof(req->buf));
|
|
|
|
|
|
|
|
if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
|
|
|
|
- (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
|
|
|
|
- strlcat(req->buf, sysroot_dir, sizeof(req->buf));
|
|
|
|
-
|
|
|
|
+ (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
|
|
|
|
+ (!strcmp(req->variable, "includedir") || \
|
|
|
|
+ !strcmp(req->variable, "libdir") || \
|
|
|
|
+ !strcmp(req->variable, "mapdir") || \
|
2016-12-27 16:00:08 +01:00
|
|
|
+ !strcmp(req->variable, "pkgdatadir") || \
|
2015-11-02 22:57:04 +01:00
|
|
|
+ !strcmp(req->variable, "sdkdir")))
|
|
|
|
+ strlcat(req->buf, sysroot_dir, sizeof(req->buf));
|
|
|
|
strlcat(req->buf, var, sizeof(req->buf));
|
|
|
|
return;
|
|
|
|
}
|
2016-12-27 16:00:08 +01:00
|
|
|
@@ -323,8 +327,13 @@ print_variable(pkg_t *pkg, void *data, unsigned int flags)
|
2015-11-02 22:57:04 +01:00
|
|
|
strlcat(req->buf, " ", sizeof(req->buf));
|
|
|
|
|
|
|
|
if (*var == '/' && (flags & PKGF_MUNGE_SYSROOT_PREFIX) &&
|
|
|
|
- (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))))
|
|
|
|
- strlcat(req->buf, sysroot_dir, sizeof(req->buf));
|
|
|
|
+ (sysroot_dir != NULL && strncmp(var, sysroot_dir, strlen(sysroot_dir))) &&
|
|
|
|
+ (!strcmp(req->variable, "includedir") || \
|
|
|
|
+ !strcmp(req->variable, "libdir") || \
|
|
|
|
+ !strcmp(req->variable, "mapdir") || \
|
2016-12-27 16:00:08 +01:00
|
|
|
+ !strcmp(req->variable, "pkgdatadir") || \
|
2015-11-02 22:57:04 +01:00
|
|
|
+ !strcmp(req->variable, "sdkdir")))
|
|
|
|
+ strlcat(req->buf, sysroot_dir, sizeof(req->buf));
|
|
|
|
|
|
|
|
strlcat(req->buf, var, sizeof(req->buf));
|
|
|
|
}
|
|
|
|
--
|
|
|
|
2.4.10
|
|
|
|
|