You are not logged in.
If my package needs some nodejs packages to build/run, it's preferred to install them through AUR (when provided) or just add a line
npm install -g name_of_the_packageinto build() function?
Keep in mind that if the package has been already installed on the system by npm, installation from AUR will fail.
This is my pkgbuild https://aur.archlinux.org/packages/brackets/
Offline
A PKGBUILD shouldn't call an external package manager. npm will try to install everything globally unless configured to do otherwise, which requires root privileges and results in files in the root filesystem not tracked by pacman. If you want to install Brackets with a PKGBUILD, you should also package the Node dependencies (if they aren't packaged already).
Offline
If called inside build() function, shouldn't it be installed into the fakeroot, and then managed correctly by pacman? Shouldn't this avoid the need of root privileges?
Anyway, npm without the -g flag should install locally and not globally.
Offline
Maybe, but then different people like to handle third-party packages in different ways, you need to figure out how to uninstall the deps when the package is uninstalled, how to manage dependency versions... And a PKGBUILD shouldn't modify the $HOME directory. Better to just make PKGBUILDs for all the dependencies.
Offline
- If npm install inside a fakeroot, those files will be deleted on remove by pacman without issues.
- Local installlation of package executed by npm doesn't put files inside the user home directory, but inside a subdirectory of the package that requires it.
Packaging for AUR every possible npm dependency could be pointless: ther's no advantage and if someone doesn't use an AUR helper (like me) installing and keeping updated all those stuf should be frustrating.
Offline
I suggest to use tools that automatically converts npm packages to PKGBUILD files. Similar to what gem2arch and quarry do with ruby packages. With such tool maintaining AUR packages up-to-date becomes very easy.
I googled and found this project https://github.com/Filirom1/npm2arch
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
I don't want to sound pretentious, but nodejs is a strange framework (I don't know almost anything about it), and i.e. brackets has all this build dependencies (just the build ones...)
"grunt": "0.4.1",
"jasmine-node": "1.11.0",
"grunt-jasmine-node": "0.1.0",
"grunt-cli": "0.1.9",
"phantomjs": "1.9.0-1",
"grunt-lib-phantomjs": "0.3.0",
"grunt-contrib-jshint": "0.6.0",
"grunt-contrib-watch": "0.4.3",
"grunt-contrib-jasmine": "0.4.2",
"grunt-template-jasmine-requirejs": "0.1.0",
"grunt-contrib-cssmin": "0.6.0",
"grunt-contrib-clean": "0.4.1",
"grunt-contrib-copy": "0.4.1",
"grunt-contrib-htmlmin": "0.1.3",
"grunt-contrib-less": "0.8.2",
"grunt-contrib-requirejs": "0.4.1",
"grunt-contrib-uglify": "0.2.0",
"grunt-contrib-concat": "0.3.0",
"grunt-targethtml": "0.2.6",
"grunt-usemin": "0.1.11",
"load-grunt-tasks": "0.2.0",
"q": "0.9.2",
"jshint": "2.1.4",
"xmldoc": "^0.1.2"I don't think that a user without an AUR helper should be happy to have to install all these things, when it can just be avoided adding
npm installinside PKGBUILD.
Offline
Tell you what: send an email to the aur-general mailing list and see what the TUs would recommend. I'd bet they'd tell you to use separate AUR packages for the whole thing, but I certainly can't read their minds; they might agree with you on this one.
Offline
Offline
For those who wants proper Arch packages but does not like to use AUR helper the best solution would be create a binary repository for language-specific package managers. Something like quarry for rubygems https://wiki.archlinux.org/index.php/ruby#Quarry
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
I don't want to create and maintain a whole binary repository just for a package. I think I'll keep using npm, at least until some of these nodejs building packages will be intoduced into official repo. I'll wait another day or two to get other feddback on ML.
Thanks.
Offline