diff options
Diffstat (limited to 'dev-lang/crystal')
-rw-r--r-- | dev-lang/crystal/Manifest | 22 | ||||
-rw-r--r-- | dev-lang/crystal/crystal-0.21.1.ebuild | 91 | ||||
-rw-r--r-- | dev-lang/crystal/crystal-0.22.0.ebuild | 97 | ||||
-rw-r--r-- | dev-lang/crystal/crystal-0.23.0-r1.ebuild | 100 | ||||
-rw-r--r-- | dev-lang/crystal/crystal-0.23.0.ebuild | 98 | ||||
-rw-r--r-- | dev-lang/crystal/crystal-0.23.1.ebuild | 101 | ||||
-rw-r--r-- | dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch | 9 | ||||
-rw-r--r-- | dev-lang/crystal/files/crystal-0.20.5-verbose.patch | 9 | ||||
-rw-r--r-- | dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch | 20 | ||||
-rw-r--r-- | dev-lang/crystal/files/crystal-0.23.0-verbose-LDFLAGS.patch | 9 | ||||
-rw-r--r-- | dev-lang/crystal/files/crystal-0.23.1-llvm-5.patch | 837 | ||||
-rw-r--r-- | dev-lang/crystal/metadata.xml | 40 |
12 files changed, 1433 insertions, 0 deletions
diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest new file mode 100644 index 000000000000..214286423517 --- /dev/null +++ b/dev-lang/crystal/Manifest @@ -0,0 +1,22 @@ +AUX crystal-0.20.5-LDFLAGS.patch 566 SHA256 c21fe26fe47e1535966148493485c221ace209bcfdf0c261ffdcbacd4dd95476 SHA512 e4f136eed1c4d6508eaa9fb0dbc7ce451b058e63fde53ff8c90396afab3ee27d06af64c162459bbe5dc5e5915a7ae8271879a4f146cf7335442edd589da92ce3 WHIRLPOOL 8d9cca0a5a03aab8668ad190820a6e93d480ed9d2371added7875e335c3053626194519fa3801e933c067d4d8b143db184f689681fa16ff09213c811b633dafd +AUX crystal-0.20.5-verbose.patch 496 SHA256 c454ff921250e0c4482f2bbfe0a5bba152cf8e1217e15ebeda5200c268fd1365 SHA512 eb230fa98ff0b19b0e3b90b5ff76b30869df53241d36123c470fbb58bfab89cc046c39258e36b31d12592ad9a7fe8a76e91669303224ecd1f43713bcdbef1064 WHIRLPOOL 788a3f0df2aeaa3e65fe9906ba3e92bbb3ce2fddaed70e87548725d7cca5fee5b218051f2c5d587de16c7a1c084ff021558689eb55e1fbc6199e8e4a79aef0e0 +AUX crystal-0.22.0-blocking-stdio-hack.patch 564 SHA256 89c7d66010627980a695bf4daa0422c7f162fa1e105d89c3296d7d7c61c939e0 SHA512 51df3a464efc7b34db970854577d89027177179cb4e72fdf74b6c9ae754749e30c93155bb18a5daf22db78b0f8985ec341092a95435f8de19800c33bca2f983e WHIRLPOOL 49434307301fcd492522b27ca1c16fd97e60bd3e82170e276c7a728e34f91c269f7b43b9aa63fe0ddf6d5e7f765b6e076f25f9f9334051a9eb32ccab143b330d +AUX crystal-0.23.0-verbose-LDFLAGS.patch 653 SHA256 52e9789b4a9215e3790e444f1c4b23c833636224fa3021e0fc990f46627e924d SHA512 76494f1dcd97665f787fac76f2b94ef8428259133f13b52cf21c6e5b816ab7697a96f90dad0dc658de6373c6df28b72809cce5656d4b8356a6b3eca73f23856a WHIRLPOOL 32f863b12501ff36333431568c7438442ea12b1c1c7ab511cc6a57a3cc91954d1bb394833b033458a366424c92e06cb4ea0c0162cf49b937f2c118a9da604a3e +AUX crystal-0.23.1-llvm-5.patch 35030 SHA256 3aeecf8a2bd4397bc9817ac42e58722677247505904e8c5b376c419839536d96 SHA512 027ea2ad7d0af9736c59c770295490341509a1aec442bd1a859e33d3f783adf328edd9cd886f6645b45aab67084f41d55fac15263b2db9183aa4db93e1a528e4 WHIRLPOOL 8efd6a4c25a077a67f10ce264bf064ea81aee013287116cb22a1f2c16a244aa8ecb7790ee10a209dc5b71ee1c1b9f7fb891a44d908dea80f836bd7f7574c3322 +DIST crystal-0.21.1-1-linux-i686.tar.gz 18825516 SHA256 8ab875309aa71d4501995e834850d40538fb66dd9890024ed812777f83085f48 SHA512 790043db666d7f65a3cc9e68511eb8fa03c352d2ca044bb38995ca4ab37b731bf612bf36d6efecd7a1763b22930c67315d0ae3b2e087c1a40ac209564492b5b9 WHIRLPOOL 642e4a6ec71cb33042c1dc0da11cd5e231b58f46afc77aa754bc0fa7d8d5104c4c0625b214d4bd48ad62ef6ad6eaeb33ba3e6040ebabb4a37f5fb20f399ae063 +DIST crystal-0.21.1-1-linux-x86_64.tar.gz 18930207 SHA256 e8a7489aba888cc0deec61e9bda5dd27ab600edb102afc17fa11582b90960875 SHA512 ed7860c93e25546e8df311851b6b9a3abf44e6046cf4cb3208555db80d63afc0ce45fdfdb1833f67f2e62f9a6b2d015ba5674d9273d572de15d7515aa481ae1f WHIRLPOOL c70cad45911e5ac4fd62ad42d13507280feccfbae46e682eb5eec81ec49de67e49f7384ad7d127a2d8624c4a1b4a425aded4a2f3a0b6b59025b31f0415864e95 +DIST crystal-0.21.1.tar.gz 1586701 SHA256 eb93de3b388641fd2a09a2d10ab9fe40a58148d888fc48e4583a86ee1ddb1085 SHA512 1deaf696b715efee841b0a07a1dca9e5fad31896a7fbfe8ed69a3fb2dc72cc71c38d003c660ab61c4ab3dcb9e0e2687e714a78ada55b51b42da0e0a0411c2208 WHIRLPOOL 1eaacc4d50b1f5cc0237f9413f54d8cd12837edc348a287951d1cb6a03f3ce29130407ccb9a462dab72f04c369eccf595231127c6aae4c716a8c9f92da36290e +DIST crystal-0.22.0-1-linux-i686.tar.gz 18884966 SHA256 c084846d3f9e0c3cfcba6a79fe4e0cf6c6cb6801826a969460ecf2a47abd0fe9 SHA512 b307cc7f91b6d9f1e9a852c96e3d50b54bb5d32fefeb0ed8543c000783d51335ff60b9b4f684fbeb249acd54c1f55aa79ff2d36e2b95d5871aca58090bd03740 WHIRLPOOL fc98c770b754920f93cddb50b3edd4c43096ca605f2c12e93a23c3a0be5c93c5fa89b5cfa8ae1528ed20af63e1733419825af03702f0ffd5eb457bc4c766ad2d +DIST crystal-0.22.0-1-linux-x86_64.tar.gz 18980187 SHA256 789d7b844886133428248605113ede9174c6ea4ba47d96a13f0efd1565b5810d SHA512 466aabf4f875278f5afb3238011e784928dbb234ea58ba1a3a649fca94481804c118639739134a370b5052dce6b17601a5c9d86162264934beb030d5f64f4203 WHIRLPOOL b2ece8a95c9036eebaf62a2d55f11b5010a35149649c56e916153b5596bc8cdb7f62a57ac98d44d553227e56c06fb7cd0a0d7f4637220d7ed94819c93e30f874 +DIST crystal-0.22.0.tar.gz 1597215 SHA256 5b9f11d9710ca9bd971a5afb94d369fd8dfaee103d7edf1c9fbebb2f21898547 SHA512 62d484b0c204c7213fc6eb38e59c730f6ba11d30d7b1027dcc5ae2f12a88808cd57628e21619875943714337bf181a8ae6739608c7435fdf18224950151aad21 WHIRLPOOL 6810d08a6284a365b27c86071c5943b072fb0a842157909715bc9de392d584e2b73b190f034dddd47f49b2a47cf730b5530e7d612800175e5b1f0b2dc0b59df0 +DIST crystal-0.23.0-1-linux-i686.tar.gz 18498501 SHA256 0a758770e6cb277bc5ed38fb6edafbf820b99527b65d6a44fd9f3a4c4743b70f SHA512 8745114c4824d2859c569ed1bd1057d6d649d57b10d41d22c17627f623704eb98ec2e3ab2bf06622de624906f53e053975a6b9d852aeaafeae4f43585609de28 WHIRLPOOL 5601fa0fc8d7e3ce2ecfea534135437645bb982a009e4c00349a7b9eb1fdcf193f648d6decbf90b41732d08fd1eb9ba92f4945de97f4138092cdc1efc80f1b92 +DIST crystal-0.23.0-1-linux-x86_64.tar.gz 18729061 SHA256 1d0348e1df3c56f9c29a3a76254c074846389fe5bed659c2cc1051bab83e1a5a SHA512 6a4e427b4ab3c3be6efcfaee5c1a19eff04eaf00db949d1e1ba8f29c3277affe96a7aba4273d93fd05251453d5b5b937aa792bc448ff2f6d6aa7f2b17d175f75 WHIRLPOOL cf9056733e0eea87cf58b7c488c28942a79020a3a5b38ff88eb9f9b04e61678201d647a5821282b4d0c4bb330ca8aced7520c22b19693f5e39533875666fda8e +DIST crystal-0.23.0.tar.gz 1637983 SHA256 9b65904bb55100994a3b8022b9c553e5aa78979f459c8b10aa64053a65e5d517 SHA512 41ae9391d9183f8bdbffc02350d3aadc22c9c76a4476d55a4f8ec4c4acee80495601077a49e4f6135a80a937767fe39a28044fb6b5c070b05d2ee562fab65bfd WHIRLPOOL fe06c040268a89b1c0cf22fb46e6a938517a41644a7247f83f3a6981b988a7d8fbbc1d2bef019437c1796f148957cf7496a07b5b4e6c9acc881a3f4c06dd2eef +DIST crystal-0.23.1.tar.gz 1646650 SHA256 8cf1b9a4eab29fca2f779ea186ae18f7ce444ce189c621925fa1a0c61dd5ff55 SHA512 06ee0d45cc79cc343d04c346e9cd47b6e4ebc79bf21833662f268f9604f7d2080f7696824e1959de341539f801ae8f898fe1d7b18e4c75378d4eb191878668d5 WHIRLPOOL 944d35f0bfe0d567fd51567775c33671895ede8596222a94e89efe349461432565aae4f0cb7483fb696e0a685c25764ac4bcfc16971dd1f2db33c510f1a04059 +EBUILD crystal-0.21.1.ebuild 2023 SHA256 0efc380a4e536036532453fa2a21f38c9b7ec686d62632ccf98f728f22a163ce SHA512 7225390b611096c66b5ee3bdcae5908d9132c2d19aa9477182363540ea1e9f48daa881bb2c09ab3848619f396723d7b58efa6b704c86075425b7b004ce2a5c33 WHIRLPOOL 0d1f1a5fd5afd500d8f92815e5d44794cfffb46a83bdbabf46782993b8506a07124b75dfe4fcc460a78db675e22cc3e12f15ac777d92ebf483043a77f9f3d1e6 +EBUILD crystal-0.22.0.ebuild 2162 SHA256 105dcb445442b561d74ffffb3e047cef3b007463a6939845f6f536a6c0e65a5a SHA512 81e39676ac8c06d2716cc4539dd6737c9a4a7edad876c43d03cc07f08ec3294f9dc8953b6058dbcca9f6287d48b37a67cc07275dd8ea766a58d4a7bd62d8640d WHIRLPOOL a2657df009678b4f525a22c6696bb7ca33a3fcaed3086a5f69a8a18369afbf357b10b4082d24a9afdf4db095b784ac233b7e94261d58d387f66bf3fd83eb82a7 +EBUILD crystal-0.23.0-r1.ebuild 2223 SHA256 58bdc570fc179ebb434f74af08b0b1f2667094685a528760c53cf0f2ac4dd9f3 SHA512 34ce0ace57f2f0d32bef8298fcfda6744aaae5170d6d581de30a7aaf74162c26e7acae5bd5439fc86e1c72f7098025adbbf478c4ab8e784056dcb1ed539d0105 WHIRLPOOL 5eddbab07f0aa028bf8f498cca56f834b7312f6791028e4b2c80c906fd938769e5d39888ee61fd758eec291547e0f15139d322feca18c1158c7979d4ffa44c59 +EBUILD crystal-0.23.0.ebuild 2164 SHA256 1386bfa7b323bb1ac9ccfbd39a1d3ba060a5cfc225f9fe0ea72b18da0535afcd SHA512 6572ba6343b27eda778e1125a6588a2009ac376fc6152bad5d7c546ea8a9226dbe2a6b2d3817bbf8e052149466a269a6e824a0e9176ae5e54323742ef941aa22 WHIRLPOOL 3bd454f40e8eff67d74757e18906d2be5795d27e5dd3bfb7a4d7ceb58f45e95cbe88c298f0f31f31652d652b952a28e0dabce28767d43264ff293aa4f1e80233 +EBUILD crystal-0.23.1.ebuild 2264 SHA256 23912dfa677c14d9df97b31e72144abea31f668204a6557ea505e31fe776273d SHA512 63235c8606674a010e09c5e39333bc9f9d668b071d261d9c399b038f466234bd0cbc4b047dcfa68136a0afcc5869e3b62b7117286df0e6294a5d813e65639293 WHIRLPOOL 21bf0927a67165d4c71b99372b90ac5fa5e4c35324e5b9e503e3ddd09316eed72865fc72d5311180d01c0fa82175f76145ba04ac2822e384847d01c2eb564bad +MISC ChangeLog 4531 SHA256 54946148fedb0df6d9a124ae8dfa80044f3e43fb47250ccb66e82f03e5446c31 SHA512 fd212beb49ad92a4e9ae424f91ffb8668e447e453b184b5b7e4d5d2e40d248f6ffd9c63dcca4e164f8056e7151a210517da14da7ca625bd0496ac5dcd4a6ea0b WHIRLPOOL 1af2d8d91607892b5af7f6da40b7d71bb22353dc380756fc4a7a771cf74449a17c94449a09dcd38587eeae2cf8301ac43e8484368731c9394f75acd784619787 +MISC metadata.xml 1217 SHA256 883ddaf00ce61e22e169eaebb5e74c90f02ae767db01c94bef30ba8d6284fa0a SHA512 ab6182218a9b597cb7d2ed45eb6204fe30b1567e288e897ca1e2fe78433da260a24f1f79b988fe7d8ace37c7f6c0da7ad4789bc79e15775be44b645d485738bd WHIRLPOOL 790a71b6b1139c547698216a4f47565e61ed6abe4397173fa44a0003b6217e285b4eb57cec6de18d2358d1ea991ad4050154ee45df7924a1315c911418d171e9 diff --git a/dev-lang/crystal/crystal-0.21.1.ebuild b/dev-lang/crystal/crystal-0.21.1.ebuild new file mode 100644 index 000000000000..19dbdc212a50 --- /dev/null +++ b/dev-lang/crystal/crystal-0.21.1.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit multiprocessing toolchain-funcs + +BV=0.21.1-1 +BV_AMD64=${BV}-linux-x86_64 +BV_X86=${BV}-linux-i686 + +DESCRIPTION="The Crystal Programming Language" +HOMEPAGE="https://crystal-lang.org" +SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz + amd64? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_AMD64}.tar.gz ) + x86? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_X86}.tar.gz )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="doc debug examples +xml +yaml" + +# dev-libs/boehm-gc[static-libs] dependency problem, check the issue: https://github.com/manastech/crystal/issues/1382 +DEPEND=" + >=sys-devel/llvm-3.9.0 + dev-libs/boehm-gc[static-libs,threads] + dev-libs/libatomic_ops + dev-libs/libevent + dev-libs/libpcre + sys-libs/libunwind + dev-libs/pcl + dev-libs/gmp:0 +" +RDEPEND="${DEPEND} + xml? ( dev-libs/libxml2 ) + yaml? ( dev-libs/libyaml ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-0.20.5-verbose.patch + "${FILESDIR}"/${PN}-0.20.5-LDFLAGS.patch +) + +src_compile() { + emake \ + $(usex debug "" release=1) \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + PATH="${WORKDIR}"/${PN}-${BV}/bin:"${PATH}" \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} \ + CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal" + use doc && emake doc +} + +src_test() { + emake spec \ + $(usex debug "" release=1) \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} +} + +src_install() { + insinto /usr/$(get_libdir)/crystal + doins -r src/. + dobin .build/crystal + + insinto /usr/share/zsh/site-functions + newins etc/completion.zsh _crystal + + use examples && dodoc -r samples + + if use doc ; then + docinto api + dodoc -r doc/. + fi +} diff --git a/dev-lang/crystal/crystal-0.22.0.ebuild b/dev-lang/crystal/crystal-0.22.0.ebuild new file mode 100644 index 000000000000..534a8852b6f7 --- /dev/null +++ b/dev-lang/crystal/crystal-0.22.0.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit multiprocessing toolchain-funcs + +BV=0.22.0-1 +BV_AMD64=${BV}-linux-x86_64 +BV_X86=${BV}-linux-i686 + +DESCRIPTION="The Crystal Programming Language" +HOMEPAGE="https://crystal-lang.org" +SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz + amd64? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_AMD64}.tar.gz ) + x86? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_X86}.tar.gz )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="doc debug examples blocking-stdio-hack +xml +yaml" + +# dev-libs/boehm-gc[static-libs] dependency problem, check the issue: https://github.com/manastech/crystal/issues/1382 +DEPEND=" + >=sys-devel/llvm-3.9.0 + dev-libs/boehm-gc[static-libs,threads] + dev-libs/libatomic_ops + dev-libs/libevent + dev-libs/libpcre + sys-libs/libunwind + dev-libs/pcl + dev-libs/gmp:0 +" +RDEPEND="${DEPEND} + xml? ( dev-libs/libxml2 ) + yaml? ( dev-libs/libyaml ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-0.20.5-verbose.patch + "${FILESDIR}"/${PN}-0.20.5-LDFLAGS.patch +) + +src_prepare() { + default + + use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch +} + +src_compile() { + emake \ + $(usex debug "" release=1) \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + PATH="${WORKDIR}"/${PN}-${BV}/bin:"${PATH}" \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} \ + CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal" + use doc && emake doc +} + +src_test() { + emake spec \ + $(usex debug "" release=1) \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} +} + +src_install() { + insinto /usr/$(get_libdir)/crystal + doins -r src/. + dobin .build/crystal + + insinto /usr/share/zsh/site-functions + newins etc/completion.zsh _crystal + + use examples && dodoc -r samples + + if use doc ; then + docinto api + dodoc -r doc/. + fi +} diff --git a/dev-lang/crystal/crystal-0.23.0-r1.ebuild b/dev-lang/crystal/crystal-0.23.0-r1.ebuild new file mode 100644 index 000000000000..b526f8026565 --- /dev/null +++ b/dev-lang/crystal/crystal-0.23.0-r1.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit bash-completion-r1 multiprocessing toolchain-funcs + +BV=0.23.0-1 +BV_AMD64=${BV}-linux-x86_64 +BV_X86=${BV}-linux-i686 + +DESCRIPTION="The Crystal Programming Language" +HOMEPAGE="https://crystal-lang.org" +SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz + amd64? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_AMD64}.tar.gz ) + x86? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_X86}.tar.gz )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="doc debug examples blocking-stdio-hack +xml +yaml" + +# dev-libs/boehm-gc[static-libs] dependency problem, check the issue: https://github.com/manastech/crystal/issues/1382 +DEPEND=" + >=sys-devel/llvm-3.9.0 + dev-libs/boehm-gc[static-libs,threads] + dev-libs/libatomic_ops + dev-libs/libevent + dev-libs/libpcre + sys-libs/libunwind + dev-libs/pcl + dev-libs/gmp:0 +" +RDEPEND="${DEPEND} + xml? ( dev-libs/libxml2 ) + yaml? ( dev-libs/libyaml ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-0.23.0-verbose-LDFLAGS.patch +) + +src_prepare() { + default + + use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch +} + +src_compile() { + emake \ + $(usex debug "" release=1) \ + progress=true \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + PATH="${WORKDIR}"/${PN}-${BV}/bin:"${PATH}" \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} \ + CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal" + use doc && emake doc +} + +src_test() { + emake spec \ + $(usex debug "" release=1) \ + progress=true \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} +} + +src_install() { + insinto /usr/$(get_libdir)/crystal + doins -r src/. + dobin .build/crystal + + insinto /usr/share/zsh/site-functions + newins etc/completion.zsh _crystal + + use examples && dodoc -r samples + + if use doc ; then + docinto api + dodoc -r doc/. + fi + + newbashcomp etc/completion.bash ${PN} +} diff --git a/dev-lang/crystal/crystal-0.23.0.ebuild b/dev-lang/crystal/crystal-0.23.0.ebuild new file mode 100644 index 000000000000..5df6f0b64406 --- /dev/null +++ b/dev-lang/crystal/crystal-0.23.0.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit multiprocessing toolchain-funcs + +BV=0.23.0-1 +BV_AMD64=${BV}-linux-x86_64 +BV_X86=${BV}-linux-i686 + +DESCRIPTION="The Crystal Programming Language" +HOMEPAGE="https://crystal-lang.org" +SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz + amd64? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_AMD64}.tar.gz ) + x86? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_X86}.tar.gz )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="doc debug examples blocking-stdio-hack +xml +yaml" + +# dev-libs/boehm-gc[static-libs] dependency problem, check the issue: https://github.com/manastech/crystal/issues/1382 +DEPEND=" + >=sys-devel/llvm-3.9.0 + dev-libs/boehm-gc[static-libs,threads] + dev-libs/libatomic_ops + dev-libs/libevent + dev-libs/libpcre + sys-libs/libunwind + dev-libs/pcl + dev-libs/gmp:0 +" +RDEPEND="${DEPEND} + xml? ( dev-libs/libxml2 ) + yaml? ( dev-libs/libyaml ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-0.23.0-verbose-LDFLAGS.patch +) + +src_prepare() { + default + + use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch +} + +src_compile() { + emake \ + $(usex debug "" release=1) \ + progress=true \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + PATH="${WORKDIR}"/${PN}-${BV}/bin:"${PATH}" \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} \ + CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal" + use doc && emake doc +} + +src_test() { + emake spec \ + $(usex debug "" release=1) \ + progress=true \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} +} + +src_install() { + insinto /usr/$(get_libdir)/crystal + doins -r src/. + dobin .build/crystal + + insinto /usr/share/zsh/site-functions + newins etc/completion.zsh _crystal + + use examples && dodoc -r samples + + if use doc ; then + docinto api + dodoc -r doc/. + fi +} diff --git a/dev-lang/crystal/crystal-0.23.1.ebuild b/dev-lang/crystal/crystal-0.23.1.ebuild new file mode 100644 index 000000000000..6bf8e74cc817 --- /dev/null +++ b/dev-lang/crystal/crystal-0.23.1.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit bash-completion-r1 multiprocessing toolchain-funcs + +BV=0.23.0-1 +BV_AMD64=${BV}-linux-x86_64 +BV_X86=${BV}-linux-i686 + +DESCRIPTION="The Crystal Programming Language" +HOMEPAGE="https://crystal-lang.org" +SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz + amd64? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_AMD64}.tar.gz ) + x86? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_X86}.tar.gz )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="doc debug examples blocking-stdio-hack +xml +yaml" + +# dev-libs/boehm-gc[static-libs] dependency problem, check the issue: https://github.com/manastech/crystal/issues/1382 +DEPEND=" + >=sys-devel/llvm-3.9.0 + dev-libs/boehm-gc[static-libs,threads] + dev-libs/libatomic_ops + dev-libs/libevent + dev-libs/libpcre + sys-libs/libunwind + dev-libs/pcl + dev-libs/gmp:0 +" +RDEPEND="${DEPEND} + xml? ( dev-libs/libxml2 ) + yaml? ( dev-libs/libyaml ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-0.23.0-verbose-LDFLAGS.patch + "${FILESDIR}"/${PN}-0.23.1-llvm-5.patch +) + +src_prepare() { + default + + use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch +} + +src_compile() { + emake \ + $(usex debug "" release=1) \ + progress=true \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + PATH="${WORKDIR}"/${PN}-${BV}/bin:"${PATH}" \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} \ + CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal" + use doc && emake doc +} + +src_test() { + emake spec \ + $(usex debug "" release=1) \ + progress=true \ + stats=1 \ + threads=$(makeopts_jobs) \ + verbose=1 \ + \ + CC=$(tc-getCC) \ + CXX=$(tc-getCXX) \ + AR=$(tc-getAR) \ + \ + CRYSTAL_PATH=src \ + CRYSTAL_CONFIG_VERSION=${PV} +} + +src_install() { + insinto /usr/$(get_libdir)/crystal + doins -r src/. + dobin .build/crystal + + insinto /usr/share/zsh/site-functions + newins etc/completion.zsh _crystal + + use examples && dodoc -r samples + + if use doc ; then + docinto api + dodoc -r doc/. + fi + + newbashcomp etc/completion.bash ${PN} +} diff --git a/dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch b/dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch new file mode 100644 index 000000000000..42970a84a7c0 --- /dev/null +++ b/dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch @@ -0,0 +1,9 @@ +diff --git a/Makefile b/Makefile +index fa71479..d316bbc 100644 +--- a/Makefile ++++ b/Makefile +@@ -24,3 +24,3 @@ SOURCES := $(shell find src -name '*.cr') + SPEC_SOURCES := $(shell find spec -name '*.cr') +-FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(verbose),--verbose ) ++FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(verbose),--verbose )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" ) + VERBOSE := $(if $(verbose),-v ) diff --git a/dev-lang/crystal/files/crystal-0.20.5-verbose.patch b/dev-lang/crystal/files/crystal-0.20.5-verbose.patch new file mode 100644 index 000000000000..6a0a301b5c02 --- /dev/null +++ b/dev-lang/crystal/files/crystal-0.20.5-verbose.patch @@ -0,0 +1,9 @@ +diff --git a/Makefile b/Makefile +index 1f53d40..fa71479 100644 +--- a/Makefile ++++ b/Makefile +@@ -24,3 +24,3 @@ SOURCES := $(shell find src -name '*.cr') + SPEC_SOURCES := $(shell find spec -name '*.cr') +-FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )$(if $(debug),-d ) ++FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(verbose),--verbose ) + VERBOSE := $(if $(verbose),-v ) diff --git a/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch b/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch new file mode 100644 index 000000000000..07b7dba7be65 --- /dev/null +++ b/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch @@ -0,0 +1,20 @@ +Workaround tty corruption in crystal. + +Patch restores blocking mode of file desriptors +in exchange of potential runtime deadlocks +when dealing with stdio. + +Reported-by: Renich Bon Ciric +Bug: https://github.com/crystal-lang/crystal/issues/2065 +Bug: https://bugs.gentoo.org/616256 +diff --git a/src/compiler/crystal/stdio.cr b/src/compiler/crystal/stdio.cr +new file mode 100644 +index 000000000..e65f65089 +--- /dev/null ++++ b/src/compiler/crystal/stdio.cr +@@ -0,0 +1,5 @@ ++module Crystal ++ STDIN.blocking = true ++ STDOUT.blocking=true ++ STDERR.blocking = true ++end diff --git a/dev-lang/crystal/files/crystal-0.23.0-verbose-LDFLAGS.patch b/dev-lang/crystal/files/crystal-0.23.0-verbose-LDFLAGS.patch new file mode 100644 index 000000000000..35eace15dae0 --- /dev/null +++ b/dev-lang/crystal/files/crystal-0.23.0-verbose-LDFLAGS.patch @@ -0,0 +1,9 @@ +diff --git a/Makefile b/Makefile +index eff69e5..5c0c024 100644 +--- a/Makefile ++++ b/Makefile +@@ -28,3 +28,3 @@ SOURCES := $(shell find src -name '*.cr') + SPEC_SOURCES := $(shell find spec -name '*.cr') +-FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d ) ++FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(verbose),--verbose )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" ) + SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) ) diff --git a/dev-lang/crystal/files/crystal-0.23.1-llvm-5.patch b/dev-lang/crystal/files/crystal-0.23.1-llvm-5.patch new file mode 100644 index 000000000000..bbfd922149eb --- /dev/null +++ b/dev-lang/crystal/files/crystal-0.23.1-llvm-5.patch @@ -0,0 +1,837 @@ +https://bugs.gentoo.org/630634 +diff --git a/.gitignore b/.gitignore +index 9a883edfd..5f852d930 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -12,5 +12,6 @@ all_spec + /tmp + /doc/ + /src/llvm/ext/llvm_ext.o ++/src/llvm/ext/llvm_ext.dwo + /src/ext/*.o + /src/ext/libcrystal.a +diff --git a/Makefile b/Makefile +index a5dc0d7e3..14a21bb86 100644 +--- a/Makefile ++++ b/Makefile +@@ -37,8 +37,6 @@ LLVM_CONFIG_FINDER := \ + (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 3.9*) command -v llvm-config;; *) false;; esac)) || \ + command -v llvm-config-3.8 || command -v llvm-config38 || \ + (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 3.8*) command -v llvm-config;; *) false;; esac)) || \ +- command -v llvm-config-3.6 || command -v llvm-config36 || \ +- command -v llvm-config-3.5 || command -v llvm-config35 || \ + command -v llvm-config + LLVM_CONFIG := $(shell $(LLVM_CONFIG_FINDER)) + LLVM_EXT_DIR = src/llvm/ext +diff --git a/src/compiler/crystal/compiler.cr b/src/compiler/crystal/compiler.cr +index a2bed9a95..afc7976e3 100644 +--- a/src/compiler/crystal/compiler.cr ++++ b/src/compiler/crystal/compiler.cr +@@ -447,9 +447,6 @@ module Crystal + + protected def optimize(llvm_mod) + fun_pass_manager = llvm_mod.new_function_pass_manager +- {% if LibLLVM::IS_35 || LibLLVM::IS_36 %} +- fun_pass_manager.add_target_data target_machine.data_layout +- {% end %} + pass_manager_builder.populate fun_pass_manager + fun_pass_manager.run llvm_mod + module_pass_manager.run llvm_mod +@@ -460,9 +457,6 @@ module Crystal + private def module_pass_manager + @module_pass_manager ||= begin + mod_pass_manager = LLVM::ModulePassManager.new +- {% if LibLLVM::IS_35 || LibLLVM::IS_36 %} +- mod_pass_manager.add_target_data target_machine.data_layout +- {% end %} + pass_manager_builder.populate mod_pass_manager + mod_pass_manager + end +@@ -554,54 +548,29 @@ module Crystal + can_reuse_previous_compilation = + !compiler.emit && !@bc_flags_changed && File.exists?(bc_name) && File.exists?(object_name) + +- {% if LibLLVM::IS_35 %} +- # In LLVM 3.5 we can't write a bitcode to memory, +- # so instead we write it to another file +- bc_name_new = self.bc_name_new +- llvm_mod.write_bitcode_to_file(bc_name_new) +- +- if can_reuse_previous_compilation +- if FileUtils.cmp(bc_name, bc_name_new) +- # If the user cancelled a previous compilation it might be that +- # the .o file is empty +- if File.size(object_name) > 0 +- File.delete bc_name_new +- must_compile = false +- end +- end +- end ++ memory_buffer = llvm_mod.write_bitcode_to_memory_buffer + +- if must_compile +- # Create/overwrite the .bc file (for next compilations) +- File.rename(bc_name_new, bc_name) +- compiler.optimize llvm_mod if compiler.release? +- compiler.target_machine.emit_obj_to_file llvm_mod, object_name +- end +- {% else %} +- memory_buffer = llvm_mod.write_bitcode_to_memory_buffer +- +- if can_reuse_previous_compilation +- memory_io = IO::Memory.new(memory_buffer.to_slice) +- changed = File.open(bc_name) { |bc_file| !FileUtils.cmp(bc_file, memory_io) } +- +- # If the user cancelled a previous compilation +- # it might be that the .o file is empty +- if !changed && File.size(object_name) > 0 +- must_compile = false +- memory_buffer.dispose +- memory_buffer = nil +- else +- # We need to compile, so we'll write the memory buffer to file +- end +- end ++ if can_reuse_previous_compilation ++ memory_io = IO::Memory.new(memory_buffer.to_slice) ++ changed = File.open(bc_name) { |bc_file| !FileUtils.cmp(bc_file, memory_io) } + +- # If there's a memory buffer, it means we must create a .o from it +- if memory_buffer +- # Create the .bc file (for next compilations) +- File.write(bc_name, memory_buffer.to_slice) ++ # If the user cancelled a previous compilation ++ # it might be that the .o file is empty ++ if !changed && File.size(object_name) > 0 ++ must_compile = false + memory_buffer.dispose ++ memory_buffer = nil ++ else ++ # We need to compile, so we'll write the memory buffer to file + end +- {% end %} ++ end ++ ++ # If there's a memory buffer, it means we must create a .o from it ++ if memory_buffer ++ # Create the .bc file (for next compilations) ++ File.write(bc_name, memory_buffer.to_slice) ++ memory_buffer.dispose ++ end + + if must_compile + compiler.optimize llvm_mod if compiler.release? +diff --git a/src/llvm.cr b/src/llvm.cr +index 44a03c272..f9b31cf4b 100644 +--- a/src/llvm.cr ++++ b/src/llvm.cr +@@ -94,11 +94,5 @@ module LLVM + string + end + +- {% if LibLLVM::IS_35 %} +- DEBUG_METADATA_VERSION = 1 +- {% elsif LibLLVM::IS_36 %} +- DEBUG_METADATA_VERSION = 2 +- {% else %} +- DEBUG_METADATA_VERSION = 3 +- {% end %} ++ DEBUG_METADATA_VERSION = 3 + end +diff --git a/src/llvm/context.cr b/src/llvm/context.cr +index 8485eedf1..7d66a4365 100644 +--- a/src/llvm/context.cr ++++ b/src/llvm/context.cr +@@ -9,9 +9,9 @@ class LLVM::Context + end + + def new_module(name : String) : Module +- {% if LibLLVM::IS_38 || LibLLVM::IS_36 || LibLLVM::IS_35 %} ++ {% if LibLLVM::IS_38 %} + Module.new(LibLLVM.module_create_with_name_in_context(name, self), name, self) +- {% else %} ++ {% else %} # LLVM >= 3.9 + Module.new(LibLLVM.module_create_with_name_in_context(name, self), self) + {% end %} + end +@@ -104,9 +104,9 @@ class LLVM::Context + if ret != 0 && msg + raise LLVM.string_and_dispose(msg) + end +- {% if LibLLVM::IS_38 || LibLLVM::IS_36 || LibLLVM::IS_35 %} ++ {% if LibLLVM::IS_38 %} + Module.new(mod, "unknown", self) +- {% else %} ++ {% else %} # LLVM >= 3.9 + Module.new(mod, self) + {% end %} + end +diff --git a/src/llvm/di_builder.cr b/src/llvm/di_builder.cr +index b8c0fd628..79571d2c0 100644 +--- a/src/llvm/di_builder.cr ++++ b/src/llvm/di_builder.cr +@@ -31,16 +31,8 @@ struct LLVM::DIBuilder + + def create_function(scope, name, linkage_name, file, line, composite_type, is_local_to_unit, is_definition, + scope_line, flags, is_optimized, func) +- {% if LibLLVM::IS_36 || LibLLVM::IS_35 %} +- LibLLVMExt.di_builder_create_function(self, scope, name, linkage_name, file, line, composite_type, +- is_local_to_unit ? 1 : 0, +- is_definition ? 1 : 0, +- scope_line, flags, +- is_optimized ? 1 : 0, func) +- {% else %} +- LibLLVMExt.di_builder_create_function(self, scope, name, linkage_name, file, line, composite_type, +- is_local_to_unit, is_definition, scope_line, flags, is_optimized, func) +- {% end %} ++ LibLLVMExt.di_builder_create_function(self, scope, name, linkage_name, file, line, composite_type, ++ is_local_to_unit, is_definition, scope_line, flags, is_optimized, func) + end + + def create_auto_variable(scope, name, file, line, type, align_in_bits) +@@ -87,19 +79,11 @@ struct LLVM::DIBuilder + end + + def create_replaceable_composite_type(scope, name, file, line, context : Context) +- {% if LibLLVM::IS_35 || LibLLVM::IS_36 %} +- LibLLVMExt.temporary_md_node(context, nil, 0).as(LibLLVMExt::Metadata) +- {% else %} +- LibLLVMExt.di_builder_create_replaceable_composite_type(self, scope, name, file, line) +- {% end %} ++ LibLLVMExt.di_builder_create_replaceable_composite_type(self, scope, name, file, line) + end + + def replace_temporary(from, to) +- {% if LibLLVM::IS_35 || LibLLVM::IS_36 %} +- LibLLVMExt.metadata_replace_all_uses_with(from, to) +- {% else %} +- LibLLVMExt.di_builder_replace_temporary(self, from, to) +- {% end %} ++ LibLLVMExt.di_builder_replace_temporary(self, from, to) + end + + def end +diff --git a/src/llvm/ext/llvm_ext.cc b/src/llvm/ext/llvm_ext.cc +index d13446160..3dbdd4220 100644 +--- a/src/llvm/ext/llvm_ext.cc ++++ b/src/llvm/ext/llvm_ext.cc +@@ -18,35 +18,22 @@ using namespace llvm; + #define LLVM_VERSION_LE(major, minor) \ + (LLVM_VERSION_MAJOR < (major) || LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR <= (minor)) + ++#if LLVM_VERSION_LE(4, 0) + typedef struct LLVMOpaqueDIBuilder *LLVMDIBuilderRef; + DEFINE_SIMPLE_CONVERSION_FUNCTIONS(DIBuilder, LLVMDIBuilderRef) + +-#if LLVM_VERSION_EQ(3, 5) +-typedef LLVMValueRef LLVMMetadataRef; +-typedef Value Metadata; +-#define DIBuilderRef LLVMDIBuilderRef +- +-#else /* LLVM != 3.5 */ + typedef struct LLVMOpaqueMetadata *LLVMMetadataRef; + DEFINE_ISA_CONVERSION_FUNCTIONS(Metadata, LLVMMetadataRef) + inline Metadata **unwrap(LLVMMetadataRef *Vals) { + return reinterpret_cast<Metadata **>(Vals); + } +-#endif /* LLVM == 3.5 */ +- +-#if LLVM_VERSION_LE(3, 6) +-template <typename T> T unwrapDIptr(LLVMMetadataRef v) { +- return v ? T(unwrap<MDNode>(v)) : T(); +-} +-#define DIBuilderRef LLVMDIBuilderRef ++#endif + +-#else /* LLVM > 3.6 */ + typedef DIBuilder *DIBuilderRef; + #define DIArray DINodeArray + template <typename T> T *unwrapDIptr(LLVMMetadataRef v) { + return (T *)(v ? unwrap<MDNode>(v) : NULL); + } +-#endif /* LLVM <= 3.6 */ + + #if LLVM_VERSION_LE(3, 6) + #define OperandBundleDef void +@@ -66,13 +53,7 @@ void LLVMDIBuilderFinalize(LLVMDIBuilderRef dref) { unwrap(dref)->finalize(); } + + LLVMMetadataRef LLVMDIBuilderCreateFile(DIBuilderRef Dref, const char *File, + const char *Dir) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DIFile F = D->createFile(File, Dir); +- return wrap(F); +-#else + return wrap(Dref->createFile(File, Dir)); +-#endif + } + + LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(DIBuilderRef Dref, unsigned Lang, +@@ -82,20 +63,13 @@ LLVMMetadataRef LLVMDIBuilderCreateCompileUnit(DIBuilderRef Dref, unsigned Lang, + int Optimized, + const char *Flags, + unsigned RuntimeVersion) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DICompileUnit CU = D->createCompileUnit(Lang, File, Dir, Producer, Optimized, +- Flags, RuntimeVersion); +- return wrap(CU); +-#else +-# if LLVM_VERSION_LE(3, 9) ++#if LLVM_VERSION_LE(3, 9) + return wrap(Dref->createCompileUnit(Lang, File, Dir, Producer, Optimized, + Flags, RuntimeVersion)); +-# else ++#else + DIFile *F = Dref->createFile(File, Dir); + return wrap(Dref->createCompileUnit(Lang, F, Producer, Optimized, + Flags, RuntimeVersion)); +-# endif + #endif + } + +@@ -111,19 +85,11 @@ LLVMMetadataRef LLVMDIBuilderCreateFunction( + #endif + bool IsOptimized, + LLVMValueRef Func) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DISubprogram Sub = D->createFunction( +- unwrapDI<DIDescriptor>(Scope), Name, LinkageName, unwrapDI<DIFile>(File), +- Line, unwrapDI<DICompositeType>(CompositeType), IsLocalToUnit, +- IsDefinition, ScopeLine, Flags, IsOptimized, unwrap<Function>(Func)); +-#else + DISubprogram *Sub = Dref->createFunction( + unwrapDI<DIScope>(Scope), Name, LinkageName, unwrapDI<DIFile>(File), Line, + unwrapDI<DISubroutineType>(CompositeType), IsLocalToUnit, IsDefinition, + ScopeLine, Flags, IsOptimized); + unwrap<Function>(Func)->setSubprogram(Sub); +-#endif + return wrap(Sub); + } + +@@ -132,18 +98,8 @@ LLVMMetadataRef LLVMDIBuilderCreateLexicalBlock(DIBuilderRef Dref, + LLVMMetadataRef File, + unsigned Line, + unsigned Column) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +-# if LLVM_VERSION_EQ(3, 5) +- DILexicalBlock LB = D->createLexicalBlock(unwrapDI<DIDescriptor>(Scope), unwrapDI<DIFile>(File), Line, Column, 0); +-# else /* LLVM <= 3.6 && LLVM != 3.5 */ +- DILexicalBlock LB = D->createLexicalBlock(unwrapDI<DIDescriptor>(Scope), unwrapDI<DIFile>(File), Line, Column); +-# endif +- return wrap(LB); +-#else /* LLVM > 3.6 */ + return wrap(Dref->createLexicalBlock(unwrapDI<DIDescriptor>(Scope), + unwrapDI<DIFile>(File), Line, Column)); +-#endif /* LLVM <= 3.6 */ + } + + LLVMMetadataRef LLVMDIBuilderCreateBasicType(DIBuilderRef Dref, +@@ -151,71 +107,34 @@ LLVMMetadataRef LLVMDIBuilderCreateBasicType(DIBuilderRef Dref, + uint64_t SizeInBits, + uint64_t AlignInBits, + unsigned Encoding) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DIBasicType T = D->createBasicType(Name, SizeInBits, AlignInBits, Encoding); +- return wrap(T); +-#else +-# if LLVM_VERSION_LE(3, 9) ++#if LLVM_VERSION_LE(3, 9) + return wrap(Dref->createBasicType(Name, SizeInBits, AlignInBits, Encoding)); +-# else ++#else + return wrap(Dref->createBasicType(Name, SizeInBits, Encoding)); +-# endif + #endif + } + + LLVMMetadataRef LLVMDIBuilderGetOrCreateTypeArray(DIBuilderRef Dref, + LLVMMetadataRef *Data, + unsigned Length) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +-# if LLVM_VERSION_EQ(3, 5) +- Value **DataValue = unwrap(Data); +- ArrayRef<Value *> Elements(DataValue, Length); +- DIArray A = D->getOrCreateArray(Elements); +-# else /* LLVM <= 3.6 && LLVM != 3.5 */ +- Metadata **DataValue = unwrap(Data); +- ArrayRef<Metadata *> Elements(DataValue, Length); +- DITypeArray A = D->getOrCreateTypeArray(Elements); +-# endif +- return wrap(A); +-#else /* LLVM > 3.6 */ + Metadata **DataValue = unwrap(Data); + return wrap( + Dref->getOrCreateTypeArray(ArrayRef<Metadata *>(DataValue, Length)) + .get()); +-#endif /* LLVM <= 3.6 */ + } + + LLVMMetadataRef LLVMDIBuilderGetOrCreateArray(DIBuilderRef Dref, + LLVMMetadataRef *Data, + unsigned Length) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- ArrayRef<Metadata *> elements(unwrap(Data), Length); +- DIArray a = D->getOrCreateArray(elements); +- +- return wrap(a); +-#else + Metadata **DataValue = unwrap(Data); + return wrap( + Dref->getOrCreateArray(ArrayRef<Metadata *>(DataValue, Length)).get()); +-#endif + } + + LLVMMetadataRef + LLVMDIBuilderCreateSubroutineType(DIBuilderRef Dref, LLVMMetadataRef File, + LLVMMetadataRef ParameterTypes) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +-# if LLVM_VERSION_EQ(3, 5) +- DICompositeType CT = D->createSubroutineType(unwrapDI<DIFile>(File), unwrapDI<DIArray>(ParameterTypes)); +-# else /* LLVM <= 3.6 && LLVM != 3.5 */ +- DICompositeType CT = D->createSubroutineType(unwrapDI<DIFile>(File), unwrapDI<DITypeArray>(ParameterTypes)); +-# endif +-#else /* LLVM > 3.6 */ + DISubroutineType *CT = Dref->createSubroutineType(DITypeRefArray(unwrap<MDTuple>(ParameterTypes))); +-#endif /* LLVM <= 3.6 */ + return wrap(CT); + } + +@@ -229,21 +148,14 @@ LLVMMetadataRef LLVMDIBuilderCreateAutoVariable( + DINode::DIFlags Flags, + #endif + uint32_t AlignInBits) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DIVariable V = D->createLocalVariable( +- llvm::dwarf::DW_TAG_auto_variable, unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), Line, +- unwrapDI<DIType>(Ty), AlwaysPreserve, Flags, 0); +-#else +-# if LLVM_VERSION_LE(3, 9) ++#if LLVM_VERSION_LE(3, 9) + DILocalVariable *V = Dref->createAutoVariable( + unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), Line, + unwrapDI<DIType>(Ty), AlwaysPreserve, Flags); +-# else ++#else + DILocalVariable *V = Dref->createAutoVariable( + unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), Line, + unwrapDI<DIType>(Ty), AlwaysPreserve, Flags, AlignInBits); +-# endif + #endif + return wrap(V); + } +@@ -258,18 +170,10 @@ LLVMMetadataRef LLVMDIBuilderCreateParameterVariable( + DINode::DIFlags Flags + #endif + ) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DIVariable V = D->createLocalVariable( +- llvm::dwarf::DW_TAG_arg_variable, unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), Line, +- unwrapDI<DIType>(Ty), AlwaysPreserve, Flags, ArgNo); +- return wrap(V); +-#else + DILocalVariable *V = Dref->createParameterVariable + (unwrapDI<DIDescriptor>(Scope), Name, ArgNo, unwrapDI<DIFile>(File), Line, + unwrapDI<DIType>(Ty), AlwaysPreserve, Flags); + return wrap(V); +-#endif + } + + LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(DIBuilderRef Dref, +@@ -278,46 +182,17 @@ LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd(DIBuilderRef Dref, + LLVMMetadataRef Expr, + LLVMValueRef DL, + LLVMBasicBlockRef Block) { +-#if LLVM_VERSION_EQ(3, 5) +- DIBuilder *D = unwrap(Dref); +- Instruction *Instr = +- D->insertDeclare(unwrap(Storage), unwrapDI<DIVariable>(VarInfo), +- unwrap(Block)); +- Instr->setDebugLoc(DebugLoc::getFromDILocation(cast<MDNode>(DL))); +-#endif +- +-#if LLVM_VERSION_EQ(3, 6) +- DIBuilder *D = unwrap(Dref); +- Instruction *Instr = +- D->insertDeclare(unwrap(Storage), unwrapDI<DIVariable>(VarInfo), +- unwrapDI<DIExpression>(Expr), unwrap(Block)); +- Instr->setDebugLoc(DebugLoc::getFromDILocation(cast<MDNode>(unwrap<MetadataAsValue>(DL)->getMetadata()))); +-#endif +- +-#if LLVM_VERSION_GE(3, 7) + Instruction *Instr = + Dref->insertDeclare(unwrap(Storage), unwrap<DILocalVariable>(VarInfo), + unwrapDI<DIExpression>(Expr), + DebugLoc(cast<MDNode>(unwrap<MetadataAsValue>(DL)->getMetadata())), + unwrap(Block)); +-#endif +- + return wrap(Instr); + } + + LLVMMetadataRef LLVMDIBuilderCreateExpression(DIBuilderRef Dref, int64_t *Addr, + size_t Length) { +-#if LLVM_VERSION_LE(3, 6) +-# if LLVM_VERSION_EQ(3, 5) +- return nullptr; +-# else /* LLVM <= 3.6 && LLVM != 3.5 */ +- DIBuilder *D = unwrap(Dref); +- DIExpression Expr = D->createExpression(ArrayRef<int64_t>(Addr, Length)); +- return wrap(Expr); +-# endif +-#else /* LLVM > 3.6 */ + return wrap(Dref->createExpression(ArrayRef<int64_t>(Addr, Length))); +-#endif + } + + LLVMMetadataRef LLVMDIBuilderCreateEnumerationType( +@@ -325,30 +200,16 @@ LLVMMetadataRef LLVMDIBuilderCreateEnumerationType( + LLVMMetadataRef File, unsigned LineNumber, uint64_t SizeInBits, + uint64_t AlignInBits, LLVMMetadataRef Elements, + LLVMMetadataRef UnderlyingType) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DICompositeType enumType = D->createEnumerationType( +- unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), LineNumber, +- SizeInBits, AlignInBits, unwrapDI<DIArray>(Elements), +- unwrapDI<DIType>(UnderlyingType)); +-#else + DICompositeType *enumType = Dref->createEnumerationType( + unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), LineNumber, + SizeInBits, AlignInBits, DINodeArray(unwrapDI<MDTuple>(Elements)), + unwrapDI<DIType>(UnderlyingType)); +-#endif + return wrap(enumType); + } + + LLVMMetadataRef LLVMDIBuilderCreateEnumerator(DIBuilderRef Dref, + const char *Name, int64_t Value) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DIEnumerator e = D->createEnumerator(Name, Value); +- return wrap(e); +-#else + DIEnumerator *e = Dref->createEnumerator(Name, Value); +-#endif + return wrap(e); + } + +@@ -367,22 +228,13 @@ LLVMDIBuilderCreateStructType(DIBuilderRef Dref, + #endif + LLVMMetadataRef DerivedFrom, + LLVMMetadataRef Elements) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DICompositeType CT = D->createStructType( +- unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), Line, +- SizeInBits, AlignInBits, Flags, unwrapDI<DIType>(DerivedFrom), +- unwrapDI<DIArray>(Elements)); +-#else + DICompositeType *CT = Dref->createStructType( + unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), Line, + SizeInBits, AlignInBits, Flags, unwrapDI<DIType>(DerivedFrom), + DINodeArray(unwrapDI<MDTuple>(Elements))); +-#endif + return wrap(CT); + } + +-#if LLVM_VERSION_GE(3, 8) + LLVMMetadataRef + LLVMDIBuilderCreateReplaceableCompositeType(DIBuilderRef Dref, + LLVMMetadataRef Scope, +@@ -409,7 +261,6 @@ LLVMDIBuilderReplaceTemporary(DIBuilderRef Dref, + llvm::TempMDNode fwd_decl(Node); + Dref->replaceTemporary(std::move(fwd_decl), Type); + } +-#endif + + LLVMMetadataRef + LLVMDIBuilderCreateMemberType(DIBuilderRef Dref, LLVMMetadataRef Scope, +@@ -422,16 +273,9 @@ LLVMDIBuilderCreateMemberType(DIBuilderRef Dref, LLVMMetadataRef Scope, + DINode::DIFlags Flags, + #endif + LLVMMetadataRef Ty) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DIDerivedType DT = D->createMemberType( +- unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), Line, +- SizeInBits, AlignInBits, OffsetInBits, Flags, unwrapDI<DIType>(Ty)); +-#else + DIDerivedType *DT = Dref->createMemberType( + unwrapDI<DIDescriptor>(Scope), Name, unwrapDI<DIFile>(File), Line, + SizeInBits, AlignInBits, OffsetInBits, Flags, unwrapDI<DIType>(Ty)); +-#endif + return wrap(DT); + } + +@@ -440,39 +284,24 @@ LLVMMetadataRef LLVMDIBuilderCreatePointerType(DIBuilderRef Dref, + uint64_t SizeInBits, + uint64_t AlignInBits, + const char *Name) { +-#if LLVM_VERSION_LE(3, 6) +- DIBuilder *D = unwrap(Dref); +- DIDerivedType T = D->createPointerType(unwrapDI<DIType>(PointeeType), +- SizeInBits, AlignInBits, Name); +-#else + DIDerivedType *T = Dref->createPointerType(unwrapDI<DIType>(PointeeType), +- SizeInBits, AlignInBits, Name); ++ SizeInBits, AlignInBits, ++#if LLVM_VERSION_GE(5, 0) ++ None, + #endif ++ Name); + return wrap(T); + } + + LLVMMetadataRef LLVMTemporaryMDNode(LLVMContextRef C, LLVMMetadataRef *MDs, + unsigned Count) { +-#if LLVM_VERSION_LE(3, 6) +- return wrap(MDNode::getTemporary(*unwrap(C), +- ArrayRef<Metadata *>(unwrap(MDs), Count))); +-#else + return wrap(MDTuple::getTemporary(*unwrap(C), + ArrayRef<Metadata *>(unwrap(MDs), Count)) + .release()); +-#endif + } + + void LLVMMetadataReplaceAllUsesWith(LLVMMetadataRef MD, LLVMMetadataRef New) { +-#if LLVM_VERSION_LE(3, 6) +-# if LLVM_VERSION_EQ(3, 5) + auto *Node = unwrap<MDNode>(MD); +-# else /* LLVM <= 3.6 && LLVM != 3.5 */ +- auto *Node = unwrap<MDNodeFwdDecl>(MD); +-# endif +-#else /* LLVM > 3.6 */ +- auto *Node = unwrap<MDNode>(MD); +-#endif + Node->replaceAllUsesWith(unwrap<MDNode>(New)); + MDNode::deleteTemporary(Node); + } +diff --git a/src/llvm/function_pass_manager.cr b/src/llvm/function_pass_manager.cr +index 979cb9c97..834d72a20 100644 +--- a/src/llvm/function_pass_manager.cr ++++ b/src/llvm/function_pass_manager.cr +@@ -2,12 +2,6 @@ class LLVM::FunctionPassManager + def initialize(@unwrap : LibLLVM::PassManagerRef) + end + +- {% if LibLLVM::IS_35 || LibLLVM::IS_36 %} +- def add_target_data(target_data) +- LibLLVM.add_target_data target_data, self +- end +- {% end %} +- + def run(mod : Module) + changed = false + run do |runner| +diff --git a/src/llvm/lib_llvm.cr b/src/llvm/lib_llvm.cr +index e2c7a9445..5a0b67cdd 100644 +--- a/src/llvm/lib_llvm.cr ++++ b/src/llvm/lib_llvm.cr +@@ -6,8 +6,6 @@ lib LibLLVM + (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 3.9*) command -v llvm-config;; *) false;; esac)) || \ + command -v llvm-config-3.8 || command -v llvm-config38 || \ + (command -v llvm-config > /dev/null && (case "$(llvm-config --version)" in 3.8*) command -v llvm-config;; *) false;; esac)) || \ +- command -v llvm-config-3.6 || command -v llvm-config36 || \ +- command -v llvm-config-3.5 || command -v llvm-config35 || \ + command -v llvm-config + `.chomp.stringify + }} +@@ -32,8 +30,6 @@ end + IS_40 = {{LibLLVM::VERSION.starts_with?("4.0")}} + IS_39 = {{LibLLVM::VERSION.starts_with?("3.9")}} + IS_38 = {{LibLLVM::VERSION.starts_with?("3.8")}} +- IS_36 = {{LibLLVM::VERSION.starts_with?("3.6")}} +- IS_35 = {{LibLLVM::VERSION.starts_with?("3.5")}} + end + {% end %} + +@@ -283,9 +279,7 @@ lib LibLLVM + fun set_alignment = LLVMSetAlignment(value : ValueRef, bytes : UInt32) + fun get_return_type = LLVMGetReturnType(TypeRef) : TypeRef + +- {% unless LibLLVM::IS_35 %} +- fun write_bitcode_to_memory_buffer = LLVMWriteBitcodeToMemoryBuffer(mod : ModuleRef) : MemoryBufferRef +- {% end %} ++ fun write_bitcode_to_memory_buffer = LLVMWriteBitcodeToMemoryBuffer(mod : ModuleRef) : MemoryBufferRef + + fun dispose_memory_buffer = LLVMDisposeMemoryBuffer(buf : MemoryBufferRef) : Void + fun get_buffer_start = LLVMGetBufferStart(buf : MemoryBufferRef) : UInt8* +@@ -293,26 +287,22 @@ lib LibLLVM + + fun write_bitcode_to_fd = LLVMWriteBitcodeToFD(mod : ModuleRef, fd : LibC::Int, should_close : LibC::Int, unbuffered : LibC::Int) : LibC::Int + +- {% if LibLLVM::IS_36 || LibLLVM::IS_35 %} +- fun add_target_data = LLVMAddTargetData(td : TargetDataRef, pm : PassManagerRef) +- {% end %} +- +- {% if LibLLVM::IS_38 || LibLLVM::IS_36 || LibLLVM::IS_35 %} ++ {% if LibLLVM::IS_38 %} + fun copy_string_rep_of_target_data = LLVMCopyStringRepOfTargetData(data : TargetDataRef) : UInt8* + fun get_target_machine_data = LLVMGetTargetMachineData(t : TargetMachineRef) : TargetDataRef + fun set_data_layout = LLVMSetDataLayout(mod : ModuleRef, data : UInt8*) +- {% else %} ++ {% else %} # LLVM >= 3.9 + fun create_target_data_layout = LLVMCreateTargetDataLayout(t : TargetMachineRef) : TargetDataRef + fun set_module_data_layout = LLVMSetModuleDataLayout(mod : ModuleRef, data : TargetDataRef) + {% end %} + +- {% if LibLLVM::IS_38 || LibLLVM::IS_36 || LibLLVM::IS_35 %} ++ {% if LibLLVM::IS_38 %} + fun add_attribute = LLVMAddAttribute(arg : ValueRef, attr : LLVM::Attribute) + fun add_instr_attribute = LLVMAddInstrAttribute(instr : ValueRef, index : UInt32, attr : LLVM::Attribute) + fun add_function_attr = LLVMAddFunctionAttr(fn : ValueRef, pa : LLVM::Attribute) + fun get_function_attr = LLVMGetFunctionAttr(fn : ValueRef) : LLVM::Attribute + fun get_attribute = LLVMGetAttribute(arg : ValueRef) : LLVM::Attribute +- {% else %} ++ {% else %} # LLVM >= 3.9 + type AttributeRef = Void* + alias AttributeIndex = UInt + +diff --git a/src/llvm/lib_llvm_ext.cr b/src/llvm/lib_llvm_ext.cr +index 84c65cccb..953567eb8 100644 +--- a/src/llvm/lib_llvm_ext.cr ++++ b/src/llvm/lib_llvm_ext.cr +@@ -13,19 +13,11 @@ lib LibLLVMExt + fun create_di_builder = LLVMNewDIBuilder(LibLLVM::ModuleRef) : DIBuilder + fun di_builder_finalize = LLVMDIBuilderFinalize(DIBuilder) + +- {% if LibLLVM::IS_36 || LibLLVM::IS_35 %} +- fun di_builder_create_function = LLVMDIBuilderCreateFunction( +- builder : DIBuilder, scope : Metadata, name : Char*, +- linkage_name : Char*, file : Metadata, line : UInt, +- composite_type : Metadata, is_local_to_unit : Int, is_definition : Int, +- scope_line : UInt, flags : LLVM::DIFlags, is_optimized : Int, func : LibLLVM::ValueRef) : Metadata +- {% else %} +- fun di_builder_create_function = LLVMDIBuilderCreateFunction( +- builder : DIBuilder, scope : Metadata, name : Char*, +- linkage_name : Char*, file : Metadata, line : UInt, +- composite_type : Metadata, is_local_to_unit : Bool, is_definition : Bool, +- scope_line : UInt, flags : LLVM::DIFlags, is_optimized : Bool, func : LibLLVM::ValueRef) : Metadata +- {% end %} ++ fun di_builder_create_function = LLVMDIBuilderCreateFunction( ++ builder : DIBuilder, scope : Metadata, name : Char*, ++ linkage_name : Char*, file : Metadata, line : UInt, ++ composite_type : Metadata, is_local_to_unit : Bool, is_definition : Bool, ++ scope_line : UInt, flags : LLVM::DIFlags, is_optimized : Bool, func : LibLLVM::ValueRef) : Metadata + + fun di_builder_create_file = LLVMDIBuilderCreateFile(builder : DIBuilder, file : Char*, dir : Char*) : Metadata + fun di_builder_create_compile_unit = LLVMDIBuilderCreateCompileUnit(builder : DIBuilder, +@@ -94,17 +86,12 @@ lib LibLLVMExt + align_in_bits : UInt64, + name : Char*) : Metadata + +- {% if LibLLVM::IS_35 || LibLLVM::IS_36 %} +- fun temporary_md_node = LLVMTemporaryMDNode(context : LibLLVM::ContextRef, mds : Metadata*, count : UInt) : Metadata +- fun metadata_replace_all_uses_with = LLVMMetadataReplaceAllUsesWith(Metadata, Metadata) +- {% else %} +- fun di_builder_create_replaceable_composite_type = LLVMDIBuilderCreateReplaceableCompositeType(builder : DIBuilder, +- scope : Metadata, +- name : Char*, +- file : Metadata, +- line : UInt) : Metadata +- fun di_builder_replace_temporary = LLVMDIBuilderReplaceTemporary(builder : DIBuilder, from : Metadata, to : Metadata) +- {% end %} ++ fun di_builder_create_replaceable_composite_type = LLVMDIBuilderCreateReplaceableCompositeType(builder : DIBuilder, ++ scope : Metadata, ++ name : Char*, ++ file : Metadata, ++ line : UInt) : Metadata ++ fun di_builder_replace_temporary = LLVMDIBuilderReplaceTemporary(builder : DIBuilder, from : Metadata, to : Metadata) + + fun set_current_debug_location = LLVMSetCurrentDebugLocation2(LibLLVM::BuilderRef, Int, Int, Metadata, Metadata) + +diff --git a/src/llvm/module.cr b/src/llvm/module.cr +index cb71e3b21..c15a56e77 100644 +--- a/src/llvm/module.cr ++++ b/src/llvm/module.cr +@@ -6,7 +6,7 @@ class LLVM::Module + + getter context : Context + +- {% if LibLLVM::IS_38 || LibLLVM::IS_36 || LibLLVM::IS_35 %} ++ {% if LibLLVM::IS_38 %} + def initialize(@unwrap : LibLLVM::ModuleRef, @name : String, @context : Context) + @owned = false + end +@@ -14,7 +14,7 @@ class LLVM::Module + def name : String + @name + end +- {% else %} ++ {% else %} # LLVM >= 3.9 + def initialize(@unwrap : LibLLVM::ModuleRef, @context : Context) + @owned = false + end +@@ -34,9 +34,9 @@ class LLVM::Module + end + + def data_layout=(data : TargetData) +- {% if LibLLVM::IS_38 || LibLLVM::IS_36 || LibLLVM::IS_35 %} ++ {% if LibLLVM::IS_38 %} + LibLLVM.set_data_layout(self, data.to_data_layout_string) +- {% else %} ++ {% else %} # LLVM >= 3.9 + LibLLVM.set_module_data_layout(self, data) + {% end %} + end +@@ -57,11 +57,9 @@ class LLVM::Module + LibLLVM.write_bitcode_to_file self, filename + end + +- {% unless LibLLVM::IS_35 %} +- def write_bitcode_to_memory_buffer +- MemoryBuffer.new(LibLLVM.write_bitcode_to_memory_buffer self) +- end +- {% end %} ++ def write_bitcode_to_memory_buffer ++ MemoryBuffer.new(LibLLVM.write_bitcode_to_memory_buffer self) ++ end + + def write_bitcode_to_fd(fd : Int, should_close = false, buffered = false) + LibLLVM.write_bitcode_to_fd(self, fd, should_close ? 1 : 0, buffered ? 1 : 0) +diff --git a/src/llvm/module_pass_manager.cr b/src/llvm/module_pass_manager.cr +index 10bfa60bd..519227809 100644 +--- a/src/llvm/module_pass_manager.cr ++++ b/src/llvm/module_pass_manager.cr +@@ -3,12 +3,6 @@ class LLVM::ModulePassManager + @unwrap = LibLLVM.pass_manager_create + end + +- {% if LibLLVM::IS_35 || LibLLVM::IS_36 %} +- def add_target_data(target_data) +- LibLLVM.add_target_data target_data, self +- end +- {% end %} +- + def run(mod) + LibLLVM.run_pass_manager(self, mod) != 0 + end +diff --git a/src/llvm/target_machine.cr b/src/llvm/target_machine.cr +index e4bb081e9..42e44abe2 100644 +--- a/src/llvm/target_machine.cr ++++ b/src/llvm/target_machine.cr +@@ -9,9 +9,9 @@ class LLVM::TargetMachine + + def data_layout + @layout ||= begin +- layout = {% if LibLLVM::IS_38 || LibLLVM::IS_36 || LibLLVM::IS_35 %} ++ layout = {% if LibLLVM::IS_38 %} + LibLLVM.get_target_machine_data(self) +- {% else %} ++ {% else %} # LLVM >= 3.9 + LibLLVM.create_target_data_layout(self) + {% end %} + layout ? TargetData.new(layout) : raise "Missing layout for #{self}" +-- +2.14.1 + diff --git a/dev-lang/crystal/metadata.xml b/dev-lang/crystal/metadata.xml new file mode 100644 index 000000000000..8c0dacece652 --- /dev/null +++ b/dev-lang/crystal/metadata.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>longlene@gmail.com</email> + <name>Lixiao Chen</name> + </maintainer> + <maintainer type="person"> + <email>slyfox@gentoo.org</email> + <name>Sergei Trofimovich</name> + </maintainer> + <maintainer type="project"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <longdescription lang="en"> + Crystal is a programming language that resembles Ruby but compiles to + native code and tries to be much more efficient, at the cost of + disallowing certain dynamic aspects of Ruby. + </longdescription> + <use> + <flag name="debug"> + Build each module as a separate object file. Speeds build up. + </flag> + <flag name="blocking-stdio-hack"> + Keep STDIO file descriptors in blocking mode. + </flag> + <flag name="yaml"> + Use the <pkg>dev-libs/libyaml</pkg> library to enable Crystal yaml + module + </flag> + <flag name="xml"> + Use the <pkg>dev-libs/libxml2</pkg> library to enable Crystal xml + module + </flag> + </use> + <upstream> + <remote-id type="github">manastech/crystal</remote-id> + </upstream> +</pkgmetadata> |