logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

uglifyjs-3.17.4.ebuild (1159B)


  1. # Copyright 1999-2022 Gentoo Authors
  2. # Copyright 2023 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  3. # Distributed under the terms of the GNU General Public License v2
  4. EAPI=8
  5. inherit nodejs
  6. MY_PN="UglifyJS"
  7. DESCRIPTION="JavaScript parser, minifier, compressor and beautifier toolkit"
  8. HOMEPAGE="https://lisperator.net/uglifyjs/"
  9. SRC_URI="https://github.com/mishoo/${MY_PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
  10. S="${WORKDIR}/${MY_PN}-${PV}"
  11. LICENSE="BSD-2"
  12. SLOT="0"
  13. KEYWORDS="~amd64 ~x86"
  14. IUSE="test"
  15. RESTRICT="!test? ( test )"
  16. DEPEND="test? ( dev-nodejs/semver )"
  17. RDEPEND="net-libs/nodejs"
  18. BDEPEND="sys-apps/help2man"
  19. DOCS=( README.md )
  20. NPM_FLAGS=(
  21. --audit false
  22. --color false
  23. --foreground-scripts
  24. --global
  25. --offline
  26. --progress false
  27. --save false
  28. --verbose
  29. )
  30. src_prepare() {
  31. default
  32. # One doesn't simply packages acorn
  33. rm test/mocha/exports.js test/mocha/imports.js || die
  34. }
  35. src_compile() {
  36. help2man -s1 -o uglifyjs.1 -N ./bin/uglifyjs || die
  37. npm "${NPM_FLAGS[@]}" pack || die
  38. }
  39. src_install() {
  40. einstalldocs
  41. doman uglifyjs.1
  42. npm "${NPM_FLAGS[@]}" \
  43. --prefix "${ED}"/usr \
  44. install \
  45. uglify-js-${PV}.tgz || die
  46. }