public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2017-04-23 21:39 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2017-04-23 21:39 UTC (permalink / raw
  To: gentoo-commits

commit:     3cf9beab238c015964bb1c8193d9a4394fce3a21
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 23 21:39:02 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Apr 23 21:39:21 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3cf9beab

dev-lang/crystal: Workaround tty corruption in crystal, bug #616256

Patch restores blocking mode of file desriptors in exchange
of potential runtime deadlocks when dealing with stdio.

As it's a potentially invasive patch it's not enabled by default
and is available only under USE=blocking-stdio-hack

Reported-by: Renich Bon Ciric
Bug: https://github.com/crystal-lang/crystal/issues/2065
Bug: https://bugs.gentoo.org/616256
Package-Manager: Portage-2.3.5, Repoman-2.3.2

 dev-lang/crystal/crystal-0.22.0.ebuild               |  8 +++++++-
 .../files/crystal-0.22.0-blocking-stdio-hack.patch   | 20 ++++++++++++++++++++
 dev-lang/crystal/metadata.xml                        |  3 +++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/dev-lang/crystal/crystal-0.22.0.ebuild b/dev-lang/crystal/crystal-0.22.0.ebuild
index 91cd89b0f5a..219789c6b1c 100644
--- a/dev-lang/crystal/crystal-0.22.0.ebuild
+++ b/dev-lang/crystal/crystal-0.22.0.ebuild
@@ -18,7 +18,7 @@ SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.ta
 LICENSE="Apache-2.0"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="doc debug examples +xml +yaml"
+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="
@@ -41,6 +41,12 @@ PATCHES=(
 	"${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) \

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 00000000000..07b7dba7be6
--- /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/metadata.xml b/dev-lang/crystal/metadata.xml
index 80b55be2293..8c0dacece65 100644
--- a/dev-lang/crystal/metadata.xml
+++ b/dev-lang/crystal/metadata.xml
@@ -22,6 +22,9 @@
 		<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


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2017-06-30  7:08 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2017-06-30  7:08 UTC (permalink / raw
  To: gentoo-commits

commit:     5b0478f68eecd2e5f03a0c63bf1b058e1e91e9eb
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 29 21:58:20 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Fri Jun 30 07:08:06 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b0478f6

dev-lang/crystal: bump up to 0.23.0

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 dev-lang/crystal/Manifest                          |  3 +
 dev-lang/crystal/crystal-0.23.0.ebuild             | 98 ++++++++++++++++++++++
 .../files/crystal-0.23.0-verbose-LDFLAGS.patch     |  9 ++
 3 files changed, 110 insertions(+)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 35cdba803b4..f1c7ff4d267 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -4,3 +4,6 @@ DIST crystal-0.21.1.tar.gz 1586701 SHA256 eb93de3b388641fd2a09a2d10ab9fe40a58148
 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

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 00000000000..05929f747c3
--- /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="http://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/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 00000000000..35eace15dae
--- /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) )


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2017-09-16 10:54 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2017-09-16 10:54 UTC (permalink / raw
  To: gentoo-commits

commit:     a5770fdf734d8d6d4bf95f6778adf0d024efb705
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 16 10:54:30 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Sep 16 10:54:30 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5770fdf

dev-lang/crystal: add llvm-5 support, bug #630634

Thanks to Renich Bon Ciric who found the problem
and found out the patch!

Reported-by: Renich Bon Ciric
Closes: https://bugs.gentoo.org/630634
Package-Manager: Portage-2.3.8, Repoman-2.3.3

 dev-lang/crystal/crystal-0.23.1.ebuild             |   1 +
 dev-lang/crystal/files/crystal-0.23.1-llvm-5.patch | 837 +++++++++++++++++++++
 2 files changed, 838 insertions(+)

diff --git a/dev-lang/crystal/crystal-0.23.1.ebuild b/dev-lang/crystal/crystal-0.23.1.ebuild
index b526f802656..6bf8e74cc81 100644
--- a/dev-lang/crystal/crystal-0.23.1.ebuild
+++ b/dev-lang/crystal/crystal-0.23.1.ebuild
@@ -38,6 +38,7 @@ RDEPEND="${DEPEND}
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-0.23.0-verbose-LDFLAGS.patch
+	"${FILESDIR}"/${PN}-0.23.1-llvm-5.patch
 )
 
 src_prepare() {

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 00000000000..bbfd922149e
--- /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
+


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2017-11-25 19:58 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2017-11-25 19:58 UTC (permalink / raw
  To: gentoo-commits

commit:     4262e73b76bb55bf730ebcda9b357512a8588890
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 25 19:57:26 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Nov 25 19:58:19 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4262e73b

dev-lang/crystal: drop old

Package-Manager: Portage-2.3.16, Repoman-2.3.6

 dev-lang/crystal/Manifest                          |  13 +--
 dev-lang/crystal/crystal-0.21.1.ebuild             |  91 -------------------
 dev-lang/crystal/crystal-0.22.0.ebuild             |  97 --------------------
 dev-lang/crystal/crystal-0.23.0-r1.ebuild          | 100 ---------------------
 dev-lang/crystal/crystal-0.23.0.ebuild             |  98 --------------------
 .../crystal/files/crystal-0.20.5-LDFLAGS.patch     |   9 --
 .../crystal/files/crystal-0.20.5-verbose.patch     |   9 --
 7 files changed, 3 insertions(+), 414 deletions(-)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 5f9244681b8..c0ba3024244 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -1,10 +1,3 @@
-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
+DIST crystal-0.23.0-1-linux-i686.tar.gz 18498501 BLAKE2B 7a8e4e5a2b1425b6effe0a634b74b28c340c4d23c4bfccc0abac4e5d47473e10421d025e68e1fb1fa5b0ba8296108e36cd17d393fb143b8012168d595e5852f9 SHA512 8745114c4824d2859c569ed1bd1057d6d649d57b10d41d22c17627f623704eb98ec2e3ab2bf06622de624906f53e053975a6b9d852aeaafeae4f43585609de28
+DIST crystal-0.23.0-1-linux-x86_64.tar.gz 18729061 BLAKE2B bfca07702b2f7c7d6b11aac864475316cabe86bdba90b1819ecd5cb45769b2b7fd9fb4c9f80e46301785209cc5b35fe39bf689163b9376a32b24f8a685a6281b SHA512 6a4e427b4ab3c3be6efcfaee5c1a19eff04eaf00db949d1e1ba8f29c3277affe96a7aba4273d93fd05251453d5b5b937aa792bc448ff2f6d6aa7f2b17d175f75
+DIST crystal-0.23.1.tar.gz 1646650 BLAKE2B 3105a683e61835d1e514d5d403b00d3dfae01100a9862d6346c45201c5fb6cba879255469652463719998e976afc495ee9fd4f14f829a709f832cd323cfc2b3b SHA512 06ee0d45cc79cc343d04c346e9cd47b6e4ebc79bf21833662f268f9604f7d2080f7696824e1959de341539f801ae8f898fe1d7b18e4c75378d4eb191878668d5

diff --git a/dev-lang/crystal/crystal-0.21.1.ebuild b/dev-lang/crystal/crystal-0.21.1.ebuild
deleted file mode 100644
index 19dbdc212a5..00000000000
--- a/dev-lang/crystal/crystal-0.21.1.ebuild
+++ /dev/null
@@ -1,91 +0,0 @@
-# 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
deleted file mode 100644
index 534a8852b6f..00000000000
--- a/dev-lang/crystal/crystal-0.22.0.ebuild
+++ /dev/null
@@ -1,97 +0,0 @@
-# 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
deleted file mode 100644
index b526f802656..00000000000
--- a/dev-lang/crystal/crystal-0.23.0-r1.ebuild
+++ /dev/null
@@ -1,100 +0,0 @@
-# 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
deleted file mode 100644
index 5df6f0b6440..00000000000
--- a/dev-lang/crystal/crystal-0.23.0.ebuild
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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/files/crystal-0.20.5-LDFLAGS.patch b/dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch
deleted file mode 100644
index 42970a84a7c..00000000000
--- a/dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index 6a0a301b5c0..00000000000
--- a/dev-lang/crystal/files/crystal-0.20.5-verbose.patch
+++ /dev/null
@@ -1,9 +0,0 @@
-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 )


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2017-12-11 20:03 Michał Górny
  0 siblings, 0 replies; 16+ messages in thread
From: Michał Górny @ 2017-12-11 20:03 UTC (permalink / raw
  To: gentoo-commits

commit:     e4e28b774ec066428e0116b94af8baad3e95c559
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 11 20:01:09 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec 11 20:03:38 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4e28b77

dev-lang/crystal: [QA] Move patches to a distfile

 dev-lang/crystal/Manifest                          |   1 +
 dev-lang/crystal/crystal-0.23.1.ebuild             |   7 +-
 .../files/crystal-0.22.0-blocking-stdio-hack.patch |  20 -
 .../files/crystal-0.23.0-verbose-LDFLAGS.patch     |   9 -
 dev-lang/crystal/files/crystal-0.23.1-llvm-5.patch | 837 ---------------------
 5 files changed, 5 insertions(+), 869 deletions(-)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index c0ba3024244..29524660167 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -1,3 +1,4 @@
 DIST crystal-0.23.0-1-linux-i686.tar.gz 18498501 BLAKE2B 7a8e4e5a2b1425b6effe0a634b74b28c340c4d23c4bfccc0abac4e5d47473e10421d025e68e1fb1fa5b0ba8296108e36cd17d393fb143b8012168d595e5852f9 SHA512 8745114c4824d2859c569ed1bd1057d6d649d57b10d41d22c17627f623704eb98ec2e3ab2bf06622de624906f53e053975a6b9d852aeaafeae4f43585609de28
 DIST crystal-0.23.0-1-linux-x86_64.tar.gz 18729061 BLAKE2B bfca07702b2f7c7d6b11aac864475316cabe86bdba90b1819ecd5cb45769b2b7fd9fb4c9f80e46301785209cc5b35fe39bf689163b9376a32b24f8a685a6281b SHA512 6a4e427b4ab3c3be6efcfaee5c1a19eff04eaf00db949d1e1ba8f29c3277affe96a7aba4273d93fd05251453d5b5b937aa792bc448ff2f6d6aa7f2b17d175f75
+DIST crystal-0.23.1-patchset.tar.bz2 7268 BLAKE2B 135990ac9f1a225f169dbc5bb6034d2194d9fc917954764564d68afec09af703382743965a801c9ce54a5866af60847b4c4fc0b9daf2cf5ea99052fbeb771b2a SHA512 68896fc5d1772eeb3dd263f1615fc8031a63d0f3eebca1feb35165adf14a610157302541c84cbc9031a3070fd5566ffe88ad03a8c523f55980520e5614b00b89
 DIST crystal-0.23.1.tar.gz 1646650 BLAKE2B 3105a683e61835d1e514d5d403b00d3dfae01100a9862d6346c45201c5fb6cba879255469652463719998e976afc495ee9fd4f14f829a709f832cd323cfc2b3b SHA512 06ee0d45cc79cc343d04c346e9cd47b6e4ebc79bf21833662f268f9604f7d2080f7696824e1959de341539f801ae8f898fe1d7b18e4c75378d4eb191878668d5

diff --git a/dev-lang/crystal/crystal-0.23.1.ebuild b/dev-lang/crystal/crystal-0.23.1.ebuild
index 08967bd554f..41f26d88e36 100644
--- a/dev-lang/crystal/crystal-0.23.1.ebuild
+++ b/dev-lang/crystal/crystal-0.23.1.ebuild
@@ -12,6 +12,7 @@ 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
+	https://dev.gentoo.org/~mgorny/dist/${P}-patchset.tar.bz2
 	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 )"
 
@@ -37,14 +38,14 @@ RDEPEND="${DEPEND}
 "
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-0.23.0-verbose-LDFLAGS.patch
-	"${FILESDIR}"/${PN}-0.23.1-llvm-5.patch
+	"${WORKDIR}"/${P}-patchset/${PN}-0.23.0-verbose-LDFLAGS.patch
+	"${WORKDIR}"/${P}-patchset/${PN}-0.23.1-llvm-5.patch
 )
 
 src_prepare() {
 	default
 
-	use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch
+	use blocking-stdio-hack && eapply "${WORKDIR}"/${P}-patchset/${PN}-0.22.0-blocking-stdio-hack.patch
 }
 
 src_compile() {

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
deleted file mode 100644
index 07b7dba7be6..00000000000
--- a/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-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
deleted file mode 100644
index 35eace15dae..00000000000
--- a/dev-lang/crystal/files/crystal-0.23.0-verbose-LDFLAGS.patch
+++ /dev/null
@@ -1,9 +0,0 @@
-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
deleted file mode 100644
index bbfd922149e..00000000000
--- a/dev-lang/crystal/files/crystal-0.23.1-llvm-5.patch
+++ /dev/null
@@ -1,837 +0,0 @@
-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
-


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2017-12-21 10:13 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2017-12-21 10:13 UTC (permalink / raw
  To: gentoo-commits

commit:     c0192cdd4f44c25ba6d7c3261a48b522ba4a5ca5
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 21 10:04:41 2017 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Dec 21 10:13:19 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0192cdd

Revert "dev-lang/crystal: [QA] Move patches to a distfile"

This reverts commit e4e28b774ec066428e0116b94af8baad3e95c559.

There is no policy about patches in distfiles:
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Policies

 dev-lang/crystal/crystal-0.23.1.ebuild               |  4 ++--
 .../files/crystal-0.22.0-blocking-stdio-hack.patch   | 20 ++++++++++++++++++++
 .../files/crystal-0.23.0-verbose-LDFLAGS.patch       |  9 +++++++++
 3 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/dev-lang/crystal/crystal-0.23.1.ebuild b/dev-lang/crystal/crystal-0.23.1.ebuild
index 41f26d88e36..c1b0b885924 100644
--- a/dev-lang/crystal/crystal-0.23.1.ebuild
+++ b/dev-lang/crystal/crystal-0.23.1.ebuild
@@ -38,14 +38,14 @@ RDEPEND="${DEPEND}
 "
 
 PATCHES=(
-	"${WORKDIR}"/${P}-patchset/${PN}-0.23.0-verbose-LDFLAGS.patch
+	"${FILESDIR}"/${PN}-0.23.0-verbose-LDFLAGS.patch
 	"${WORKDIR}"/${P}-patchset/${PN}-0.23.1-llvm-5.patch
 )
 
 src_prepare() {
 	default
 
-	use blocking-stdio-hack && eapply "${WORKDIR}"/${P}-patchset/${PN}-0.22.0-blocking-stdio-hack.patch
+	use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch
 }
 
 src_compile() {

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 00000000000..07b7dba7be6
--- /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 00000000000..35eace15dae
--- /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) )


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2018-08-09 22:34 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2018-08-09 22:34 UTC (permalink / raw
  To: gentoo-commits

commit:     a90b30e0ed07c7844a8f79b7a995be8ab03143b5
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  9 20:55:43 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Aug  9 22:34:32 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a90b30e0

dev-lang/crystal: bump up to 0.26.0

Package-Manager: Portage-2.3.45, Repoman-2.3.10

 dev-lang/crystal/Manifest                          |   3 +
 dev-lang/crystal/crystal-0.26.0.ebuild             | 105 +++++++++++++++++++++
 ...tal-0.26.0-gentoo-tests-network-sandbox-2.patch |  23 +++++
 3 files changed, 131 insertions(+)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 6f848b551cd..eacede05b48 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -7,3 +7,6 @@ DIST crystal-0.24.2-1-linux-i686.tar.gz 17667007 BLAKE2B 73104ce088e161f03a7b4a1
 DIST crystal-0.24.2-1-linux-x86_64.tar.gz 35022853 BLAKE2B 5b101a27fef0dfbbf61920d826689a45f400c28afe7383320b69f8887512bcab65cbfe8a2cf35b0c598b06083d1ea5e338f4e2b910db03226ba05195483e4c89 SHA512 21d8e7fc34fc24ccb7e8e2c7aade0c3d6fe17e385f0f00534bb91e886788da0b27ff8276b634f7ae13d6342c7e22c6acd609562bcf1af8fddfdee5e256e1bcf0
 DIST crystal-0.24.2.tar.gz 1745462 BLAKE2B 8f3d5cf9e274558a5622aae44c6f7d54d0b3042d08810ddc650f181b91a536a3d0cc2d8fa726b677cce1f8a946319a55b803823596cef0d4d3e63832bfcea720 SHA512 db9fb973eeb2bc72ef91bb894b7c5aea73e727ff46e739aa431d68e556238f346a688a7a43de284afb4667b49366afce3ca423a523bea521180fa8f19ba6862d
 DIST crystal-0.25.0.tar.gz 1957613 BLAKE2B 4c2467e39a9bc6745b74c00f755490a2f726e775c2a0d15562af27d2a6771c95c44f79e6b59ad45f61a59566529854d75c980c55a6886538fa98663879477258 SHA512 20f2864919c7710e5aee8112e1c6ab54a2e50b244ac63d374edfed41ab659b11c062f76dbfc38e763a08bdbea9e0a39f3b5cac5e00bf453be3a31d3b0a023917
+DIST crystal-0.25.1-1-linux-i686.tar.gz 39882213 BLAKE2B 35d0045a72ced6ba7348105c9b88e564f85b075af78decd52c40b47b338cd1c7c1b01565430f9aa21251cfd1266041268e037eb616a24475acfa22b1b8ae1448 SHA512 79601b6c586184e064798c4daca3de77f7c81fbc4d0062a558824533f9272f04899c0041b17dce072757f20f7940c99303c6ff1143448b6452e8216ca4bb43dd
+DIST crystal-0.25.1-1-linux-x86_64.tar.gz 38004788 BLAKE2B 580ccad2227e6467c4c61ce9adf4aeb99c55f694c71a02b9d959c31deba66e428f5c5e7d920dd42d01524ccaef04b9eae3b068f2c6ff16414fa3fd36f462414f SHA512 ec33781b767f8f9f0a6d00f73109fbe9d683a23fca9cc8b462acda3eb024fc970d0daf8c36fb2239297f77510d2e3f544f58ec1cf53d08ea856bc6307f81d1dd
+DIST crystal-0.26.0.tar.gz 1992091 BLAKE2B dfc96e3e9a71dbec07235a982bbb34ea81bb3adbb39f6c8f8c9bb855ac97e5faf4d47d4a78901317798941b84117399aeee6af53c6c06ae21b9504ca617a2899 SHA512 45a62a2496d477cd72666e98b36bdcbfff958a8f5f0e71f04101f2ba72fc87117d53c8c098a72edb55e9be192b68b73529d5f76e4c660033332ed6e88a372519

diff --git a/dev-lang/crystal/crystal-0.26.0.ebuild b/dev-lang/crystal/crystal-0.26.0.ebuild
new file mode 100644
index 00000000000..033b3eb6c94
--- /dev/null
+++ b/dev-lang/crystal/crystal-0.26.0.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
+
+BV=0.25.1
+BV_AMD64=${BV}-1-linux-x86_64
+BV_X86=${BV}-1-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/${BV/}/crystal-${BV_AMD64}.tar.gz )
+	x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV}/crystal-${BV_X86}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc debug examples blocking-stdio-hack +xml +yaml"
+
+LLVM_MAX_SLOT=6
+
+# dev-libs/boehm-gc[static-libs] dependency problem,  check the issue: https://github.com/manastech/crystal/issues/1382
+DEPEND="
+	sys-devel/llvm:${LLVM_MAX_SLOT}
+	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.25.0-verbose.patch
+	"${FILESDIR}"/${PN}-0.24.2-gentoo-tests-sandbox.patch
+	"${FILESDIR}"/${PN}-0.24.2-gentoo-tests-network-sandbox.patch
+	"${FILESDIR}"/${PN}-0.26.0-gentoo-tests-network-sandbox-2.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 docs
+}
+
+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 docs/.
+	fi
+
+	newbashcomp etc/completion.bash ${PN}
+}

