From f19bc995e90dfcd4e5e265ac50efce38b672efb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Bar=C4=87?= Date: Fri, 12 Nov 2021 06:24:38 +0100 Subject: [PATCH] dev-lang/idris2: new package; add version 0.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Maciej Barć --- dev-lang/idris2/Manifest | 1 + dev-lang/idris2/idris2-0.5.1.ebuild | 105 ++++++++++++++++++++++++++++ dev-lang/idris2/metadata.xml | 27 +++++++ 3 files changed, 133 insertions(+) create mode 100644 dev-lang/idris2/Manifest create mode 100644 dev-lang/idris2/idris2-0.5.1.ebuild create mode 100644 dev-lang/idris2/metadata.xml diff --git a/dev-lang/idris2/Manifest b/dev-lang/idris2/Manifest new file mode 100644 index 0000000000..97fd4e3767 --- /dev/null +++ b/dev-lang/idris2/Manifest @@ -0,0 +1 @@ +DIST idris2-0.5.1.tar.gz 6057004 BLAKE2B d44d28739d350d7987b86ef3a08e2f6d73cd32fdb406c8156336f72d996fbd30296edf8b74e461d7a67861edc188d9e0d0f939bace337bebbf4124862b81a243 SHA512 6b4a4092570136a684bdd80765d271bc1ebe163c273ff22d22c808f586183a8e90a326573dd0e4b339e1ab0b88fd31f1cc7bf2820ff7bab2742c4156b816c5b7 diff --git a/dev-lang/idris2/idris2-0.5.1.ebuild b/dev-lang/idris2/idris2-0.5.1.ebuild new file mode 100644 index 0000000000..46d5f2085e --- /dev/null +++ b/dev-lang/idris2/idris2-0.5.1.ebuild @@ -0,0 +1,105 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# NOTICE: make targets for documentation fail: libdocs & install-libdocs + +EAPI=8 + +inherit toolchain-funcs xdg-utils + +DESCRIPTION="Purely functional programming language with first class types" +HOMEPAGE="https://github.com/idris-lang/Idris2/" + +if [[ "${PV}" == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/idris-lang/Idris2.git" +else + SRC_URI="https://github.com/idris-lang/Idris2/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64" + S="${WORKDIR}/${P^}" +fi + +LICENSE="BSD" +SLOT="0" +IUSE="+chez doc racket test-full" +REQUIRED_USE="^^ ( chez racket )" + +BDEPEND=" + dev-libs/gmp + chez? ( dev-scheme/chez ) + racket? ( dev-scheme/racket ) + doc? ( dev-python/sphinx_rtd_theme ) + test-full? ( + dev-scheme/chez + dev-scheme/racket + net-libs/nodejs + ) +" + +# Generated via "SCHEME", not CC +QA_FLAGS_IGNORED="usr/lib/idris2/bin/idris2_app/idris2 + usr/lib/idris2/bin/idris2_app/idris2-boot" +QA_PRESTRIPPED="${QA_FLAGS_IGNORED}" + +src_prepare() { + xdg_environment_reset + unset IDRIS2_DATA IDRIS2_INC_CGS IDRIS2_LIBS IDRIS2_PACKAGE_PATH + unset IDRIS2_PATH IDRIS2_PREFIX + unset PLTUSERHOME + + tc-export AR CC CXX LD RANLIB + export CFLAGS + sed -i '/^CFLAGS/d' ./support/*/Makefile || die + + # Sorry... (jobserver unavailable) + unset MAKEOPTS + + export IDRIS2_VERSION=${PV} + export SCHEME=$(usex chez chezscheme racket) + + if use chez; then + export IDRIS2_CG=chez + export BOOTSTRAP_MAKE_TARGET=bootstrap + elif use racket; then + export IDRIS2_CG=racket + export BOOTSTRAP_MAKE_TARGET=bootstrap-racket + else + die "Neither chez nor racket was chosen" + fi + + # Fix "PREFIX" + sed -i 's|$(HOME)/.idris2|/usr/lib/idris2|g' ./config.mk || die + + # Bad tests + sed -i 's|"chez033",||g' ./tests/Main.idr || die + + default +} + +src_configure() { + : +} + +src_compile() { + emake SCHEME=${SCHEME} ${BOOTSTRAP_MAKE_TARGET} + + use doc && emake -C ./docs html +} + +src_test() { + emake SCHEME=${SCHEME} bootstrap-test +} + +src_install() { + # "DESTDIR" variable is not respected + emake IDRIS2_PREFIX="${D}/usr/lib/idris2" PREFIX="${D}/usr/lib/idris2" install + + dosym ../lib/${PN}/bin/${PN} /usr/bin/${PN} + + einstalldocs + + if use doc; then + insinto /usr/share/doc/${PF}/ + doins -r ./docs/build/html + fi +} diff --git a/dev-lang/idris2/metadata.xml b/dev-lang/idris2/metadata.xml new file mode 100644 index 0000000000..66edc68e07 --- /dev/null +++ b/dev-lang/idris2/metadata.xml @@ -0,0 +1,27 @@ + + + + + + xgqt@riseup.net + Maciej Barć + + + Idris is a programming language designed to encourage Type-Driven + Development. + In type-driven development, types are tools for constructing programs. + We treat the type as the plan for a program, and use the compiler + and type checker as our assistant, guiding us to a complete program that + satisfies the type. The more expressive the type is that we give up front, + the more confidence we can have that the resulting program will be correct. + + + https://github.com/idris-lang/Idris2/issues + idris-lang/Idris2> + + + build using dev-scheme/chez + build using dev-scheme/racket + pull in depedndencies to run all tests + +