public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "David Seifert" <soap@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/plplot/files/, sci-libs/plplot/
Date: Sun,  9 Jul 2017 21:03:05 +0000 (UTC)	[thread overview]
Message-ID: <1499634173.e094f6f984fe57e55a2850f60ba11be9dfaf23a6.soap@gentoo> (raw)

commit:     e094f6f984fe57e55a2850f60ba11be9dfaf23a6
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Jul  9 21:02:26 2017 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jul  9 21:02:53 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e094f6f9

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

 .../files/plplot-5.12.0-ocaml-remove-rpath.patch   | 34 ++++++++++++++++++++++
 sci-libs/plplot/plplot-5.12.0-r1.ebuild            | 20 ++++++++-----
 2 files changed, 47 insertions(+), 7 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 00000000000..2d18c79736f
--- /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

diff --git a/sci-libs/plplot/plplot-5.12.0-r1.ebuild b/sci-libs/plplot/plplot-5.12.0-r1.ebuild
index c8be469a4e5..a8582c6ed65 100644
--- a/sci-libs/plplot/plplot-5.12.0-r1.ebuild
+++ b/sci-libs/plplot/plplot-5.12.0-r1.ebuild
@@ -17,7 +17,7 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
 LICENSE="LGPL-2"
 SLOT="0/14" # SONAME of libplplot.so
 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="cairo cxx doc +dynamic examples fortran gd java jpeg latex lua octave pdf
+IUSE="cairo cxx doc +dynamic examples fortran gd java jpeg latex lua ocaml octave pdf
 	pdl png python qhull qt5 shapefile svg tcl test	threads tk truetype wxwidgets X"
 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} ) qt5? ( dynamic ) test? ( latex ) tk? ( tcl )"
 RESTRICT="octave? ( test )"
@@ -31,6 +31,11 @@ RDEPEND="
 		virtual/latex-base
 	)
 	lua? ( dev-lang/lua:0= )
+	ocaml? (
+		dev-lang/ocaml
+		dev-ml/camlidl
+		cairo? ( dev-ml/cairo-ocaml[gtk] )
+	)
 	octave? ( sci-mathematics/octave:0= )
 	pdf? ( media-libs/libharu:0= )
 	pdl? (
@@ -78,6 +83,7 @@ DEPEND="${RDEPEND}
 		>=virtual/jdk-1.5
 		dev-lang/swig
 	)
+	ocaml? ( dev-ml/findlib )
 	octave? ( >=dev-lang/swig-3.0.12 )
 	python? ( dev-lang/swig )
 	test? (
@@ -90,6 +96,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-5.11.0-octave.patch
 	"${FILESDIR}"/${PN}-5.12.0-multiarch.patch
 	"${FILESDIR}"/${PN}-5.12.0-java-install-path.patch
+	"${FILESDIR}"/${PN}-5.12.0-ocaml-remove-rpath.patch
 )
 
 pkg_setup() {
@@ -131,9 +138,6 @@ src_configure() {
 	# - Bindings:
 	#   * Ada is a mess in Gentoo, don't use
 	#   * D has been removed from Gentoo, don't use
-	#   * OCaml is a general disaster and randomly inserts RPATH
-	#     on the basis of absolute -L linker paths:
-	#       https://caml.inria.fr/mantis/view.php?id=5943
 	#   * Qt4 has been disabled, as it is deprecated and unsupported upstream
 	# - DPLD_* drivers need to use ON/OFF instead of the usex defaults yes/no, as
 	#   the testsuite performs a string comparison to determine which tests to run
@@ -149,8 +153,7 @@ src_configure() {
 		## Features
 		-DBUILD_DOC=OFF
 		-DBUILD_DOX_DOC=OFF
-		-DUSE_RPATH=OFF
-		-DCMAKE_SKIP_INSTALL_RPATH=ON
+		-DCMAKE_SKIP_RPATH=ON
 		-DPREBUILT_DOC=$(usex doc)
 		-DHAVE_SHAPELIB=$(usex shapefile)
 		-DWITH_FREETYPE=$(usex truetype)
@@ -165,7 +168,7 @@ src_configure() {
 		## Bindings
 		-DENABLE_ada=OFF
 		-DENABLE_d=OFF
-		-DENABLE_ocaml=OFF
+		-DENABLE_ocaml=$(usex ocaml)
 		-DENABLE_pyqt4=OFF
 		-DENABLE_cxx=$(usex cxx)
 		-DENABLE_DYNDRIVERS=$(usex dynamic)
@@ -242,6 +245,9 @@ src_configure() {
 	use shapefile && mycmakeargs+=(
 		-DSHAPELIB_INCLUDE_DIR="${EPREFIX}"/usr/include/libshp
 	)
+	use ocaml && mycmakeargs+=(
+		-DOCAML_INSTALL_DIR="$(ocamlc -where)"
+	)
 	use python && mycmakeargs+=(
 		-DENABLE_pyqt5=$(usex qt5)
 	)


             reply	other threads:[~2017-07-09 21:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-09 21:03 David Seifert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-10  1:43 [gentoo-commits] repo/gentoo:master commit in: sci-libs/plplot/files/, sci-libs/plplot/ Sam James
2023-04-14  4:00 Sam James
2020-01-16  7:03 Michał Górny
2018-01-22  0:42 Andreas Sturmlechner
2017-02-18 19:10 David Seifert
2016-11-25 18:57 Pacho Ramos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499634173.e094f6f984fe57e55a2850f60ba11be9dfaf23a6.soap@gentoo \
    --to=soap@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox