You are not logged in.

#1 2023-06-14 17:43:50

ImmortAlex
Member
Registered: 2023-06-14
Posts: 34

PKGBUILD Review: smhasher3-git

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

#2 2023-06-14 18:37:48

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,701
Website

Re: PKGBUILD Review: smhasher3-git

You can get rid of the empty variables (backup and optdepends).  Other than that it looks good (I've not tested it myself).


To Be A Dev: propose idea; invite feedback; mock, ridicule, and ostracize any critical feedback; but be warm and kind to those who kiss your ring.

Offline

#3 2023-06-15 02:08:35

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,685

Re: PKGBUILD Review: smhasher3-git

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

#4 2023-06-15 09:12:54

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,126

Re: PKGBUILD Review: smhasher3-git

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)

Online

#5 2023-06-16 05:09:11

ImmortAlex
Member
Registered: 2023-06-14
Posts: 34

Re: PKGBUILD Review: smhasher3-git

Thanks a lot!
Seems like I'm too dependent on modern IDEs autoformatting feature smile Of course, this different styles are result of copy-paste from different sources.

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!

Offline

#6 2023-06-16 12:24:21

loqs
Member
Registered: 2014-03-06
Posts: 17,709

Re: PKGBUILD Review: smhasher3-git

ImmortAlex wrote:
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

Board footer

Powered by FluxBB