diff --git a/dev-lang/crystal/files/crystal-0.26.0-gentoo-tests-network-sandbox-2.patch b/dev-lang/crystal/files/crystal-0.26.0-gentoo-tests-network-sandbox-2.patch
new file mode 100644
index 00000000000..bfe23f9ade8
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.26.0-gentoo-tests-network-sandbox-2.patch
@@ -0,0 +1,23 @@
+--- a/spec/std/http/server/server_spec.cr
++++ b/spec/std/http/server/server_spec.cr
+@@ -381,7 +381,9 @@ module HTTP
+     end
+ 
+     describe "#bind_ssl" do
+-      it "binds SSL server context" do
++      # gentoo's FEATURES=network-sandbox blocks external network:
++      #   connect: Connection timed out (Errno)
++      pending "binds SSL server context" do
+         server = Server.new do |context|
+           context.response.puts "Test Server (#{context.request.headers["Host"]?})"
+           context.response.close
+--- a/spec/std/http/web_socket_spec.cr
++++ b/spec/std/http/web_socket_spec.cr
+@@ -335,4 +335,6 @@ describe HTTP::WebSocket do
+   end
+ 
+-  it "negotiates over HTTPS correctly" do
++  # gentoo's FEATURES=network-sandbox blocks external network:
++  #   connect: Connection timed out (Errno)
++  pending "negotiates over HTTPS correctly" do
+     address_chan = Channel(Socket::IPAddress).new


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2018-09-02 10:53 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2018-09-02 10:53 UTC (permalink / raw
  To: gentoo-commits

commit:     d3dd554487c3b4517f5e7c4b6cfdb12fe1b19c0f
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  2 09:53:10 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Sep  2 10:53:24 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3dd5544

dev-lang/crystal: bump up to 0.26.1

Package-Manager: Portage-2.3.48, Repoman-2.3.10

 dev-lang/crystal/Manifest                          |   3 +
 dev-lang/crystal/crystal-0.26.1.ebuild             | 106 +++++++++++++++++++++
 ...tal-0.26.1-gentoo-tests-network-sandbox-3.patch |  26 +++++
 .../crystal-0.26.1-gentoo-tests-sandbox.patch      |  22 +++++
 4 files changed, 157 insertions(+)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 7eda964d98e..04860184158 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -6,4 +6,7 @@ DIST crystal-0.24.2.tar.gz 1745462 BLAKE2B 8f3d5cf9e274558a5622aae44c6f7d54d0b30
 DIST crystal-0.25.0.tar.gz 1957613 BLAKE2B 4c2467e39a9bc6745b74c00f755490a2f726e775c2a0d15562af27d2a6771c95c44f79e6b59ad45f61a59566529854d75c980c55a6886538fa98663879477258 SHA512 20f2864919c7710e5aee8112e1c6ab54a2e50b244ac63d374edfed41ab659b11c062f76dbfc38e763a08bdbea9e0a39f3b5cac5e00bf453be3a31d3b0a023917
 DIST crystal-0.25.1-1-linux-i686.tar.gz 39882213 BLAKE2B 35d0045a72ced6ba7348105c9b88e564f85b075af78decd52c40b47b338cd1c7c1b01565430f9aa21251cfd1266041268e037eb616a24475acfa22b1b8ae1448 SHA512 79601b6c586184e064798c4daca3de77f7c81fbc4d0062a558824533f9272f04899c0041b17dce072757f20f7940c99303c6ff1143448b6452e8216ca4bb43dd
 DIST crystal-0.25.1-1-linux-x86_64.tar.gz 38004788 BLAKE2B 580ccad2227e6467c4c61ce9adf4aeb99c55f694c71a02b9d959c31deba66e428f5c5e7d920dd42d01524ccaef04b9eae3b068f2c6ff16414fa3fd36f462414f SHA512 ec33781b767f8f9f0a6d00f73109fbe9d683a23fca9cc8b462acda3eb024fc970d0daf8c36fb2239297f77510d2e3f544f58ec1cf53d08ea856bc6307f81d1dd
+DIST crystal-0.26.0-1-linux-i686.tar.gz 39814913 BLAKE2B 8c73e33b52a7c5d9ae24ead5d5adbd038f63fc76f904b20ec8dc4da1b1ed6f53283970b06ec7af7ecac7f58c55dc911fe56bcb9897a44a86fc88deb43249a5af SHA512 f0ba602a07b608ac7b3c0f841cbcc70b44d42ce87f405ce9d1a09df7b8c1764e13bca9471b2499a51d22cebc8228e949086893fd3c946d17e7b36ae4e8ac4f75
+DIST crystal-0.26.0-1-linux-x86_64.tar.gz 37986465 BLAKE2B dc8e05519653f82d09d8bd3a84fedd9f4720880bc61a110709643850bbcfa95738292cca8168a8c5c550abe9b178ce28fd59321c66862a1cc81007cc1cb22223 SHA512 c252d2d585fe49c755397b8f8c7965c855e8f8102598b34a83cc6e5ae821a22f3dccce8b7787dd0f00fa39fad3d2dffc23c6105c9cefe525da7855550c790ab2
 DIST crystal-0.26.0.tar.gz 1992091 BLAKE2B dfc96e3e9a71dbec07235a982bbb34ea81bb3adbb39f6c8f8c9bb855ac97e5faf4d47d4a78901317798941b84117399aeee6af53c6c06ae21b9504ca617a2899 SHA512 45a62a2496d477cd72666e98b36bdcbfff958a8f5f0e71f04101f2ba72fc87117d53c8c098a72edb55e9be192b68b73529d5f76e4c660033332ed6e88a372519
+DIST crystal-0.26.1.tar.gz 1994987 BLAKE2B 2292fbdf119e181313000e035802581ae206083aa5c9651a01e131d74e701ea75dc713b44274769decfc9f0f300d8fc2e6c24a94f60380b79c3cdb1a10e73369 SHA512 5e020b0f262f9bedaaae60010f669d7987a77d3416bf0dd057e29eb11adbe8fceb1c4f55a822e623d32e302a01ccc99218d2c3fe474d4ce0dde4312c196ccfa6

diff --git a/dev-lang/crystal/crystal-0.26.1.ebuild b/dev-lang/crystal/crystal-0.26.1.ebuild
new file mode 100644
index 00000000000..d02b47f0788
--- /dev/null
+++ b/dev-lang/crystal/crystal-0.26.1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
+
+BV=0.26.0
+BV_AMD64=${BV}-1-linux-x86_64
+BV_X86=${BV}-1-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/${BV/}/crystal-${BV_AMD64}.tar.gz )
+	x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV}/crystal-${BV_X86}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc debug examples blocking-stdio-hack +xml +yaml"
+
+LLVM_MAX_SLOT=6
+
+# dev-libs/boehm-gc[static-libs] dependency problem,  check the issue: https://github.com/manastech/crystal/issues/1382
+DEPEND="
+	sys-devel/llvm:${LLVM_MAX_SLOT}
+	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.25.0-verbose.patch
+	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
+	"${FILESDIR}"/${PN}-0.24.2-gentoo-tests-network-sandbox.patch
+	"${FILESDIR}"/${PN}-0.26.0-gentoo-tests-network-sandbox-2.patch
+	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-network-sandbox-3.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 docs
+}
+
+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 docs/.
+	fi
+
+	newbashcomp etc/completion.bash ${PN}
+}

