void-packages/srcpkgs/boost/patches/install-strip-destdir.patch

34 lines
934 B
Diff

boost doesn't support DESTDIR or something like that,
hence, we need --prefix=$DESTDIR/usr.
However --prefix=$DESTDIR/usr adds $DESTDIR into
its cmake config. This patch strips $DESTDIR out
of cmake config
--- a/tools/boost_install/boost-install.jam
+++ b/tools/boost_install/boost-install.jam
@@ -703,6 +703,16 @@ local rule path-native-fwd ( path )
return $(path) ;
}
+local rule path-strip-destdir ( path )
+{
+ local parts = [ MATCH "^(/destdir(/[^/]+)?/boost-[0-9.]+)(/.*)" : $(path) ] ;
+ if $(parts)
+ {
+ path = $(parts[3]) ;
+ }
+ return $(path) ;
+}
+
local rule get-dir ( name : dir )
{
if [ path.is-rooted $(dir) ]
@@ -781,6 +791,7 @@ rule generate-cmake-config- ( target : s
if [ path.is-rooted $(cmakedir) ]
{
local cmakedir-native = [ path-native-fwd $(cmakedir) ] ;
+ cmakedir-native = [ path-strip-destdir $(cmakedir-native) ] ;
print.text