You are not logged in.

#1 2024-05-26 08:19:40

develux
Member
Registered: 2024-05-26
Posts: 3

PKGBUILD review: topmem

Hello, I`m new to this and want review on my PKGBUILD of topmem app
Thanks in advance

# Maintainer: develux <erroor234@gmail.com>
pkgname=topmem-cpp
pkgver=0.1
pkgrel=1
pkgdesc="It shows the top 10 processes using RAM and SWAP"
arch=('x86_64')
url="https://github.com/develux44/topmem-cpp"
license=('GPL-3.0-only')
makedepends=(gcc git)
source=("git+https://github.com/develux44/topmem-cpp.git#branch=main")
sha256sums=('SKIP')
build() {
  cd topmem-cpp
  make
}

package() {
  cd topmem-cpp
  install -Dm755 topmem $pkgdir/usr/bin/topmem
}

Last edited by develux (2024-05-26 08:31:42)

Offline

#2 2024-05-26 10:09:08

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

Re: PKGBUILD review: topmem

source=("git+https://github.com/develux44/topmem-cpp.git#branch=main")

If main is the default branch for your upstream repo, you can omit #branch= from the source-url .

Since your pulling from git and not a released tarball, this qualifies as a VCS package .
The pkgname should be suffixed with -git, you need to have a pkgver() function and conflict with the (future) non-vcs version.

See https://wiki.archlinux.org/title/VCS_package_guidelines .


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

#3 2024-05-26 11:03:00

develux
Member
Registered: 2024-05-26
Posts: 3

Re: PKGBUILD review: topmem

This way?

# Maintainer: develux <erroor234@gmail.com>
pkgname=topmem-cpp-git
pkgver=r37.a243537
pkgrel=1
pkgdesc="It shows the top 10 processes using RAM and SWAP"
arch=('x86_64')
url="https://github.com/develux44/topmem-cpp"
license=('GPL-3.0-only')
makedepends=(gcc git)
conflicts=(topmem-cpp)
provides=("topmem-cpp=${pkgver}")
source=("git+https://github.com/develux44/topmem-cpp.git")
sha256sums=('SKIP')

pkgver() {
  cd topmem-cpp
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

build() {
  cd topmem-cpp
  make
}

package() {
  cd topmem-cpp
  install -Dm755 topmem $pkgdir/usr/bin/topmem
}

Offline

#4 2024-05-26 11:49:37

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

Re: PKGBUILD review: topmem

Looks good, yes.

One thing :
archlinux default settings are to build 2 binaries : a stripped executable AND one with debug symbols .
If your project doesn't use debug symbols, you should disable creating the debug package.

man PKGBUILD > options(array) lists all flags that can be enabled/disabled .


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

#5 2024-05-26 12:05:02

develux
Member
Registered: 2024-05-26
Posts: 3

Re: PKGBUILD review: topmem

Lone_Wolf wrote:

Looks good, yes.

One thing :
archlinux default settings are to build 2 binaries : a stripped executable AND one with debug symbols .
If your project does't use debug symbols, you should disable creating the debug package.

man PKGBUILD > options(array) lists all flags that can be enabled/disabled .

Added

options=(strip !docs !debug lto)

should disable debug and improve performance a bit
Thank you so much for your help

Offline

#6 2024-05-26 15:05:55

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

Re: PKGBUILD review: topmem

makedepends=(gcc git)

gcc is a dependency of base-devel which is an implicit dependency of all PKGBUILD's.

options=(strip !docs !debug lto)

lto and strip are current defaults. Also lto relies on the projects build system using the flags makepkg exports.  As the projects current Makefile does not use any environment variables it does not work.

Offline

Board footer

Powered by FluxBB