diff --git a/dev-lang/crystal/files/crystal-0.26.1-gentoo-tests-network-sandbox-3.patch b/dev-lang/crystal/files/crystal-0.26.1-gentoo-tests-network-sandbox-3.patch
new file mode 100644
index 00000000000..eb1b84ce618
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.26.1-gentoo-tests-network-sandbox-3.patch
@@ -0,0 +1,26 @@
+diff --git a/spec/std/http/server/server_spec.cr b/spec/std/http/server/server_spec.cr
+index 9de0c3f..59882db 100644
+--- a/spec/std/http/server/server_spec.cr
++++ b/spec/std/http/server/server_spec.cr
+@@ -400,7 +400,9 @@ module HTTP
+     end
+ 
+     describe "#bind_tls" do
+-      it "binds SSL server context" do
++      # gentoo's FEATURES=network-sandbox blocks external network:
++      #   connect: Connection timed out (Errno)
++      pending "binds SSL server context" do
+         server = Server.new do |context|
+           context.response.puts "Test Server (#{context.request.headers["Host"]?})"
+           context.response.close
+@@ -512,7 +514,9 @@ module HTTP
+       end
+     {% end %}
+ 
+-    it "handles exception during SSL handshake (#6577)" do
++    # gentoo's FEATURES=network-sandbox blocks external network:
++    #   connect: Connection timed out (Errno)
++    pending "handles exception during SSL handshake (#6577)" do
+       server = SilentErrorHTTPServer.new do |context|
+         context.response.print "ok"
+         context.response.close

