*/*: [QA] Use consistent function definition formatting
[gentoo.git] / dev-lang / coffee-script / coffee-script-1.12.5.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 MY_PN="coffeescript"
7
8 DESCRIPTION="A little language that compiles into javascript"
9 HOMEPAGE="https://coffeescript.org/"
10 SRC_URI="https://github.com/jashkenas/${MY_PN}/archive/${PV}.tar.gz
11         -> ${P}.tar.gz"
12 S="${WORKDIR}/${MY_PN}-${PV}"
13
14 LICENSE="MIT"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17
18 # This package has a test suite (that works), but it requires a number
19 # of NodeJS/NPM packages that aren't in the tree.
20 IUSE="doc examples"
21
22 RDEPEND="net-libs/nodejs"
23
24 src_install() {
25         local npm_module_dir="/usr/$(get_libdir)/node/${PN}"
26         insinto "${npm_module_dir}"
27         doins *.js package.json
28         doins -r lib
29         dodoc CONTRIBUTING.md README.md
30
31         use doc && dodoc -r documentation
32         use examples && dodoc -r examples
33
34         # The coffee and cake "binaries" use a relative path to find the lib
35         # directory, so we have to symlink them rather than use dobin().
36         exeinto "${npm_module_dir}/bin"
37         doexe bin/cake
38         doexe bin/coffee
39         dosym "${npm_module_dir}/bin/cake" "/usr/bin/cake"
40         dosym "${npm_module_dir}/bin/coffee" "/usr/bin/coffee"
41 }