summaryrefslogtreecommitdiff
path: root/www-apps/isso/isso-9999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/isso/isso-9999.ebuild')
-rw-r--r--www-apps/isso/isso-9999.ebuild96
1 files changed, 53 insertions, 43 deletions
diff --git a/www-apps/isso/isso-9999.ebuild b/www-apps/isso/isso-9999.ebuild
index fec2a933..1363ca68 100644
--- a/www-apps/isso/isso-9999.ebuild
+++ b/www-apps/isso/isso-9999.ebuild
@@ -27,15 +27,16 @@ if [[ $PV == *9999* ]]; then
VCS_DEPEND="dev-vcs/git[curl]"
else
inherit user distutils-r1
- ALMOND_PV=0.2.9
- RJS_PV=2.1.11
- TEXT_PV=2.0.10
- DOMREADY_PV=2.0.1
- SRC_URI="https://github.com/posativ/${PN}/archive/${PV}.tar.gz
- https://github.com/jrburke/almond/archive/${ALMOND_PV}.tar.gz -> almond-${ALMOND_PV}.tar.gz
- https://github.com/jrburke/r.js/archive/${RJS_PV}.tar.gz -> r.js-${RJS_PV}.tar.gz
- https://github.com/requirejs/text/archive/${TEXT_PV}.tar.gz -> requirejs-text-${TEXT_PV}.tar.gz
- https://github.com/requirejs/domReady/archive/${DOMREADY_PV}.tar.gz -> requirejs-domReady-${DOMREADY_PV}.tar.gz"
+ ALMOND_PV=-0.2.9
+ RJS_PV=-2.1.11
+ TEXT_PV=-2.0.10
+ DOMREADY_PV=-2.0.1
+ SRC_URI="https://github.com/posativ/${PN}/archive/${PV}.tar.gz -> ${P}-src.tar.gz
+ !binary? ( https://github.com/jrburke/almond/archive/${ALMOND_PV}.tar.gz -> almond${ALMOND_PV}.tar.gz
+ https://github.com/jrburke/r.js/archive/${RJS_PV}.tar.gz -> r.js${RJS_PV}.tar.gz
+ https://github.com/requirejs/text/archive/${TEXT_PV}.tar.gz -> requirejs-text${TEXT_PV}.tar.gz
+ https://github.com/requirejs/domReady/archive/${DOMREADY_PV}.tar.gz -> requirejs-domReady${DOMREADY_PV}.tar.gz )
+ binary? ( mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz )"
fi
DESCRIPTION="lightweight Disqus alternative"
@@ -44,7 +45,8 @@ HOMEPAGE="http://posativ.org/isso/ https://pypi.python.org/pypi/isso/ https://gi
LICENSE="MIT BSD"
SLOT="0"
KEYWORDS=""
-IUSE="debug doc test"
+IUSE="binary debug doc test"
+[[ ${PV} == *9999* ]] && REQUIRED_USE="!binary"
DOCS=( README.md CHANGES.rst docs/{contribute.rst,faq.rst,isso.example.cfg} )
LIBDEPEND="dev-python/html5lib[${PYTHON_USEDEP}]
@@ -59,8 +61,8 @@ LIBDEPEND="dev-python/html5lib[${PYTHON_USEDEP}]
">=dev-python/werkzeug-0.9[$(python_gen_usedep 'python3*')]" \
'python3*')"
HDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
- dev-ruby/sass
- net-libs/nodejs
+ !binary? ( dev-ruby/sass
+ net-libs/nodejs )
doc? ( dev-python/sphinx )"
DEPEND="${HDEPEND}
test? ( dev-python/nose[${PYTHON_USEDEP}]
@@ -71,17 +73,10 @@ RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
pkg_setup() {
enewuser ${PN}
- if [[ ${PV} == *9999* ]]; then
- TEXT_D=${WORKDIR}/text.git
- ALMOND_D=${WORKDIR}/almond.git
- RJS_D=${WORKDIR}/r.js.git
- DOMREADY_D=${WORKDIR}/domReady.git
- else
- TEXT_D=${WORKDIR}/text-${TEXT_PV}
- ALMOND_D=${WORKDIR}/almond-${ALMOND_PV}
- RJS_D=${WORKDIR}/r.js-${RJS_PV}
- DOMREADY_D=${WORKDIR}/domReady-${DOMREADY_PV}
- fi
+ TEXT_D=${WORKDIR}/text${TEXT_PV:-.git}
+ ALMOND_D=${WORKDIR}/almond${ALMOND_PV:-.git}
+ RJS_D=${WORKDIR}/r.js${RJS_PV:-.git}
+ DOMREADY_D=${WORKDIR}/domReady${DOMREADY_PV:-.git}
RJS=${RJS_D}/r.js
}
@@ -105,29 +100,43 @@ src_unpack() {
EGIT_CHECKOUT_DIR=${WORKDIR}/${EGIT_REPO_URI##*/} git-r3_src_unpack
); done
else
- default
+ # binary tarball clobbers source tarball
+ unpack ${A/${P}.tar.gz/}
+ if use binary; then
+ mkdir binary && pushd binary 2>/dev/null || die
+ unpack ${P}.tar.gz
+ popd 2>/dev/null || die
+ fi
+ fi
+ if ! use binary; then
+ mkdir -p "${S}"/isso/js/components/{requirejs-text,almond,requirejs-domready} || die
+ cp "${TEXT_D}"/text.js "${S}"/isso/js/components/requirejs-text/ || die
+ cp "${ALMOND_D}"/almond.js "${S}"/isso/js/components/almond/ || die
+ cp "${DOMREADY_D}"/domReady.js "${S}"/isso/js/components/requirejs-domready/ || die
+ else
+ cp binary/${P}/isso/css/isso.css "${S}"/isso/css/ || die
+ cp binary/${P}/isso/js/{count.min.js,embed.min.js} "${S}"/isso/js/ || die
+ use debug && cp binary/${P}/isso/js/{count.dev.js,embed.dev.js} "${S}"/isso/js/ || die
fi
- mkdir -p "${S}"/isso/js/components/{requirejs-text,almond,requirejs-domready} || die
- cp "${TEXT_D}"/text.js "${S}"/isso/js/components/requirejs-text/ || die
- cp "${ALMOND_D}"/almond.js "${S}"/isso/js/components/almond/ || die
- cp "${DOMREADY_D}"/domReady.js "${S}"/isso/js/components/requirejs-domready/ || die
}
src_compile() {
- # build r.js
- pushd "${RJS_D}" 2>/dev/null || die
- node dist.js || die
- popd 2>/dev/null || die
-
- # generate css
- scss isso/css/isso.scss isso/css/isso.css || die
-
- # generate js using r.js
- node "${RJS}" -o isso/js/build.embed.js || die
- node "${RJS}" -o isso/js/build.count.js || die
- if use debug; then
- node "${RJS}" -o isso/js/build.embed.js optimize="none" out="isso/js/embed.dev.js" || die
- node "${RJS}" -o isso/js/build.count.js optimize="none" out="isso/js/count.dev.js" || die
+ if ! use binary; then
+ # build r.js
+ pushd "${RJS_D}" 2>/dev/null || die
+ node dist.js || die
+ popd 2>/dev/null || die
+
+ # generate css
+ scss isso/css/isso.scss isso/css/isso.css || die
+
+ # generate js using r.js
+ node "${RJS}" -o isso/js/build.embed.js || die
+ node "${RJS}" -o isso/js/build.count.js || die
+ if use debug; then
+ node "${RJS}" -o isso/js/build.embed.js optimize="none" out="isso/js/embed.dev.js" || die
+ node "${RJS}" -o isso/js/build.count.js optimize="none" out="isso/js/count.dev.js" || die
+ fi
fi
if use doc; then
@@ -148,7 +157,8 @@ python_test() {
--with-coverage --cover-package=isso \
isso/ specs/ \
|| die "tests failed"
- #nosetests --with-doctest --with-doctest-ignore-unicode \
+ #PYTHONPATH="${BUILD_DIR}:${PYTHONPATH}" nosetests \
+ # --with-doctest --with-doctest-ignore-unicode \
# --with-coverage --cover-package=isso \
# isso/ specs/ \
# || die "tests failed"