diff --git a/dev-lang/crystal/files/crystal-0.26.1-gentoo-tests-sandbox.patch b/dev-lang/crystal/files/crystal-0.26.1-gentoo-tests-sandbox.patch
new file mode 100644
index 00000000000..cab165c3905
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.26.1-gentoo-tests-sandbox.patch
@@ -0,0 +1,22 @@
+--- a/spec/std/file_spec.cr
++++ b/spec/std/file_spec.cr
+@@ -1164,3 +1164,4 @@ describe "File" do
+     # TODO: there is no file which is reliably unwritable on windows
+-    pending_win32 "raises if file cannot be accessed" do
++    # On linux(or sandbox?) it's "Permission denied", not "Operation not permitted"
++    pending "raises if file cannot be accessed" do
+       expect_raises Errno, "Operation not permitted" do
+--- a/spec/std/process_spec.cr
++++ b/spec/std/process_spec.cr
+@@ -135,3 +135,4 @@ describe Process do
+   describe "environ" do
+-    it "clears the environment" do
++    #gentoo's sandbox keeps sandbox environment
++    pending "clears the environment" do
+       value = Process.run("env", clear_env: true) do |proc|
+@@ -142,3 +143,4 @@ describe Process do
+ 
+-    it "sets an environment variable" do
++    #gentoo's sandbox keeps sandbox environment
++    pending "sets an environment variable" do
+       env = {"FOO" => "bar"}


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2018-12-23 13:26 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2018-12-23 13:26 UTC (permalink / raw
  To: gentoo-commits

commit:     ce14d2a533200d2917090e18b324d3bbf914ea18
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 23 13:25:47 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Dec 23 13:26:04 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce14d2a5

dev-lang/crystal: disable broken tests

networking tests don't work with FEATURES=network-sandbox
unix tests don't work on paths more than 107 bytes (crystal limitation)

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-lang/crystal/crystal-0.27.0.ebuild             |  3 +
 .../crystal-0.27.0-gentoo-tests-long-unix.patch    | 90 ++++++++++++++++++++++
 ...ystal-0.27.0-gentoo-tests-network-sandbox.patch | 44 +++++++++++
 .../files/crystal-0.27.0-max-age-0-test.patch      | 14 ++++
 4 files changed, 151 insertions(+)

diff --git a/dev-lang/crystal/crystal-0.27.0.ebuild b/dev-lang/crystal/crystal-0.27.0.ebuild
index b7dcd5f70cf..763582835a2 100644
--- a/dev-lang/crystal/crystal-0.27.0.ebuild
+++ b/dev-lang/crystal/crystal-0.27.0.ebuild
@@ -44,6 +44,9 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
 	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-network-sandbox-3.patch
 	"${FILESDIR}"/${PN}-0.27.0-extra-spec-flags.patch
+	"${FILESDIR}"/${PN}-0.27.0-max-age-0-test.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-network-sandbox.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
 )
 
 src_prepare() {

diff --git a/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-long-unix.patch b/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-long-unix.patch
new file mode 100644
index 00000000000..51b049ee980
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-long-unix.patch
@@ -0,0 +1,90 @@
+--- a/spec/std/socket/unix_server_spec.cr
++++ b/spec/std/socket/unix_server_spec.cr
+@@ -14,7 +14,9 @@ describe UNIXServer do
+       end
+     end
+ 
+-    it "creates the socket file" do
++    # On large non-standard temp paths the test fails as:
++    #    Path size exceeds the maximum size of 107 bytes
++    pending "creates the socket file" do
+       with_tempfile("unix_server.sock") do |path|
+         UNIXServer.open(path) do
+           File.exists?(path).should be_true
+@@ -24,7 +26,9 @@ describe UNIXServer do
+       end
+     end
+ 
+-    it "deletes socket file on close" do
++    # On large non-standard temp paths the test fails as:
++    #    Path size exceeds the maximum size of 107 bytes
++    pending "deletes socket file on close" do
+       with_tempfile("unix_server-close.sock") do |path|
+         server = UNIXServer.new(path)
+         server.close
+@@ -33,7 +37,9 @@ describe UNIXServer do
+       end
+     end
+ 
+-    it "raises when socket file already exists" do
++    # On large non-standard temp paths the test fails as:
++    #    Path size exceeds the maximum size of 107 bytes
++    pending "raises when socket file already exists" do
+       with_tempfile("unix_server-twice.sock") do |path|
+         server = UNIXServer.new(path)
+ 
+@@ -45,7 +51,9 @@ describe UNIXServer do
+       end
+     end
+ 
+-    it "won't delete existing file on bind failure" do
++    # On large non-standard temp paths the test fails as:
++    #    Path size exceeds the maximum size of 107 bytes
++    pending "won't delete existing file on bind failure" do
+       with_tempfile("unix_server-exist.sock") do |path|
+         File.write(path, "")
+         File.exists?(path).should be_true
+@@ -60,7 +68,9 @@ describe UNIXServer do
+   end
+ 
+   describe "accept" do
+-    it "returns the client UNIXSocket" do
++    # On large non-standard temp paths the test fails as:
++    #    Path size exceeds the maximum size of 107 bytes
++    pending "returns the client UNIXSocket" do
+       with_tempfile("unix_server-accept.sock") do |path|
+         UNIXServer.open(path) do |server|
+           UNIXSocket.open(path) do |_|
+@@ -72,7 +82,9 @@ describe UNIXServer do
+       end
+     end
+ 
+-    it "raises when server is closed" do
++    # On large non-standard temp paths the test fails as:
++    #    Path size exceeds the maximum size of 107 bytes
++    pending "raises when server is closed" do
+       with_tempfile("unix_server-closed.sock") do |path|
+         server = UNIXServer.new(path)
+         exception = nil
+@@ -97,7 +109,9 @@ describe UNIXServer do
+   end
+ 
+   describe "accept?" do
+-    it "returns the client UNIXSocket" do
++    # On large non-standard temp paths the test fails as:
++    #    Path size exceeds the maximum size of 107 bytes
++    pending "returns the client UNIXSocket" do
+       with_tempfile("unix_server-accept_.sock") do |path|
+         UNIXServer.open(path) do |server|
+           UNIXSocket.open(path) do |_|
+@@ -109,7 +123,9 @@ describe UNIXServer do
+       end
+     end
+ 
+-    it "returns nil when server is closed" do
++    # On large non-standard temp paths the test fails as:
++    #    Path size exceeds the maximum size of 107 bytes
++    pending "returns nil when server is closed" do
+       with_tempfile("unix_server-accept2.sock") do |path|
+         server = UNIXServer.new(path)
+         ret = :initial

diff --git a/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-network-sandbox.patch b/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-network-sandbox.patch
new file mode 100644
index 00000000000..0ba0f18f73d
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-network-sandbox.patch
@@ -0,0 +1,44 @@
+--- a/spec/std/socket/tcp_server_spec.cr
++++ b/spec/std/socket/tcp_server_spec.cr
+@@ -76,13 +76,17 @@ describe TCPServer do
+         TCPServer.new("localhost", unused_local_port)
+       end
+ 
+-      it "raises when host doesn't exist" do
++      # gentoo's FEATURES=network-sandbox blocks external network:
++      #   Socket::Error: getaddrinfo: Temporary failure in name resolution
++      pending "raises when host doesn't exist" do
+         expect_raises(Socket::Error, "No address") do
+           TCPServer.new("doesnotexist.example.org.", 12345)
+         end
+       end
+ 
+-      it "raises (rather than segfault on darwin) when host doesn't exist and port is 0" do
++      # gentoo's FEATURES=network-sandbox blocks external network:
++      #   Socket::Error: getaddrinfo: Temporary failure in name resolution
++      pending "raises (rather than segfault on darwin) when host doesn't exist and port is 0" do
+         expect_raises(Socket::Error, "No address") do
+           TCPServer.new("doesnotexist.example.org.", 0)
+         end
+--- a/spec/std/socket/tcp_socket_spec.cr
++++ b/spec/std/socket/tcp_socket_spec.cr
+@@ -56,13 +56,17 @@ describe TCPSocket do
+         end
+       end
+ 
+-      it "raises when host doesn't exist" do
++      # gentoo's FEATURES=network-sandbox blocks external network:
++      #   Socket::Error: getaddrinfo: Temporary failure in name resolution
++      pending "raises when host doesn't exist" do
+         expect_raises(Socket::Error, "No address") do
+           TCPSocket.new("doesnotexist.example.org.", 12345)
+         end
+       end
+ 
+-      it "raises (rather than segfault on darwin) when host doesn't exist and port is 0" do
++      # gentoo's FEATURES=network-sandbox blocks external network:
++      #   Socket::Error: getaddrinfo: Temporary failure in name resolution
++      pending "raises (rather than segfault on darwin) when host doesn't exist and port is 0" do
+         expect_raises(Socket::Error, "No address") do
+           TCPSocket.new("doesnotexist.example.org.", 0)
+         end

diff --git a/dev-lang/crystal/files/crystal-0.27.0-max-age-0-test.patch b/dev-lang/crystal/files/crystal-0.27.0-max-age-0-test.patch
new file mode 100644
index 00000000000..d78927ab3ee
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.27.0-max-age-0-test.patch
@@ -0,0 +1,14 @@
+--- a/spec/std/http/cookie_spec.cr
++++ b/spec/std/http/cookie_spec.cr
+@@ -150,7 +150,10 @@ module HTTP
+         parse_set_cookie("a=1; domain=127.0.0.1; path=/; HttpOnly").domain.should eq "127.0.0.1"
+       end
+ 
+-      it "parse max-age as seconds from Time.now" do
++      # unstable test: sometimes 'now - max-age=0' == 0.0:
++      #    Failure/Error: delta.should be > 0.seconds
++      #    Expected 00:00:00 to be > 00:00:00
++      pending "parse max-age as seconds from Time.now" do
+         cookie = parse_set_cookie("a=1; max-age=10")
+         delta = cookie.expires.not_nil! - Time.now
+         delta.should be > 9.seconds


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2018-12-23 14:23 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2018-12-23 14:23 UTC (permalink / raw
  To: gentoo-commits

commit:     d913d22dc3c9b4fb2f13461be4fd26c76fbc7a76
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 23 14:23:27 2018 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Dec 23 14:23:46 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d913d22d

dev-lang/crystal: duisable more unix socket tests

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-lang/crystal/crystal-0.27.0.ebuild                      |  2 ++
 .../files/crystal-0.27.0-gentoo-tests-long-unix-2.patch     | 13 +++++++++++++
 dev-lang/crystal/files/crystal-0.27.0-tcp-server-test.patch | 12 ++++++++++++
 3 files changed, 27 insertions(+)

diff --git a/dev-lang/crystal/crystal-0.27.0.ebuild b/dev-lang/crystal/crystal-0.27.0.ebuild
index 763582835a2..cb040059d96 100644
--- a/dev-lang/crystal/crystal-0.27.0.ebuild
+++ b/dev-lang/crystal/crystal-0.27.0.ebuild
@@ -47,6 +47,8 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-0.27.0-max-age-0-test.patch
 	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-network-sandbox.patch
 	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix-2.patch
+	"${FILESDIR}"/${PN}-0.27.0-tcp-server-test.patch
 )
 
 src_prepare() {

diff --git a/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-long-unix-2.patch b/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-long-unix-2.patch
new file mode 100644
index 00000000000..61cec14afcb
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.27.0-gentoo-tests-long-unix-2.patch
@@ -0,0 +1,13 @@
+--- a/spec/std/socket/unix_socket_spec.cr
++++ b/spec/std/socket/unix_socket_spec.cr
+@@ -37,7 +37,9 @@ describe UNIXSocket do
+     end
+   end
+ 
+-  it "sync flag after accept" do
++  # On large non-standard temp paths the test fails as:
++  #    Path size exceeds the maximum size of 107 bytes
++  pending "sync flag after accept" do
+     with_tempfile("unix_socket-accept.sock") do |path|
+       UNIXServer.open(path) do |server|
+         UNIXSocket.open(path) do |client|

diff --git a/dev-lang/crystal/files/crystal-0.27.0-tcp-server-test.patch b/dev-lang/crystal/files/crystal-0.27.0-tcp-server-test.patch
new file mode 100644
index 00000000000..8f61c8aeef4
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.27.0-tcp-server-test.patch
@@ -0,0 +1,12 @@
+--- a/spec/std/http/server/server_spec.cr
++++ b/spec/std/http/server/server_spec.cr
+@@ -524,7 +524,8 @@ module HTTP
+     end
+ 
+     describe "#close" do
+-      it "closes gracefully" do
++      # fails under gentoo's sandbox
++      pending "closes gracefully" do
+         server = Server.new do |context|
+           context.response.flush
+           context.response.puts "foo"


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2019-01-31  7:21 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2019-01-31  7:21 UTC (permalink / raw
  To: gentoo-commits

commit:     fd96ea70c618437312b122ae3cf5c9922f1f2565
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Jan 30 22:49:03 2019 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Jan 31 07:20:25 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fd96ea70

dev-lang/crystal: bump up to 0.27.1

Package-Manager: Portage-2.3.59, Repoman-2.3.12
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-lang/crystal/Manifest                          |   1 +
 dev-lang/crystal/crystal-0.27.1.ebuild             | 121 +++++++++++++++++++++
 .../crystal/files/crystal-0.27.1-verbose.patch     |   7 ++
 3 files changed, 129 insertions(+)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 7c76aef7d30..db092cd4722 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -13,3 +13,4 @@ DIST crystal-0.26.1.tar.gz 1994987 BLAKE2B 2292fbdf119e181313000e035802581ae2060
 DIST crystal-0.27.0-1-linux-i686.tar.gz 39751745 BLAKE2B 22adf22a2e423f4b0fddda1d8d9bbfb68a4b51f18da9705b6515a500610781251561577dd25c6509aa2b6860b1b329bc7e3d213743330b91206b50239e053a89 SHA512 4fb819a67f3e2c965b454af53cf0bad9606a6a13f85f1bfbe59057291ea293099892344cd31127f5b35e3b25fc6e3f591bda508587fc32f5ef1433aeff0ca706
 DIST crystal-0.27.0-1-linux-x86_64.tar.gz 37933811 BLAKE2B 76bb57b556f14ae8ce219ef490e58ff03571f36fcb4343672ff10ddd6e275e9c5c26a028d63f0592c1a081f2f5dc8241106d8a99add1a7936f52b9e3a57f96e6 SHA512 c403c4080830b928621da07f409ba5433109ee0fc81589f87e79d2e04fcbce8facfa205b7e8c78ab9bb772b4444c938b3bcf691596ee0b2d54c3f3d97150e008
 DIST crystal-0.27.0.tar.gz 2025777 BLAKE2B 0a5cc02a516586b033c65efd8e28a13ac0ed67fddbd1a1f0a88a484dff825bec8f6b03b16938c750e99e0c7c1c12a3fd3fc87e61d038b25b7707e0e7f2913fae SHA512 02b0e1d43d699d1dd91f4b979c8ab8909264e5f1fcc344f6110bebb808c0ee764a943368cce9d33a258adb9631ed4f445e1f771d5a9e50fcd337fc8b319616cf
+DIST crystal-0.27.1.tar.gz 2061304 BLAKE2B 1776525925a25f72cf83f1a6076ab8b2bf1602c9d8c6a1fff8869c200faa35de008655f046ff60fb3733c8c3577f3544184080ee39acedfde006b9fd63d6c844 SHA512 8c6dd9489aff5d4b3e119ef6f531a3248c20f3da97c44dd3febe551adc67f5d87aa4f7679cbcc0dcde0374f3f5a3c523da6dff32a7ac95a9db1406102e980822

diff --git a/dev-lang/crystal/crystal-0.27.1.ebuild b/dev-lang/crystal/crystal-0.27.1.ebuild
new file mode 100644
index 00000000000..d1888dfde89
--- /dev/null
+++ b/dev-lang/crystal/crystal-0.27.1.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
+
+BV=0.27.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/${BV/-*}/crystal-${BV_AMD64}.tar.gz )
+	x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_X86}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc debug examples blocking-stdio-hack +xml +yaml"
+
+# Not compatible with llvm-7
+LLVM_MAX_SLOT=6
+
+# dev-libs/boehm-gc[static-libs] dependency problem,  check the issue: https://github.com/manastech/crystal/issues/1382
+DEPEND="
+	sys-devel/llvm:${LLVM_MAX_SLOT}
+	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.27.1-verbose.patch
+	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
+	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-network-sandbox-3.patch
+	"${FILESDIR}"/${PN}-0.27.0-extra-spec-flags.patch
+	"${FILESDIR}"/${PN}-0.27.0-max-age-0-test.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix-2.patch
+	"${FILESDIR}"/${PN}-0.27.0-tcp-server-test.patch
+)
+
+src_prepare() {
+	default
+
+	use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch
+}
+
+src_compile() {
+	local bootstrap_path=${WORKDIR}/${PN}-${BV}/bin
+	if [[ ! -d ${bootstrap_path} ]]; then
+		eerror "Binary tarball does not contain expected directory:"
+		die "'${bootstrap_path}' path does not exist."
+	fi
+
+	emake \
+		$(usex debug "" release=1) \
+		progress=true \
+		stats=1 \
+		threads=$(makeopts_jobs) \
+		verbose=1 \
+		\
+		CC=$(tc-getCC) \
+		CXX=$(tc-getCXX) \
+		AR=$(tc-getAR) \
+		\
+		PATH="${bootstrap_path}:${PATH}" \
+		CRYSTAL_PATH=src \
+		CRYSTAL_CONFIG_VERSION=${PV} \
+		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
+	use doc && emake docs
+}
+
+src_test() {
+	# EXTRA_SPEC_FLAGS is useful to debug individual tests
+	# as part of full build:
+	#    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal
+	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} \
+		\
+		"EXTRA_SPEC_FLAGS=${EXTRA_SPEC_FLAGS}"
+}
+
+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 docs/.
+	fi
+
+	newbashcomp etc/completion.bash ${PN}
+}

