Commit 70743c89 authored by Jakub Jirutka's avatar Jakub Jirutka

community/crystal: upgrade to 0.25.0

parent 49692f3e
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=crystal
pkgver=0.24.2
pkgrel=5
pkgver=0.25.0
pkgrel=0
_bootver=0.24.2
_llvmver=5
pkgdesc="The Crystal Programming Language"
......@@ -19,15 +19,9 @@ subpackages="$pkgname-doc
source="$pkgname-$pkgver.tar.gz::https://github.com/crystal-lang/$pkgname/archive/$pkgver.tar.gz
https://dev.alpinelinux.org/archive/crystal/crystal-$_bootver-x86_64-alpine-linux-musl.tar.gz
https://dev.alpinelinux.org/archive/crystal/crystal-$_bootver-aarch64-alpine-linux-musl.tar.gz
makefile-shell.patch
fix-makefile-stderr-redirect.patch
makefile-allow-extra-flags.patch
paxmark.patch
aarch64-linux-musl.patch
fix-codegen-specs.patch
disable-specs-using-GB2312-encoding.patch
libressl.patch
alpine-shards-help.patch
"
builddir="$srcdir/$pkgname-$pkgver"
......@@ -70,7 +64,7 @@ prepare() {
progress = 1
threads = ${JOBS:-2}
verbose = 1
EXTRA_FLAGS = --verbose --target $CTARGET ${BUILD_STATIC:+"--link-flags=-no-pie"}
FLAGS = --verbose --target $CTARGET ${BUILD_STATIC:+"--link-flags=-no-pie"}
LLVM_CONFIG = /usr/lib/llvm$_llvmver/bin/llvm-config
EOF
}
......@@ -124,15 +118,9 @@ zshcomp() {
"$subpkgdir"/usr/share/zsh/site-functions/_$pkgname
}
sha512sums="db9fb973eeb2bc72ef91bb894b7c5aea73e727ff46e739aa431d68e556238f346a688a7a43de284afb4667b49366afce3ca423a523bea521180fa8f19ba6862d crystal-0.24.2.tar.gz
sha512sums="20f2864919c7710e5aee8112e1c6ab54a2e50b244ac63d374edfed41ab659b11c062f76dbfc38e763a08bdbea9e0a39f3b5cac5e00bf453be3a31d3b0a023917 crystal-0.25.0.tar.gz
6d7ee01ff5bfaaf79fa80c15575ae4496e17629ed18cb0577db6734266c2dbf5b0bf0a554c7c153e1b81f4c71e62bb803fd4b6513e3d039571ee4f953d85ecf4 crystal-0.24.2-x86_64-alpine-linux-musl.tar.gz
d6ed122a5ddb4e1ea772357cd3115dcf8cd92a75f973b6f7e4b8b6135fb4123fb98334495f6f312da7ab7ba3bda57bd3cb4f06c0f421df2c09d19c0ab1b8b67b crystal-0.24.2-aarch64-alpine-linux-musl.tar.gz
2a81b6eaeb934ef5d4435a80a346425a760a602d04bccc89068dde7ed48a6099c4ea59a291f444127e91e81acde0ee42d857481041869cf6094a2e29f0de184a makefile-shell.patch
2f995903093da9af4263bf2d7fde75715a114b02b74ba26c8290d7b20042be8a2db305a2ea144925f054354f6f6a430750d19fa036bf764562dedb56da12866a fix-makefile-stderr-redirect.patch
d1641f538cb1ae9f817b57e19800b0af91e3723c752fba38b2644b8acc66d80862c6bef22194f1f4c64ae7d8393c2772f0a0ea0a76a199151ef8c74c686ea49f makefile-allow-extra-flags.patch
31fd94f07edb83eb6ff43dd20f99a52e3c28dc0bf67f7e0b5c473c40d455febfbd0cdf9fe1fe599dbf080fd4c05a2a2d9ad8745f9effc8dfb565e19fa0e49509 libressl.patch
dec4ed7abfd215eec825bed97b1e40bf3aa8bd959a4ec7153ea1bc51d409d892ebec19ddb0372e3a543e74c7018aca0c1f3cf956fa1d95efb946c8c3417c8749 paxmark.patch
0252e850b79d622fe69329fac3653128b1cc0108961c928a9efa8fa5df1bce13692b6a520697c45c37791a9e6547d5ec7f0f11905e8299902055ab3dbdfd7556 aarch64-linux-musl.patch
702927a86c2e934511415e97093fb6fe04e2e63dd5a4e2e2b1fcc772c7f02e037f1b05e516943222f282515fc562618a83442e2d53cc899933a2b2e8ad8dd53d fix-codegen-specs.patch
269976fbc990dde075769e651c9fac6e7e0b39681e55cbd067c6d2a790c58a096bdc9981f62ae69b5217623025ba768daa63bc5316bd8ddd18192d88839aedcb disable-specs-using-GB2312-encoding.patch
b5c9c03ad6b648759262a896da3dfbe530ea2d626a5d18fbade08af14a32f8556cdcaf593504db405ff6e5772d3bf00d9d1a8af82f677436602c5bbcbf69b1c6 libressl.patch
2aa476a2077679a72b94c220bbca6a157555f4751227cb34da1f67b1f8a9a549e00ccb2a8b939ee516f31a429f25b67dbb048984ec49a0c01f092385651daf32 alpine-shards-help.patch"
269976fbc990dde075769e651c9fac6e7e0b39681e55cbd067c6d2a790c58a096bdc9981f62ae69b5217623025ba768daa63bc5316bd8ddd18192d88839aedcb disable-specs-using-GB2312-encoding.patch"
This diff is collapsed.
This is downstream patch only.
--- a/src/compiler/crystal/command/deps.cr
+++ b/src/compiler/crystal/command/deps.cr
@@ -5,7 +5,7 @@
private def deps
path_to_shards = `which shards`.chomp
if path_to_shards.empty?
- error "`shards` executable is missing. Please install shards: https://github.com/crystal-lang/shards"
+ error "`shards` executable is missing. Please install shards: apk add shards"
end
status = Process.run(path_to_shards, args: options, output: Process::Redirect::Inherit, error: Process::Redirect::Inherit)
From 19bad9d05b723980551eb203715456e700b06002 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Mon, 26 Mar 2018 00:44:52 +0200
Subject: [PATCH 1/2] Fix codegen/asm specs to run x86 ASM only on x86_64 and
i686
See https://github.com/crystal-lang/crystal/pull/5861#issuecomment-376006679
Upstream-Issue: https://github.com/crystal-lang/crystal/pull/5866
---
spec/compiler/codegen/asm_spec.cr | 59 ++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 28 deletions(-)
diff --git a/spec/compiler/codegen/asm_spec.cr b/spec/compiler/codegen/asm_spec.cr
index 6fe8cbc26e..bc68d0f0cc 100644
--- a/spec/compiler/codegen/asm_spec.cr
+++ b/spec/compiler/codegen/asm_spec.cr
@@ -1,34 +1,37 @@
require "../../spec_helper"
describe "Code gen: asm" do
- it "codegens without inputs" do
- run(%(
- dst = uninitialized Int32
- asm("mov $$1234, $0" : "=r"(dst))
- dst
- )).to_i.should eq(1234)
- end
+ # TODO: arm asm tests
+ {% if flag?(:i686) || flag?(:x86_64) %}
+ it "codegens without inputs" do
+ run(%(
+ dst = uninitialized Int32
+ asm("mov $$1234, $0" : "=r"(dst))
+ dst
+ )).to_i.should eq(1234)
+ end
- it "codegens with one input" do
- run(%(
- src = 1234
- dst = uninitialized Int32
- asm("mov $1, $0" : "=r"(dst) : "r"(src))
- dst
- )).to_i.should eq(1234)
- end
+ it "codegens with one input" do
+ run(%(
+ src = 1234
+ dst = uninitialized Int32
+ asm("mov $1, $0" : "=r"(dst) : "r"(src))
+ dst
+ )).to_i.should eq(1234)
+ end
- it "codegens with two inputs" do
- run(%(
- c = uninitialized Int32
- a = 20
- b = 22
- asm(
- "add $2, $0"
- : "=r"(c)
- : "0"(a), "r"(b)
- )
- c
- )).to_i.should eq(42)
- end
+ it "codegens with two inputs" do
+ run(%(
+ c = uninitialized Int32
+ a = 20
+ b = 22
+ asm(
+ "add $2, $0"
+ : "=r"(c)
+ : "0"(a), "r"(b)
+ )
+ c
+ )).to_i.should eq(42)
+ end
+ {% end %}
end
From bde57387cf7239dea152b870471500da8faaec6f Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Mon, 26 Mar 2018 00:48:14 +0200
Subject: [PATCH 2/2] Fix codegen/sizeof specs for aarch64 (and other 64bit
arches)
See https://github.com/crystal-lang/crystal/pull/5861#issuecomment-376006679
---
spec/compiler/codegen/sizeof_spec.cr | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/spec/compiler/codegen/sizeof_spec.cr b/spec/compiler/codegen/sizeof_spec.cr
index 2f703abd1c..bc4a2d5b9a 100644
--- a/spec/compiler/codegen/sizeof_spec.cr
+++ b/spec/compiler/codegen/sizeof_spec.cr
@@ -48,7 +48,7 @@ describe "Code gen: sizeof" do
# be struct { 8 bytes, 8 bytes }.
#
# In 32 bits structs are aligned to 4 bytes, so it remains the same.
- {% if flag?(:x86_64) %}
+ {% if flag?(:bits64) %}
size.should eq(16)
{% else %}
size.should eq(12)
@@ -137,7 +137,7 @@ describe "Code gen: sizeof" do
sizeof(typeof(foo))
)).to_i
- {% if flag?(:x86_64) %}
+ {% if flag?(:bits64) %}
size.should eq(8)
{% else %}
size.should eq(4)
From 2d5bc81866affe7a625da96161644d17c50cf675 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sat, 24 Mar 2018 18:15:46 +0100
Subject: [PATCH] Makefile: Fix redirect to stderr to be more portable
`>/dev/stderr` does not work in some environments. Moreover, all POSIX
compliant shells supports standard `>&2` for redirect stdout to stderr.
Upstream-Issue: https://github.com/crystal-lang/crystal/pull/5859
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2aa2e4f..a034f44 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,7 @@ CXXFLAGS += $(if $(debug),-g -O0)
ifeq (${LLVM_CONFIG},)
$(error Could not locate llvm-config, make sure it is installed and in your PATH, or set LLVM_CONFIG)
else
- $(shell echo $(shell printf '\033[33m')Using $(LLVM_CONFIG) [version=$(shell $(LLVM_CONFIG) --version)]$(shell printf '\033[0m') >/dev/stderr)
+ $(shell echo $(shell printf '\033[33m')Using $(LLVM_CONFIG) [version=$(shell $(LLVM_CONFIG) --version)]$(shell printf '\033[0m') >&2)
endif
.PHONY: all
--
2.10.1 (Apple Git-78)
From a834b9a274b5dcb076b64ca855bcccc322cdd07c Mon Sep 17 00:00:00 2001
From: lvmbdv <ata.kuyumcu@protonmail.com>
Date: Fri, 2 Feb 2018 23:31:19 +0300
Subject: [PATCH] Fixed OpenSSL bindings to recognize LibreSSL
Hack OpenSSL bindings to recognize LibreSSL
This patch is ported from https://github.com/crystal-lang/crystal/pull/5676.
This patch is based on https://github.com/crystal-lang/crystal/pull/5676.
diff --git a/src/openssl/lib_crypto.cr b/src/openssl/lib_crypto.cr
index 458ad13..7e42604 100644
--- a/src/openssl/lib_crypto.cr
+++ b/src/openssl/lib_crypto.cr
@@ -1,11 +1,23 @@
{% begin %}
@@ -2,10 +2,22 @@
lib LibCrypto
- OPENSSL_110 = {{ `command -v pkg-config > /dev/null && pkg-config --atleast-version=1.1.0 libcrypto || printf %s false`.stringify != "false" }}
- OPENSSL_102 = {{ `command -v pkg-config > /dev/null && pkg-config --atleast-version=1.0.2 libcrypto || printf %s false`.stringify != "false" }}
......@@ -23,7 +18,7 @@ index 458ad13..7e42604 100644
end
{% end %}
-@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs libcrypto || printf %s '-lcrypto'`")]
-@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'`")]
+{% begin %}
+ lib LibCrypto
+ OPENSSL_110 = {{ (LibCrypto::LIBRESSL_VERSION == 0) && (LibCrypto::OPENSSL_VERSION >= 0x10101000) }}
......@@ -37,10 +32,9 @@ index 458ad13..7e42604 100644
alias Char = LibC::Char
alias Int = LibC::Int
diff --git a/src/openssl/lib_ssl.cr b/src/openssl/lib_ssl.cr
index e69f82b..b8786b8 100644
--- a/src/openssl/lib_ssl.cr
+++ b/src/openssl/lib_ssl.cr
@@ -2,12 +2,13 @@ require "./lib_crypto"
@@ -2,8 +2,9 @@
{% begin %}
lib LibSSL
......@@ -52,12 +46,7 @@ index e69f82b..b8786b8 100644
end
{% end %}
-@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs libssl || printf %s '-lssl -lcrypto'`")]
+@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'`")]
lib LibSSL
alias Int = LibC::Int
alias Char = LibC::Char
@@ -198,13 +199,17 @@ lib LibSSL
@@ -198,13 +199,17 @@
fun sslv23_method = SSLv23_method : SSLMethod
{% end %}
......@@ -79,7 +68,6 @@ index e69f82b..b8786b8 100644
fun ssl_ctx_set1_param = SSL_CTX_set1_param(ctx : SSLContext, param : X509VerifyParam) : Int
{% end %}
diff --git a/src/openssl/ssl/context.cr b/src/openssl/ssl/context.cr
index b21568d..a694abd 100644
--- a/src/openssl/ssl/context.cr
+++ b/src/openssl/ssl/context.cr
@@ -304,7 +304,7 @@ abstract class OpenSSL::SSL::Context
......@@ -103,7 +91,6 @@ index b21568d..a694abd 100644
#
# Depending on the OpenSSL version, the available defaults are
diff --git a/src/openssl/ssl/socket.cr b/src/openssl/ssl/socket.cr
index 10fc100..14c3c16 100644
--- a/src/openssl/ssl/socket.cr
+++ b/src/openssl/ssl/socket.cr
@@ -119,7 +119,7 @@ abstract class OpenSSL::SSL::Socket < IO
......@@ -115,6 +102,3 @@ index 10fc100..14c3c16 100644
# Returns the negotiated ALPN protocol (eg: `"h2"`) of `nil` if no protocol was
# negotiated.
def alpn_protocol
--
2.10.1 (Apple Git-78)
From 746da810fd045ae2ccad8cecfd746375788b6bfb Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sat, 24 Mar 2018 18:20:59 +0100
Subject: [PATCH] Makefile: Allow to add EXTRA_FLAGS to FLAGS
Upstream-Issue: https://github.com/crystal-lang/crystal/pull/5860
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 2aa2e4fbdb..d18cd58e22 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@
O := .build
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 )$(if $(static),--static )
+FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(progress),--progress )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(static),--static ) $(EXTRA_FLAGS)
SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )
EXPORTS := $(if $(release),,CRYSTAL_CONFIG_PATH=`pwd`/src)
SHELL = bash
From 80f94f33956a758444f6c6918036b41288cd4da9 Mon Sep 17 00:00:00 2001
From: Julien Reichardt <mi@jrei.ch>
Date: Tue, 2 Jan 2018 14:52:14 +0100
Subject: [PATCH] Change from `bash` to `sh` (#5468)
* Removes bash as a dependency
* Better compliance to POSIX
diff --git a/Makefile b/Makefile
index a4b2281dc1..a6b2f5d1d4 100644
--- a/Makefile
+++ b/Makefile
@@ -29,8 +29,8 @@ 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 )$(if $(static),--static )
SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )
-EXPORTS := $(if $(release),,CRYSTAL_CONFIG_PATH=`pwd`/src)
-SHELL = bash
+EXPORTS := $(if $(release),,CRYSTAL_CONFIG_PATH=$PWD/src)
+SHELL = sh
LLVM_CONFIG_FINDER := \
[ -n "$(LLVM_CONFIG)" ] && command -v "$(LLVM_CONFIG)" || \
command -v llvm-config-4.0 || command -v llvm-config40 || \
@@ -118,7 +118,7 @@ $(O)/crystal: $(DEPS) $(SOURCES)
$(BUILD_PATH) $(EXPORTS) ./bin/crystal build $(FLAGS) -o $@ src/compiler/crystal.cr -D without_openssl -D without_zlib
$(LLVM_EXT_OBJ): $(LLVM_EXT_DIR)/llvm_ext.cc
- $(CXX) -c $(CXXFLAGS) -o $@ $< `$(LLVM_CONFIG) --cxxflags`
+ $(CXX) -c $(CXXFLAGS) -o $@ $< $(shell $(LLVM_CONFIG) --cxxflags)
$(LIB_CRYSTAL_TARGET): $(LIB_CRYSTAL_OBJS)
$(AR) -rcs $@ $^
diff --git a/Vagrantfile b/Vagrantfile
index 83bcf8c3ce..859f682dbf 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -15,7 +15,7 @@ Vagrant.configure("2") do |config|
c.vm.box = "ubuntu/#{box_name}"
c.vm.provision :shell, inline: %(
- curl -s https://dist.crystal-lang.org/apt/setup.sh | bash
+ curl -s https://dist.crystal-lang.org/apt/setup.sh | sh
apt-get install -y crystal git libgmp3-dev zlib1g-dev libedit-dev libxml2-dev libssl-dev libyaml-dev libreadline-dev g++
curl -s https://crystal-lang.s3.amazonaws.com/llvm/llvm-3.5.0-1-linux-`uname -m`.tar.gz | tar xz -C /opt
echo 'export LIBRARY_PATH="/opt/crystal/embedded/lib"' > /etc/profile.d/crystal.sh
diff --git a/bin/crystal b/bin/crystal
index 698ed9b2b3..c901d9b37f 100755
--- a/bin/crystal
+++ b/bin/crystal
@@ -37,7 +37,7 @@ _resolve_symlinks() {
local dir_context path
path=$(readlink -- "$1")
- if [ $? -eq 0 ]; then
+ if [ $? = 0 ]; then
dir_context=$(dirname -- "$1")
_resolve_symlinks "$(_prepend_dir_context_if_necessary "$dir_context" "$path")" "$@"
else
@@ -141,16 +141,13 @@ CRYSTAL_DIR="$CRYSTAL_ROOT/.build"
export CRYSTAL_PATH=$CRYSTAL_ROOT/src:lib
export CRYSTAL_HAS_WRAPPER=true
-if [ -x "$CRYSTAL_DIR/crystal" ]
-then
+if [ -x "$CRYSTAL_DIR/crystal" ]; then
__warning_msg "Using compiled compiler at \`.build/crystal'"
exec "$CRYSTAL_DIR/crystal" "$@"
-elif ! command -v crystal > /dev/null
-then
+elif ! command -v crystal > /dev/null; then
__error_msg 'You need to have a crystal executable in your path!'
exit 1
-elif [ "$(command -v crystal)" = "$SCRIPT_PATH" ] || [ "$(command -v crystal)" = "bin/crystal" ]
-then
+elif [ "$(command -v crystal)" = "$SCRIPT_PATH" ] || [ "$(command -v crystal)" = "bin/crystal" ]; then
export PATH="$(remove_path_item "$(remove_path_item "$PATH" "$SCRIPT_ROOT")" "bin")"
exec "$SCRIPT_PATH" "$@"
else
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment