aboutsummaryrefslogtreecommitdiffstats
path: root/tools/fakeroot
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-09-10 14:52:31 +0200
committerDaniel Golle <daniel@makrotopia.org>2020-10-30 00:39:09 +0000
commitf93cb5c2c8dcffae6f7bc80b9c7807de30d67371 (patch)
tree7c8d2a08e9e6becd839106dcc276993fc5b78553 /tools/fakeroot
parent04757f964b9dd4190b27d51914a4c0053d4a38cd (diff)
downloadupstream-f93cb5c2c8dcffae6f7bc80b9c7807de30d67371.tar.gz
upstream-f93cb5c2c8dcffae6f7bc80b9c7807de30d67371.tar.bz2
upstream-f93cb5c2c8dcffae6f7bc80b9c7807de30d67371.zip
fakeroot: make fakeroot script relocatable
Patch the fakeroot script template to discover faked and libfakeroot.so relative to the STAGING_DIR_HOST environment variable, similar to how it is done for automake, libtool, quilt and autoconf already. This avoids the need for passing the paths to faked and libfakeroot.so manually every time we invoke fakeroot and subsequently allows us to drop OS X specific logic. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tools/fakeroot')
-rw-r--r--tools/fakeroot/patches/000-relocatable.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/fakeroot/patches/000-relocatable.patch b/tools/fakeroot/patches/000-relocatable.patch
new file mode 100644
index 0000000000..9f6915bfe8
--- /dev/null
+++ b/tools/fakeroot/patches/000-relocatable.patch
@@ -0,0 +1,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"