Advertisement
yochananmarqos

nuclear-player-git

Aug 31st, 2021 (edited)
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.78 KB | None | 0 0
  1. pkgname=nuclear-player-git
  2. _app_id=org.js.nuclear.Nuclear
  3. pkgver=0.6.17.r4.g4a807e1d
  4. pkgrel=1
  5. _nodeversion=12
  6. pkgdesc="Streaming music player that finds free music for you"
  7. arch=('x86_64')
  8. url="https://nuclear.js.org"
  9. license=('GPL3')
  10. depends=('gtk3' 'nss')
  11. makedepends=('git' 'nvm' 'setconf')
  12. provides=("${pkgname%-git}")
  13. conflicts=("${pkgname%-git}")
  14. source=('git+https://github.com/nukeop/nuclear.git')
  15. sha256sums=('SKIP')
  16.  
  17. pkgver() {
  18.   cd "$srcdir/nuclear"
  19.   git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
  20. }
  21.  
  22. _ensure_local_nvm() {
  23.   # let's be sure we are starting clean
  24.   which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
  25.   export NVM_DIR="$srcdir/.nvm"
  26.  
  27.   # The init script returns 3 if version specified
  28.   # in ./.nvrc is not (yet) installed in $NVM_DIR
  29.   # but nvm itself still gets loaded ok
  30.   source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
  31. }
  32.  
  33. prepare() {
  34.   cd "$srcdir/nuclear"
  35.   setconf "flatpak/${_app_id}.desktop" Exec nuclear
  36.  
  37.   export npm_config_cache="$srcdir/npm_cache"
  38.   _ensure_local_nvm
  39.   nvm install "$_nodeversion"
  40. }
  41.  
  42. build(){
  43.   cd "$srcdir/nuclear"
  44.   export npm_config_cache="$srcdir/npm_cache"
  45.   _ensure_local_nvm
  46.   npm install
  47.   npm run build
  48. }
  49.  
  50. package(){
  51.   cd "$srcdir/nuclear"
  52.   install -d "$pkgdir/opt/nuclear/"
  53.   cp -r release/linux-unpacked/* "$pkgdir/opt/nuclear/"
  54.  
  55.   install -Dm644 "flatpak/${_app_id}.desktop" -t "$pkgdir/usr/share/applications/"
  56.   install -Dm644 "flatpak/${_app_id}.metainfo.xml" -t "$pkgdir/usr/share/metainfo/"
  57.  
  58.   install -d "$pkgdir/usr/share/icons/hicolor/512x512/apps/"
  59.   ln -s /opt/nuclear/resources/media/512x512.png \
  60.     "$pkgdir/usr/share/icons/hicolor/512x512/apps/${_app_id}.png"
  61.  
  62.   install -d "$pkgdir/usr/bin"
  63.   ln -s /opt/nuclear/nuclear "$pkgdir/usr/bin/"
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement