build_environment: ffi/linux force predictable lib path.
authorRay Molenkamp <github@lazydodo.com>
Mon, 17 Sep 2018 17:58:13 +0000 (11:58 -0600)
committerRay Molenkamp <github@lazydodo.com>
Mon, 17 Sep 2018 17:58:13 +0000 (11:58 -0600)
ffi stubbornly wants to put libs in lib64 even when you tell it not to on some linux distributions.
patch based on sed fix the gentoo guys did [1]

[1] https://bugs.gentoo.org/462814

build_files/build_environment/cmake/ffi.cmake
build_files/build_environment/patches/ffi.diff [new file with mode: 0644]

index 18531fd7906715506adad9cacfc1e3cc637a3d9b..bc0932022cb85d3f9784f4011df70c9e1efa5940 100644 (file)
@@ -25,8 +25,10 @@ ExternalProject_Add(external_ffi
                --enable-shared=no
                --enable-static=yes
                --with-pic
+               --libdir=${LIBDIR}/ffi/lib/
        BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ffi/src/external_ffi/ && make -j${MAKE_THREADS}
        INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/ffi/src/external_ffi/ && make install
+       PATCH_COMMAND ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/ffi/src/external_ffi < ${PATCH_DIR}/ffi.diff
        INSTALL_DIR ${LIBDIR}/ffi
 )
 
diff --git a/build_files/build_environment/patches/ffi.diff b/build_files/build_environment/patches/ffi.diff
new file mode 100644 (file)
index 0000000..84e7f04
--- /dev/null
@@ -0,0 +1,11 @@
+--- Makefile.in        2014-11-12 06:59:58.000000000 -0500
++++ Makefile.in        2018-09-17 13:36:10.974086554 -0400
+@@ -600,7 +600,7 @@
+ target_os = @target_os@
+ target_vendor = @target_vendor@
+ toolexecdir = @toolexecdir@
+-toolexeclibdir = @toolexeclibdir@
++toolexeclibdir = $(libdir)
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@