Skip to content

Instantly share code, notes, and snippets.

@axzxc1236
Created September 12, 2022 11:58
Show Gist options
  • Select an option

  • Save axzxc1236/6a30b0f4a6873046d5354c9da66e38f3 to your computer and use it in GitHub Desktop.

Select an option

Save axzxc1236/6a30b0f4a6873046d5354c9da66e38f3 to your computer and use it in GitHub Desktop.
PKGBUILD for ripdrag
# Written by axzxc1236
pkgname=ripdrag-git
_pkgname=ripdrag
pkgver=0.1.2r23
pkgrel=1
pkgdesc="Drag and Drop files to and from the terminal"
arch=(any) #Not sure if there is architecture limitation or not
url="https://github.com/nik012003/ripdrag"
license=('GPL3')
depends=('libxcb' 'gdk-pixbuf2' 'libxrender' 'libthai' 'libpng' 'fribidi' 'libxi' 'libxext' 'libxcursor' 'libtiff' 'libxrandr' 'libxml2' 'libdatrie' 'xz' 'libxdmcp' 'util-linux-libs' 'libxdamage' 'fontconfig' 'cairo' 'gcc-libs' 'graphite' 'glib2' 'lzo' 'sqlite' 'json-glib' 'icu' 'expat' 'gtk4' 'brotli' 'libepoxy' 'glibc' 'zlib' 'wayland' 'graphene' 'libjpeg-turbo' 'freetype2' 'libffi' 'libcloudproviders' 'pango' 'tracker3' 'libxinerama' 'pixman' 'harfbuzz' 'libxkbcommon' 'libstemmer' 'zstd' 'libxfixes' 'bzip2' 'pcre' 'libxau' 'libx11') # I don't know exact requirement so I just use "ldd ripdrag" and find packages associated with so libraries, this is also why I don't push this PKGBUILD to aur.
makedepends=('cargo' 'git')
provides=('ripdrag' 'ripdrag-git')
conflicts=('ripdrag')
source=("git+https://github.com/nik012003/ripdrag#branch=master")
sha256sums=('SKIP')
pkgver() {
cd "$srcdir/$_pkgname"
# get major version number from Cargo.toml
major_version=$(grep -oP '^version = "\K.*"$' Cargo.toml | rev | cut -c2- | rev)
# get commit number
commit_number=$(git rev-list --count master)
echo "${major_version}r${commit_number}"
}
build() {
cd "$srcdir/$_pkgname"
cargo build --release
}
# Not sure if this is needed but why not
check() {
cd "$srcdir/$_pkgname"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen --all-features
}
package() {
cd "$srcdir/$_pkgname"
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$_pkgname"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment