summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2017-07-09 14:02:26 -0700
committerDavid Seifert <soap@gentoo.org>2017-07-09 14:02:53 -0700
commite094f6f984fe57e55a2850f60ba11be9dfaf23a6 (patch)
treefc2af2dd3b540b93d434bf5ad5c2a41133878081 /sci-libs/plplot/files
parentdev-libs/libreport: Add alternative kwallet provider (diff)
downloadgentoo-e094f6f984fe57e55a2850f60ba11be9dfaf23a6.tar.gz
gentoo-e094f6f984fe57e55a2850f60ba11be9dfaf23a6.tar.bz2
gentoo-e094f6f984fe57e55a2850f60ba11be9dfaf23a6.zip
sci-libs/plplot: Re-enable OCaml support
* Convert absolute -L paths to relative ones in order to prevent ocamlmklib's braindead behaviour of randomly inserting RPATHs into libraries. Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'sci-libs/plplot/files')
-rw-r--r--sci-libs/plplot/files/plplot-5.12.0-ocaml-remove-rpath.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/sci-libs/plplot/files/plplot-5.12.0-ocaml-remove-rpath.patch b/sci-libs/plplot/files/plplot-5.12.0-ocaml-remove-rpath.patch
new file mode 100644
index 000000000000..2d18c79736fa
--- /dev/null
+++ b/sci-libs/plplot/files/plplot-5.12.0-ocaml-remove-rpath.patch
@@ -0,0 +1,34 @@
+Fix OCaml's asinine RPATH inserting behaviour.
+
+--- a/bindings/ocaml/CMakeLists.txt
++++ b/bindings/ocaml/CMakeLists.txt
+@@ -97,6 +97,20 @@
+
+ # ocamlc -c compiles *.c into *.o.
+ # ocamlmklib links *.o into *.so and *.a
++
++ # ocamlmklib implicits inserts RPATHs if it is provided with an absolute path to -L,
++ # which is absolutely unacceptable and presents a massive security hazard. The
++ # following statements convert the absolute paths to relative ones to fix this.
++ # See also:
++ # https://caml.inria.fr/mantis/view.php?id=5943
++ if(CMAKE_SKIP_RPATH)
++ file(RELATIVE_PATH CAMLIDL_LINK_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR} ${CAMLIDL_LIB_DIR})
++ file(RELATIVE_PATH CMAKE_LINK_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BINARY_DIR})
++ else(CMAKE_SKIP_RPATH)
++ set(CAMLIDL_LINK_LIB_DIR ${CAMLIDL_LIB_DIR})
++ set(CMAKE_LINK_BINARY_DIR ${CMAKE_BINARY_DIR})
++ endif(CMAKE_SKIP_RPATH)
++
+ add_custom_command(
+ OUTPUT
+ ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.o
+@@ -105,7 +119,7 @@
+ ${CMAKE_CURRENT_BINARY_DIR}/libplplot_stubs.a
+ COMMAND ${OCAMLC} -ccopt -I${CAMLIDL_LIB_DIR} -c ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.c
+ COMMAND ${OCAMLC} -ccopt -I${CMAKE_SOURCE_DIR}/include -ccopt -I${CMAKE_BINARY_DIR}/include -ccopt -I${CMAKE_SOURCE_DIR}/lib/qsastime -ccopt -I${CMAKE_BINARY_DIR} -ccopt -I${CAMLIDL_LIB_DIR} -ccopt -DPLPLOT_HAVE_CONFIG_H -c ${CMAKE_CURRENT_SOURCE_DIR}/plplot_impl.c
+- COMMAND ${OCAMLMKLIB} -o plplot_stubs -L${CAMLIDL_LIB_DIR} -lcamlidl -L${CMAKE_BINARY_DIR}/src -lplplot ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.o ${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.o ${ocaml_STATIC_FLAGS}
++ COMMAND ${OCAMLMKLIB} -o plplot_stubs -L${CAMLIDL_LINK_LIB_DIR} -lcamlidl -L${CMAKE_LINK_BINARY_DIR}/src -lplplot ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.o ${CMAKE_CURRENT_BINARY_DIR}/plplot_impl.o ${ocaml_STATIC_FLAGS}
+ DEPENDS
+ ${CMAKE_CURRENT_BINARY_DIR}/plplot_core_stubs.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/plplot_impl.c