diff options
Diffstat (limited to 'dev-lang/ocaml')
-rw-r--r-- | dev-lang/ocaml/ChangeLog | 11 | ||||
-rw-r--r-- | dev-lang/ocaml/Manifest | 17 | ||||
-rw-r--r-- | dev-lang/ocaml/files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch | 27 | ||||
-rw-r--r-- | dev-lang/ocaml/files/ocaml-3.11.0_beta1-configure.patch | 16 | ||||
-rw-r--r-- | dev-lang/ocaml/files/ocaml-3.11.0_beta1-exec-stack-fixes.patch | 237 | ||||
-rw-r--r-- | dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild | 127 |
6 files changed, 433 insertions, 2 deletions
diff --git a/dev-lang/ocaml/ChangeLog b/dev-lang/ocaml/ChangeLog index 5c4e3ba93a73..ecdfa8fd2b14 100644 --- a/dev-lang/ocaml/ChangeLog +++ b/dev-lang/ocaml/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for dev-lang/ocaml # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ChangeLog,v 1.149 2008/09/22 18:56:34 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ChangeLog,v 1.150 2008/10/15 16:08:56 aballier Exp $ + +*ocaml-3.11.0_beta1 (15 Oct 2008) + + 15 Oct 2008; Alexis Ballier <aballier@gentoo.org> + +files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch, + +files/ocaml-3.11.0_beta1-configure.patch, + +files/ocaml-3.11.0_beta1-exec-stack-fixes.patch, + +ocaml-3.11.0_beta1.ebuild: + New upstream beta release 22 Sep 2008; Raúl Porcel <armin76@gentoo.org> ocaml-3.10.2.ebuild: Re-add ~arm wrt #178256 diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest index 38e877e4b384..b40619c38b02 100644 --- a/dev-lang/ocaml/Manifest +++ b/dev-lang/ocaml/Manifest @@ -1,12 +1,27 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX ocaml-3.10.0-automagic.patch 1849 RMD160 6986c47d9d2d9bdaf246f3399ccc59a5751fe86d SHA1 d999c1023c5aa07316d8405fde6ebf3a1bcb2b9f SHA256 f959da02f8b31f3d1ad5b76426d493b50c87dc3a6241204470866a321ece40f9 AUX ocaml-3.10.0-call-ld-with-proper-ldflags.patch 1497 RMD160 7eef667019e79f2877836f77a31466f9d301725b SHA1 36d95fb8b05e7bbff8e5f49a8f1faec5f11f0c78 SHA256 13d6cc7401c8374327e438517975fe9abf1b99030bb3243f2adb91d12570bc8d AUX ocaml-3.10.0-configure.patch 5644 RMD160 1a63847a6e632f59fef8ff448b96bc45da15eae5 SHA1 6a030e48dd5fc399b985dd99e21b6c0e6b95a12e SHA256 f42e11db2d184532aa561b0b117f7ce5850bb50981ea997d08eee34f826360ac AUX ocaml-3.10.0-exec-stack-fixes.patch 9395 RMD160 00d5e1ac85a090baeaf9b9cba2e277c72bef5792 SHA1 15bc9692307f4781c3d01db7724869f7e9a401d7 SHA256 a260416a0fc1cf05ff3b2dceac83bd00043ee7ad6a8f2487934723f5b9f406da AUX ocaml-3.10.2-tk85.patch 2414 RMD160 1b8dc94de1c90264684a300f5f31ffce02e94cec SHA1 98c7a48c167500d3e7d8c34e79124dc0cedc315d SHA256 ba539578fbec539ff481b5fc786612d5e85b01cc2d6eee22a2f9ed340d2d0fd3 +AUX ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch 1323 RMD160 b6bd9d0039d8daf03167655a5c398633c9d576b1 SHA1 079024c22e21d39e6dc804de8106cc11c222b6ea SHA256 c5f4d2aa54f9597933c4d5649821e7d947e32cd8367b6f38e7359dc16c0d4785 +AUX ocaml-3.11.0_beta1-configure.patch 562 RMD160 f012deda8e9d954b8dd968dd3feb3ced45ceaadb SHA1 e9f74f67b4a59032cb7347a25fb57e891202075d SHA256 353518154c90851a406f52b173cbc69f512ec593177db4c2bf4dec3ea8f9a061 +AUX ocaml-3.11.0_beta1-exec-stack-fixes.patch 7262 RMD160 1a3d125b775494bf8e0f8d9b85edb101447d5756 SHA1 a0f762f089679f8f273ea0e44998a9c5e364ded7 SHA256 e8d7cded5ebc494df8be81764e80982cba0192d1e010472690ccff75e5d0e03b AUX ocaml-rebuild.sh 1253 RMD160 c9a261dc50239cb3cf8ee890bf0fa314903421d9 SHA1 7cfe5d413de41b1ae3761903549c6cb9af9b02b2 SHA256 99abe161795c6b6c7b4a180e3cc850fee2d175f9123858883ae181cc96851cae DIST ocaml-3.08.4.tar.bz2 2054019 RMD160 448ed9af56cacb9c32208d064e1c9732a2086bd2 SHA1 d9eb54611d24f9e1c33736f12c7ba87412057cbb SHA256 8d4322791d0dd424f355636ba50934ac17dbefde269736dad0da0683c8888684 DIST ocaml-3.10.2.tar.bz2 2284860 RMD160 f631230b090dbd9bf9a9f71631cd0347c033cbb1 SHA1 f604580bf2943891d8faf265eeb900bbe90abce0 SHA256 3755a32da1a7490d47fff7838c12c754d3fcfe69d7c9ff2358704259dc477c58 +DIST ocaml-3.11.0+beta1.tar.bz2 2366506 RMD160 bf5e0b6c2346b29ba43a23ac5603c0f09cef2080 SHA1 2d903961dc802d10ad0e07e3e9a44b425e66307b SHA256 a4190b6373d99b98c10fda82057b68785da13e76e141d55e6bfcb937d1956234 EBUILD ocaml-3.08.4.ebuild 2532 RMD160 4f76d197232320e0450b7c847dc0006c10ff165b SHA1 4ca95ee897d20abb813855194fbd3206baff5813 SHA256 8d0dfe01e1186149e6e545d8227796b6e7976c6d3e6cc04aa8262c3d574ef252 EBUILD ocaml-3.10.2.ebuild 4446 RMD160 79c3b1bfbfccb7ea3823f8d7f36f9b2280392d5a SHA1 43fabdb80ac1ba267f964a39ba07bc8d208d8c5a SHA256 27680e3e8e19e88e1ea35594771fca0494d5d5b69a515e5a738a743963b0949a -MISC ChangeLog 23468 RMD160 fdacb634463105ffbc1764990bef9527a9b5298a SHA1 6db4fa49498a8d319dc64e05a2079890f3772a12 SHA256 aecdf00ff0e9f3d72b8ee1fcee68cad7129276ca73d7ba6dd7b25e92a23fdd32 +EBUILD ocaml-3.11.0_beta1.ebuild 4298 RMD160 0bd96ef9c8b0841a059990cb1f3f6943750a8d4a SHA1 2bb7f777ced3025dc12edecb0da228acf3aa4cf0 SHA256 d1acc4a9f883a27470cd3c44a152a76ee935c4a43975974881220f4372076900 +MISC ChangeLog 23775 RMD160 4446bfe142a9d28f1660092b0d24f3e497676174 SHA1 ebaa63e0c91b3e309103524c04fd4d5853ff963b SHA256 86f0913a506e87aa3e90476912d2c6f812d094ca00d065d342fd10c43a84f20a MISC metadata.xml 155 RMD160 dfaa057e679b01302a807c75a32a910098b26809 SHA1 94024f83dcacbb53e92be090dd0f994ec93dc90d SHA256 118048376ebb76f57628b0819f3de4856e73959c2578c88715d37ea2d1e0af81 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.9 (GNU/Linux) + +iEYEARECAAYFAkj2FZ4ACgkQvFcC4BYPU0rT1QCghLOAMEi9YRi84G3COzvYREww +LJcAoLmvFigqIV3sImmOJZ+KFTbReM9x +=cb/3 +-----END PGP SIGNATURE----- diff --git a/dev-lang/ocaml/files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch new file mode 100644 index 000000000000..53e2febe6681 --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-call-ld-with-proper-ldflags.patch @@ -0,0 +1,27 @@ +As we now support LDFLAGS in NATIVECCLINKOPTS +it can happen that -Wl,--foo,--bar option is in that variable +As ocaml happens to call ld with NATIVECCLINKOPTS +we have to "translate" it so that ld doesn't bail out with unrecognized option +Initial patch from Julien Cristau : http://caml.inria.fr/mantis/view.php?id=4142 +Modified a bit to catch comma separated options +Index: ocaml-3.11.0+beta1/configure +=================================================================== +--- ocaml-3.11.0+beta1.orig/configure ++++ ocaml-3.11.0+beta1/configure +@@ -1503,6 +1503,7 @@ fi + bytecccompopts="$CFLAGS $bytecccompopts" + bytecclinkopts="$LDFLAGS $bytecclinkopts" + natdynlinkopts="$LDFLAGS $natdynlinkopts" ++nativeccrawlinkopts="$RAW_LDFLAGS $nativecclinkopts" + nativecclinkopts="$LDFLAGS $nativecclinkopts" + nativecccompopts="$CFLAGS $nativecccompopts" + nativeccprofopts="$nativecccompopts" +@@ -1553,7 +1554,7 @@ echo "DEBUGGER=$debugger" >> Makefile + echo "CC_PROFILE=$cc_profile" >> Makefile + echo "SYSTHREAD_SUPPORT=$systhread_support" >> Makefile + echo "PARTIALLD=$partialld" >> Makefile +-echo "PACKLD=\$(PARTIALLD) \$(NATIVECCLINKOPTS) -o " >> Makefile ++echo "PACKLD=\$(PARTIALLD) $nativeccrawlinkopts -o " >> Makefile + echo "DLLCCCOMPOPTS=$dllccompopts" >> Makefile + echo "IFLEXDIR=$iflexdir" >> Makefile + echo "O=o" >> Makefile diff --git a/dev-lang/ocaml/files/ocaml-3.11.0_beta1-configure.patch b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-configure.patch new file mode 100644 index 000000000000..31f8620b251e --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-configure.patch @@ -0,0 +1,16 @@ +Index: ocaml-3.11.0+beta1/configure +=================================================================== +--- ocaml-3.11.0+beta1.orig/configure ++++ ocaml-3.11.0+beta1/configure +@@ -1494,6 +1494,11 @@ fi + + # Final twiddling of compiler options to work around known bugs + ++bytecccompopts="$CFLAGS $bytecccompopts" ++bytecclinkopts="$LDFLAGS $bytecclinkopts" ++natdynlinkopts="$LDFLAGS $natdynlinkopts" ++nativecclinkopts="$LDFLAGS $nativecclinkopts" ++nativecccompopts="$CFLAGS $nativecccompopts" + nativeccprofopts="$nativecccompopts" + case "$buggycc" in + gcc.2.96) diff --git a/dev-lang/ocaml/files/ocaml-3.11.0_beta1-exec-stack-fixes.patch b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-exec-stack-fixes.patch new file mode 100644 index 000000000000..4b15a35e123d --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-3.11.0_beta1-exec-stack-fixes.patch @@ -0,0 +1,237 @@ +Index: ocaml-3.10.0/asmcomp/alpha/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/alpha/emit.mlp ++++ ocaml-3.10.0/asmcomp/alpha/emit.mlp +@@ -811,6 +811,11 @@ let data l = + ` .data\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -843,6 +848,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly () = ++ nx_stack(); + let lbl_end = Compilenv.make_symbol (Some "code_end") in + ` .text\n`; + ` .globl {emit_symbol lbl_end}\n`; +Index: ocaml-3.10.0/asmrun/alpha.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/alpha.S ++++ ocaml-3.10.0/asmrun/alpha.S +@@ -438,3 +438,7 @@ caml_system__frametable: + .word -1 /* negative frame size => use callback link */ + .word 0 /* no roots here */ + .align 3 ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif +Index: ocaml-3.10.0/asmrun/arm.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/arm.S ++++ ocaml-3.10.0/asmrun/arm.S +@@ -337,3 +337,7 @@ caml_system__frametable: + .short -1 /* negative frame size => use callback link */ + .short 0 /* no roots */ + .align 2 ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif +Index: ocaml-3.10.0/asmrun/hppa.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/hppa.S ++++ ocaml-3.10.0/asmrun/hppa.S +@@ -532,3 +532,8 @@ G(caml_system__frametable): + .long L104 + 3 /* return address into callback */ + .short -1 /* negative frame size => use callback link */ + .short 0 /* no roots */ ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmrun/ia64.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/ia64.S ++++ ocaml-3.10.0/asmrun/ia64.S +@@ -528,3 +528,8 @@ caml_system__frametable: + + .common caml_saved_bsp#, 8, 8 + .common caml_saved_rnat#, 8, 8 ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmrun/m68k.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/m68k.S ++++ ocaml-3.10.0/asmrun/m68k.S +@@ -242,3 +242,8 @@ _caml_system__frametable: + .long L107 | return address into callback + .word -1 | negative frame size => use callback link + .word 0 | no roots here ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmrun/power-elf.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/power-elf.S ++++ ocaml-3.10.0/asmrun/power-elf.S +@@ -419,3 +419,7 @@ caml_system__frametable: + .short -1 /* negative size count => use callback link */ + .short 0 /* no roots here */ + ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmrun/sparc.S +=================================================================== +--- ocaml-3.10.0.orig/asmrun/sparc.S ++++ ocaml-3.10.0/asmrun/sparc.S +@@ -405,3 +405,8 @@ Caml_system__frametable: + .type Caml_raise_exception, #function + .type Caml_system__frametable, #object + #endif ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif ++ +Index: ocaml-3.10.0/asmcomp/arm/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/arm/emit.mlp ++++ ocaml-3.10.0/asmcomp/arm/emit.mlp +@@ -642,6 +642,13 @@ let data l = + ` .data\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ ++ ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -661,6 +668,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly () = ++ nx_stack(); + let lbl_end = Compilenv.make_symbol (Some "code_end") in + ` .text\n`; + ` .global {emit_symbol lbl_end}\n`; +Index: ocaml-3.10.0/asmcomp/hppa/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/hppa/emit.mlp ++++ ocaml-3.10.0/asmcomp/hppa/emit.mlp +@@ -994,6 +994,12 @@ let data l = + ` .data\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -1022,6 +1028,7 @@ let begin_assembly() = + + + let end_assembly() = ++ nx_stack(); + ` .code\n`; + let lbl_end = Compilenv.make_symbol (Some "code_end") in + declare_global lbl_end; +Index: ocaml-3.10.0/asmcomp/ia64/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/ia64/emit.mlp ++++ ocaml-3.10.0/asmcomp/ia64/emit.mlp +@@ -1306,6 +1306,11 @@ let data l = + ` .align 8\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -1315,6 +1320,7 @@ let begin_assembly() = + emit_define_symbol (Compilenv.make_symbol (Some "code_begin")) + + let end_assembly () = ++ nx_stack(); + ` .data\n`; + emit_define_symbol (Compilenv.make_symbol (Some "data_end")); + ` .text\n`; +Index: ocaml-3.10.0/asmcomp/power/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/power/emit.mlp ++++ ocaml-3.10.0/asmcomp/power/emit.mlp +@@ -916,6 +916,12 @@ let data l = + emit_string data_space; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "elf" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -932,6 +938,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly() = ++ nx_stack(); + if pic_externals then + (* Emit the pointers to external functions *) + StringSet.iter emit_external !external_functions; +Index: ocaml-3.10.0/asmcomp/sparc/emit.mlp +=================================================================== +--- ocaml-3.10.0.orig/asmcomp/sparc/emit.mlp ++++ ocaml-3.10.0/asmcomp/sparc/emit.mlp +@@ -741,6 +741,12 @@ let data l = + ` .data\n`; + List.iter emit_item l + ++(* Mark stack as non executable *) ++let nx_stack() = ++ if Config.system = "linux" then ++ ` .section .note.GNU-stack,\"\",%progbits\n` ++ ++ + (* Beginning / end of an assembly file *) + + let begin_assembly() = +@@ -754,6 +760,7 @@ let begin_assembly() = + `{emit_symbol lbl_begin}:\n` + + let end_assembly() = ++ nx_stack(); + ` .text\n`; + let lbl_end = Compilenv.make_symbol (Some "code_end") in + ` .global {emit_symbol lbl_end}\n`; diff --git a/dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild b/dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild new file mode 100644 index 000000000000..03d73bb5e68e --- /dev/null +++ b/dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild @@ -0,0 +1,127 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/ocaml/ocaml-3.11.0_beta1.ebuild,v 1.1 2008/10/15 16:08:56 aballier Exp $ + +inherit flag-o-matic eutils multilib versionator toolchain-funcs + +EAPI="1" + +MY_P="${P/_beta/+beta}" +DESCRIPTION="Fast modern type-inferring functional programming language descended from the ML family" +HOMEPAGE="http://www.ocaml.org/" +SRC_URI="http://caml.inria.fr/distrib/ocaml-$( get_version_component_range 1-2)/${MY_P}.tar.bz2" + +LICENSE="QPL-1.0 LGPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="emacs gdbm latex ncurses +ocamlopt tk X xemacs" + +DEPEND="tk? ( >=dev-lang/tk-3.3.3 ) + ncurses? ( sys-libs/ncurses ) + X? ( x11-libs/libX11 x11-proto/xproto ) + gdbm? ( sys-libs/gdbm )" + +PDEPEND="emacs? ( app-emacs/ocaml-mode ) + xemacs? ( app-xemacs/ocaml )" + +S="${WORKDIR}/${MY_P}" +pkg_setup() { + # dev-lang/ocaml creates its own objects but calls gcc for linking, which will + # results in relocations if gcc wants to create a PIE executable + if gcc-specs-pie ; then + append-ldflags -nopie + ewarn "Ocaml generates its own native asm, you're using a PIE compiler" + ewarn "We have appended -nopie to ocaml build options" + ewarn "because linking an executable with pie while the objects are not pic will not work" + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + # Fix the EXEC_STACK in ocaml compiled binaries (#153382) + epatch "${FILESDIR}"/${PN}-3.11.0_beta1-exec-stack-fixes.patch + + # The configure script doesn't inherit previous defined variables, + # overwriting previous declarations of bytecccompopts, bytecclinkopts, + # nativecccompopts and nativecclinkopts. Reported upstream as issue 0004267. + epatch "${FILESDIR}"/${PN}-3.11.0_beta1-configure.patch + + # ocaml has automagics on libX11 and gdbm + # http://caml.inria.fr/mantis/view.php?id=4278 + epatch "${FILESDIR}/${PN}-3.10.0-automagic.patch" + + # Call ld with proper flags, different from gcc ones + # This happens when calling ocamlc -pack + # See comment in the patch + epatch "${FILESDIR}/${PN}-3.11.0_beta1-call-ld-with-proper-ldflags.patch" +} + +src_compile() { + local myconf="--host ${CHOST}" + + # It doesn't compile on alpha without this LDFLAGS + use alpha && append-ldflags "-Wl,--no-relax" + + use tk || myconf="${myconf} -no-tk" + use ncurses || myconf="${myconf} -no-curses" + use X || myconf="${myconf} -no-graph" + use gdbm || myconf="${myconf} -no-dbm" + + # ocaml uses a home-brewn configure script, preventing it to use econf. + RAW_LDFLAGS="$(raw-ldflags)" ./configure -prefix /usr \ + --bindir /usr/bin \ + --libdir /usr/$(get_libdir)/ocaml \ + --mandir /usr/share/man \ + --with-pthread ${myconf} || die "configure failed!" + + make world || die "make world failed!" + + # Native code generation can be disabled now + if use ocamlopt ; then + make opt || die "make opt failed!" + make opt.opt || die "make opt.opt failed!" + fi +} + +src_install() { + make BINDIR="${D}"/usr/bin \ + LIBDIR="${D}"/usr/$(get_libdir)/ocaml \ + MANDIR="${D}"/usr/share/man \ + install || die "make install failed!" + + # Install the compiler libs + dodir /usr/$(get_libdir)/ocaml/compiler-libs + insinto /usr/$(get_libdir)/ocaml/compiler-libs + doins {utils,typing,parsing}/*.{mli,cmi,cmo,cmx,o} + + # Symlink the headers to the right place + dodir /usr/include + dosym /usr/$(get_libdir)/ocaml/caml /usr/include/ + + # Remove ${D} from ld.conf, as the buildsystem isn't $(DESTDIR) aware + dosed "s:${D}::g" /usr/$(get_libdir)/ocaml/ld.conf + + dodoc Changes INSTALL README Upgrading + + # Create and envd entry for latex input files (this definitely belongs into + # CONTENT and not in pkg_postinst. + if use latex ; then + echo "TEXINPUTS=/usr/$(get_libdir)/ocaml/ocamldoc:" > "${T}"/99ocamldoc + doenvd "${T}"/99ocamldoc + fi + + # Install ocaml-rebuild.sh script rather than keeping it in $PORTDIR + dosbin "${FILESDIR}/ocaml-rebuild.sh" +} + +pkg_postinst() { + echo + ewarn "OCaml is not binary compatible from version to version, so you" + ewarn "need to rebuild all packages depending on it, that are actually" + ewarn "installed on your system. To do so, you can run:" + ewarn "/usr/sbin/ocaml-rebuild.sh [-h | emerge options]" + ewarn "Which will call emerge on all old packages with the given options" + echo +} |