From 0ceb76e690bd355afa6d84a9d2f2ebcaec422baa Mon Sep 17 00:00:00 2001 From: Maciej Barć Date: Fri, 26 Nov 2021 15:04:04 +0100 Subject: sci-mathematics/lean: always use non-hardcoded MAJOR; use readme.gentoo 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ć --- sci-mathematics/lean/lean-3.35.1-r1.ebuild | 75 ++++++++++++++++++++++++++++++ sci-mathematics/lean/lean-3.35.1.ebuild | 68 --------------------------- 2 files changed, 75 insertions(+), 68 deletions(-) create mode 100644 sci-mathematics/lean/lean-3.35.1-r1.ebuild delete mode 100644 sci-mathematics/lean/lean-3.35.1.ebuild (limited to 'sci-mathematics') diff --git a/sci-mathematics/lean/lean-3.35.1-r1.ebuild b/sci-mathematics/lean/lean-3.35.1-r1.ebuild new file mode 100644 index 000000000000..cc208dc27850 --- /dev/null +++ b/sci-mathematics/lean/lean-3.35.1-r1.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MAJOR=$(ver_cut 1) +CMAKE_IN_SOURCE_BUILD="ON" + +inherit cmake optfeature readme.gentoo-r1 + +DESCRIPTION="The Lean Theorem Prover" +HOMEPAGE="https://leanprover-community.github.io/" + +if [[ "${PV}" == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/leanprover-community/lean.git" +else + SRC_URI="https://github.com/leanprover-community/lean/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi +S="${WORKDIR}/lean-${PV}/src" + +LICENSE="Apache-2.0" +SLOT="0/${MAJOR}" +IUSE="debug +json +threads" + +RDEPEND="dev-libs/gmp" +DEPEND="${RDEPEND}" + +PATCHES=( "${FILESDIR}/${PN}-CMakeLists-fix_flags.patch" ) + +src_configure() { + local CMAKE_BUILD_TYPE + if use debug; then + CMAKE_BUILD_TYPE="Debug" + else + CMAKE_BUILD_TYPE="Release" + fi + + local mycmakeargs=( + -DALPHA=ON + -DAUTO_THREAD_FINALIZATION=ON + -DJSON=$(usex json) + -DLEAN_EXTRA_CXX_FLAGS="${CXXFLAGS}" + -DMULTI_THREAD=$(usex threads) + -DUSE_GITHASH=OFF + ) + cmake_src_configure +} + +src_test() { + local myctestargs=( + # Disable problematic "style_check" cpplint test, + # this also removes the python test dependency + --exclude-regex style_check + ) + cmake_src_test +} + +src_install() { + cmake_src_install + + local DISABLE_AUTOFORMATTING="yes" + local DOC_CONTENTS="You probably want to use lean with mathlib, you can either: + - Do not install mathlib globally and use local versions + - Use leanproject from sci-mathematics/mathlib-tools + $ leanproject global-install + - Use leanpkg and compile mathlib (which will take some time) + $ leanpkg install https://github.com/leanprover-community/mathlib" + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog +} diff --git a/sci-mathematics/lean/lean-3.35.1.ebuild b/sci-mathematics/lean/lean-3.35.1.ebuild deleted file mode 100644 index 71e0662ac80e..000000000000 --- a/sci-mathematics/lean/lean-3.35.1.ebuild +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -CMAKE_IN_SOURCE_BUILD="ON" - -inherit cmake optfeature - -DESCRIPTION="The Lean Theorem Prover" -HOMEPAGE="https://leanprover-community.github.io/" - -if [[ "${PV}" == *9999* ]]; then - MAJOR=3 # sync this periodically for the live version - inherit git-r3 - EGIT_REPO_URI="https://github.com/leanprover-community/lean.git" -else - MAJOR=$(ver_cut 1) - SRC_URI="https://github.com/leanprover-community/lean/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~x86" -fi -S="${WORKDIR}/lean-${PV}/src" - -LICENSE="Apache-2.0" -SLOT="0/${MAJOR}" -IUSE="debug +json +threads" - -RDEPEND="dev-libs/gmp" -DEPEND="${RDEPEND}" - -PATCHES=( "${FILESDIR}/${PN}-CMakeLists-fix_flags.patch" ) - -src_configure() { - local CMAKE_BUILD_TYPE - if use debug; then - CMAKE_BUILD_TYPE="Debug" - else - CMAKE_BUILD_TYPE="Release" - fi - - local mycmakeargs=( - -DALPHA=ON - -DAUTO_THREAD_FINALIZATION=ON - -DJSON=$(usex json) - -DLEAN_EXTRA_CXX_FLAGS="${CXXFLAGS}" - -DMULTI_THREAD=$(usex threads) - -DUSE_GITHASH=OFF - ) - cmake_src_configure -} - -src_test() { - local myctestargs=( - # Disable problematic "style_check" cpplint test, - # this also removes the python test dependency - --exclude-regex style_check - ) - cmake_src_test -} - -pkg_postinst() { - elog "You probably want to use lean with mathlib, you can either:" - elog " - Do not install mathlib globally and use local versions" - elog " - Use leanproject from sci-mathematics/mathlib-tools" - elog " $ leanproject global-install" - elog " - Use leanpkg and compile mathlib (which will take some time)" - elog " $ leanpkg install https://github.com/leanprover-community/mathlib" -} -- cgit v1.2.3-65-gdbad