Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/, dev-lang/crystal/files/
Date: Sat, 28 Jan 2017 12:48:30
Message-Id: 1485607702.ef80935bdf6325a68ed25e5a94ae602227402cd2.slyfox@gentoo
1 commit: ef80935bdf6325a68ed25e5a94ae602227402cd2
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 28 12:26:38 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 28 12:48:22 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ef80935b
7
8 dev-lang/crystal: respect CC/CXX/AR/MAKEOPTS, bug #607468
9
10 While at it enabled a few verbosity flags to make
11 build slightly more chatty.
12
13 Reported-by: Michał Górny
14 Bug: https://bugs.gentoo.org/607468
15
16 Package-Manager: Portage-2.3.3, Repoman-2.3.1
17
18 dev-lang/crystal/crystal-0.20.5-r1.ebuild | 85 ++++++++++++++++++++++
19 dev-lang/crystal/files/crystal-0.20.5-AR.patch | 9 +++
20 .../crystal/files/crystal-0.20.5-verbose.patch | 9 +++
21 3 files changed, 103 insertions(+)
22
23 diff --git a/dev-lang/crystal/crystal-0.20.5-r1.ebuild b/dev-lang/crystal/crystal-0.20.5-r1.ebuild
24 new file mode 100644
25 index 00000000..347af38
26 --- /dev/null
27 +++ b/dev-lang/crystal/crystal-0.20.5-r1.ebuild
28 @@ -0,0 +1,85 @@
29 +# Copyright 1999-2017 Gentoo Foundation
30 +# Distributed under the terms of the GNU General Public License v2
31 +# $Id$
32 +
33 +EAPI=6
34 +
35 +inherit multiprocessing toolchain-funcs
36 +
37 +BV=0.20.4-1
38 +BV_AMD64=${BV}-linux-x86_64
39 +BV_X86=${BV}-linux-i686
40 +
41 +DESCRIPTION="The Crystal Programming Language"
42 +HOMEPAGE="http://crystal-lang.org"
43 +SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz
44 + amd64? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_AMD64}.tar.gz )
45 + x86? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_X86}.tar.gz )"
46 +
47 +LICENSE="Apache-2.0"
48 +SLOT="0"
49 +KEYWORDS="~amd64"
50 +IUSE="doc examples +xml +yaml"
51 +
52 +# dev-libs/boehm-gc[static-libs] dependency problem, check the issue: https://github.com/manastech/crystal/issues/1382
53 +DEPEND="
54 + >=sys-devel/llvm-3.9.0
55 + dev-libs/boehm-gc[static-libs,threads]
56 + dev-libs/libatomic_ops
57 + dev-libs/libevent
58 + dev-libs/libpcre
59 + sys-libs/libunwind
60 + dev-libs/pcl
61 + dev-libs/gmp:0
62 +"
63 +RDEPEND="${DEPEND}
64 + xml? ( dev-libs/libxml2 )
65 + yaml? ( dev-libs/libyaml )
66 +"
67 +
68 +PATCHES=(
69 + "${FILESDIR}"/${P}-AR.patch
70 + "${FILESDIR}"/${P}-verbose.patch
71 +)
72 +
73 +src_compile() {
74 + emake \
75 + release=1 \
76 + stats=1 \
77 + threads=$(makeopts_jobs) \
78 + verbose=1 \
79 + \
80 + CC=$(tc-getCC) \
81 + CXX=$(tc-getCXX) \
82 + AR=$(tc-getAR) \
83 + \
84 + PATH="${WORKDIR}"/${PN}-${BV}/bin:"${PATH}" \
85 + CRYSTAL_PATH=src \
86 + CRYSTAL_CONFIG_VERSION=${PV} \
87 + CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
88 + use doc && emake doc
89 +}
90 +
91 +src_test() {
92 + emake spec \
93 + verbose=1 \
94 + \
95 + CRYSTAL_PATH=src \
96 + CRYSTAL_CONFIG_VERSION=${PV}
97 +}
98 +
99 +src_install() {
100 + insinto /usr/$(get_libdir)/crystal
101 + doins -r src/.
102 + dobin .build/crystal
103 +
104 + insinto /usr/share/zsh/site-functions
105 + newins etc/completion.zsh _crystal
106 +
107 + use examples && dodoc -r samples
108 +
109 + if use doc ; then
110 + docinto api
111 + dodoc -r doc/.
112 + fi
113 +}
114
115 diff --git a/dev-lang/crystal/files/crystal-0.20.5-AR.patch b/dev-lang/crystal/files/crystal-0.20.5-AR.patch
116 new file mode 100644
117 index 00000000..950bc23
118 --- /dev/null
119 +++ b/dev-lang/crystal/files/crystal-0.20.5-AR.patch
120 @@ -0,0 +1,9 @@
121 +diff --git a/Makefile b/Makefile
122 +index dc675a0..1f53d40 100644
123 +--- a/Makefile
124 ++++ b/Makefile
125 +@@ -118,3 +118,3 @@ $(LLVM_EXT_OBJ): $(LLVM_EXT_DIR)/llvm_ext.cc
126 + $(LIB_CRYSTAL_TARGET): $(LIB_CRYSTAL_OBJS)
127 +- ar -rcs $@ $^
128 ++ $(AR) -rcs $@ $^
129 +
130
131 diff --git a/dev-lang/crystal/files/crystal-0.20.5-verbose.patch b/dev-lang/crystal/files/crystal-0.20.5-verbose.patch
132 new file mode 100644
133 index 00000000..6a0a301
134 --- /dev/null
135 +++ b/dev-lang/crystal/files/crystal-0.20.5-verbose.patch
136 @@ -0,0 +1,9 @@
137 +diff --git a/Makefile b/Makefile
138 +index 1f53d40..fa71479 100644
139 +--- a/Makefile
140 ++++ b/Makefile
141 +@@ -24,3 +24,3 @@ SOURCES := $(shell find src -name '*.cr')
142 + SPEC_SOURCES := $(shell find spec -name '*.cr')
143 +-FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )$(if $(debug),-d )
144 ++FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(verbose),--verbose )
145 + VERBOSE := $(if $(verbose),-v )