Page MenuHomeFreeBSD

www/yarn: Update to version 0.24.6
ClosedPublic

Authored by jrm on May 13 2017, 12:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 17, 4:09 PM
Unknown Object (File)
Thu, Nov 14, 10:46 AM
Unknown Object (File)
Thu, Nov 14, 3:20 AM
Unknown Object (File)
Mon, Nov 4, 11:44 AM
Unknown Object (File)
Sun, Nov 3, 10:16 PM
Unknown Object (File)
Sun, Nov 3, 10:16 PM
Unknown Object (File)
Sun, Nov 3, 10:16 PM
Unknown Object (File)
Sun, Nov 3, 10:16 PM
Subscribers

Details

Summary

The packages that were in the tarball have been removed and listed in
package.json. Please confirm that this hasn't messed something up; I have
almost no experience with node/npm. I did go through the tests described
at https://yarnpkg.com/en/docs/usage and all seemed fine, but please
confirm I didn't do something stupid.

Test Plan

portlint -C: OK
testport: OK (poudriere: 10.3-RELEASE-p10, i386 with all node options)

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 9248
Build 9699: arc lint + arc unit

Event Timeline

Stick with node6 as the default.

jrm retitled this revision from www/yarn: Update to version 0.24.4 and make www/node the default dependency to www/yarn: Update to version 0.24.4.May 13 2017, 8:16 PM
jrm retitled this revision from www/yarn: Update to version 0.24.4 to www/yarn: Update to version 0.24.5.May 22 2017, 9:34 AM

Hi Luca. I have been using this latest version of yarn a descent amount recently for work with the upcoming net-im/mastodon. All seems well from here. Have you had a chance to do any tests?

jlduran added a subscriber: jlduran.

I'm moving my suggestions here per request of the package maintainer:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219507

www/yarn/Makefile
39

Also add the link to yarnpkg:

${LN} -sf ../lib/node_modules/yarn/bin/yarnpkg ${STAGEDIR}${PREFIX}/bin/yarnpkg
www/yarn/pkg-plist
4

This needs the executable bit set

7

This is a Windows cmd file. It is better not to have the executable bit set.

10

This is a Windows cmd file. It is better not to have the executable bit set.

This revision now requires changes to proceed.May 30 2017, 11:53 AM
jrm edited edge metadata.
  • Use DISTVERSION
  • Remove PORTREVISION
  • Stop trying to remove files that are no longer in WRKSRC
  • Remove Windows cmd files
  • Create a link to yarnpkg in ${PREFIX}/bin
This revision is now accepted and ready to land.May 30 2017, 12:19 PM
jrm marked 4 inline comments as done.May 30 2017, 12:24 PM

And to you. The missing yarnpkg link was bad. :)

Actually, taking a closer look at $WRKSRC, I wonder if do-install should be changed.

WRKSRC is now simply

./bin
./bin/yarn
./bin/yarn.js
./bin/yarnpkg
./bin/yarnpkg.cmd
./bin/yarn.cmd
./package.json
./lib
./lib/v8-compile-cache.js
./lib/yarn-cli.js
./LICENSE

Why not just install what's in bin/ to ${PREFIX}/bin and what's in lib to ${PREFIX}/lib? Where should package.json go?

luca.pizzamiglio_gmail.com retitled this revision from www/yarn: Update to version 0.24.5 to www/yarn: Update to version 0.24.6.May 30 2017, 12:38 PM

I spent a couple of week on holiday. Today I performed several tests and I'm very happy with all of your modifications. Thanks for the contribution!

In D10696#227510, @jrm wrote:

Actually, taking a closer look at $WRKSRC, I wonder if do-install should be changed.

WRKSRC is now simply

./bin
./bin/yarn
./bin/yarn.js
./bin/yarnpkg
./bin/yarnpkg.cmd
./bin/yarn.cmd
./package.json
./lib
./lib/v8-compile-cache.js
./lib/yarn-cli.js
./LICENSE

Why not just install what's in bin/ to ${PREFIX}/bin and what's in lib to ${PREFIX}/lib? Where should package.json go?

yarn is a node module, so it should be installed where all other node modules are installed.
yarn, as module, is special, because it provides a couple of shell script that, for convenience, are made available using symbolic links.
Even if installing under ${PREFIX} should be doable, imho it's not consistent with node

I agree after taking a closer look at the source files and other yarn packages. I will proceed with the accepted changes. Thanks.

It should go in /usr/local/lib/node_modules/yarn/package.json.

If you want to be picky, you can replace "installationMethod": "tar", to "installationMethod": "pkg", in package.json.

Something like:

post-patch:
	@${REINPLACE_CMD} -i '' -e 's|"installationMethod": "tar"|"installationMethod": "pkg"|g' \
		${WRKSRC}/package.json

This is what the homebrew package does:

https://github.com/Homebrew/homebrew-core/blob/db259153b81c8a5db00e93fe7bc467228f9df8da/Formula/yarn.rb#L16

www/yarn/Makefile
39–40

Both these lines should probably use the RLN macro, so that you can use fully qualified paths. Something like:

${RLN} ${STAGEDIR}${PREFIX}/lib/node_modules/yarn/bin/yarn.js \
       ${STAGEDIR}${PREFIX}/bin/yarn
jrm edited edge metadata.
  • Patch package.json
  • Use RLN to create links

Thanks jlduran and mat.

This revision now requires review to proceed.May 30 2017, 4:05 PM
jlduran added inline comments.
www/yarn/Makefile
31–33

I'm sorry. I think the convention is to do it this way:

REINPLACE_ARGS=	-i ''

post-patch:
	@${RM} ${WRKSRC}/bin/*.cmd
	@${REINPLACE_CMD} -e 's|"installationMethod": "tar"|"installationMethod": "pkg"|g' \
		${WRKSRC}/package.json
This revision is now accepted and ready to land.May 31 2017, 11:10 AM
This revision was automatically updated to reflect the committed changes.
jrm marked an inline comment as done.