Ticket #52827: Portfile

File Portfile, 3.4 KB (added by isomarcte (David Strawn), 8 years ago)

Update to 0.18.0

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2
3PortSystem          1.0
4PortGroup           github 1.0
5
6github.setup        yarnpkg yarn 0.18.0 v
7
8categories          devel
9platforms           darwin
10license             BSD
11maintainers         gmail.com:isomacrte
12
13supported_archs     noarch
14
15description         yarn package manager for JavaScript.
16long_description    Yarn is a package manager for your code. \
17                    It allows you to use and share code with other developers from around the world. \
18                    Yarn does this quickly, securely, and reliably so you dont ever have to worry. \
19                    Yarn allows you to use other developers solutions to different problems, making it easier for you to develop your software. \
20                    If you have problems, you can report issues or contribute back, and when the problem is fixed, you can use Yarn to keep it all up to date. \
21                    Code is shared through something called a package (sometimes referred to as a module). \
22                    A package contains all the code being shared as well as a package.json file which describes the package.
23
24homepage            https://yarnpkg.com/
25
26github.tarball_from releases
27
28checksums           rmd160 26ecfb7134e6a400fdceff7c97f535466c934dce \
29                    Sha256 8fb1843d2a1283972ff5fead9d6c9f9002de793ecec6dfec7abec908403ecd19
30
31distname            ${name}-${git.branch}
32
33worksrcdir          "dist"
34
35use_configure       no
36
37depends_run         bin:node:nodejs7
38
39patchfiles          patch-symbolic-link-fix.diff
40
41build {}
42
43# Since this is all just JavaScript code, there is nothing to _build_. We just copy the files into the correct locations.
44destroot {
45    xinstall -d -m 755 ${destroot}${prefix}/lib/node_modules/
46    file copy ${worksrcpath} ${destroot}${prefix}/lib/node_modules/
47    file rename ${destroot}${prefix}/lib/node_modules/${worksrcdir} ${destroot}${prefix}/lib/node_modules/${name}
48    ln -s ../lib/node_modules/${name}/bin/${name} ${destroot}${prefix}/bin/${name}
49}
50
51# Borrowed a bit of the well written opening from the macports npm packages.
52notes "
53It is not recommended to install packages globally. But if you do so\
54please be aware that they won't get cleaned up when you deactivate\
55or uninstall ${name}. Globally installed packages will leave a\
56symboolic link in ${prefix}/bin with the package resources installed\
57in \$HOME/.yarn-config/global by default. You can remove all globally\
58installed packages by first running the following command (assuming\
59you have xargs installed),
60
61$ ls -1 \$HOME/.yarn-config/global/node_modules/ | xargs sudo yarn global remove
62
63You should also check your \$HOME folder for leftover .yarn* files.
64
65This is only required if you have installed packages globally. If you did not\
66install anything globally then you can uninstall normally.
67
68Note, while this package doesn't conflict with NPM, if you have both NPM and\
69Yarn installed and you use both to install packages globally you may end up\
70with strange errors. If you do choose to install packages globally you should\
71probably only use one of these tools to do so.
72
73Rather than installing packages globally, you can set the environment variable\
74PREFIX and then yarn will install into that location instead, i.e.
75
76mkdir -p \$HOME/.yarnGlobal/bin # Or wherever you want
77export PREFIX=\$HOME/.yarnGlobal/bin
78export PATH=\$PREFIX:\$PATH
79"