From 4cbcc855382a06088e2f016f62cafdbcb7e40665 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 20 Mar 2022 00:40:44 +0000 Subject: gentoo resync : 20.03.2022 --- dev-lang/ocaml/Manifest | 23 ++- .../ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch | 70 --------- dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch | 59 -------- dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch | 65 --------- dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch | 21 --- dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch | 42 ------ dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch | 42 ++++++ .../files/ocaml-4.12.1-fix-textrel-riscv.patch | 46 ++++++ dev-lang/ocaml/ocaml-4.05.0-r7.ebuild | 155 -------------------- dev-lang/ocaml/ocaml-4.05.0-r8.ebuild | 156 --------------------- dev-lang/ocaml/ocaml-4.05.0-r9.ebuild | 156 +++++++++++++++++++++ dev-lang/ocaml/ocaml-4.09.0-r2.ebuild | 104 -------------- dev-lang/ocaml/ocaml-4.09.0-r3.ebuild | 105 ++++++++++++++ dev-lang/ocaml/ocaml-4.10.2-r2.ebuild | 105 -------------- dev-lang/ocaml/ocaml-4.10.2-r3.ebuild | 107 ++++++++++++++ dev-lang/ocaml/ocaml-4.11.2-r2.ebuild | 4 +- dev-lang/ocaml/ocaml-4.12.1.ebuild | 1 + dev-lang/ocaml/ocaml-4.13.1.ebuild | 4 + 18 files changed, 474 insertions(+), 791 deletions(-) delete mode 100644 dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch delete mode 100644 dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch delete mode 100644 dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch delete mode 100644 dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch delete mode 100644 dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch create mode 100644 dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch create mode 100644 dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch delete mode 100644 dev-lang/ocaml/ocaml-4.05.0-r7.ebuild delete mode 100644 dev-lang/ocaml/ocaml-4.05.0-r8.ebuild create mode 100644 dev-lang/ocaml/ocaml-4.05.0-r9.ebuild delete mode 100644 dev-lang/ocaml/ocaml-4.09.0-r2.ebuild create mode 100644 dev-lang/ocaml/ocaml-4.09.0-r3.ebuild delete mode 100644 dev-lang/ocaml/ocaml-4.10.2-r2.ebuild create mode 100644 dev-lang/ocaml/ocaml-4.10.2-r3.ebuild (limited to 'dev-lang/ocaml') diff --git a/dev-lang/ocaml/Manifest b/dev-lang/ocaml/Manifest index a4140461c20b..501212afc387 100644 --- a/dev-lang/ocaml/Manifest +++ b/dev-lang/ocaml/Manifest @@ -1,25 +1,24 @@ AUX ocaml-4.04.2-tinfo.patch 506 BLAKE2B 889c964385442247a70b7205abc497a8d83ac9e3fcedebdb184c9ded8ae81d171656fbe0ade7e431990545c01287f3618e45c3d25e0f77a4e7682e9a21c3f76a SHA512 5bf7e13de2e4a513b5411c3dcaa204aeaff6975b978d68455e059177049c2a1d862b4d1a96f0a986112ea0d347306190c81da6ec4b1150f56a3addc8f3d9b777 -AUX ocaml-4.05.0-CVE-2018-9838.patch 2888 BLAKE2B 75fe491c1b12d9882c7b558efb3384a133c56bea0c85e97a6b46ec5b5f4050da4752228c795d937875645260b98ac9d203b9cdbf583ed36934a29faf4d47ecc3 SHA512 3da218dcea2c08ed97da805a2c1a1bc134a48b4425b4912283e353dde606ae99c95b86b59c6575b42961c9eb6903e09d60968c5a8db72a58510c4e3dcd13a5ef -AUX ocaml-4.05.0-gcc10.patch 1976 BLAKE2B cf1240a815d731e99862740ddf90f6a0ea1d078c9e4e1cef126eff4a7d80afbde73f45d360a26eaa14863cc35d2086d98d130251490959df4c361a51ced0557e SHA512 e55cb651431798294b21ee0ea8818d6c42f88c329b7a1985af9d460f2a5b3057f2ee229e72699f9660168202a0c78dcf89b8bfce2154ca3e141fe8fb5f861773 -AUX ocaml-4.09.0-cflags.patch 2644 BLAKE2B df053880534f47ad922a16bce7ad49017152afe514af037c069ef27f54a154332c860a7d1a264b882d82abf474dfdabf803e24dd3632bd67aa0e149e7f52b292 SHA512 622f6f8be1dfe6c10cb6eea2357beff7470f9ff9a0bedd45211099d3ba5a465a01422db61849b0625671ac8e1c2d198f8dd848258d40317062d217f2859c278b -AUX ocaml-4.09.0-gcc-10.patch 571 BLAKE2B 990107a1d199d350a821596e7655566bb8eb71ee828eb0247bd25111760dd4dd6952a0bea6c29f69f6fa4ef8d02bd47166b5f2c4ced30ed830078b1555ca86eb SHA512 430774f62cea3f4ed06c9a1cbc73c68e3eab0d6fbebb5e62ea12a012cc2b25bb1a776ff08a7d532140bc2e12eae3e1a43605bf5708e1333b23a135b9801de084 -AUX ocaml-4.10.2-cflags.patch 1704 BLAKE2B aa106b9a90e2daa49df1cae0d9a0f57c7a7c3bd38b0f083aa0f52a247190a5a64c165266e86fdd5a0ad7bf1d0a250ae9823b8d2050d3f00d3cc0ac4145a0c9c5 SHA512 a4d402d769c8d8a0135fcdb1b75a3edcae4fe2e62614e6c4513429f7a0e21be108f4d67eed31470a869737e13dfb7a4493173164902937dcc0fbc8e5d8150e83 +AUX ocaml-4.11.2-cflags.patch 1416 BLAKE2B 722ffd7944c3dabd753e98bfb885ad283aa5b66a07f9785a8993d321f4ad4fc29bb2656fc5df339a19ab2dca21efda911fb3104eea5a7e6961307f12a312d7f3 SHA512 707c4ab6e09bab1b45c0f955edb775cfc5e7018404263a125c87405b77c6c2c93e64f5427c43e22519b342392631869dc661dd173083bac17c50bda4650287e4 AUX ocaml-4.11.2-glibc-2.34.patch 3318 BLAKE2B 96fe61e553e7c67f76df32f2e5532f7a6eae57fb60752c7c49d71baf416ac74a4c7b925ecfd0bd5874a1728b51ca36b82d636bfa6ab30ec5f3df37fbac2a73b9 SHA512 eb54d912338a42a21f736dcd1591f77403b0dff8772059bd7f39a6e83b8a5e89bd5a7a9d4200bacbcaa8ec0450a5a78ecf6645bb5405d45fd1c077cbe1c36f7f AUX ocaml-4.12.0-glibc-2.34.patch 3411 BLAKE2B d5138feaf6ca1e4a25ee85100013e343f8867bfe22d1c8c26df56fe1a6266b9cf37738f0b5fa6ee6daaaed9c90880529a50ffa1e789766039727dd407d15da51 SHA512 978a300d28bcb4c4d312e5b9f830140b08a282ba850d7c7a3866ca54413a321695d21315fff423d646085d8eed148a3f84567c08a4e09957b4b87010d65ee694 +AUX ocaml-4.12.1-fix-textrel-riscv.patch 1784 BLAKE2B 700fca8fe6c30a301bca5a64ed94038923bec1df80e6a75d4afb88ecfc38c9c55f5c163dfb12506f6b3a1e5784e65314385e13b9f45230b9f3b3e7d771c89b2e SHA512 f4f3a4b1f3f9fd823e09338c7c06ce6abc8699a765c0aa442e3b66ae72a83bb6dee744bfc0cb527a1131bbbe0ae5a5fd1d51c4700b62927f1fdf25a47e541e80 AUX ocaml-rebuild.sh 1120 BLAKE2B 6f88a9f2b99fae7f89b884bb08d2c6ad6a0e14d4a8fd06d498037f78c5f6ef040428f9de224b5fe5df4ef64eaed419cda6d8715ea0c0a4c4dad60c5cf75a4147 SHA512 05a3e81e95533135d9895091c21621c73ae82851abd4889d64f035979eb25f8d90b60f469d7ef5e789fd1a4adffd6bbe255e6708c14c24a04f8a423507d19a40 AUX ocaml.conf 177 BLAKE2B da070848d9e3a30ad303c296f55de87c30fd15feee3304ccc1d1f844d83c5a646664cd4d9958375ead2324e25bb88280fdb78f9e4230eeb8cd5825eed6f2f91d SHA512 4f0a48b8101b77d568d8d0a852f2a21fd46b7947c5d3f975ee4cd8a9c37c993d689cf5fb53b54a6b2740cb865051dc50c74c0c373eb697fca800ca143d401aa4 +DIST ocaml-4.05.0-patches-1.tar.bz2 4009 BLAKE2B 052c3a6859a942f2993d0b06ab57ca8f7469650c096f20bff7ff7cf5c2842e8d5019d595a4eca0dc1a4e5feda2db8a831a6917b3b6d9f39166c8ae7af1e894e7 SHA512 b349e6613201d9400f736c5b2d0ede01e7e113524cbc6989999a71fb97cb1eb67f90af8c2fbd3fd8abeccf3193e317cdd8258aee328c3e078634385c21558619 DIST ocaml-4.05.0.tar.gz 4431750 BLAKE2B c2ab003a13e0a581ebd0e1c96eeb8a9baea9bfe6bee08823b0e4541819201ec109f1846e13fc1aefa51a001eefbb8f73320ba854d41975fc68cef41bc75b1ecc SHA512 9a060ae4b741e1687277403e5bdb8f6eda2e2ebf6c45f7c0149b66ea1213cb26d13febfbb3f11c12543e244cfdd053b786b09c4145e2348e5d89a7206f7de225 +DIST ocaml-4.09.0-patches-1.tar.bz2 3300 BLAKE2B ef710ea5ed5a243ae684f68b7f203ba454192c9f8f19c32697d336bf18cf2a0e8ea08df232b0fd8e2475a000758a5ba95b3794096ec7d0d1b292a715ab3de86f SHA512 94096b99fd58b32232e418c5736203f08ab3c1558154ed00d4290730bd4db849bc60dfae6160f344acce63bbb8eaceecee25cf836bb73fa419d7bbf4eac433f1 DIST ocaml-4.09.0.tar.gz 4838748 BLAKE2B 80f29d535c64bf2371b480217723ed20b2b21cfd93ce31366a7b91e7ddffdf68db4e88d085288b7e21efee567a13f42ecff24c3a0115507b006acf844239cefd SHA512 dc0271e591bf929b751705835790949a9d741e12d085c8b207c3689b5838a02ea8de80da8b2605d2e6744f2f541b0d1694ffafff9509e99ce01f3a391f6ef2ae +DIST ocaml-4.10.2-patches-1.tar.bz2 3180 BLAKE2B 474471e10c4525e4da730fcf8602fddf5209f7d8eb15bd76894ed2bc22213a6e61aa7f52b1b67dff6c8bf04eac7d759ada28f1783c83a075cc65e7e5caadc715 SHA512 1456f90c0c833461eb9d1c140ba1a7358aa9351f6303e83b0e19bb8688dcb17bdad211f4cec1281a47180bbdddcfdbf44367b47a6b301d2ea41fa9d926bd03a5 DIST ocaml-4.10.2.tar.gz 4933135 BLAKE2B ec5e92adb23c28a254247182c79ab555fd82603e02f24799049b8057abf869d18234302408c8ae89b9997a2b210ed6965e45c2c03e4f0cab34262ad3f6ebb528 SHA512 1dd827da07f01e815fd74dd7ee84db0900f24782f8f7fd426e2d71b9fb03c7b8045f22e018120a0446c362315751365d1bd8c1724edef2b182394e76eb0a07b2 DIST ocaml-4.11.2.tar.gz 5075323 BLAKE2B bdc503d9a8d0e39dd11060febcd0287657b460e50ed81e55578a3e778af990ca5d4ef9011753eee4e1a144da33eb76c95b1672dc99b76e65a2e107eee472fe06 SHA512 03d8a9f6e130142c121ff2eb3d54f584f1e7c8475f066a5803bb0edd2fa172ca06a56a3ec548b225f5c8b12112d7a68511b1e16f3ade075b5f02610d4247bbb3 DIST ocaml-4.12.1.tar.gz 5181696 BLAKE2B 9d21438e09b1a9680eabb65f5c78d9fe84459592ef7bb797a1933e5383f7b6d5cefffa8cdc184abc102417f5dbc0fca8ef624c9b560f89eaff6537544b5b395f SHA512 e942e5cf5530804690ec45c40936ad2acbb60e11279fc676e0f04181fe1855f84ee5c3cb9c337fc5d01f6ee0e7b2251a6c04f7de56d99c20bb62026dff6c5671 DIST ocaml-4.13.1.tar.gz 5323203 BLAKE2B f1dcb1601ebfa2a37351e3a466a7ca601518c2da403b01aeb182738a54d5887523ab554d747d6591cb09b07b417865e20907f7877117b2d2d069ef6c9edc0fae SHA512 da3434177438c852da53c0fda7bc2519adcda6384d97d45e44137ed0fd384ffb3da61958a7b51296edb3f88f5a5310ca71b6862f6d756aaa4012d1f54e5955f6 DIST ocaml-patches-9.tar.bz2 1700 BLAKE2B 4e46b8fb490db28f815414e285f54e251394ea53e1d25c529bbea9f03e426fd19132b1e2c7c2be7d14983fceb4cad073d191b001f6da522fee4226371d4a2eca SHA512 cc19f9104fac69aecc5effa8cb772342e1fb61cdcd38ba0176efe04cf3d710b1c56d5178748f3bd29099af91fa684da432a8ef8d42de76dbd1b6954a255ea6c0 -EBUILD ocaml-4.05.0-r7.ebuild 4293 BLAKE2B bd07fb0811d4345e135b92c782a45322b0be6f70b1ac7b5734278ce89503c6eeb5dc86521f3f142fcedb4717f9a568c8fc1e8a1cf8681d30b5c170e3c65a83fe SHA512 c5d527caa2bf54ab1d518ab85a4b9a331e5575af93cfc2f1ac792476edab1d035be56e603260ef44ba0c85097040e46721af31ad02b115f55da26f73c97a2d3a -EBUILD ocaml-4.05.0-r8.ebuild 4333 BLAKE2B 45432804c19f71b9b671adac43627bdfd81dec327d3664f8b692de544c44a8224246e4bfd2038740d3d91e1e6fe400da555343796ed94381289c129e860f268f SHA512 96398dffb8f7f28946f27ea157a0c80aaf69e1507f3de506566b99956b8418a61a15bc0d2da5ad9985bad027e2ec50e224b47d6f47fc06f927766d552a4031fb -EBUILD ocaml-4.09.0-r2.ebuild 2755 BLAKE2B a5baaf014e722eacb2b1ed1c7e1bfee9dca9b2c19f40fb14256d77607a2c554a4084e4851de604f902691067894438dd229fe26d47efbb55b25b6aba1df183f1 SHA512 85d4ac2b1f7d48dd9867e786f9ed8f687bfe2078a3694c2a9aa86c5684917eba4f51cd5228f3b5c811b6dbf431770d5fb66b6fed1167828a6c32881f604671a0 -EBUILD ocaml-4.10.2-r2.ebuild 2722 BLAKE2B f9e52093866c8f0d76cb3ed889dea2c2c6435aa8e0e504d8b8afa0bb2ab681208a2dbb0ab598e6eb42015ebf9046cb2ae2f7dd421c3375db8651174f8e929019 SHA512 58645c5008d88fea796e3cc77cf1bc3a194cdc7da480747ab6ada82b998d08e954d29fc7ad7b72dfcba667103059a7c5e7d7683acb7d3730fcf4c1182de9c48b -EBUILD ocaml-4.11.2-r2.ebuild 2641 BLAKE2B 8fb877a5a10778e4d96830b7d9f6b62217fc76d3208c7aeda9973479f5aede645251cd0c4a0680115898cf435a141fd09b8900d2efbbe91c2d8e324fa54e2bbc SHA512 b52ce16cafece2d229cbaf04e815c5791b3b211b1e512337f5c02d7af41328dfa5fa573853d6fd9a858d5733fbb321244a811902b8116b57a564961e7ffa6bd5 -EBUILD ocaml-4.12.1.ebuild 2515 BLAKE2B 6d91d1e528169b037dafd58701b57dafe536f1abdf1a207ffa8ad75b20577410bf55305b031510432ca9c28391e2fce5b7bd6e4066a6cf09470e3eb689da6f2f SHA512 5497b9ca6081b947c6489fe7c6cbcfc7f4b18dbc8bda8682615c255326454941e7e6ff277168cf8234250e89539022364d2b7a4c79a3d1a886e3d8c7bfc2f846 -EBUILD ocaml-4.13.1.ebuild 2457 BLAKE2B cca2eae8a16069050ee1248270a720c4726da6e67ed0bd7ef15e401db8cdfaaec74e7c9462a8d5faf5acadfaaa9e269de6e3a8d8944b86a5c36dbb8409777012 SHA512 601cb38b4174a46c441da4051ce5b789d16d0e2f69c9fb85aa3dd4027903cbe7a3ad4b5738fbd63893225ec72874f43d4a6d11558760335d961071e54e21bb2a +EBUILD ocaml-4.05.0-r9.ebuild 4370 BLAKE2B 22f915f38da08b3f98923f337dbe1a2ae25f2edaf73887f602c0d13047808bff8f5bcde68d7ac214f07da7d68d6c05a2f9520318d1cda041d54e37966b27c605 SHA512 111a2e4d4a18034a2d4580d19e4074fd4d6b60330e0af861062c4196c19027667d18e0361e1e73cdf9d46c31d06d66ce9a7ada36058fca168f634a891cdae861 +EBUILD ocaml-4.09.0-r3.ebuild 2794 BLAKE2B 0a7e6b805915602875e3f323f97370a5f9345c2a1a9e30ed545922cfdd31c8d304d2e534b1ead1719b9be33f72c79c8383ca63fa45f2f62084f47c7cfd1e127c SHA512 b87052b9caea618b0024342e614859e68bb30b3426b31df313006a3c655be8b60e47ab9611c609307bacff610f0cc889e68db14e1c78bb820f33bcde8b32f5ee +EBUILD ocaml-4.10.2-r3.ebuild 2801 BLAKE2B 089f0d19153db72faa63db09fc7ef60b69ea087573f79f137e0f458ea1d6dc0e353ab2455359418dce6f26c5f6df912198360369873decaa340b72dce3abba5b SHA512 a3d8ec3bd0639af28ceb824d84c4b591a1f4ed40f61377477265c42eea2f18cbe9729c9493a0577e4c3540521a0be1b9cc5dba8d5dea245eba43ce57ac03d987 +EBUILD ocaml-4.11.2-r2.ebuild 2642 BLAKE2B 3639ba3300e16337b2b0d31b4bca1accad472b734003207a7a863de24b7391686a9e18fd6c12ee7775efe40f0c21ae89d652b7c7c40e5e757ea360333d5055df SHA512 5ef88e24a64f6627b599f05fd6e6f9fd4e476f4c7547b00385d3594ceb24a7c15c4b32f055adc8d1ebc101ec0f948b339d4368a573b0b49c931ad061dba0834a +EBUILD ocaml-4.12.1.ebuild 2559 BLAKE2B 50f373f16833ba2783fa3f1758ce0678934b3be58d662b595440f8abf0f0179ea78781835303dadd583cedf412c08cb1799e54276237fae491cdd944615d9f98 SHA512 9f3ce96e0f69f6a11d431255709f0ea11f46bb80f43597d3b026a916191bc6e71671621720184e4d2ddb962dc45360a6d0541c68525720ea89e63b009acf57f8 +EBUILD ocaml-4.13.1.ebuild 2522 BLAKE2B 8960f3e3ec99267b9a5673c7ab3765970ecbf1d1cd35500be26b7d0ec5d4e35c2c700b39179c2178f86b9f89fe9772d47f01ea70f925b6bfce048f7a799cbfba SHA512 390b1b201c9a3b9cebf6a17e4820224e7b321390801134a496ba45fe607a9af8b1417eb3d17cf52f41c5a70eef9d463182df392cb264e1243efbce90f7f5a8e7 MISC metadata.xml 776 BLAKE2B e7b13b4bb764cec6df76ede0eb2d492cc705ce51b18a445fa3f9ebaab119fab8cae45a2a9d02c70f38e19f2e2d2c06de648a3a0843a603dd7b68942c7cd00bdb SHA512 92e3afe1c40991d37dc460d6091ff2b15c83740343e5d8dd69344eb61d873fbd66af1b96e70904f7757c06f2b104d1450883cc79877709c779467af64e2ea96e diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch b/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch deleted file mode 100644 index cfe3ff636c25..000000000000 --- a/dev-lang/ocaml/files/ocaml-4.05.0-CVE-2018-9838.patch +++ /dev/null @@ -1,70 +0,0 @@ -https://bugs.gentoo.org/755257 - -Needed for both fixing the CVE + compatibility with Debian for e.g. -Unison. - -From c6ca3afc78b75d7748e4e09e56c6b020418be06e Mon Sep 17 00:00:00 2001 -From: Stephane Glondu -Date: Fri, 25 Jan 2019 14:34:23 +0100 -Subject: [PATCH] Fix integer overflows when unmarshaling a bigarray - -Malicious or corrupted marshaled data can result in a bigarray -with impossibly large dimensions that cause overflow when computing -the in-memory size of the bigarray. Disaster ensues when the data -is read in a too small memory area. This commit checks for overflows -when computing the in-memory size of the bigarray. - -This patch is based on one by Xavier Leroy and has been modified to -use caml_ba_multov instead of caml_umul_overflow which is unavailable -in OCaml 4.05.0. - -The original commit hash is 85162eee9d4072fa9c2f498f03cd94e357033eec. - -Origin: https://github.com/ocaml/ocaml/pull/1718 -Bug: https://github.com/ocaml/ocaml/issues/7765 -Bug-Debian: https://bugs.debian.org/895472 -Bug-CVE: CVE-2018-9838 ---- a/otherlibs/bigarray/bigarray_stubs.c -+++ b/otherlibs/bigarray/bigarray_stubs.c -@@ -966,22 +966,34 @@ static void caml_ba_deserialize_longarray(void * dest, intnat num_elts) - uintnat caml_ba_deserialize(void * dst) - { - struct caml_ba_array * b = dst; -- int i, elt_size; -- uintnat num_elts; -+ int i; -+ uintnat num_elts, size; -+ int overflow; - - /* Read back header information */ - b->num_dims = caml_deserialize_uint_4(); -+ if (b->num_dims < 0 || b->num_dims > CAML_BA_MAX_NUM_DIMS) -+ caml_deserialize_error("input_value: wrong number of bigarray dimensions"); - b->flags = caml_deserialize_uint_4() | CAML_BA_MANAGED; - b->proxy = NULL; - for (i = 0; i < b->num_dims; i++) b->dim[i] = caml_deserialize_uint_4(); -- /* Compute total number of elements */ -- num_elts = caml_ba_num_elts(b); -- /* Determine element size in bytes */ -+ /* Compute total number of elements. Watch out for overflows (MPR#7765). */ -+ num_elts = 1; -+ for (i = 0; i < b->num_dims; i++) { -+ overflow = 0; -+ num_elts = caml_ba_multov(num_elts, b->dim[i], &overflow); -+ if (overflow) -+ caml_deserialize_error("input_value: size overflow for bigarray"); -+ } -+ /* Determine array size in bytes. Watch out for overflows (MPR#7765). */ - if ((b->flags & CAML_BA_KIND_MASK) > CAML_BA_CHAR) - caml_deserialize_error("input_value: bad bigarray kind"); -- elt_size = caml_ba_element_size[b->flags & CAML_BA_KIND_MASK]; -+ overflow = 0; -+ size = caml_ba_multov(num_elts, caml_ba_element_size[b->flags & CAML_BA_KIND_MASK], &overflow); -+ if (overflow) -+ caml_deserialize_error("input_value: size overflow for bigarray"); - /* Allocate room for data */ -- b->data = malloc(elt_size * num_elts); -+ b->data = malloc(size); - if (b->data == NULL) - caml_deserialize_error("input_value: out of memory for bigarray"); - /* Read data */ diff --git a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch b/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch deleted file mode 100644 index a0c67da534a0..000000000000 --- a/dev-lang/ocaml/files/ocaml-4.05.0-gcc10.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/byterun/caml/intext.h 2021-01-28 22:46:20.400224678 +0100 -+++ b/byterun/caml/intext.h 2021-01-28 22:46:49.312751054 +0100 -@@ -196,7 +196,7 @@ - - CAMLextern struct code_fragment * caml_extern_find_code(char *addr); - --struct ext_table caml_code_fragments_table; -+extern struct ext_table caml_code_fragments_table; - - #endif /* CAML_INTERNALS */ - ---- a/byterun/caml/major_gc.h 2021-01-28 22:44:12.193323457 +0100 -+++ b/byterun/caml/major_gc.h 2021-01-28 22:45:20.918198701 +0100 -@@ -64,9 +64,9 @@ - extern char *caml_gc_sweep_hp; - - extern int caml_major_window; --double caml_major_ring[Max_major_window]; --int caml_major_ring_index; --double caml_major_work_credit; -+extern double caml_major_ring[Max_major_window]; -+extern int caml_major_ring_index; -+extern double caml_major_work_credit; - extern double caml_gc_clock; - - /* [caml_major_gc_hook] is called just between the end of the mark ---- a/byterun/meta.c 2021-01-28 22:47:34.148016359 +0100 -+++ b/byterun/meta.c 2021-01-28 22:47:56.048657393 +0100 -@@ -32,6 +32,8 @@ - #include "caml/prims.h" - #include "caml/stacks.h" - -+struct ext_table caml_code_fragments_table; -+ - #ifndef NATIVE_CODE - - CAMLprim value caml_get_global_data(value unit) ---- a/byterun/backtrace.c 2021-01-28 22:50:25.275226598 +0100 -+++ b/byterun/backtrace.c 2021-01-28 22:50:37.541027290 +0100 -@@ -28,7 +28,7 @@ - #include "caml/fail.h" - - /* The table of debug information fragments */ --struct ext_table caml_debug_info; -+extern struct ext_table caml_debug_info; - - CAMLexport int32_t caml_backtrace_active = 0; - CAMLexport int32_t caml_backtrace_pos = 0; ---- a/asmrun/startup.c 2021-01-28 23:02:50.526072662 +0100 -+++ b/asmrun/startup.c 2021-01-28 23:03:09.977754311 +0100 -@@ -44,7 +44,7 @@ - #endif - - extern int caml_parser_trace; --CAMLexport header_t caml_atom_table[256]; -+CAMLextern header_t caml_atom_table[256]; - char * caml_code_area_start, * caml_code_area_end; - - /* Initialize the atom table and the static data and code area limits. */ diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch b/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch deleted file mode 100644 index 8d2391407a35..000000000000 --- a/dev-lang/ocaml/files/ocaml-4.09.0-cflags.patch +++ /dev/null @@ -1,65 +0,0 @@ ---- a/runtime/Makefile 2022-01-22 19:49:32.914213696 +0100 -+++ b/runtime/Makefile 2022-01-22 19:50:03.765640701 +0100 -@@ -335,7 +335,7 @@ - # (without the extension, which is added by the macro) - define COMPILE_C_FILE - $(1).$(O): %.c -- $$(CC) -c $$(OC_CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$< -+ $$(CC) -c $$(OC_CFLAGS) $(CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$< - endef - - object_types := % %_b %_bd %_bi %_bpic %_n %_nd %_ni %_np %_npic ---- a/yacc/Makefile 2022-01-22 20:02:56.510340885 +0100 -+++ b/yacc/Makefile 2022-01-22 20:03:14.998000508 +0100 -@@ -63,4 +63,4 @@ - # also works for .obj files. - - %.$(O): %.c -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< ---- a/otherlibs/Makefile.otherlibs.common 2022-01-22 20:24:15.316779625 +0100 -+++ b/otherlibs/Makefile.otherlibs.common 2022-01-22 20:24:50.730126701 +0100 -@@ -138,4 +138,4 @@ - $(CAMLOPT) -c $(COMPFLAGS) $(OPTCOMPFLAGS) $< - - .c.$(O): -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< ---- a/ocamltest/Makefile 2022-01-22 20:30:22.454009704 +0100 -+++ b/ocamltest/Makefile 2022-01-22 20:30:33.845799603 +0100 -@@ -221,7 +221,7 @@ - $(ocamllex) -q $< - - %.$(O): %.c -- $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -c $< -+ $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -c $< - - ocamltest_config.ml: ocamltest_config.ml.in Makefile ../Makefile.config - sed \ ---- a/otherlibs/systhreads/Makefile 2022-01-22 20:42:17.647349876 +0100 -+++ b/otherlibs/systhreads/Makefile 2022-01-22 20:43:29.766086103 +0100 -@@ -93,11 +93,11 @@ - # twice, each time with different options). - - st_stubs_b.$(O): st_stubs.c $(HEADER) -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime \ -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime \ - $(SHAREDLIB_CFLAGS) $(OUTPUTOBJ)$@ $< - - st_stubs_n.$(O): st_stubs.c $(HEADER) -- $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) \ -+ $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) \ - -I$(ROOTDIR)/runtime $(SHAREDLIB_CFLAGS) -DNATIVE_CODE \ - -DTARGET_$(ARCH) -DMODEL_$(MODEL) -DSYS_$(SYSTEM) \ - $(OUTPUTOBJ)$@ -c $< ---- a/tools/Makefile 2022-01-23 09:57:00.788877931 +0100 -+++ b/tools/Makefile 2022-01-23 09:57:21.735516656 +0100 -@@ -322,7 +322,7 @@ - endif - - objinfo_helper$(EXE): objinfo_helper.c $(ROOTDIR)/runtime/caml/s.h -- $(CC) $(OC_CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime $(OUTPUTEXE)$@ \ -+ $(CC) $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) -I$(ROOTDIR)/runtime $(OUTPUTEXE)$@ \ - $(DEF_SYMBOL_PREFIX) $(LIBBFD_INCLUDE) $< $(LIBBFD_LINK) - - OBJINFO=$(ROOTDIR)/compilerlibs/ocamlcommon.cma \ diff --git a/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch b/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch deleted file mode 100644 index e25d55a5f668..000000000000 --- a/dev-lang/ocaml/files/ocaml-4.09.0-gcc-10.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/runtime/backtrace.c -+++ b/runtime/backtrace.c -@@ -28,7 +28,7 @@ - #include "caml/fail.h" - - /* The table of debug information fragments */ --struct ext_table caml_debug_info; -+extern struct ext_table caml_debug_info; - - CAMLexport int32_t caml_backtrace_active = 0; - CAMLexport int32_t caml_backtrace_pos = 0; ---- a/runtime/startup_nat.c -+++ b/runtime/startup_nat.c -@@ -44,7 +44,6 @@ - #endif - - extern int caml_parser_trace; --CAMLexport header_t caml_atom_table[256]; - char * caml_code_area_start, * caml_code_area_end; - struct ext_table caml_code_fragments_table; - diff --git a/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch b/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch deleted file mode 100644 index 01117c39887d..000000000000 --- a/dev-lang/ocaml/files/ocaml-4.10.2-cflags.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/runtime/Makefile 2022-01-22 19:49:32.914213696 +0100 -+++ b/runtime/Makefile 2022-01-22 19:50:03.765640701 +0100 -@@ -335,7 +335,7 @@ - # (without the extension, which is added by the macro) - define COMPILE_C_FILE - $(1).$(O): %.c -- $$(CC) -c $$(OC_CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$< -+ $$(CC) -c $$(OC_CFLAGS) $(CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$< - endef - - object_types := % %_b %_bd %_bi %_bpic %_n %_nd %_ni %_np %_npic ---- a/otherlibs/Makefile.otherlibs.common 2022-01-22 20:24:15.316779625 +0100 -+++ b/otherlibs/Makefile.otherlibs.common 2022-01-22 20:24:50.730126701 +0100 -@@ -138,4 +138,4 @@ - $(CAMLOPT) -c $(COMPFLAGS) $(OPTCOMPFLAGS) $< - - .c.$(O): -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< ---- a/otherlibs/systhreads/Makefile 2022-01-22 20:42:17.647349876 +0100 -+++ b/otherlibs/systhreads/Makefile 2022-01-22 20:43:29.766086103 +0100 -@@ -102,10 +102,10 @@ - st_stubs_n.$(O): OC_CPPFLAGS += $(NATIVE_CPPFLAGS) - - st_stubs_b.$(O): st_stubs.c $(HEADER) -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< - - st_stubs_n.$(O): st_stubs.c $(HEADER) -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< - - partialclean: - rm -f *.cm* ---- a/Makefile.common.in 2022-01-23 18:05:04.192323554 +0100 -+++ b/Makefile.common.in 2022-01-23 18:05:17.211122643 +0100 -@@ -79,4 +79,4 @@ - # general (it supports both .o and .obj) - - %.$(O): %.c -- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< -+ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< diff --git a/dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch b/dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch new file mode 100644 index 000000000000..7adb1ea0768d --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-4.11.2-cflags.patch @@ -0,0 +1,42 @@ +--- a/runtime/Makefile ++++ b/runtime/Makefile +@@ -335,7 +335,7 @@ + # (without the extension, which is added by the macro) + define COMPILE_C_FILE + $(1).$(O): %.c +- $$(CC) -c $$(OC_CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$< ++ $$(CC) -c $$(OC_CFLAGS) $(CFLAGS) $$(OC_CPPFLAGS) $$(OUTPUTOBJ)$$@ $$< + endef + + object_types := % %_b %_bd %_bi %_bpic %_n %_nd %_ni %_np %_npic +--- a/otherlibs/Makefile.otherlibs.common ++++ b/otherlibs/Makefile.otherlibs.common +@@ -138,4 +138,4 @@ + $(CAMLOPT) -c $(COMPFLAGS) $(OPTCOMPFLAGS) $< + + .c.$(O): +- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< ++ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< +--- a/otherlibs/systhreads/Makefile ++++ b/otherlibs/systhreads/Makefile +@@ -102,10 +102,10 @@ + st_stubs_n.$(O): OC_CPPFLAGS += $(NATIVE_CPPFLAGS) + + st_stubs_b.$(O): st_stubs.c $(HEADER) +- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< ++ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< + + st_stubs_n.$(O): st_stubs.c $(HEADER) +- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< ++ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< + + partialclean: + rm -f *.cm* +--- a/Makefile.common.in ++++ b/Makefile.common.in +@@ -79,4 +79,4 @@ + # general (it supports both .o and .obj) + + %.$(O): %.c +- $(CC) -c $(OC_CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< ++ $(CC) -c $(OC_CFLAGS) $(CFLAGS) $(OC_CPPFLAGS) $(OUTPUTOBJ)$@ $< diff --git a/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch b/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch new file mode 100644 index 000000000000..5ba8582d3a65 --- /dev/null +++ b/dev-lang/ocaml/files/ocaml-4.12.1-fix-textrel-riscv.patch @@ -0,0 +1,46 @@ +From ddf99786f8229c8282905af5c7c74360d4f2fbd0 Mon Sep 17 00:00:00 2001 +From: Alex Fan +Date: Tue, 22 Feb 2022 19:28:30 +1100 +Subject: [PATCH] riscv: Generate frametable in data section to improve code + relocatability (#11042) + +Similar to what PowerPC and System-Z have done in commit 24980d3fd9848e281761ef2b8fe383e71261789b + +With this commit ocamlopt produces .so shared libraries and PIE relocatable +executables that contain no relocations in the text segment. + +Upstream status: merged in 4.14 and 5.x +--- + Changes | 5 +++++ + asmcomp/riscv/emit.mlp | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/Changes b/Changes +index 4898e9d69fc..2bec76daac6 100644 +--- a/Changes ++++ b/Changes +@@ -477,6 +477,11 @@ OCaml 4.14.0 + - #10907, #10959: Wrong type inferred from existential types + (Jacques Garrigue and Gabriel Scherer, report by @dyzsr, review by Leo White) + ++- #10688: Move frame descriptor table from `rodata` to `data` section on ++ RISC-V. Improves support for building DLLs and PIEs. In particular, this ++ applies to all binaries in distributions that build PIEs by default (eg ++ Gentoo and Alpine). ++ (Alex Fan, review by Gabriel Scherer) + + OCaml 4.13 maintenance branch + ----------------------------- +diff --git a/asmcomp/riscv/emit.mlp b/asmcomp/riscv/emit.mlp +index 474a3c6857a..b36aa0ea38c 100644 +--- a/asmcomp/riscv/emit.mlp ++++ b/asmcomp/riscv/emit.mlp +@@ -645,7 +645,7 @@ let end_assembly() = + `{emit_symbol lbl_end}:\n`; + ` .quad 0\n`; + (* Emit the frame descriptors *) +- ` {emit_string rodata_space}\n`; ++ ` {emit_string data_space}\n`; (* not rodata because relocations inside *) + let lbl = Compilenv.make_symbol (Some "frametable") in + declare_global_data lbl; + `{emit_symbol lbl}:\n`; diff --git a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild deleted file mode 100644 index 8f3bd8015bfc..000000000000 --- a/dev-lang/ocaml/ocaml-4.05.0-r7.ebuild +++ /dev/null @@ -1,155 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic toolchain-funcs - -PATCHLEVEL="9" -MY_P="${P/_/-}" -DESCRIPTION="Type-inferring functional programming language descended from the ML family" -HOMEPAGE="https://ocaml.org" -SRC_URI="https://github.com/ocaml/ocaml/archive/${PV/_/+}.tar.gz -> ${MY_P}.tar.gz - mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2" - -LICENSE="QPL-1.0 LGPL-2" -# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt, -# so here we go with the subslot. -SLOT="0/$(ver_cut 1-2)" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" -IUSE="emacs flambda latex ncurses +ocamlopt spacetime X xemacs" - -RDEPEND=" - sys-libs/binutils-libs:= - ncurses? ( sys-libs/ncurses:0= ) - spacetime? ( sys-libs/libunwind:= ) - X? ( x11-libs/libX11 ) - !dev-ml/num" -BDEPEND="${RDEPEND} - virtual/pkgconfig" -PDEPEND="emacs? ( app-emacs/ocaml-mode ) - xemacs? ( app-xemacs/ocaml )" - -QA_FLAGS_IGNORED='/usr/lib.*/ocaml/raw_spacetime_lib.cmxs' - -S="${WORKDIR}/${MY_P}" - -PATCHES=( - "${FILESDIR}/${PN}-4.04.2-tinfo.patch" #459512 - "${FILESDIR}"/${P}-gcc10.patch -) - -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_prepare() { - EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches" - - cp "${FILESDIR}"/ocaml.conf "${T}" || die - - default -} - -src_configure() { - export LC_ALL=C - local myconf="" - - # Causes build failures because it builds some programs with -pg, - # bug #270920 - filter-flags -fomit-frame-pointer - # Bug #285993 - filter-mfpmath sse - - # Broken until 4.12 - # bug #818445 - filter-flags '-flto*' - append-flags -fno-strict-aliasing - - # -ggdb3 & co makes it behave weirdly, breaks sexplib - replace-flags -ggdb* -ggdb - - # OCaml generates textrels on 32-bit arches - # We can't do anything about it, but disabling it means that tests - # for OCaml-based packages won't fail on unexpected output - # bug #773226 - if use arm || use ppc || use x86 ; then - append-ldflags "-Wl,-z,notext" - fi - - # It doesn't compile on alpha without this LDFLAGS - use alpha && append-ldflags "-Wl,--no-relax" - - use ncurses || myconf="${myconf} -no-curses" - use X || myconf="${myconf} -no-graph" - use flambda && myconf="${myconf} -flambda" - use spacetime && myconf="${myconf} -spacetime" - - # ocaml uses a home-brewn configure script, preventing it to use econf. - RAW_LDFLAGS="$(raw-ldflags)" ./configure \ - --prefix "${EPREFIX}"/usr \ - --bindir "${EPREFIX}"/usr/bin \ - --target-bindir "${EPREFIX}"/usr/bin \ - --libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \ - --mandir "${EPREFIX}"/usr/share/man \ - -target "${CHOST}" \ - -host "${CBUILD}" \ - -cc "$(tc-getCC)" \ - -as "$(tc-getAS)" \ - -aspp "$(tc-getCC) -c" \ - -partialld "$(tc-getLD) -r" \ - --with-pthread ${myconf} || die "configure failed!" - - # http://caml.inria.fr/mantis/view.php?id=4698 - export CCLINKFLAGS="${LDFLAGS}" -} - -src_compile() { - emake world - - # Native code generation can be disabled now - if use ocamlopt ; then - # bug #279968 - emake opt - emake -j1 opt.opt - fi -} - -src_test() { - if use ocamlopt ; then - emake -j1 tests - else - ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." - fi -} - -src_install() { - emake BINDIR="${ED}"/usr/bin \ - LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \ - MANDIR="${ED}"/usr/share/man \ - install - - # Symlink the headers to the right place - dodir /usr/include - # Create symlink for header files - dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml - dodoc Changes README.adoc - # Create envd entry for latex input files - if use latex ; then - echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die - doenvd "${T}/99ocamldoc" - fi - - sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die - - # Install ocaml-rebuild portage set - insinto /usr/share/portage/config/sets - doins "${T}"/ocaml.conf -} diff --git a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild deleted file mode 100644 index 58ae1dde82d7..000000000000 --- a/dev-lang/ocaml/ocaml-4.05.0-r8.ebuild +++ /dev/null @@ -1,156 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic toolchain-funcs - -PATCHLEVEL="9" -MY_P="${P/_/-}" -DESCRIPTION="Type-inferring functional programming language descended from the ML family" -HOMEPAGE="https://ocaml.org" -SRC_URI="https://github.com/ocaml/ocaml/archive/${PV/_/+}.tar.gz -> ${MY_P}.tar.gz - mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2" - -LICENSE="QPL-1.0 LGPL-2" -# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt, -# so here we go with the subslot. -SLOT="0/$(ver_cut 1-2)" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" -IUSE="emacs flambda latex ncurses +ocamlopt spacetime X xemacs" - -RDEPEND=" - sys-libs/binutils-libs:= - ncurses? ( sys-libs/ncurses:0= ) - spacetime? ( sys-libs/libunwind:= ) - X? ( x11-libs/libX11 ) - !dev-ml/num" -BDEPEND="${RDEPEND} - virtual/pkgconfig" -PDEPEND="emacs? ( app-emacs/ocaml-mode ) - xemacs? ( app-xemacs/ocaml )" - -QA_FLAGS_IGNORED='/usr/lib.*/ocaml/raw_spacetime_lib.cmxs' - -S="${WORKDIR}/${MY_P}" - -PATCHES=( - "${FILESDIR}"/${PN}-4.04.2-tinfo.patch #459512 - "${FILESDIR}"/${P}-gcc10.patch - "${FILESDIR}"/${P}-CVE-2018-9838.patch -) - -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_prepare() { - EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches" - - cp "${FILESDIR}"/ocaml.conf "${T}" || die - - default -} - -src_configure() { - export LC_ALL=C - local myconf="" - - # Causes build failures because it builds some programs with -pg, - # bug #270920 - filter-flags -fomit-frame-pointer - # Bug #285993 - filter-mfpmath sse - - # Broken until 4.12 - # bug #818445 - filter-flags '-flto*' - append-flags -fno-strict-aliasing - - # -ggdb3 & co makes it behave weirdly, breaks sexplib - replace-flags -ggdb* -ggdb - - # OCaml generates textrels on 32-bit arches - # We can't do anything about it, but disabling it means that tests - # for OCaml-based packages won't fail on unexpected output - # bug #773226 - if use arm || use ppc || use x86 ; then - append-ldflags "-Wl,-z,notext" - fi - - # It doesn't compile on alpha without this LDFLAGS - use alpha && append-ldflags "-Wl,--no-relax" - - use ncurses || myconf="${myconf} -no-curses" - use X || myconf="${myconf} -no-graph" - use flambda && myconf="${myconf} -flambda" - use spacetime && myconf="${myconf} -spacetime" - - # ocaml uses a home-brewn configure script, preventing it to use econf. - RAW_LDFLAGS="$(raw-ldflags)" ./configure \ - --prefix "${EPREFIX}"/usr \ - --bindir "${EPREFIX}"/usr/bin \ - --target-bindir "${EPREFIX}"/usr/bin \ - --libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \ - --mandir "${EPREFIX}"/usr/share/man \ - -target "${CHOST}" \ - -host "${CBUILD}" \ - -cc "$(tc-getCC)" \ - -as "$(tc-getAS)" \ - -aspp "$(tc-getCC) -c" \ - -partialld "$(tc-getLD) -r" \ - --with-pthread ${myconf} || die "configure failed!" - - # http://caml.inria.fr/mantis/view.php?id=4698 - export CCLINKFLAGS="${LDFLAGS}" -} - -src_compile() { - emake world - - # Native code generation can be disabled now - if use ocamlopt ; then - # bug #279968 - emake opt - emake -j1 opt.opt - fi -} - -src_test() { - if use ocamlopt ; then - emake -j1 tests - else - ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." - fi -} - -src_install() { - emake BINDIR="${ED}"/usr/bin \ - LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \ - MANDIR="${ED}"/usr/share/man \ - install - - # Symlink the headers to the right place - dodir /usr/include - # Create symlink for header files - dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml - dodoc Changes README.adoc - # Create envd entry for latex input files - if use latex ; then - echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die - doenvd "${T}"/99ocamldoc - fi - - sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die - - # Install ocaml-rebuild portage set - insinto /usr/share/portage/config/sets - doins "${T}"/ocaml.conf -} diff --git a/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild b/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild new file mode 100644 index 000000000000..836f967b59ce --- /dev/null +++ b/dev-lang/ocaml/ocaml-4.05.0-r9.ebuild @@ -0,0 +1,156 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic toolchain-funcs + +PATCHLEVEL="9" +MY_P="${P/_/-}" +DESCRIPTION="Type-inferring functional programming language descended from the ML family" +HOMEPAGE="https://ocaml.org" +SRC_URI="https://github.com/ocaml/ocaml/archive/${PV/_/+}.tar.gz -> ${MY_P}.tar.gz + mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.bz2 + https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches-1.tar.bz2" + +LICENSE="QPL-1.0 LGPL-2" +# Everytime ocaml is updated to a new version, everything ocaml must be rebuilt, +# so here we go with the subslot. +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" +IUSE="emacs flambda latex ncurses +ocamlopt spacetime X xemacs" + +RDEPEND=" + sys-libs/binutils-libs:= + ncurses? ( sys-libs/ncurses:0= ) + spacetime? ( sys-libs/libunwind:= ) + X? ( x11-libs/libX11 ) + !dev-ml/num" +BDEPEND="${RDEPEND} + virtual/pkgconfig" +PDEPEND="emacs? ( app-emacs/ocaml-mode ) + xemacs? ( app-xemacs/ocaml )" + +QA_FLAGS_IGNORED='usr/lib.*/ocaml/raw_spacetime_lib.cmxs' + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${FILESDIR}"/${PN}-4.04.2-tinfo.patch #459512 + "${WORKDIR}"/${P}-patches-1/ +) + +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_prepare() { + EPATCH_SUFFIX="patch" eapply "${WORKDIR}/patches" + + cp "${FILESDIR}"/ocaml.conf "${T}" || die + + default +} + +src_configure() { + export LC_ALL=C + local myconf="" + + # Causes build failures because it builds some programs with -pg, + # bug #270920 + filter-flags -fomit-frame-pointer + # Bug #285993 + filter-mfpmath sse + + # Broken until 4.12 + # bug #818445 + filter-flags '-flto*' + append-flags -fno-strict-aliasing + + # -ggdb3 & co makes it behave weirdly, breaks sexplib + replace-flags -ggdb* -ggdb + + # OCaml generates textrels on 32-bit arches + # We can't do anything about it, but disabling it means that tests + # for OCaml-based packages won't fail on unexpected output + # bug #773226 + if use arm || use ppc || use x86 ; then + append-ldflags "-Wl,-z,notext" + fi + + # It doesn't compile on alpha without this LDFLAGS + use alpha && append-ldflags "-Wl,--no-relax" + + use ncurses || myconf="${myconf} -no-curses" + use X || myconf="${myconf} -no-graph" + use flambda && myconf="${myconf} -flambda" + use spacetime && myconf="${myconf} -spacetime" + + # ocaml uses a home-brewn configure script, preventing it to use econf. + RAW_LDFLAGS="$(raw-ldflags)" ./configure \ + --prefix "${EPREFIX}"/usr \ + --bindir "${EPREFIX}"/usr/bin \ + --target-bindir "${EPREFIX}"/usr/bin \ + --libdir "${EPREFIX}"/usr/$(get_libdir)/ocaml \ + --mandir "${EPREFIX}"/usr/share/man \ + -target "${CHOST}" \ + -host "${CBUILD}" \ + -cc "$(tc-getCC)" \ + -as "$(tc-getAS)" \ + -aspp "$(tc-getCC) -c" \ + -partialld "$(tc-getLD) -r" \ + --with-pthread ${myconf} || die "configure failed!" + + # http://caml.inria.fr/mantis/view.php?id=4698 + export CCLINKFLAGS="${LDFLAGS}" +} + +src_compile() { + emake world + + # Native code generation can be disabled now + if use ocamlopt ; then + # bug #279968 + emake opt + emake -j1 opt.opt + fi +} + +src_test() { + if use ocamlopt ; then + emake -j1 tests + else + ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." + fi +} + +src_install() { + emake BINDIR="${ED}"/usr/bin \ + LIBDIR="${ED}"/usr/$(get_libdir)/ocaml \ + MANDIR="${ED}"/usr/share/man \ + install + + # Symlink the headers to the right place + dodir /usr/include + # Create symlink for header files + dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml + dodoc Changes README.adoc + # Create envd entry for latex input files + if use latex ; then + echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die + doenvd "${T}"/99ocamldoc + fi + + sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die + + # Install ocaml-rebuild portage set + insinto /usr/share/portage/config/sets + doins "${T}"/ocaml.conf +} diff --git a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild b/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild deleted file mode 100644 index ef5e9bedc947..000000000000 --- a/dev-lang/ocaml/ocaml-4.09.0-r2.ebuild +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic - -HOMEPAGE="https://ocaml.org/" -SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz" -DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles" - -LICENSE="LGPL-2.1" -SLOT="0/$(ver_cut 1-2)" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" -IUSE="emacs flambda latex +ocamlopt spacetime xemacs" - -RDEPEND="sys-libs/binutils-libs:= - spacetime? ( sys-libs/libunwind:= )" -BDEPEND="${RDEPEND} - virtual/pkgconfig" -PDEPEND="emacs? ( app-emacs/ocaml-mode ) - xemacs? ( app-xemacs/ocaml )" - -QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs' - -PATCHES=( - "${FILESDIR}"/${PN}-4.09.0-gcc-10.patch - "${FILESDIR}"/${P}-cflags.patch -) - -src_prepare() { - default - - cp "${FILESDIR}"/ocaml.conf "${T}" || die - - # Broken until 4.12 - # bug #818445 - filter-flags '-flto*' - append-flags -fno-strict-aliasing - - # OCaml generates textrels on 32-bit arches - # We can't do anything about it, but disabling it means that tests - # for OCaml-based packages won't fail on unexpected output - # bug #773226 - if use arm || use ppc || use x86 ; then - append-ldflags "-Wl,-z,notext" - fi - - # Upstream build ignores LDFLAGS in several places. - sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \ - -e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \ - -e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \ - Makefile.config.in || die "LDFLAGS fix failed" - # ${P} overrides upstream build's own P due to a wrong assignment operator. - sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed" -} - -src_configure() { - local opt=( - --bindir="${EPREFIX}/usr/bin" - --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml" - --mandir="${EPREFIX}/usr/share/man" - --prefix="${EPREFIX}/usr" - $(use_enable flambda) - $(use_enable spacetime) - ) - econf ${opt[@]} -} - -src_compile() { - if use ocamlopt ; then - emake world.opt - else - emake world - fi -} - -src_test() { - if use ocamlopt ; then - # OCaml tests only work when run sequentially - emake -j1 -C testsuite all - else - ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." - fi -} - -src_install() { - default - dodir /usr/include - # Create symlink for header files - dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml - dodoc Changes README.adoc - # Create envd entry for latex input files - if use latex ; then - echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die - doenvd "${T}"/99ocamldoc - fi - - sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die - - # Install ocaml-rebuild portage set - insinto /usr/share/portage/config/sets - doins "${T}"/ocaml.conf -} diff --git a/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild b/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild new file mode 100644 index 000000000000..7a37a7cf0528 --- /dev/null +++ b/dev-lang/ocaml/ocaml-4.09.0-r3.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic + +DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles" +HOMEPAGE="https://ocaml.org/" +SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches-1.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" +IUSE="emacs flambda latex +ocamlopt spacetime xemacs" + +RDEPEND="sys-libs/binutils-libs:= + spacetime? ( sys-libs/libunwind:= )" +BDEPEND="${RDEPEND} + virtual/pkgconfig" +PDEPEND="emacs? ( app-emacs/ocaml-mode ) + xemacs? ( app-xemacs/ocaml )" + +QA_FLAGS_IGNORED='usr/lib.*/ocaml/bigarray.cmxs' + +PATCHES=( + "${WORKDIR}"/${P}-patches-1/ +) + +src_prepare() { + default + + cp "${FILESDIR}"/ocaml.conf "${T}" || die + + # Broken until 4.12 + # bug #818445 + filter-flags '-flto*' + append-flags -fno-strict-aliasing + + # OCaml generates textrels on 32-bit arches + # We can't do anything about it, but disabling it means that tests + # for OCaml-based packages won't fail on unexpected output + # bug #773226 + if use arm || use ppc || use x86 ; then + append-ldflags "-Wl,-z,notext" + fi + + # Upstream build ignores LDFLAGS in several places. + sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \ + -e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \ + -e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \ + Makefile.config.in || die "LDFLAGS fix failed" + # ${P} overrides upstream build's own P due to a wrong assignment operator. + sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed" +} + +src_configure() { + local opt=( + --bindir="${EPREFIX}/usr/bin" + --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml" + --mandir="${EPREFIX}/usr/share/man" + --prefix="${EPREFIX}/usr" + $(use_enable flambda) + $(use_enable spacetime) + ) + + econf "${opt[@]}" +} + +src_compile() { + if use ocamlopt ; then + emake world.opt + else + emake world + fi +} + +src_test() { + if use ocamlopt ; then + # OCaml tests only work when run sequentially + emake -j1 -C testsuite all + else + ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." + fi +} + +src_install() { + default + dodir /usr/include + # Create symlink for header files + dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml + dodoc Changes README.adoc + # Create envd entry for latex input files + if use latex ; then + echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}"/99ocamldoc || die + doenvd "${T}"/99ocamldoc + fi + + sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die + + # Install ocaml-rebuild portage set + insinto /usr/share/portage/config/sets + doins "${T}"/ocaml.conf +} diff --git a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild deleted file mode 100644 index fbf4e4c204b6..000000000000 --- a/dev-lang/ocaml/ocaml-4.10.2-r2.ebuild +++ /dev/null @@ -1,105 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -inherit flag-o-matic - -HOMEPAGE="https://ocaml.org/" -SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz" -DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles" - -LICENSE="LGPL-2.1" -SLOT="0/$(ver_cut 1-2)" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" -IUSE="emacs flambda latex +ocamlopt spacetime xemacs" - -RDEPEND="sys-libs/binutils-libs:= - spacetime? ( sys-libs/libunwind:= )" -BDEPEND="${RDEPEND} - virtual/pkgconfig" -PDEPEND="emacs? ( app-emacs/ocaml-mode ) - xemacs? ( app-xemacs/ocaml )" - -QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs' - -PATCHES=( - "${FILESDIR}"/${P}-cflags.patch -) - -src_prepare() { - default - - cp "${FILESDIR}"/ocaml.conf "${T}" || die - - # Broken until 4.12 - # bug #818445 - filter-flags '-flto*' - append-flags -fno-strict-aliasing - - # OCaml generates textrels on 32-bit arches - # We can't do anything about it, but disabling it means that tests - # for OCaml-based packages won't fail on unexpected output - # bug #773226 - if use arm || use ppc || use x86 ; then - append-ldflags "-Wl,-z,notext" - fi - - # Upstream build ignores LDFLAGS in several places. - sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \ - -e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \ - -e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \ - Makefile.config.in || die "LDFLAGS fix failed" - # ${P} overrides upstream build's own P due to a wrong assignment operator. - sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed" -} - -src_configure() { - local opt=( - --bindir="${EPREFIX}/usr/bin" - --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml" - --mandir="${EPREFIX}/usr/share/man" - --prefix="${EPREFIX}/usr" - $(use_enable flambda) - $(use_enable spacetime) - ) - econf ${opt[@]} -} - -src_compile() { - if use ocamlopt ; then - emake world.opt - else - emake world - fi -} - -src_test() { - if use ocamlopt ; then - # OCaml tests only work when run sequentially - emake -j1 -C testsuite all - else - ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." - fi -} - -src_install() { - default - dodir /usr/include - - # Create symlink for header files - dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml - dodoc Changes README.adoc - - # Create envd entry for latex input files - if use latex ; then - echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}/99ocamldoc" || die - doenvd "${T}"/99ocamldoc - fi - - sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die - - # Install ocaml-rebuild portage set - insinto /usr/share/portage/config/sets - doins "${T}"/ocaml.conf -} diff --git a/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild b/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild new file mode 100644 index 000000000000..b0b37115a35c --- /dev/null +++ b/dev-lang/ocaml/ocaml-4.10.2-r3.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit flag-o-matic + +DESCRIPTION="Programming language supporting functional, imperative & object-oriented styles" +HOMEPAGE="https://ocaml.org/" +SRC_URI="https://github.com/ocaml/ocaml/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-patches-1.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" +IUSE="emacs flambda latex +ocamlopt spacetime xemacs" + +RDEPEND="sys-libs/binutils-libs:= + spacetime? ( sys-libs/libunwind:= )" +BDEPEND="${RDEPEND} + virtual/pkgconfig" +PDEPEND="emacs? ( app-emacs/ocaml-mode ) + xemacs? ( app-xemacs/ocaml )" + +QA_FLAGS_IGNORED='usr/lib.*/ocaml/bigarray.cmxs' + +PATCHES=( + "${WORKDIR}"/${P}-patches-1/ +) + +src_prepare() { + default + + cp "${FILESDIR}"/ocaml.conf "${T}" || die + + # Broken until 4.12 + # bug #818445 + filter-flags '-flto*' + append-flags -fno-strict-aliasing + + # OCaml generates textrels on 32-bit arches + # We can't do anything about it, but disabling it means that tests + # for OCaml-based packages won't fail on unexpected output + # bug #773226 + if use arm || use ppc || use x86 ; then + append-ldflags "-Wl,-z,notext" + fi + + # Upstream build ignores LDFLAGS in several places. + sed -i -e 's/\(^MKDLL=.*\)/\1 $(LDFLAGS)/' \ + -e 's/\(^OC_CFLAGS=.*\)/\1 $(LDFLAGS)/' \ + -e 's/\(^OC_LDFLAGS=.*\)/\1 $(LDFLAGS)/' \ + Makefile.config.in || die "LDFLAGS fix failed" + # ${P} overrides upstream build's own P due to a wrong assignment operator. + sed -i -e 's/^P ?=/P =/' stdlib/StdlibModules || die "P fix failed" +} + +src_configure() { + local opt=( + --bindir="${EPREFIX}/usr/bin" + --libdir="${EPREFIX}/usr/$(get_libdir)/ocaml" + --mandir="${EPREFIX}/usr/share/man" + --prefix="${EPREFIX}/usr" + $(use_enable flambda) + $(use_enable spacetime) + ) + + econf "${opt[@]}" +} + +src_compile() { + if use ocamlopt ; then + emake world.opt + else + emake world + fi +} + +src_test() { + if use ocamlopt ; then + # OCaml tests only work when run sequentially + emake -j1 -C testsuite all + else + ewarn "${PN} was built without 'ocamlopt' USE flag; skipping tests." + fi +} + +src_install() { + default + dodir /usr/include + + # Create symlink for header files + dosym "../$(get_libdir)/ocaml/caml" /usr/include/caml + dodoc Changes README.adoc + + # Create envd entry for latex input files + if use latex ; then + echo "TEXINPUTS=\"${EPREFIX}/usr/$(get_libdir)/ocaml/ocamldoc:\"" > "${T}/99ocamldoc" || die + doenvd "${T}"/99ocamldoc + fi + + sed -i -e "s:lib:$(get_libdir):" "${T}"/ocaml.conf || die + + # Install ocaml-rebuild portage set + insinto /usr/share/portage/config/sets + doins "${T}"/ocaml.conf +} diff --git a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild index 666f43b938bd..95b42d8a1a61 100644 --- a/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild +++ b/dev-lang/ocaml/ocaml-4.11.2-r2.ebuild @@ -11,7 +11,7 @@ DESCRIPTION="Programming language supporting functional, imperative & object-ori LICENSE="QPL-1.0 LGPL-2" SLOT="0/$(ver_cut 1-2)" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ~ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris" IUSE="emacs flambda latex +ocamlopt spacetime xemacs" RDEPEND="sys-libs/binutils-libs:= @@ -25,7 +25,7 @@ QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs' PATCHES=( "${FILESDIR}"/${PN}-4.11.2-glibc-2.34.patch - "${FILESDIR}"/${PN}-4.10.2-cflags.patch + "${FILESDIR}"/${PN}-4.11.2-cflags.patch ) src_prepare() { diff --git a/dev-lang/ocaml/ocaml-4.12.1.ebuild b/dev-lang/ocaml/ocaml-4.12.1.ebuild index fd6cae2fff2c..70049fcc0ae4 100644 --- a/dev-lang/ocaml/ocaml-4.12.1.ebuild +++ b/dev-lang/ocaml/ocaml-4.12.1.ebuild @@ -24,6 +24,7 @@ QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs' PATCHES=( "${FILESDIR}"/${PN}-4.12.0-glibc-2.34.patch + "${FILESDIR}"/${P}-fix-textrel-riscv.patch ) src_prepare() { diff --git a/dev-lang/ocaml/ocaml-4.13.1.ebuild b/dev-lang/ocaml/ocaml-4.13.1.ebuild index 1765de6905c0..979584167046 100644 --- a/dev-lang/ocaml/ocaml-4.13.1.ebuild +++ b/dev-lang/ocaml/ocaml-4.13.1.ebuild @@ -22,6 +22,10 @@ PDEPEND="emacs? ( app-emacs/ocaml-mode ) QA_FLAGS_IGNORED='/usr/lib.*/ocaml/bigarray.cmxs' +PATCHES=( + "${FILESDIR}"/${PN}-4.12.1-fix-textrel-riscv.patch +) + src_prepare() { default -- cgit v1.2.3