aboutsummaryrefslogtreecommitdiffstats
path: root/tools/fakeroot/patches/000-relocatable.patch
blob: 44897c5ab8c79b84f831ef0a016c4aaa049168bf (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
26
27
28
29
--- a/scripts/fakeroot.in
+++ b/scripts/fakeroot.in
@@ -30,13 +30,20 @@ fatal ()
 }
 
 # strip /bin/fakeroot to find install prefix
-FAKEROOT_PREFIX=@prefix@
-FAKEROOT_BINDIR=@bindir@
+if [ -n "$STAGING_DIR_HOST" ]; then
+    USEABSLIBPATH=1
+    FAKEROOT_LIB=${STAGING_DIR_HOST}/lib/lib@fakeroot_transformed@@DLSUFFIX@
+    FAKED=${STAGING_DIR_HOST}/bin/faked
+    PATHS=
+else
+    FAKEROOT_PREFIX=@prefix@
+    FAKEROOT_BINDIR=@bindir@
 
-USEABSLIBPATH=@LDPRELOADABS@
-FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@
-PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
-FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
+    USEABSLIBPATH=@LDPRELOADABS@
+    FAKEROOT_LIB=lib@fakeroot_transformed@@DLSUFFIX@
+    PATHS=@libdir@:${FAKEROOT_PREFIX}/lib64/libfakeroot:${FAKEROOT_PREFIX}/lib32/libfakeroot
+    FAKED=${FAKEROOT_BINDIR}/@faked_transformed@
+fi
 
 FAKED_MODE="unknown-is-root"
 export FAKED_MODE