aboutsummaryrefslogtreecommitdiffstats
path: root/tools/fakeroot/patches/000-relocatable.patch
blob: 9f6915bfe80e00eb2ed8e62fd40b87e7015ca9a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- a/scripts/fakeroot.in
+++ b/scripts/fakeroot.in
@@ -30,12 +30,19 @@ fatal ()
 }
 
 # strip /bin/fakeroot to find install prefix
-FAKEROOT_PREFIX=@prefix@
-FAKEROOT_BINDIR=@bindir@
+if [ -n "$STAGING_DIR_HOST" ]; then
+    FAKEROOT_PREFIX="${STAGING_DIR_HOST}"
+    FAKEROOT_BINDIR="${STAGING_DIR_HOST}/bin"
+    FAKEROOT_LIBDIR="${STAGING_DIR_HOST}/lib"
+else
+    FAKEROOT_PREFIX=@prefix@
+    FAKEROOT_BINDIR=@bindir@
+    FAKEROOT_LIBDIR=@libdir@
+fi
 
 USEABSLIBPATH=@LDPRELOADABS@
 LIB=lib@fakeroot_transformed@@DLSUFFIX@
-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
+PATHS=${FAKEROOT_LIBDIR}:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
 FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
 
 FAKED_MODE="unknown-is-root"