mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-12 00:54:37 +08:00
87 lines
2.5 KiB
Bash
87 lines
2.5 KiB
Bash
#
|
|
# Software packages for Chakra, part of www.chakra-project.org
|
|
#
|
|
# Maintainer: H W Tovetjärn (totte) <totte@tott.es>
|
|
# Contributors: R Biegelmeyer (RenanBS) <renan.biegel@gmail.com>
|
|
# Sébastien Luttringer
|
|
# Angel Velasquez <angvp@archlinux.org>
|
|
# Fabio Volpe <volpefabio@gmail.com>
|
|
|
|
pkgbase=python-sphinx
|
|
pkgname=('python3-sphinx' 'python2-sphinx')
|
|
pkgver=1.1.3
|
|
pkgrel=2
|
|
arch=('any')
|
|
url='http://sphinx.pocoo.org/'
|
|
license=('GPL')
|
|
makedepends=(
|
|
'python3-setuptools'
|
|
'python3-docutils'
|
|
'python3-jinja'
|
|
'python3-pygments'
|
|
'python2-setuptools'
|
|
'python2-docutils'
|
|
'python2-jinja'
|
|
'python2-pygments'
|
|
)
|
|
checkdepends=(
|
|
'python3-nose'
|
|
'python2-nose'
|
|
'texlive-latexextra'
|
|
)
|
|
source=("http://pypi.python.org/packages/source/S/Sphinx/Sphinx-$pkgver.tar.gz")
|
|
sha512sums=('b8312140d752bf557c8e41728513812aff3e5d0a89af88dea9da0df21bf09c8315f13305d7a724a5596d0192b167d613065ea564c6d92e4ffb23f1f246dbf052')
|
|
|
|
build() {
|
|
cd Sphinx-$pkgver
|
|
|
|
# remove build directory (avoid sed issues)
|
|
[[ -e build ]] && rm -rf build
|
|
|
|
# python builds
|
|
python3 setup.py build --build-lib=build/python3
|
|
python2 setup.py build --build-lib=build/python2
|
|
|
|
# change python3 interpreter
|
|
find build/python3 -type f -exec \
|
|
sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python3,' {} \;
|
|
|
|
# change python2 interpreter
|
|
find build/python2 -type f -exec \
|
|
sed -i '1s,^#! \?/usr/bin/\(env \|\)python$,#!/usr/bin/python2,' {} \;
|
|
|
|
# change sphinx-binaries name in source code
|
|
find build/python2 -type f -name '*.py' -exec \
|
|
sed -ri 's,(sphinx-(:?build|apidoc|autogen|quickstart)),\12,' {} \;
|
|
}
|
|
|
|
check() {
|
|
#(cd Sphinx-$pkgver/build/python3/ && python3 ../../tests/run.py -d)
|
|
(cd Sphinx-$pkgver/build/python2/ && python2 ../../tests/run.py -d)
|
|
}
|
|
|
|
package_python3-sphinx() {
|
|
pkgdesc='Python 3 documentation generator'
|
|
depends=('python3' 'python3-jinja' 'python3-pygments' 'python3-docutils')
|
|
optdepends=('texlive-latexextra: for generation of PDF documentation')
|
|
|
|
cd Sphinx-$pkgver
|
|
python3 setup.py build --build-lib=build/python3 \
|
|
install --root="$pkgdir" --optimize=1
|
|
}
|
|
|
|
package_python2-sphinx() {
|
|
pkgdesc='Python 2 documentation generator'
|
|
depends=('python2' 'python2-jinja' 'python2-pygments' 'python2-docutils')
|
|
optdepends=('texlive-latexextra: for generation of PDF documentation')
|
|
|
|
cd Sphinx-$pkgver
|
|
python2 setup.py build --build-lib=build/python2 \
|
|
install --root="$pkgdir" --optimize=1
|
|
|
|
# fix python3 conflict
|
|
for _f in "$pkgdir"/usr/bin/*; do
|
|
mv -v "$_f" "${_f}2"
|
|
done
|
|
}
|