diff --git a/dev-lang/crystal/files/crystal-0.27.1-verbose.patch b/dev-lang/crystal/files/crystal-0.27.1-verbose.patch
new file mode 100644
index 00000000000..33c3c5d61c4
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.27.1-verbose.patch
@@ -0,0 +1,7 @@
+--- a/Makefile
++++ b/Makefile
+@@ -29,3 +29,3 @@ SOURCES := $(shell find src -name '*.cr')
+ SPEC_SOURCES := $(shell find spec -name '*.cr')
+-override FLAGS += -D preview_overflow -D compiler_rt $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )
++override FLAGS += -D preview_overflow -D compiler_rt $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )$(if $(verbose),--verbose )
+ SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2020-04-07 21:47 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2020-04-07 21:47 UTC (permalink / raw
  To: gentoo-commits

commit:     e638e3d755bdd6c83363824ee282295cf28cb644
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  7 21:46:43 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Apr  7 21:47:20 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e638e3d7

dev-lang/crystal: bump up to 0.34.0

Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-lang/crystal/Manifest                          |   3 +
 dev-lang/crystal/crystal-0.34.0.ebuild             | 121 +++++++++++++++++++++
 .../crystal/files/crystal-0.34.0-no-usr-lib.patch  |  14 +++
 3 files changed, 138 insertions(+)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index f2003bb9de6..d0d69e11e9a 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -4,3 +4,6 @@ DIST crystal-0.32.1.tar.gz 2225383 BLAKE2B 81cdda508945ebea481c3ad784ecdccffe25e
 DIST crystal-0.33.0-1-linux-i686.tar.gz 29627750 BLAKE2B 284c300eb57e9192c367b1692c95a8da584820ecd068515cf59174106bdcd4341033e68ecdcc64a263dcf1c69ca58f9403e9b4b8e166c86b1b6747e4e0d2ea92 SHA512 8ff065555e5782a84575ddc8210f92bc6d5702692e2674be4fcef470dfeff3ec325954eb665b222cb3f332e335cae4ae49cc06ffe4ce939519d0947225b452b4
 DIST crystal-0.33.0-1-linux-x86_64.tar.gz 27553242 BLAKE2B c24ab3e1577c33de9e9de2fa03f0fe831821b70b72ee9fb421eab9aed8b0ba357547160be9fff20c30b2d52e6c6d75bbde19dc322638c5c3f33ba2aa14dbf4c4 SHA512 7c815335ff882effd9dfc22cbeec6cee6e014805bf048bedf4476b1ecdf3a87bd8d53543c78be3493f937659a88041cd5370814eba043c81f23e7ef707ccd834
 DIST crystal-0.33.0.tar.gz 2242162 BLAKE2B 0d9dbdd230bb190209772fafaeb1d59008cbe90b0bd33f851886bf90e7ac497c0bcef7609d6295dd4a4bad213fb687dea3d16c42ebe3bc92b3e06df156c53570 SHA512 41f518ec5c8f2f2cffb84105e0cc5096d4ba7ef64887ad0089aa37109fa5fa8e28747fe4f4ca8a74012e7b77d8c7a9d72cd9da787a330a4a62b5e55b40f0e57b
+DIST crystal-0.34.0-1-linux-i686.tar.gz 30161592 BLAKE2B b53dd3c3fb36ae7654396bcca305dbdd32c90f72e3e549fd054517230df3fdadcc07056d4a53c600e1fbae14ce79b66268191a3a01f27e1d625451865a414774 SHA512 47874a6a349dcf42b92532c4d454f8c65f2f94d78240f2a5baa865063ed373410be0ff5e457d4d1c3483ce8965e894fa918973fa03ee934f226a56a8a544f8d0
+DIST crystal-0.34.0-1-linux-x86_64.tar.gz 28036344 BLAKE2B dbd9305cadfda3a9d072672c91a0a7e9b230507d69c84735af900c40e602dbd6777b48ddce679935b87cff669d0534a8d65b09dc0fa6d8167f66117ba8468f8a SHA512 291713acb6291c106e60c2b7bcdab33a6df3d6f464c81392ea340b25d01d301c743c0d81f29eb9b32a2099203775a8fc2df9617f90c28699e4864bee16f4252e
+DIST crystal-0.34.0.tar.gz 2270363 BLAKE2B bef2f09ef45ed9c7c9ffc5bcc9e8d6516c799b60ae3d87d5512fcd36634231091c1c534a708059362c3e5bc9db36a377dffd2dbca4290964362ea8740345e4f2 SHA512 6167ca5974d02167fe695cc51fe8ef95e56076a2af88eae39a12b07930b96ca0b30d53fd7c6e2296139d89a1c7eacfce5326f25a8fa3487cdb446ab592723f66

diff --git a/dev-lang/crystal/crystal-0.34.0.ebuild b/dev-lang/crystal/crystal-0.34.0.ebuild
new file mode 100644
index 00000000000..65305e025a7
--- /dev/null
+++ b/dev-lang/crystal/crystal-0.34.0.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
+
+BV=${PV}-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/${BV/-*}/crystal-${BV_AMD64}.tar.gz )
+	x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_X86}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc debug examples blocking-stdio-hack +xml +yaml"
+
+RESTRICT=test # not stable for day-to-day runs
+
+LLVM_MAX_SLOT=10
+
+# dev-libs/boehm-gc[static-libs] dependency problem,  check the issue: https://github.com/manastech/crystal/issues/1382
+DEPEND="
+	sys-devel/llvm:${LLVM_MAX_SLOT}
+	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.31.0-verbose.patch
+	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
+	"${FILESDIR}"/${PN}-0.27.0-extra-spec-flags.patch
+	#"${FILESDIR}"/${PN}-0.27.0-max-age-0-test.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix-2.patch
+	"${FILESDIR}"/${PN}-0.34.0-no-usr-lib.patch
+)
+
+src_prepare() {
+	default
+
+	use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch
+}
+
+src_compile() {
+	local bootstrap_path=${WORKDIR}/${PN}-${BV}/bin
+	if [[ ! -d ${bootstrap_path} ]]; then
+		eerror "Binary tarball does not contain expected directory:"
+		die "'${bootstrap_path}' path does not exist."
+	fi
+
+	emake \
+		$(usex debug "" release=1) \
+		progress=true \
+		stats=1 \
+		threads=$(makeopts_jobs) \
+		verbose=1 \
+		\
+		CC=$(tc-getCC) \
+		CXX=$(tc-getCXX) \
+		AR=$(tc-getAR) \
+		\
+		PATH="${bootstrap_path}:${PATH}" \
+		CRYSTAL_PATH=src \
+		CRYSTAL_CONFIG_VERSION=${PV} \
+		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
+	use doc && emake docs
+}
+
+src_test() {
+	# EXTRA_SPEC_FLAGS is useful to debug individual tests
+	# as part of full build:
+	#    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal
+	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} \
+		\
+		"EXTRA_SPEC_FLAGS=${EXTRA_SPEC_FLAGS}"
+}
+
+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 docs/.
+	fi
+
+	newbashcomp etc/completion.bash ${PN}
+}

diff --git a/dev-lang/crystal/files/crystal-0.34.0-no-usr-lib.patch b/dev-lang/crystal/files/crystal-0.34.0-no-usr-lib.patch
new file mode 100644
index 00000000000..4dc0b42d90a
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-0.34.0-no-usr-lib.patch
@@ -0,0 +1,14 @@
+On amd64 linux /usr/lib does not match default 64-bit ABI.
+
+Let's rely on default compiler and linker paths instead.
+--- a/src/compiler/crystal/codegen/link.cr
++++ b/src/compiler/crystal/codegen/link.cr
+@@ -106,7 +106,7 @@ module Crystal
+ 
+     private def lib_flags_posix
+       library_path = ENV["LIBRARY_PATH"]?.try(&.split(':', remove_empty: true)) ||
+-                     ["/usr/lib", "/usr/local/lib"]
++                     [] of String
+       has_pkg_config = nil
+ 
+       String.build do |flags|


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2021-07-15  9:28 Sergei Trofimovich
  0 siblings, 0 replies; 16+ messages in thread
