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 13:37:10
Message-Id: 1485610619.46ea9d6b8f435e53e09a1381ccc83c4afd904b75.slyfox@gentoo
1 commit: 46ea9d6b8f435e53e09a1381ccc83c4afd904b75
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jan 28 13:36:49 2017 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 28 13:36:59 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46ea9d6b
7
8 dev-lang/crystal: respect LDFLAGS, new USE=debug for quick builds
9
10 Package-Manager: Portage-2.3.3, Repoman-2.3.1
11
12 dev-lang/crystal/crystal-0.20.5-r2.ebuild | 93 ++++++++++++++++++++++
13 .../crystal/files/crystal-0.20.5-LDFLAGS.patch | 9 +++
14 dev-lang/crystal/metadata.xml | 3 +
15 3 files changed, 105 insertions(+)
16
17 diff --git a/dev-lang/crystal/crystal-0.20.5-r2.ebuild b/dev-lang/crystal/crystal-0.20.5-r2.ebuild
18 new file mode 100644
19 index 00000000..d550e2a
20 --- /dev/null
21 +++ b/dev-lang/crystal/crystal-0.20.5-r2.ebuild
22 @@ -0,0 +1,93 @@
23 +# Copyright 1999-2017 Gentoo Foundation
24 +# Distributed under the terms of the GNU General Public License v2
25 +# $Id$
26 +
27 +EAPI=6
28 +
29 +inherit multiprocessing toolchain-funcs
30 +
31 +BV=0.20.4-1
32 +BV_AMD64=${BV}-linux-x86_64
33 +BV_X86=${BV}-linux-i686
34 +
35 +DESCRIPTION="The Crystal Programming Language"
36 +HOMEPAGE="http://crystal-lang.org"
37 +SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.tar.gz
38 + amd64? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_AMD64}.tar.gz )
39 + x86? ( https://github.com/crystal-lang/crystal/releases/download/${PV}/crystal-${BV_X86}.tar.gz )"
40 +
41 +LICENSE="Apache-2.0"
42 +SLOT="0"
43 +KEYWORDS="~amd64"
44 +IUSE="doc debug examples +xml +yaml"
45 +
46 +# dev-libs/boehm-gc[static-libs] dependency problem, check the issue: https://github.com/manastech/crystal/issues/1382
47 +DEPEND="
48 + >=sys-devel/llvm-3.9.0
49 + dev-libs/boehm-gc[static-libs,threads]
50 + dev-libs/libatomic_ops
51 + dev-libs/libevent
52 + dev-libs/libpcre
53 + sys-libs/libunwind
54 + dev-libs/pcl
55 + dev-libs/gmp:0
56 +"
57 +RDEPEND="${DEPEND}
58 + xml? ( dev-libs/libxml2 )
59 + yaml? ( dev-libs/libyaml )
60 +"
61 +
62 +PATCHES=(
63 + "${FILESDIR}"/${P}-AR.patch
64 + "${FILESDIR}"/${P}-verbose.patch
65 + "${FILESDIR}"/${P}-LDFLAGS.patch
66 +)
67 +
68 +src_compile() {
69 + emake \
70 + $(usex debug "" release=1) \
71 + stats=1 \
72 + threads=$(makeopts_jobs) \
73 + verbose=1 \
74 + \
75 + CC=$(tc-getCC) \
76 + CXX=$(tc-getCXX) \
77 + AR=$(tc-getAR) \
78 + \
79 + PATH="${WORKDIR}"/${PN}-${BV}/bin:"${PATH}" \
80 + CRYSTAL_PATH=src \
81 + CRYSTAL_CONFIG_VERSION=${PV} \
82 + CRYSTAL_CONFIG_PATH="lib:${EPREFIX}/usr/$(get_libdir)/crystal"
83 + use doc && emake doc
84 +}
85 +
86 +src_test() {
87 + emake spec \
88 + $(usex debug "" release=1) \
89 + stats=1 \
90 + threads=$(makeopts_jobs) \
91 + verbose=1 \
92 + \
93 + CC=$(tc-getCC) \
94 + CXX=$(tc-getCXX) \
95 + AR=$(tc-getAR) \
96 + \
97 + CRYSTAL_PATH=src \
98 + CRYSTAL_CONFIG_VERSION=${PV}
99 +}
100 +
101 +src_install() {
102 + insinto /usr/$(get_libdir)/crystal
103 + doins -r src/.
104 + dobin .build/crystal
105 +
106 + insinto /usr/share/zsh/site-functions
107 + newins etc/completion.zsh _crystal
108 +
109 + use examples && dodoc -r samples
110 +
111 + if use doc ; then
112 + docinto api
113 + dodoc -r doc/.
114 + fi
115 +}
116
117 diff --git a/dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch b/dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch
118 new file mode 100644
119 index 00000000..42970a8
120 --- /dev/null
121 +++ b/dev-lang/crystal/files/crystal-0.20.5-LDFLAGS.patch
122 @@ -0,0 +1,9 @@
123 +diff --git a/Makefile b/Makefile
124 +index fa71479..d316bbc 100644
125 +--- a/Makefile
126 ++++ b/Makefile
127 +@@ -24,3 +24,3 @@ SOURCES := $(shell find src -name '*.cr')
128 + SPEC_SOURCES := $(shell find spec -name '*.cr')
129 +-FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(verbose),--verbose )
130 ++FLAGS := $(if $(release),--release )$(if $(stats),--stats )$(if $(threads),--threads $(threads) )$(if $(debug),-d )$(if $(verbose),--verbose )$(if $(LDFLAGS),--link-flags="$(LDFLAGS)" )
131 + VERBOSE := $(if $(verbose),-v )
132
133 diff --git a/dev-lang/crystal/metadata.xml b/dev-lang/crystal/metadata.xml
134 index e8be383..80b55be 100644
135 --- a/dev-lang/crystal/metadata.xml
136 +++ b/dev-lang/crystal/metadata.xml
137 @@ -19,6 +19,9 @@
138 disallowing certain dynamic aspects of Ruby.
139 </longdescription>
140 <use>
141 + <flag name="debug">
142 + Build each module as a separate object file. Speeds build up.
143 + </flag>
144 <flag name="yaml">
145 Use the <pkg>dev-libs/libyaml</pkg> library to enable Crystal yaml
146 module