You are not logged in.
Hi, I'm a new user, and this is my first PKGBUILD.
My way of the samurai to this PKGBUILD was like this:
- I found smhasher3 at AUR
- I found a bug in smhasher3's sources and fill a bug report
- fwojcik (repo owner) fixed that bug
- I realized that release policy for SMHasher3 is unknown, so there's no timeline when that fix will arrive to AUR
- so I got smhasher3's PKGBUILD, got PKGBUILD-vcs.proto, got some courage and create smhasher3-git
Please let me know if you found any mistakes or have any improvements.
# Maintainer: ImmortAlex <immortalexgm@gmail.com>
# Contributor: bbx0 <39773919+bbx0@users.noreply.github.com>
# Contributor: Frank J. T. Wojcik <fwojcik@uw.edu>
# Contributor: Reini Urban <rurban@cpan.org>
# Contributor: Austin Appleby <aappleby@google.com>
pkgname=smhasher3-git
pkgver=r1688.7bbc4b8
pkgrel=1
pkgdesc="A tool for testing the quality of hash functions in terms of their distribution, collision, and performance properties (git version)"
arch=('x86_64' 'aarch64')
url="https://gitlab.com/fwojcik/smhasher3"
license=('GPL3')
depends=('gcc-libs')
makedepends=('git' 'cmake')
optdepends=()
conflicts=('smhasher3')
backup=()
source=('git+https://gitlab.com/fwojcik/smhasher3.git')
sha256sums=('SKIP')
pkgver() {
cd "$srcdir"/smhasher3
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir"/smhasher3
cmake -B build --install-prefix=/usr
cmake --build build
}
package() {
cd "$srcdir"/smhasher3
install -D --target-directory="${pkgdir}/usr/bin" build/SMHasher3
}
Offline
You can get rid of the empty variables (backup and optdepends). Other than that it looks good (I've not tested it myself).
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I see two other things, but neither of them actually matter.
This should probably 'provide' smhasher3. That way anything that depends on smhasher3 can use this package instead. Since nothing actually does depend on it, doesn't matter (for now).
You use two spaces for indentation in the prepare function, but tabs in the other functions. Doesn't matter, purely aesthetic.
Offline
package() {
cd "$srcdir"/smhasher3
install -D --target-directory="${pkgdir}/usr/bin" build/SMHasher3
}
Usually something like DESTDIR="$pkgdir" cmake --install build is used in cmake packages to get everything in the right place (example : man pages should be under /usr/share/man ) .
are you sure this package only requires stuff in /usr/bin ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Thanks a lot!
Seems like I'm too dependent on modern IDEs autoformatting feature Of course, this different styles are result of copy-paste from different sources.
Usually something like DESTDIR="$pkgdir" cmake --install build is used in cmake packages to get everything in the right place (example : man pages should be under /usr/share/man ) .
are you sure this package only requires stuff in /usr/bin ?
All cmake's parts were copied from original smhasher3's PKGBUILD... I'm pure old Java developer and not very familiar with cmake. Time to learn something new, thanks!
Offline
Lone_Wolf wrote:Usually something like DESTDIR="$pkgdir" cmake --install build is used in cmake packages to get everything in the right place (example : man pages should be under /usr/share/man ) .
are you sure this package only requires stuff in /usr/bin ?
All cmake's parts were copied from original smhasher3's PKGBUILD... I'm pure old Java developer and not very familiar with cmake. Time to learn something new, thanks!
In this particular case the CMake package guidelines can not be followed for package() as cmake --install requires the projects CMakeLists.txt to have install rules.
Offline