From: Sergei Trofimovich @ 2021-07-15  9:28 UTC (permalink / raw
  To: gentoo-commits

commit:     2a04c24cc9a3d663e0690d2aaddedcc27b54d750
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 15 09:23:08 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Jul 15 09:28:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a04c24c

dev-lang/crystal: bump up to 1.1.0

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 dev-lang/crystal/Manifest                          |   3 +
 dev-lang/crystal/crystal-1.1.0.ebuild              | 123 +++++++++++++++++++++
 dev-lang/crystal/files/crystal-1.1.0-verbose.patch |   7 ++
 3 files changed, 133 insertions(+)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 297894012d7..fde8c31a896 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -1,3 +1,6 @@
 DIST crystal-1.0.0-1-linux-i686.tar.gz 30753871 BLAKE2B 247d8327c001ef8e847d981ab771964faa90b5acb1dc1336288b4c401cd039bb259e22945aabae73b6e23cf6babec288a25e4490a860e9a6c5cc8076afb2e7d3 SHA512 36f48fbc44f254588b449c6c80dd47e8152e1e31785ce0111dcd4da9eed57c12aac7427807f4a60d86a9841726e197a6d08582438bffcc4ed16eaad35e6ea886
 DIST crystal-1.0.0-1-linux-x86_64.tar.gz 28189455 BLAKE2B 8313d201e8b8363f3f5025ab2bf2d44a981ca7185686474aa677d38986428b54e9d28fef01e12205ab58db67b516a043582a9965f31972bfa2ece5ff8bd640a0 SHA512 bbfe5010d2e620a58b25a3f7133f0f15c212ed085f020bbb8da39aca882d89c077068343fe182995ec09b436daaf8d252db232bf7fe3af087a5ab0728e0a758f
 DIST crystal-1.0.0.tar.gz 2435212 BLAKE2B 3204162abae8ef2e3e7a7a294f001b3906562c17121bb3646c1d1bac0d7b98433c77d9c8101bae9b3041996794784b8fce5dd3dfded33a27c8d229bc3b557c0c SHA512 aa56eb0131aecad15bebc6ef0ce2f34f0992a8362441dd662a518ddbc5e3818762c1c7228bc5b06aafdb8815e59d791654add9da8ba9a47a6a4fd34f6b039a8b
+DIST crystal-1.1.0-1-linux-i686.tar.gz 30747190 BLAKE2B 7fe29248ae69c81cb0c79419488c5b544bb55810894ac1d7f276ccdf2d2d98c7c2bc4f8c007214e5ffd18ee39bdf6983f33b13c08f012105fce714eeaa18fac9 SHA512 df267250971c11d1e2f4f869a14f7b2f1e5a32cf15c407a0ee9291aeb4ddc21241c3f21c7706ee2305dfbf4ac645681a06bb70a6ee9246968a30f59b7595ea8a
+DIST crystal-1.1.0-1-linux-x86_64.tar.gz 27998777 BLAKE2B 06be8a51b28266b25f1a3629b1a1ac6f3878aacdd4ca4019ac201369ca0507f3ed27bfea46ea7d8d4dfa67888268a8e027586bb32e9964d4754661f43e36ac12 SHA512 8c4542ce0623e459b61591b7bd13f416ee30c89913ce827830e570225c72ec79ad5466d414b05f520d384f04363f11964ff8bf158f0ae798da3864208655319e
+DIST crystal-1.1.0.tar.gz 2476748 BLAKE2B 2874da651a8b4454c6a34b00ac4ef93be6beaabe01ff66aaac86583a9d9c1baccde9473358d70d78490b367db3a307af3b5219af6751c1d83cb5084e74955197 SHA512 fcd14338c4c6cb9189cfb9d4d93af7feab806a49e10b9c83399f9252f0c5f3488605141f09adef82d48343eab5653b754b9196fb659590df8d4deb2c4b6499f4

diff --git a/dev-lang/crystal/crystal-1.1.0.ebuild b/dev-lang/crystal/crystal-1.1.0.ebuild
new file mode 100644
index 00000000000..7af64a71141
--- /dev/null
+++ b/dev-lang/crystal/crystal-1.1.0.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
+
+BV=${PV}-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/${BV/-*}/crystal-${BV_AMD64}.tar.gz )
+	x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_X86}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc debug examples blocking-stdio-hack +xml +yaml"
+
+RESTRICT=test # not stable for day-to-day runs
+
+LLVM_MAX_SLOT=11
+
+DEPEND="
+	sys-devel/llvm:${LLVM_MAX_SLOT}
+	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}-1.1.0-verbose.patch
+	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
+	"${FILESDIR}"/${PN}-0.27.0-extra-spec-flags.patch
+	#"${FILESDIR}"/${PN}-0.27.0-max-age-0-test.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix-2.patch
+)
+
+src_prepare() {
+	default
+
+	use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch
+}
+
+src_compile() {
+	local bootstrap_path=${WORKDIR}/${PN}-${BV}/bin
+	if [[ ! -d ${bootstrap_path} ]]; then
+		eerror "Binary tarball does not contain expected directory:"
+		die "'${bootstrap_path}' path does not exist."
+	fi
+
+	# crystal uses 'LLVM_TARGETS' to override default list of targets
+	unset LLVM_TARGETS
+	emake \
+		$(usex debug "" release=1) \
+		progress=true \
+		stats=1 \
+		threads=$(makeopts_jobs) \
+		verbose=1 \
+		\
+		CC=$(tc-getCC) \
+		CXX=$(tc-getCXX) \
+		AR=$(tc-getAR) \
+		LLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" \
+		\
+		PATH="${bootstrap_path}:${PATH}" \
+		CRYSTAL_PATH=src \
+		CRYSTAL_CONFIG_VERSION=${PV} \
+		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
+	use doc && emake docs
+}
+
+src_test() {
+	# EXTRA_SPEC_FLAGS is useful to debug individual tests
+	# as part of full build:
+	#    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal
+	emake spec \
+		$(usex debug "" release=1) \
+		progress=true \
+		stats=1 \
+		threads=$(makeopts_jobs) \
+		verbose=1 \
+		\
+		CC=$(tc-getCC) \
+		CXX=$(tc-getCXX) \
+		AR=$(tc-getAR) \
+		LLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" \
+		\
+		CRYSTAL_PATH=src \
+		CRYSTAL_CONFIG_VERSION=${PV} \
+		\
+		"EXTRA_SPEC_FLAGS=${EXTRA_SPEC_FLAGS}"
+}
+
+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 docs/.
+	fi
+
+	newbashcomp etc/completion.bash ${PN}
+}

diff --git a/dev-lang/crystal/files/crystal-1.1.0-verbose.patch b/dev-lang/crystal/files/crystal-1.1.0-verbose.patch
new file mode 100644
index 00000000000..4e68afd1a94
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-1.1.0-verbose.patch
@@ -0,0 +1,7 @@
+--- a/Makefile
++++ b/Makefile
+@@ -29,3 +29,3 @@ SOURCES := $(shell find src -name '*.cr')
+ SPEC_SOURCES := $(shell find spec -name '*.cr')
+-override FLAGS += $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )$(if $(target),--cross-compile --target $(target) )
++override FLAGS += $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )$(if $(target),--cross-compile --target $(target) )$(if $(verbose),--verbose )
+ SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2022-04-24 14:41 Michał Górny
  0 siblings, 0 replies; 16+ messages in thread
From: Michał Górny @ 2022-04-24 14:41 UTC (permalink / raw
  To: gentoo-commits

commit:     545d07c5a64b7e67867dc7cb42140609fa2b231b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 24 13:45:44 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Apr 24 14:40:46 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=545d07c5

dev-lang/crystal: Remove old

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/crystal/Manifest                          |   6 -
 dev-lang/crystal/crystal-1.1.0.ebuild              | 123 ---------------------
 dev-lang/crystal/crystal-1.1.1.ebuild              | 107 ------------------
 .../files/crystal-0.22.0-blocking-stdio-hack.patch |  20 ----
 .../files/crystal-0.27.0-max-age-0-test.patch      |  14 ---
 dev-lang/crystal/metadata.xml                      |  11 --
 6 files changed, 281 deletions(-)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 318e44303475..18941e5a07b9 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -1,9 +1,3 @@
-DIST crystal-1.1.0-1-linux-i686.tar.gz 30747190 BLAKE2B 7fe29248ae69c81cb0c79419488c5b544bb55810894ac1d7f276ccdf2d2d98c7c2bc4f8c007214e5ffd18ee39bdf6983f33b13c08f012105fce714eeaa18fac9 SHA512 df267250971c11d1e2f4f869a14f7b2f1e5a32cf15c407a0ee9291aeb4ddc21241c3f21c7706ee2305dfbf4ac645681a06bb70a6ee9246968a30f59b7595ea8a
-DIST crystal-1.1.0-1-linux-x86_64.tar.gz 27998777 BLAKE2B 06be8a51b28266b25f1a3629b1a1ac6f3878aacdd4ca4019ac201369ca0507f3ed27bfea46ea7d8d4dfa67888268a8e027586bb32e9964d4754661f43e36ac12 SHA512 8c4542ce0623e459b61591b7bd13f416ee30c89913ce827830e570225c72ec79ad5466d414b05f520d384f04363f11964ff8bf158f0ae798da3864208655319e
-DIST crystal-1.1.0.tar.gz 2476748 BLAKE2B 2874da651a8b4454c6a34b00ac4ef93be6beaabe01ff66aaac86583a9d9c1baccde9473358d70d78490b367db3a307af3b5219af6751c1d83cb5084e74955197 SHA512 fcd14338c4c6cb9189cfb9d4d93af7feab806a49e10b9c83399f9252f0c5f3488605141f09adef82d48343eab5653b754b9196fb659590df8d4deb2c4b6499f4
-DIST crystal-1.1.1-1-linux-i686.tar.gz 30749110 BLAKE2B d79113bc616685b30a80bb8632593c1b0a24d770ee9fa50810e771996f9ca95cdb5cdab64a7c445bc461e27e77e457b8334877e3a62281a3f9cbe59975518eae SHA512 eecd485fe06642a534aee2f837ac9ad6eeb5b52fa5fb4ab0f36bcf167535b784b5e306c0bb578a3198b58552efd3f0afc356b2711b0b7dc00f25fb1a2f4fe43f
-DIST crystal-1.1.1-1-linux-x86_64.tar.gz 27999355 BLAKE2B 115d9002973d9e0e1ad2edac55a10d4275176f95352634eee00f29d6ebeef2e3538f30a26904a1c6b68fa5b42e70b4cf54bb50ed4aa1097bb2d2dc716ff83427 SHA512 f27277af810f295c8ee4f5fedc3b7f1ffb06d166970fcc25d2de43e1c41e0af01de2a508292b44aac48a1583ac9892058f54fa3a7c361fc56dd483265f8bc36c
-DIST crystal-1.1.1.tar.gz 2477825 BLAKE2B 4e1b06c831a22447a4d1f065be64b12642ee4b4a75f24b0b73b990944afe6e2a6fca95189b46ea0656b8d13bd7c6a83a23452779b494822803a0264e02b9d4ce SHA512 6e9e977792c863d17ae94aa285a65a453da581a71c3fd9c57cc606ae20813504d675faffa74f78e7c4cf863b6334c4a63ab5356c04fb11d3267dd516e060fe74
 DIST crystal-1.2.1-1-linux-x86_64.tar.gz 28586682 BLAKE2B 4d7847cdc6263c369de0926055569986cece1302d2251e4b2d25308609e45c0aa3afe7cdfecba3b7909d7568b1e81aafe69f9976a90c8980684a92231cc3857c SHA512 23cfb2389c65202dc70ebadb85cf0390ba2366520fbfd4b7bb0683c5194cd2b5c87b6b4142dd251471ec4146a5c1046ec86bcafa50c66389a41c9cb394ee6f5d
 DIST crystal-1.2.1.tar.gz 2618956 BLAKE2B e9ffd8b9114af419ee433093066dcf69f86e2f3293a6eeafee20f00c982dcd78774b3faf64d1e2568ba3141e24ef751cb2b5e0b2a2c57dac92d0039e6e224971 SHA512 a6acfac36a8a0d93e39947f2e35238f9cfc43485994fd6caf102f1d62ebc4d71d13d96801e998dbbff9541b76a8eb4fade7b998b179807ed49c1c338207a4720
 DIST crystal-1.2.2-1-linux-x86_64.tar.gz 28611412 BLAKE2B 95593120b00b09b0a250917cbfd0841a77ead5e768ad483a900452678be5b231408017c4ac668df4de675612a008a385ed0dbf6ea216aec0343f8b5e8ede3e98 SHA512 7fdb247074723f52f8dfb9d2e18eef1ceb6fcf595bd12ec7304eb292716c4462ee34d2d87eac56302053dd4d8cd2beccde3dc5bfa3c75e6e832813afecfadcde

diff --git a/dev-lang/crystal/crystal-1.1.0.ebuild b/dev-lang/crystal/crystal-1.1.0.ebuild
deleted file mode 100644
index a435a4600025..000000000000
--- a/dev-lang/crystal/crystal-1.1.0.ebuild
+++ /dev/null
@@ -1,123 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
-
-BV=${PV}-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/${BV/-*}/crystal-${BV_AMD64}.tar.gz )
-	x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_X86}.tar.gz )"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="doc debug examples blocking-stdio-hack +xml +yaml"
-
-RESTRICT=test # not stable for day-to-day runs
-
-LLVM_MAX_SLOT=11
-
-DEPEND="
-	sys-devel/llvm:${LLVM_MAX_SLOT}
-	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}-1.1.0-verbose.patch
-	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
-	"${FILESDIR}"/${PN}-0.27.0-extra-spec-flags.patch
-	#"${FILESDIR}"/${PN}-0.27.0-max-age-0-test.patch
-	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
-	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix-2.patch
-)
-
-src_prepare() {
-	default
-
-	use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch
-}
-
-src_compile() {
-	local bootstrap_path=${WORKDIR}/${PN}-${BV}/bin
-	if [[ ! -d ${bootstrap_path} ]]; then
-		eerror "Binary tarball does not contain expected directory:"
-		die "'${bootstrap_path}' path does not exist."
-	fi
-
-	# crystal uses 'LLVM_TARGETS' to override default list of targets
-	unset LLVM_TARGETS
-	emake \
-		$(usex debug "" release=1) \
-		progress=true \
-		stats=1 \
-		threads=$(makeopts_jobs) \
-		verbose=1 \
-		\
-		CC="$(tc-getCC)" \
-		CXX="$(tc-getCXX)" \
-		AR="$(tc-getAR)" \
-		LLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" \
-		\
-		PATH="${bootstrap_path}:${PATH}" \
-		CRYSTAL_PATH=src \
-		CRYSTAL_CONFIG_VERSION=${PV} \
-		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
-	use doc && emake docs
-}
-
-src_test() {
-	# EXTRA_SPEC_FLAGS is useful to debug individual tests
-	# as part of full build:
-	#    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal
-	emake spec \
-		$(usex debug "" release=1) \
-		progress=true \
-		stats=1 \
-		threads=$(makeopts_jobs) \
-		verbose=1 \
-		\
-		CC=$(tc-getCC) \
-		CXX=$(tc-getCXX) \
-		AR=$(tc-getAR) \
-		LLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config" \
-		\
-		CRYSTAL_PATH=src \
-		CRYSTAL_CONFIG_VERSION=${PV} \
-		\
-		"EXTRA_SPEC_FLAGS=${EXTRA_SPEC_FLAGS}"
-}
-
-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 docs/.
-	fi
-
-	newbashcomp etc/completion.bash ${PN}
-}

