Gentoo Archives: gentoo-commits

From: "Maciej Barć" <xgqt@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/idris2/
Date: Sat, 27 Nov 2021 20:13:08
Message-Id: 1638043322.54d516476fe0434a45676f12db6a6d2eddb20533.xgqt@gentoo
1 commit: 54d516476fe0434a45676f12db6a6d2eddb20533
2 Author: Maciej Barć <xgqt <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 27 20:01:30 2021 +0000
4 Commit: Maciej Barć <xgqt <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 27 20:02:02 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54d51647
7
8 dev-lang/idris2: new package; add version 0.5.1_p20211112
9
10 Package-Manager: Portage-3.0.28, Repoman-3.0.3
11 Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>
12
13 dev-lang/idris2/Manifest | 1 +
14 dev-lang/idris2/idris2-0.5.1_p20211112.ebuild | 108 ++++++++++++++++++++++++++
15 dev-lang/idris2/metadata.xml | 27 +++++++
16 3 files changed, 136 insertions(+)
17
18 diff --git a/dev-lang/idris2/Manifest b/dev-lang/idris2/Manifest
19 new file mode 100644
20 index 000000000000..ceffb317d5de
21 --- /dev/null
22 +++ b/dev-lang/idris2/Manifest
23 @@ -0,0 +1 @@
24 +DIST idris2-0.5.1_p20211112.tar.gz 6202861 BLAKE2B 189bf28c7a33281494edea9b2c0821a934000fe9ca6e929b3318fe33576553142e5ad8d81598249cc384c6e342491ccef0998f33a4f2940b80264f5a3e4b32b2 SHA512 3b419ddbdc4aa3a28d92bf204448090c168d6a844d570886f982129f9e650c7112bbf95b727baf6c9f0f2fd6200c75eb68b6b71fd8684e01365eaf964dea1ea1
25
26 diff --git a/dev-lang/idris2/idris2-0.5.1_p20211112.ebuild b/dev-lang/idris2/idris2-0.5.1_p20211112.ebuild
27 new file mode 100644
28 index 000000000000..8069d5960163
29 --- /dev/null
30 +++ b/dev-lang/idris2/idris2-0.5.1_p20211112.ebuild
31 @@ -0,0 +1,108 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +COMMIT_HASH="ba180706d607945d8b419301f4362471d97a306a"
38 +
39 +inherit toolchain-funcs
40 +
41 +DESCRIPTION="Purely functional programming language with first class types"
42 +HOMEPAGE="https://idris-lang.org/"
43 +
44 +if [[ "${PV}" == *9999* ]]; then
45 + inherit git-r3
46 + EGIT_REPO_URI="https://github.com/idris-lang/Idris2.git"
47 +else
48 + SRC_URI="https://github.com/idris-lang/Idris2/archive/${COMMIT_HASH}.tar.gz -> ${P}.tar.gz"
49 + KEYWORDS="~amd64 ~x86"
50 + S="${WORKDIR}/${PN^}-${COMMIT_HASH}"
51 +fi
52 +
53 +LICENSE="BSD"
54 +SLOT="0"
55 +IUSE="+chez doc racket test-full"
56 +REQUIRED_USE="^^ ( chez racket )"
57 +
58 +RDEPEND="
59 + dev-libs/gmp
60 + chez? ( dev-scheme/chez[threads] )
61 + racket? ( dev-scheme/racket[threads] )
62 +"
63 +DEPEND="${RDEPEND}"
64 +BDEPEND="
65 + doc? ( dev-python/sphinx_rtd_theme )
66 + test-full? (
67 + dev-scheme/chez[threads]
68 + dev-scheme/racket[threads]
69 + net-libs/nodejs
70 + )
71 +"
72 +
73 +# Generated via "SCHEME", not CC
74 +QA_FLAGS_IGNORED="usr/lib/idris2/bin/idris2_app/idris2
75 + usr/lib/idris2/bin/idris2_app/idris2-boot"
76 +QA_PRESTRIPPED="${QA_FLAGS_IGNORED}"
77 +
78 +src_prepare() {
79 + # Clean up environment of Idris and Racket variables
80 + unset IDRIS2_DATA IDRIS2_INC_CGS IDRIS2_LIBS IDRIS2_PACKAGE_PATH
81 + unset IDRIS2_PATH IDRIS2_PREFIX
82 + unset PLTUSERHOME
83 +
84 + tc-export AR CC CXX LD RANLIB
85 + export CFLAGS
86 + sed -i '/^CFLAGS/d' ./support/*/Makefile || die
87 +
88 + # Fix "PREFIX"
89 + sed -i 's|$(HOME)/.idris2|/usr/lib/idris2|g' ./config.mk || die
90 +
91 + # Bad tests
92 + # > Missing incremental compile data, reverting to whole program compilation
93 + sed -i 's|"chez033",||g' ./tests/Main.idr || die
94 +
95 + default
96 +}
97 +
98 +src_configure() {
99 + export IDRIS2_VERSION=${PV}
100 + export SCHEME=$(usex chez chezscheme racket)
101 +
102 + if use chez; then
103 + export IDRIS2_CG=chez
104 + export BOOTSTRAP_TARGET=bootstrap
105 + elif use racket; then
106 + export IDRIS2_CG=racket
107 + export BOOTSTRAP_TARGET=bootstrap-racket
108 + else
109 + die "Neither chez nor racket was chosen"
110 + fi
111 +}
112 +
113 +src_compile() {
114 + # > jobserver unavailable
115 + # This is caused by Makefile using a script which in turn calls make
116 + # https://github.com/idris-lang/Idris2/issues/2152
117 + emake SCHEME=${SCHEME} ${BOOTSTRAP_TARGET} -j1
118 +
119 + use doc && emake -C ./docs html
120 +}
121 +
122 +src_test() {
123 + emake SCHEME=${SCHEME} bootstrap-test
124 +}
125 +
126 +src_install() {
127 + # "DESTDIR" variable is not respected
128 + emake IDRIS2_PREFIX="${D}/usr/lib/idris2" PREFIX="${D}/usr/lib/idris2" install
129 +
130 + dosym ../lib/${PN}/bin/${PN} /usr/bin/${PN}
131 +
132 + einstalldocs
133 +
134 + # Install documentation
135 + if use doc; then
136 + insinto /usr/share/doc/${PF}/
137 + doins -r ./docs/build/html
138 + fi
139 +}
140
141 diff --git a/dev-lang/idris2/metadata.xml b/dev-lang/idris2/metadata.xml
142 new file mode 100644
143 index 000000000000..0c84b056b4e8
144 --- /dev/null
145 +++ b/dev-lang/idris2/metadata.xml
146 @@ -0,0 +1,27 @@
147 +<?xml version="1.0" encoding="UTF-8"?>
148 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
149 +
150 +<pkgmetadata>
151 + <maintainer type="project">
152 + <email>scheme@g.o</email>
153 + <name>Gentoo Scheme Project</name>
154 + </maintainer>
155 + <longdescription lang="en">
156 + Idris is a programming language designed to encourage Type-Driven
157 + Development.
158 + In type-driven development, types are tools for constructing programs.
159 + We treat the type as the plan for a program, and use the compiler
160 + and type checker as our assistant, guiding us to a complete program that
161 + satisfies the type. The more expressive the type is that we give up front,
162 + the more confidence we can have that the resulting program will be correct.
163 + </longdescription>
164 + <upstream>
165 + <bugs-to>https://github.com/idris-lang/Idris2/issues</bugs-to>
166 + <remote-id type="github">idris-lang/Idris2></remote-id>
167 + </upstream>
168 + <use>
169 + <flag name="chez">build using <pkg>dev-scheme/chez</pkg></flag>
170 + <flag name="racket">build using <pkg>dev-scheme/racket</pkg></flag>
171 + <flag name="test-full">pull in depedndencies to run all tests</flag>
172 + </use>
173 +</pkgmetadata>