diff options
-rw-r--r-- | dev-python/gpep517/gpep517-6-r1.ebuild | 41 | ||||
-rw-r--r-- | dev-python/installer/installer-0.5.1-r1.ebuild | 37 | ||||
-rw-r--r-- | dev-python/tomli/tomli-2.0.1-r1.ebuild | 36 | ||||
-rw-r--r-- | eclass/distutils-r1.eclass | 154 | ||||
-rw-r--r-- | sci-mathematics/pari/pari-2.13.4-r1.ebuild | 117 |
5 files changed, 169 insertions, 216 deletions
diff --git a/dev-python/gpep517/gpep517-6-r1.ebuild b/dev-python/gpep517/gpep517-6-r1.ebuild deleted file mode 100644 index ee64cb1d660f..000000000000 --- a/dev-python/gpep517/gpep517-6-r1.ebuild +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# please keep this ebuild at EAPI 7 -- sys-apps/portage dep -EAPI=7 - -DISTUTILS_USE_PEP517=no -PYTHON_COMPAT=( pypy3 python3_{8..11} ) - -inherit distutils-r1 - -DESCRIPTION="A backend script to aid installing Python packages in Gentoo" -HOMEPAGE=" - https://pypi.org/project/gpep517/ - https://github.com/mgorny/gpep517/ -" -SRC_URI=" - https://github.com/mgorny/gpep517/archive/v${PV}.tar.gz - -> ${P}.gh.tar.gz -" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" - -RDEPEND=" - >=dev-python/installer-0.5.0[${PYTHON_USEDEP}] - >=dev-python/tomli-1.2.3[${PYTHON_USEDEP}] -" - -distutils_enable_tests pytest - -python_install() { - python_domodule gpep517 - python_newscript - gpep517 <<-EOF - #!${EPREFIX}/usr/bin/python - import sys - from gpep517.__main__ import main - sys.exit(main()) - EOF -} diff --git a/dev-python/installer/installer-0.5.1-r1.ebuild b/dev-python/installer/installer-0.5.1-r1.ebuild deleted file mode 100644 index 4f89e7433018..000000000000 --- a/dev-python/installer/installer-0.5.1-r1.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# please keep this ebuild at EAPI 7 -- sys-apps/portage dep -EAPI=7 - -DISTUTILS_USE_PEP517=no -PYTHON_COMPAT=( python3_{8..11} pypy3 ) - -inherit distutils-r1 - -DESCRIPTION="A library for installing Python wheels" -HOMEPAGE=" - https://pypi.org/project/installer/ - https://github.com/pypa/installer/ - https://installer.readthedocs.io/en/latest/ -" -SRC_URI=" - https://github.com/pypa/installer/archive/${PV}.tar.gz - -> ${P}.gh.tar.gz - https://files.pythonhosted.org/packages/py3/${PN::1}/${PN}/${P%_p*}-py3-none-any.whl - -> ${P%_p*}-py3-none-any.whl.zip -" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" - -BDEPEND=" - app-arch/unzip -" - -distutils_enable_tests pytest - -python_compile() { - python_domodule src/installer "${WORKDIR}"/*.dist-info -} diff --git a/dev-python/tomli/tomli-2.0.1-r1.ebuild b/dev-python/tomli/tomli-2.0.1-r1.ebuild deleted file mode 100644 index 338d877a350d..000000000000 --- a/dev-python/tomli/tomli-2.0.1-r1.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2021-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -# please keep this ebuild at EAPI 7 -- sys-apps/portage dep -EAPI=7 - -DISTUTILS_USE_PEP517=no -PYTHON_COMPAT=( python3_{8..11} pypy3 ) - -inherit distutils-r1 - -DESCRIPTION="A lil' TOML parser" -HOMEPAGE=" - https://pypi.org/project/tomli/ - https://github.com/hukkin/tomli/ -" -SRC_URI=" - https://github.com/hukkin/tomli/archive/${PV}.tar.gz - -> ${P}.gh.tar.gz - https://files.pythonhosted.org/packages/py3/${PN::1}/${PN}/${P}-py3-none-any.whl - -> ${P}-py3-none-any.whl.zip -" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-macos ~x64-macos ~x64-solaris" - -BDEPEND=" - app-arch/unzip -" - -distutils_enable_tests unittest - -python_compile() { - python_domodule src/tomli "${WORKDIR}"/*.dist-info -} diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 5fb97b35fed3..7829e521ca7b 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -106,8 +106,6 @@ esac # # - maturin - maturin backend # -# - no - no PEP517 build system (see below) -# # - pbr - pbr backend # # - pdm - pdm.pep517 backend @@ -123,17 +121,6 @@ esac # # The variable needs to be set before the inherit line. The eclass # adds appropriate build-time dependencies and verifies the value. -# -# The special value "no" indicates that the package has no build system. -# This is not equivalent to unset DISTUTILS_USE_PEP517 (legacy mode). -# It causes the eclass not to include any build system dependencies -# and to disable default python_compile() and python_install() -# implementations. Baseline Python deps and phase functions will still -# be set (depending on the value of DISTUTILS_OPTIONAL). Most of -# the other eclass functions will work. Testing venv will be provided -# in ${BUILD_DIR}/install after python_compile(), and if any (other) -# files are found in ${BUILD_DIR}/install after python_install(), they -# will be merged into ${D}. # @ECLASS_VARIABLE: DISTUTILS_USE_SETUPTOOLS # @DEFAULT_UNSET @@ -225,10 +212,6 @@ _distutils_set_globals() { bdep+=' >=dev-util/maturin-0.12.7[${PYTHON_USEDEP}]' ;; - no) - # undo the generic deps added above - bdep= - ;; pbr) bdep+=' >=dev-python/pbr-5.8.0-r1[${PYTHON_USEDEP}]' @@ -809,7 +792,7 @@ distutils_install_for_testing() { distutils_write_namespace() { debug-print-function ${FUNCNAME} "${@}" - if [[ ! ${DISTUTILS_USE_PEP517:-no} != no ]]; then + if [[ ! ${DISTUTILS_USE_PEP517} ]]; then die "${FUNCNAME} is available only in PEP517 mode" fi if [[ ${EBUILD_PHASE} != test || ! ${BUILD_DIR} ]]; then @@ -932,9 +915,6 @@ _distutils-r1_print_package_versions() { dev-util/maturin ) ;; - no) - return - ;; pbr) packages+=( dev-python/pbr @@ -1236,10 +1216,6 @@ distutils_pep517_install() { debug-print-function ${FUNCNAME} "${@}" [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: root" - if [[ ! ${DISTUTILS_USE_PEP517:-no} != no ]]; then - die "${FUNCNAME} is available only in PEP517 mode" - fi - local root=${1} local -x WHEEL_BUILD_DIR=${BUILD_DIR}/wheel mkdir -p "${WHEEL_BUILD_DIR}" || die @@ -1384,9 +1360,6 @@ distutils-r1_python_compile() { in_iuse debug && use debug && MATURIN_PEP517_ARGS+=" --cargo-extra-args=--profile=dev" ;; - no) - return - ;; esac if [[ ${DISTUTILS_USE_PEP517} ]]; then @@ -1397,7 +1370,33 @@ distutils-r1_python_compile() { addpredict /usr/lib/portage/pym addpredict /usr/local # bug 498232 - distutils_pep517_install "${BUILD_DIR}/install" + local root=${BUILD_DIR}/install + distutils_pep517_install "${root}" + + # copy executables to python-exec directory + # we do it early so that we can alter bindir recklessly + local bindir=${root}${EPREFIX}/usr/bin + local rscriptdir=${root}$(python_get_scriptdir) + [[ -d ${rscriptdir} ]] && + die "${rscriptdir} should not exist!" + if [[ -d ${bindir} ]]; then + mkdir -p "${rscriptdir}" || die + cp -a --reflink=auto "${bindir}"/. "${rscriptdir}"/ || die + fi + + # enable venv magic inside the install tree + mkdir -p "${bindir}" || die + ln -s "${PYTHON}" "${bindir}/${EPYTHON}" || die + ln -s "${EPYTHON}" "${bindir}/python3" || die + ln -s "${EPYTHON}" "${bindir}/python" || die + cat > "${bindir}"/pyvenv.cfg <<-EOF || die + include-system-site-packages = true + EOF + + # we need to change shebangs to point to the venv-python + find "${bindir}" -type f -exec sed -i \ + -e "1s@^#!\(${EPREFIX}/usr/bin/\(python\|pypy\)\)@#!${root}\1@" \ + {} + || die fi } @@ -1508,11 +1507,21 @@ distutils-r1_python_test() { distutils-r1_python_install() { debug-print-function ${FUNCNAME} "${@}" - [[ ${DISTUTILS_USE_PEP517} == no ]] && return _python_check_EPYTHON local scriptdir=${EPREFIX}/usr/bin - if [[ ! ${DISTUTILS_USE_PEP517} ]]; then + if [[ ${DISTUTILS_USE_PEP517} ]]; then + local root=${BUILD_DIR}/install + # remove the altered bindir, executables from the package + # are already in scriptdir + rm -r "${root}${scriptdir}" || die + if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then + local wrapped_scriptdir=${root}$(python_get_scriptdir) + if [[ -d ${wrapped_scriptdir} ]]; then + mv "${wrapped_scriptdir}" "${root}${scriptdir}" || die + fi + fi + else local root=${D%/}/_${EPYTHON} [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/} @@ -1565,6 +1574,18 @@ distutils-r1_python_install() { esetup.py "${args[@]}" fi + + if [[ ! ${DISTUTILS_SINGLE_IMPL} || ${DISTUTILS_USE_PEP517} ]]; then + multibuild_merge_root "${root}" "${D%/}" + if [[ ${DISTUTILS_USE_PEP517} ]]; then + # we need to recompile everything here in order to embed + # the correct paths + python_optimize "${D%/}$(python_get_sitedir)" + fi + fi + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + _distutils-r1_wrap_scripts "${scriptdir}" + fi } # @FUNCTION: distutils-r1_python_install_all @@ -1754,43 +1775,6 @@ distutils-r1_src_configure() { return ${ret} } -# @FUNCTION: _distutils-r1_post_python_compile -# @INTERNAL -# @DESCRIPTION: -# Post-phase function called after python_compile. In PEP517 mode, -# it adjusts the install tree for venv-style usage. -_distutils-r1_post_python_compile() { - debug-print-function ${FUNCNAME} "${@}" - - local root=${BUILD_DIR}/install - if [[ ${DISTUTILS_USE_PEP517} && -d ${root} ]]; then - # copy executables to python-exec directory - # we do it early so that we can alter bindir recklessly - local bindir=${root}${EPREFIX}/usr/bin - local rscriptdir=${root}$(python_get_scriptdir) - [[ -d ${rscriptdir} ]] && - die "${rscriptdir} should not exist!" - if [[ -d ${bindir} ]]; then - mkdir -p "${rscriptdir}" || die - cp -a --reflink=auto "${bindir}"/. "${rscriptdir}"/ || die - fi - - # enable venv magic inside the install tree - mkdir -p "${bindir}" || die - ln -s "${PYTHON}" "${bindir}/${EPYTHON}" || die - ln -s "${EPYTHON}" "${bindir}/python3" || die - ln -s "${EPYTHON}" "${bindir}/python" || die - cat > "${bindir}"/pyvenv.cfg <<-EOF || die - include-system-site-packages = true - EOF - - # we need to change shebangs to point to the venv-python - find "${bindir}" -type f -exec sed -i \ - -e "1s@^#!\(${EPREFIX}/usr/bin/\(python\|pypy\)\)@#!${root}\1@" \ - {} + || die - fi -} - distutils-r1_src_compile() { debug-print-function ${FUNCNAME} "${@}" local ret=0 @@ -1856,40 +1840,6 @@ distutils-r1_src_test() { _distutils-r1_post_python_install() { debug-print-function ${FUNCNAME} "${@}" - local root=${D%/}/_${EPYTHON} - [[ ${DISTUTILS_USE_PEP517} ]] && root=${BUILD_DIR}/install - local scriptdir=${EPREFIX}/usr/bin - if [[ -d ${root} && ${DISTUTILS_USE_PEP517} ]]; then - # remove the altered bindir, executables from the package - # are already in scriptdir - rm -r "${root}${scriptdir}" || die - if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then - local wrapped_scriptdir=${root}$(python_get_scriptdir) - if [[ -d ${wrapped_scriptdir} ]]; then - mv "${wrapped_scriptdir}" "${root}${scriptdir}" || die - fi - fi - - # prune empty directories to see if ${root} contains anything - # to merge - find "${BUILD_DIR}"/install -type d -empty -delete || die - fi - - if [[ -d ${root} ]]; then - if [[ ! ${DISTUTILS_SINGLE_IMPL} || ${DISTUTILS_USE_PEP517} ]]; then - multibuild_merge_root "${root}" "${D%/}" - fi - fi - local pypath=${D%/}$(python_get_sitedir) - if [[ ${DISTUTILS_USE_PEP517} && -d ${pypath} ]]; then - # we need to recompile everything here in order to embed - # the correct paths - python_optimize "${pypath}" - fi - if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then - _distutils-r1_wrap_scripts "${scriptdir}" - fi - local forbidden_package_names=( examples test tests .pytest_cache .hypothesis _trial_temp diff --git a/sci-mathematics/pari/pari-2.13.4-r1.ebuild b/sci-mathematics/pari/pari-2.13.4-r1.ebuild new file mode 100644 index 000000000000..0f105d54107a --- /dev/null +++ b/sci-mathematics/pari/pari-2.13.4-r1.ebuild @@ -0,0 +1,117 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit flag-o-matic toolchain-funcs + +DESCRIPTION="Computer-aided number theory C library and tools" +HOMEPAGE="https://pari.math.u-bordeaux.fr/" +SRC_URI="https://pari.math.u-bordeaux.fr/pub/${PN}/unix/${P}.tar.gz" + +LICENSE="GPL-2" + +# The subslot is the value of $soname_num obtained from +# upstream's config/version script. +SLOT="0/7" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux" +IUSE="data doc fltk gmp test threads X" +RESTRICT="!test? ( test )" + +BDEPEND=" + virtual/pkgconfig + doc? ( virtual/latex-base ) +" +DEPEND=" + sys-libs/readline:0= + data? ( sci-mathematics/pari-data ) + doc? ( X? ( x11-misc/xdg-utils ) ) + fltk? ( x11-libs/fltk:1= ) + gmp? ( dev-libs/gmp:0= ) + X? ( x11-libs/libX11:0= )" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}/${PN}"-2.9.4-strip.patch + "${FILESDIR}/${PN}"-2.9.4-ppc.patch + "${FILESDIR}/${PN}"-2.11.2-no-automagic.patch + "${FILESDIR}/${PN}"-2.9.4-fltk-detection.patch + "${FILESDIR}/${PN}"-2.11.2-Makefile-LDFLAGS.patch + "${FILESDIR}/${PN}"-2.11.2-Makefile-docinstall.patch +) + +src_prepare() { + default + + # move doc dir to a gentoo doc dir and replace acroread by xdg-open + sed -i \ + -e "s:\$d = \$0:\$d = '${EPREFIX}/usr/share/doc/${PF}':" \ + -e 's:"acroread":"xdg-open":' \ + doc/gphelp.in || die "Failed to fix doc dir" +} + +src_configure() { + tc-export CC CXX PKG_CONFIG + + # Workaraound to "asm operand has impossible constraints" as + # suggested in bug #499996. + use x86 && append-cflags $(test-flags-CC -fno-stack-check) + + # need to force optimization here, as it breaks without + if is-flag -O0; then + replace-flags -O0 -O2 + elif ! is-flag -O?; then + append-flags -O2 + fi + + # sysdatadir installs a pari.cfg stuff which is informative only. + # It is supposed to be for "architecture-dependent" data. + # It needs to be easily discoverable for downstream packages such as gp2c. + # We set LD to "" so that it is set to the value of the compiler used + # which is how a normal end user is expected to configure it. pari's build + # system do not cope very well with a naked linker, it is expecting a + # compiler driver. See https://bugs.gentoo.org/722090 + LD="" ./Configure \ + --prefix="${EPREFIX}"/usr \ + --datadir="${EPREFIX}/usr/share/${PN}" \ + --libdir="${EPREFIX}/usr/$(get_libdir)" \ + --sysdatadir="${EPREFIX}"/usr/share/pari \ + --mandir="${EPREFIX}"/usr/share/man/man1 \ + --with-readline="${EPREFIX}"/usr \ + --with-readline-lib="${EPREFIX}/usr/$(get_libdir)" \ + --with-ncurses-lib="${EPREFIX}/usr/$(get_libdir)" \ + $(use_with fltk) \ + $(use_with gmp) \ + --without-qt \ + $(usex threads "--mt=pthread" "" "" "") \ + || die "./Configure failed" +} + +src_compile() { + emake gp + + if use doc; then + # To prevent sandbox violations by metafont + VARTEXFONTS="${T}/fonts" emake docpdf + fi +} + +src_test() { + # Welcome to the jungle, where the tests fail if you make your + # terminal bigger. + emake COLUMNS=80 test-all +} + +src_install() { + DOCS=( AUTHORS CHANGES* COMPAT NEW README* ) + default + + if use doc; then + docompress -x "/usr/share/doc/${PF}" + emake \ + DESTDIR="${D}" \ + EXDIR="${ED}/usr/share/doc/${PF}/examples" \ + DOCDIR="${ED}/usr/share/doc/${PF}" \ + install-doc + fi +} |