diff --git a/dev-lang/crystal/crystal-1.1.1.ebuild b/dev-lang/crystal/crystal-1.1.1.ebuild
deleted file mode 100644
index f21d7749e7a5..000000000000
--- a/dev-lang/crystal/crystal-1.1.1.ebuild
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
-
-BV=${PV}-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/${BV/-*}/crystal-${BV_AMD64}.tar.gz )
-	x86? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_X86}.tar.gz )"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="doc debug"
-
-# Upstream test suite not reliable
-RESTRICT=test
-
-# See https://github.com/crystal-lang/crystal/issues/10434
-LLVM_MAX_SLOT=11
-
-DEPEND="
-	dev-libs/boehm-gc[static-libs,threads]
-	dev-libs/gmp:=
-	dev-libs/libatomic_ops
-	dev-libs/libevent
-	dev-libs/libpcre
-	dev-libs/pcl:=
-	sys-devel/llvm:${LLVM_MAX_SLOT}
-	sys-libs/libunwind:=
-"
-RDEPEND="${DEPEND}
-	dev-libs/libxml2
-	dev-libs/libyaml
-"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.1.0-verbose.patch
-	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
-	"${FILESDIR}"/${PN}-0.27.0-extra-spec-flags.patch
-	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
-	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix-2.patch
-)
-
-src_configure() {
-	local bootstrap_path=${WORKDIR}/${PN}-${BV}/bin
-	if [[ ! -d ${bootstrap_path} ]]; then
-		eerror "Binary tarball does not contain expected directory:"
-		die "'${bootstrap_path}' path does not exist."
-	fi
-
-	MY_EMAKE_COMMON_ARGS=(
-		$(usex debug "" release=1)
-		progress=true
-		stats=1
-		threads=$(makeopts_jobs)
-		verbose=1
-		CC="$(tc-getCC)"
-		CXX="$(tc-getCXX)"
-		AR="$(tc-getAR)"
-		LLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
-		PATH="${bootstrap_path}:${PATH}"
-		CRYSTAL_PATH=src
-		CRYSTAL_CONFIG_VERSION=${PV}
-		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
-	)
-
-	# crystal uses 'LLVM_TARGETS' to override default list of targets
-	unset LLVM_TARGETS
-}
-
-src_compile() {
-	emake "${MY_EMAKE_COMMON_ARGS[@]}"
-	use doc && emake docs
-}
-
-src_test() {
-	# EXTRA_SPEC_FLAGS is useful to debug individual tests
-	# as part of full build:
-	#    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal
-	emake std_spec "${MY_EMAKE_COMMON_ARGS[@]}" "EXTRA_SPEC_FLAGS=${EXTRA_SPEC_FLAGS}"
-}
-
-src_install() {
-	insinto /usr/$(get_libdir)/crystal
-	doins -r src/.
-	dobin .build/crystal
-
-	insinto /usr/share/zsh/site-functions
-	newins etc/completion.zsh _crystal
-
-	dodoc -r samples
-
-	if use doc ; then
-		docinto api
-		dodoc -r docs/.
-	fi
-
-	newbashcomp etc/completion.bash ${PN}
-}

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
deleted file mode 100644
index 07b7dba7be65..000000000000
--- a/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-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.27.0-max-age-0-test.patch b/dev-lang/crystal/files/crystal-0.27.0-max-age-0-test.patch
deleted file mode 100644
index d78927ab3eef..000000000000
--- a/dev-lang/crystal/files/crystal-0.27.0-max-age-0-test.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/spec/std/http/cookie_spec.cr
-+++ b/spec/std/http/cookie_spec.cr
-@@ -150,7 +150,10 @@ module HTTP
-         parse_set_cookie("a=1; domain=127.0.0.1; path=/; HttpOnly").domain.should eq "127.0.0.1"
-       end
- 
--      it "parse max-age as seconds from Time.now" do
-+      # unstable test: sometimes 'now - max-age=0' == 0.0:
-+      #    Failure/Error: delta.should be > 0.seconds
-+      #    Expected 00:00:00 to be > 00:00:00
-+      pending "parse max-age as seconds from Time.now" do
-         cookie = parse_set_cookie("a=1; max-age=10")
-         delta = cookie.expires.not_nil! - Time.now
-         delta.should be > 9.seconds

diff --git a/dev-lang/crystal/metadata.xml b/dev-lang/crystal/metadata.xml
index 233928bcc797..456e61401b3b 100644
--- a/dev-lang/crystal/metadata.xml
+++ b/dev-lang/crystal/metadata.xml
@@ -18,17 +18,6 @@
 		<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">crystal-lang/crystal</remote-id>


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2022-09-09  9:24 Sam James
  0 siblings, 0 replies; 16+ messages in thread
From: Sam James @ 2022-09-09  9:24 UTC (permalink / raw
  To: gentoo-commits

commit:     3b0b8194323dc29c5bcd661dce675ce428470e81
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  9 09:23:59 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep  9 09:23:59 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b0b8194

dev-lang/crystal: drop 1.2.2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/crystal/Manifest                          |   2 -
 dev-lang/crystal/crystal-1.2.2.ebuild              | 104 ---------------------
 dev-lang/crystal/files/crystal-1.1.0-verbose.patch |   7 --
 3 files changed, 113 deletions(-)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index 308c8788f58f..b5467f407fad 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -1,4 +1,2 @@
-DIST crystal-1.2.2-1-linux-x86_64.tar.gz 28611412 BLAKE2B 95593120b00b09b0a250917cbfd0841a77ead5e768ad483a900452678be5b231408017c4ac668df4de675612a008a385ed0dbf6ea216aec0343f8b5e8ede3e98 SHA512 7fdb247074723f52f8dfb9d2e18eef1ceb6fcf595bd12ec7304eb292716c4462ee34d2d87eac56302053dd4d8cd2beccde3dc5bfa3c75e6e832813afecfadcde
-DIST crystal-1.2.2.tar.gz 2621720 BLAKE2B abd196aab8d874e7a26116b92b046893c5f03d3ad7a28902fd2bbc3fe8e801f4c5d6766397583864bc3b7642f5c508e7ea0beb82661f87943c8a9914e014e71b SHA512 855f9c103f05d1ebb03d146d93362849a15ea67a64c993219f7c66438585b590caa53a9482daf81810920b39795c9f5c3e2a0caf316b3d62826e2540fd5fb60e
 DIST crystal-1.5.0-1-linux-x86_64.tar.gz 29749716 BLAKE2B f1a84e89bb1c92349dc6e66088cd60298a7de25a5b42876b06ab8460e277db8fe53fa5477e8189f5382ad98b571df25978437c5619260f58ac721d1235882025 SHA512 49ff065bd084c4d8ad4835e79bd7679d76f4ee641ad8955c110f585429297a3343a6e7406fbacfbea18d91fd7ebbef40f61e1db66c249ca653d43b46dce68636
 DIST crystal-1.5.0.tar.gz 2909586 BLAKE2B beb6bf0b8950317fa1883fa5c281ecf205f3a2c545b99e489ab07420534fa14ff1feb2a506a961304280cfcae1142faffd42acedd6845b96f439a6407e09106b SHA512 9f1915834c0218b05c6197325df1fc52d5d6a94ba1b83629ac07df4073271d777c1f6acfa7286eafb645e9118702ff856dfe590c8b2a3d91eb6929e88275f7f0

diff --git a/dev-lang/crystal/crystal-1.2.2.ebuild b/dev-lang/crystal/crystal-1.2.2.ebuild
deleted file mode 100644
index 7758bb838f9a..000000000000
--- a/dev-lang/crystal/crystal-1.2.2.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
-
-LLVM_MAX_SLOT=13
-inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
-
-BV=${PV}-1
-BV_AMD64=${BV}-linux-x86_64
-
-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/${BV/-*}/crystal-${BV_AMD64}.tar.gz )"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~amd64"
-IUSE="doc debug llvm-libunwind"
-
-# Upstream test suite not reliable
-RESTRICT=test
-
-DEPEND="
-	dev-libs/boehm-gc[static-libs,threads]
-	dev-libs/gmp:=
-	dev-libs/libatomic_ops
-	dev-libs/libevent
-	dev-libs/libpcre
-	dev-libs/pcl:=
-	<sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=
-	llvm-libunwind? ( sys-libs/llvm-libunwind:= )
-	!llvm-libunwind? ( sys-libs/libunwind:= )
-"
-RDEPEND="${DEPEND}
-	dev-libs/libxml2
-	dev-libs/libyaml
-"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-1.1.0-verbose.patch
-	"${FILESDIR}"/${PN}-0.26.1-gentoo-tests-sandbox.patch
-	"${FILESDIR}"/${PN}-0.27.0-extra-spec-flags.patch
-	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
-	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix-2.patch
-)
-
-src_configure() {
-	local bootstrap_path=${WORKDIR}/${PN}-${BV}/bin
-	if [[ ! -d ${bootstrap_path} ]]; then
-		eerror "Binary tarball does not contain expected directory:"
-		die "'${bootstrap_path}' path does not exist."
-	fi
-
-	MY_EMAKE_COMMON_ARGS=(
-		$(usex debug "" release=1)
-		progress=true
-		stats=1
-		threads=$(makeopts_jobs)
-		verbose=1
-		CC="$(tc-getCC)"
-		CXX="$(tc-getCXX)"
-		AR="$(tc-getAR)"
-		LLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
-		PATH="${bootstrap_path}:${PATH}"
-		CRYSTAL_PATH=src
-		CRYSTAL_CONFIG_VERSION=${PV}
-		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
-	)
-
-	# crystal uses 'LLVM_TARGETS' to override default list of targets
-	unset LLVM_TARGETS
-}
-
-src_compile() {
-	emake "${MY_EMAKE_COMMON_ARGS[@]}"
-	use doc && emake docs
-}
-
-src_test() {
-	# EXTRA_SPEC_FLAGS is useful to debug individual tests
-	# as part of full build:
-	#    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal
-	emake std_spec "${MY_EMAKE_COMMON_ARGS[@]}" "EXTRA_SPEC_FLAGS=${EXTRA_SPEC_FLAGS}"
-}
-
-src_install() {
-	insinto /usr/$(get_libdir)/crystal
-	doins -r src/.
-	dobin .build/crystal
-
-	insinto /usr/share/zsh/site-functions
-	newins etc/completion.zsh _crystal
-
-	dodoc -r samples
-
-	if use doc ; then
-		docinto api
-		dodoc -r docs/.
-	fi
-
-	newbashcomp etc/completion.bash ${PN}
-}

