yannjor / krabby

Print pokemon sprites in your terminal
GNU General Public License v3.0
124 stars 8 forks source link

Development PKGBUILD #5

Closed ChewingBever closed 2 years ago

ChewingBever commented 2 years ago

I was charmed by your project, so I wrote a PKGBUILD that tracks the main branch

pkgbase='krabby-git'
pkgname='krabby-git'
pkgver=0.1.6.r0.g2669909
pkgrel=1
pkgdesc='Print pokemon sprites in your terminal (development version)'
arch=('x86_64')

url='https://github.com/yannjor/krabby'
license=('GPL-3.0')

makedepends=('rust')
conflicts=('krabby')

source=("${pkgname}::git+https://github.com/yannjor/krabby#branch=main")
md5sums=('SKIP')

pkgver() {
    git -C "${pkgname}" describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${pkgname}"

    cargo build --release
}

package() {
    install -Dm755 "${pkgname}/target/release/krabby" -t "${pkgdir}/usr/bin"
    install -Dm644 "${pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

I noticed that the krabby-git AUR package is orphaned, perhaps you can adopt it & update it using this script (I would do it myself, but I figured you might prefer to do it yourself considering it's your project). A krabby package might be nice as well; I could write a PKGBUILD for that as well if you want.

yannjor commented 2 years ago

Hey @ChewingBever :)

Thanks for this! Your PKGBUILD looks good. The krabby-git PKGBUILD was suboptimal and doesn't work with the current project so that's why I orphaned it in favor of krabby-bin. I'm not super familiar with PKGBUILDs so your help is welcome :D

I'm wondering if we should change the arch 'any' instead of 'x86_64' since it should be possible to compile it any architecture?

Also we should probably add git to the makedepends.

A krabby package might be nice as well; I could write a PKGBUILD for that as well if you want.

Not sure what you mean by this. Could you please clarify?

ChewingBever commented 2 years ago

The krabby-git PKGBUILD was suboptimal and doesn't work with the current project so that's why I orphaned it in favor of krabby-bin.

Fair enough. I've added it to my own PKGBUILDs, but if you don't think it would add any value to the AUR, it doesn't need to be published.

I'm wondering if we should change the arch 'any' instead of 'x86_64' since it should be possible to compile it any architecture?

This is a common misconception. Arch any doesn't mean "this builds on any architecture", it means "the resulting package works on any architecture". Therefore, the only packages that can have the architecture "any" are packages that do not contain binaries that are built for a specific architecture. A classic example would be a Python package, or a package containing only man pages.

Also we should probably add git to the makedepends.

You're right, I forgot about that.

Not sure what you mean by this. Could you please clarify?

Usually if a -bin package is available, there's also a non-bin version, e.g. krabby in this case, which also installs a specific release, but builds from source instead of downloading a pre-built binary. As an example, here's two packages I maintain, cinny-desktop & cinny-desktop-bin. Both packages currently install version 2.0.3, but cinny-desktop builds the version from source, while the -bin variant downloads a prebuilt release from GitHub.

yannjor commented 2 years ago

Thanks for the clarification! I think it might be enough if I update krabby-git with your script. Feel free to create a krabby package too if you want :)