diff options
-rw-r--r-- | .SRCINFO | 11 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 44 |
3 files changed, 58 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..213abb476d04 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,11 @@ +pkgbase = gamemusic-cli + pkgdesc = Import, export and convert music files used by DOS games + pkgver = latest + pkgrel = 1 + url = http://github.com/Malvineous/gamemusicjs + arch = any + makedepends = npm + depends = nodejs + +pkgname = gamemusic-cli + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..241dc51b047d --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +src/ +pkg/ +*.pkg.tar.xz diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..907196fbac71 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,44 @@ +_npmname_base=gamemusic +_npmname=${_npmname_base}-cli +_npmscope=@camoto +pkgname=${_npmname} # All lowercase +pkgver=latest +pkgrel=1 +pkgdesc="Import, export and convert music files used by DOS games" +arch=(any) +url="http://github.com/Malvineous/${_npmname_base}js" +license=() +depends=('nodejs' ) +makedepends=('npm') +optdepends=() + +pkgver() { + # Grab the latest version from npmjs.org + #npm view "${_npmscope}/${_npmname}@latest" version + # ...but as a dodgy hack use the version of the parent package instead. This + # way when the base library gets updated this package version number will + # change to match, even though technically the package we're installing + # hasn't been updated, only one of its dependencies has. + npm view "${_npmscope}/${_npmname_base}@latest" version +} + +package() { + #npm install -g --user root --prefix "${pkgdir}/usr" "${_npmscope}/${_npmname}@${pkgver}" + # We should be installing ${pkgver} but since that is now the parent library + # version, it won't match the -cli package version. So we just use 'latest' + # to get whatever CLI version is there. It will always install the latest + # version of the underlying library because of the '*' spec in package.json + # so it should always match the $pkgver. + npm install -g --user root --prefer-online --prefix "${pkgdir}/usr" "${_npmscope}/${_npmname}@latest" + + # Non-deterministic race in npm gives 777 permissions to random directories. + # See https://github.com/npm/cli/issues/1103 for details. + find "${pkgdir}/usr" -type d -exec chmod 755 {} + + + # npm gives ownership of ALL FILES to build user + # https://bugs.archlinux.org/task/63396 + chown -R root:root "${pkgdir}" + + # Remove references to srcdir/pkgdir + find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d' +} |