diff --git a/dev-lang/crystal/files/crystal-1.1.0-verbose.patch b/dev-lang/crystal/files/crystal-1.1.0-verbose.patch
deleted file mode 100644
index 4e68afd1a94d..000000000000
--- a/dev-lang/crystal/files/crystal-1.1.0-verbose.patch
+++ /dev/null
@@ -1,7 +0,0 @@
---- a/Makefile
-+++ b/Makefile
-@@ -29,3 +29,3 @@ SOURCES := $(shell find src -name '*.cr')
- SPEC_SOURCES := $(shell find spec -name '*.cr')
--override FLAGS += $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )$(if $(target),--cross-compile --target $(target) )
-+override FLAGS += $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )$(if $(target),--cross-compile --target $(target) )$(if $(verbose),--verbose )
- SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/
@ 2023-02-12  0:48 Maciej Barć
  0 siblings, 0 replies; 16+ messages in thread
From: Maciej Barć @ 2023-02-12  0:48 UTC (permalink / raw
  To: gentoo-commits

commit:     91052710f9301696ff7368529e5a19069ba0e49e
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 12 00:29:06 2023 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Sun Feb 12 00:47:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91052710

dev-lang/crystal: bump to 1.7.2

Closes: https://bugs.gentoo.org/889541
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 dev-lang/crystal/Manifest                          |   2 +
 dev-lang/crystal/crystal-1.7.2.ebuild              | 108 +++++++++++++++++++++
 .../files/crystal-1.7.2-extra-spec-flags.patch     |  11 +++
 3 files changed, 121 insertions(+)

diff --git a/dev-lang/crystal/Manifest b/dev-lang/crystal/Manifest
index b5467f407fad..beb47f106a07 100644
--- a/dev-lang/crystal/Manifest
+++ b/dev-lang/crystal/Manifest
@@ -1,2 +1,4 @@
 DIST crystal-1.5.0-1-linux-x86_64.tar.gz 29749716 BLAKE2B f1a84e89bb1c92349dc6e66088cd60298a7de25a5b42876b06ab8460e277db8fe53fa5477e8189f5382ad98b571df25978437c5619260f58ac721d1235882025 SHA512 49ff065bd084c4d8ad4835e79bd7679d76f4ee641ad8955c110f585429297a3343a6e7406fbacfbea18d91fd7ebbef40f61e1db66c249ca653d43b46dce68636
 DIST crystal-1.5.0.tar.gz 2909586 BLAKE2B beb6bf0b8950317fa1883fa5c281ecf205f3a2c545b99e489ab07420534fa14ff1feb2a506a961304280cfcae1142faffd42acedd6845b96f439a6407e09106b SHA512 9f1915834c0218b05c6197325df1fc52d5d6a94ba1b83629ac07df4073271d777c1f6acfa7286eafb645e9118702ff856dfe590c8b2a3d91eb6929e88275f7f0
+DIST crystal-1.7.2-1-linux-x86_64.tar.gz 41103664 BLAKE2B 399f5703fe907bed55b002d3d85873871c55e5d091c6342c3dc8356b219d5190ee3bf94456c0d4f169f4e2dee1f62cb42acbe707db9ee46c12a6ac4d60c4b5a4 SHA512 374e1a26f4540a0b368edd280dbab77d39237104432d4998f067e042de05bc58340d6a80ce569d5089b73e0d9b79fa5c65c04ea51f88ac5b0294af81d54d81ca
+DIST crystal-1.7.2.tar.gz 3121696 BLAKE2B 425d03a5ab34d885c6115582ae4aea3684fb088aeb3e8480087a14ff1963032e6ff4baa3022313d418dae5dce4a533786ee3993d19c81ed281b5a75411e5a4e8 SHA512 d278bc9a54c822e6c72269505158085bc7854b0f33c91a2adc24c656b310d20f5b49c633ec6216fbdee4dd17e9fb262d3315bf522c1c88e1ddbcb0dc386ce6c8

diff --git a/dev-lang/crystal/crystal-1.7.2.ebuild b/dev-lang/crystal/crystal-1.7.2.ebuild
new file mode 100644
index 000000000000..5a6e1e59917a
--- /dev/null
+++ b/dev-lang/crystal/crystal-1.7.2.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+BV=${PV}-1
+BV_AMD64=${BV}-linux-x86_64
+LLVM_MAX_SLOT=14
+
+inherit bash-completion-r1 llvm multiprocessing toolchain-funcs
+
+DESCRIPTION="The Crystal Programming Language"
+HOMEPAGE="https://crystal-lang.org/
+	https://github.com/crystal-lang/crystal/"
+SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz
+	amd64? ( https://github.com/crystal-lang/crystal/releases/download/${BV/-*}/crystal-${BV_AMD64}.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="doc debug llvm-libunwind"
+
+# Upstream test suite not reliable
+RESTRICT="test"
+
+DEPEND="
+	dev-libs/boehm-gc:=[threads]
+	dev-libs/gmp:=
+	dev-libs/libatomic_ops:=
+	dev-libs/libevent:=
+	dev-libs/libpcre:=
+	dev-libs/pcl:=
+	<sys-devel/llvm-$((${LLVM_MAX_SLOT} + 1)):=
+	llvm-libunwind? ( sys-libs/llvm-libunwind:= )
+	!llvm-libunwind? ( sys-libs/libunwind:= )
+"
+RDEPEND="
+	${DEPEND}
+	dev-libs/libxml2
+	dev-libs/libyaml
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-extra-spec-flags.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix.patch
+	"${FILESDIR}"/${PN}-0.27.0-gentoo-tests-long-unix-2.patch
+)
+
+src_configure() {
+	local bootstrap_path=${WORKDIR}/${PN}-${BV}/bin
+	if [[ ! -d ${bootstrap_path} ]] ; then
+		eerror "Binary tarball does not contain expected directory:"
+		die "'${bootstrap_path}' path does not exist."
+	fi
+
+	# crystal uses 'LLVM_TARGETS' to override default list of targets
+	unset LLVM_TARGETS
+
+	MY_EMAKE_COMMON_ARGS=(
+		$(usex debug "" release=1)
+		progress=true
+		stats=1
+		threads=$(makeopts_jobs)
+		verbose=1
+		CC="$(tc-getCC)"
+		CXX="$(tc-getCXX)"
+		AR="$(tc-getAR)"
+		LLVM_CONFIG="$(get_llvm_prefix "${LLVM_MAX_SLOT}")/bin/llvm-config"
+		PATH="${bootstrap_path}:${PATH}"
+		CRYSTAL_PATH="${S}"/src
+		CRYSTAL_CONFIG_VERSION=${PV}
+		CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
+	)
+}
+
+src_compile() {
+	emake "${MY_EMAKE_COMMON_ARGS[@]}"
+
+	use doc && emake docs "${MY_EMAKE_COMMON_ARGS[@]}"
+}
+
+src_test() {
+	# EXTRA_SPEC_FLAGS is useful to debug individual tests
+	# as part of full build:
+	#    USE=debug EXTRA_SPEC_FLAGS='-e parse_set_cookie' emerge -1 crystal
+	emake std_spec \
+		"${MY_EMAKE_COMMON_ARGS[@]}" "EXTRA_SPEC_FLAGS=${EXTRA_SPEC_FLAGS}"
+}
+
+src_install() {
+	insinto /usr/$(get_libdir)/crystal
+	doins -r src/.
+
+	exeinto /usr/bin
+	doexe .build/crystal
+
+	insinto /usr/share/zsh/site-functions
+	newins etc/completion.zsh _crystal
+
+	dodoc -r samples
+	doman man/${PN}.1
+	newbashcomp etc/completion.bash ${PN}
+
+	if use doc ; then
+		docinto api
+		dodoc -r docs/.
+	fi
+}

diff --git a/dev-lang/crystal/files/crystal-1.7.2-extra-spec-flags.patch b/dev-lang/crystal/files/crystal-1.7.2-extra-spec-flags.patch
new file mode 100644
index 000000000000..cc9e21abcbd6
--- /dev/null
+++ b/dev-lang/crystal/files/crystal-1.7.2-extra-spec-flags.patch
@@ -0,0 +1,11 @@
+--- a/Makefile
++++ b/Makefile
+@@ -33,7 +33,7 @@ SOURCES := $(shell find src -name '*.cr')
+ SPEC_SOURCES := $(shell find spec -name '*.cr')
+ override FLAGS += -D strict_multi_assign -D preview_overload_order $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )$(if $(target),--cross-compile --target $(target) )$(if $(interpreter),,-Dwithout_interpreter )
+ SPEC_WARNINGS_OFF := --exclude-warnings spec/std --exclude-warnings spec/compiler --exclude-warnings spec/primitives
+-SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )$(if $(order),--order=$(order) )
++SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )$(if $(order),--order=$(order) )$(EXTRA_SPEC_FLAGS)
+ CRYSTAL_CONFIG_LIBRARY_PATH := '$$ORIGIN/../lib/crystal'
+ CRYSTAL_CONFIG_BUILD_COMMIT := $(shell git rev-parse --short HEAD 2> /dev/null)
+ CRYSTAL_CONFIG_PATH := '$$ORIGIN/../share/crystal/src'


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-02-12  0:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-25 19:58 [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/ Sergei Trofimovich
  -- strict thread matches above, loose matches on Subject: below --
2023-02-12  0:48 Maciej Barć
2022-09-09  9:24 Sam James
2022-04-24 14:41 Michał Górny
2021-07-15  9:28 Sergei Trofimovich
2020-04-07 21:47 Sergei Trofimovich
2019-01-31  7:21 Sergei Trofimovich
2018-12-23 14:23 Sergei Trofimovich
2018-12-23 13:26 Sergei Trofimovich
2018-09-02 10:53 Sergei Trofimovich
2018-08-09 22:34 Sergei Trofimovich
2017-12-21 10:13 Sergei Trofimovich
2017-12-11 20:03 Michał Górny
2017-09-16 10:54 Sergei Trofimovich
2017-06-30  7:08 Sergei Trofimovich
2017-04-23 21:39 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox