summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeal Wierslee2022-10-14 11:17:36 -0400
committerZeal Wierslee2022-10-14 11:18:46 -0400
commit99b95fec71a9ee826f02ae3deb328a35f4df903f (patch)
tree9abb7e5342ffc90508200063380a3599fdcff7d7
parentccf6fa20a8803ee2e052ef53e3cce9636e9fe2a3 (diff)
downloadaur-99b95fec71a9ee826f02ae3deb328a35f4df903f.tar.gz
Switch to native package
-rw-r--r--.SRCINFO11
-rw-r--r--PKGBUILD28
2 files changed, 25 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 59e67e0d5527..58f23971a528 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,19 @@
pkgbase = sugarjar
pkgdesc = A git/github helper inspired by arcanist (and others)
pkgver = 0.0.11
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/jaymzh/sugarjar
arch = x86_64
license = Apache
depends = git
depends = hub
depends = libxcrypt-compat
- source = https://github.com/jaymzh/sugarjar/releases/download/v0.0.11/sugarjar_0.0.11-1_amd64-ubuntu2004.deb
- sha256sums = d8818dcb66b2da24647c6a2cceb640cb5f69a1a45a96497f537822723a616e82
+ depends = ruby
+ depends = rubygems
+ depends = ruby-mixlib-log
+ depends = ruby-mixlib-shellout
+ depends = ruby-pastel
+ source = https://github.com/jaymzh/sugarjar/archive/refs/tags/v0.0.11.tar.gz
+ sha256sums = 1706a82e75ef7ac0469b8f7e9f6d0105cf731cd77280079464c2cfe89f86bef9
pkgname = sugarjar
diff --git a/PKGBUILD b/PKGBUILD
index 65f217cbe297..8c9e775cd8dc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,23 +1,29 @@
# Maintainer: Zeal Wierslee <zeal@wierslee.me>
pkgname=sugarjar
pkgver=0.0.11
-pkgrel=1
+pkgrel=2
pkgdesc="A git/github helper inspired by arcanist (and others)"
arch=('x86_64')
url="https://github.com/jaymzh/sugarjar"
license=('Apache')
-depends=('git' 'hub' 'libxcrypt-compat')
-source=("https://github.com/jaymzh/sugarjar/releases/download/v$pkgver/sugarjar_$pkgver-${pkgrel}_amd64-ubuntu2004.deb")
-sha256sums=("d8818dcb66b2da24647c6a2cceb640cb5f69a1a45a96497f537822723a616e82")
+depends=('git' 'hub' 'libxcrypt-compat' 'ruby' 'rubygems' 'ruby-mixlib-log' 'ruby-mixlib-shellout' 'ruby-pastel')
+source=("https://github.com/jaymzh/sugarjar/archive/refs/tags/v${pkgver}.tar.gz")
+sha256sums=("1706a82e75ef7ac0469b8f7e9f6d0105cf731cd77280079464c2cfe89f86bef9")
package() {
- cd "$srcdir"
- bsdtar -xf data.tar.xz -C "$pkgdir"
+ local _gemdir="$(env -i ruby -e'puts Gem.default_dir')"
+ cd "$pkgname-$pkgver"
+ gem install \
+ --ignore-dependencies \
+ --no-user-install \
+ -i "${pkgdir}/${_gemdir}" \
+ -n "${pkgdir}/usr/bin" \
+ --bindir "$pkgdir/usr/bin" \
+ "${pkgname}-${pkgver}.gem"
- # link executables
- mkdir -p $pkgdir/usr/bin
+ # If you use RVM the shebang will use the `ruby_executable_hooks` from your RVM installation, not the system one.
+ # Since sugarjar is installed in the system ruby, we want it to use the correct install of ruby.
+ sed -i "s%/usr/bin/env ruby_executable_hooks%/usr/bin/ruby%" "$pkgdir/usr/bin/sj"
- ln -s /opt/sugarjar/bin/sj $pkgdir/usr/bin/ || error_exit "Cannot link sj to /usr/bin"
- chown -Rh 0:0 $pkgdir
- chown -R 755 $pkgdir/opt
+ rm "${pkgdir}/${_gemdir}/cache/${pkgname}-${pkgver}.gem"
}