You are not logged in.

#1 2025-07-09 10:37:15

Pahheb
Member
Registered: 2025-07-09
Posts: 3

PKGBUILD Review: netduke32-git

Dear Arch User Repository,

I would very much appreciate it if you could verify the validity of this PKGBUILD, as it is my very first contribution to the AUR and I would like to get off to a good start.

# Maintainer: Konstantin Rannev <konstantin.rannev@gmail.com>

pkgname=netduke32-git
pkgver=r11111.f919616e0
pkgrel=1
pkgdesc="An advanced Duke Nukem 3D source port with improved multiplayer functionality"
arch=('i686' 'x86_64')
url="https://voidpoint.io/StrikerTheHedgefox/eduke32-csrefactor"
license=('GPL')
depends=('libvpx' 'sdl2' 'flac' 'libvorbis' 'alsa-lib')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
makedepends=('mesa' 'glu' 'git')
depends_i686=('lib32-alsa-lib')
makedepends_i686=('nasm')
optdepends=('freepats-general-midi: a free soundfont for music'
            'fluidsynth: alternative midi sequencer'
            'eduke32-shareware-episode: Duke Nukem 3D Demo')
install=${pkgname%-git}.install
source=("${pkgname%-git}::git+https://voidpoint.io/StrikerTheHedgefox/eduke32-csrefactor.git#tag=NetDuke32_v1.2.1"
        "${pkgname%-git}.png"
        "${pkgname%-git}.desktop")
sha256sums=('SKIP'
            '1654ddd36ec513ceb91adac09ecd5986f176612384d897b58cf70385a96882a3'
            'dcd83d9b403cc5fa51a4bd8848c8341009aac0ed1b97b2ed504be2f870e4bbee')
options=(!debug)

pkgver() {
  cd "$srcdir/${pkgname%-git}"

  # Git, no tags available
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/${pkgname%-git}"

  # since we're downloading the git files, we need to populate the submodules
  git submodule update --init --recursive

  # fix the == operator bug in libdivide
  sed -i 's|\(return div\.denom\.magic == other\)\.denom\.magic|\1.div\.denom.magic|' \
         source/build/include/libdivide.h
  sed -i 's|\(div\.denom\.more == other\)\.denom\.more|\1.div\.denom.more|' \
         source/build/include/libdivide.h
}
 
build() {
  cd "$srcdir/${pkgname%-git}"

  # strip off the leading symbols up to the "." to get the revision
  local rev=${pkgver#*.}

  # add cxxflags, set revision
  make PACKAGE_REPOSITORY=1 VC_REV="$rev" netduke32 #PRETTY_OUTPUT=0
}

package() {
  cd "$srcdir/${pkgname%-git}"

  # install binaries, license, icon and desktop files
  install -d "$pkgdir"/usr/bin
  install -m755 netduke32 "$pkgdir"/usr/bin/netduke32
  install -Dm644 "../../LICENSE" "$pkgdir"/usr/share/licenses/${pkgname%-git}/LICENSE
  install -Dm644 ../${pkgname%-git}.png "$pkgdir"/usr/share/pixmaps/${pkgname%-git}.png
  install -Dm644 ../${pkgname%-git}.desktop "$pkgdir"/usr/share/applications/${pkgname%-git}.desktop
}

I used this AUR package's structure and PKGBUILD as a base, so I was wondering if there is any way in which I can credit the maintainers/contributors?

Offline

#2 2025-07-09 12:44:27

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,900

Re: PKGBUILD Review: netduke32-git

GPL isn't a valid license. https://wiki.archlinux.org/title/PKGBUILD#license
"depends_i686=('lib32-alsa-lib')" is nonsense. lib32 is 32 bit libs on a 64 bit system, they don't exist on i686. If you haven't tested this PKGBUILD on i686, ie ArchLinux32, you shouldn't list it in the source array and have these architecture-specific arrays.
...You're building from a tag? That means this isn't a -git PKGBUILD. What's the intention here?
Why are you disabling debug packages? This should usually be left up to the user in their makepkg.conf.
See https://wiki.archlinux.org/title/VCS_pa … submodules for submodule handling.
You have "# Git, no tags available", but you're building from a tag, so....
The license doesn't need to be installed if it's common, but if you do, you need to install it to the right place, which means $pkgname instead of ${pkgname%-git}

Last edited by Scimmia (2025-07-09 12:45:26)

Offline

#3 2025-07-09 13:36:10

Pahheb
Member
Registered: 2025-07-09
Posts: 3

Re: PKGBUILD Review: netduke32-git

Hi, Scimmia

Thank you very much for the detailed analysis and explanation! I somehow completely missed and misunderstood the fact that this was indeed being built from a tag. I apologize!

I have updated the PKGBUILD to reflect your suggested changes:

# Maintainer: Konstantin Rannev <konstantin.rannev@gmail.com>

pkgname=netduke32
pkgver=1.2.1
pkgrel=1
pkgdesc="An advanced Duke Nukem 3D source port with improved multiplayer functionality"
arch=('x86_64')
url="https://voidpoint.io/StrikerTheHedgefox/eduke32-csrefactor"
license=('GPL-2.0-or-later')
depends=('libvpx' 'sdl2' 'flac' 'libvorbis' 'alsa-lib')
provides=("${pkgname}")
conflicts=("${pkgname}")
makedepends=('mesa' 'glu' 'git')
optdepends=('freepats-general-midi: a free soundfont for music'
            'fluidsynth: alternative midi sequencer'
            'eduke32-shareware-episode: Duke Nukem 3D Demo')
install=${pkgname}.install
source=("${pkgname}::git+https://voidpoint.io/StrikerTheHedgefox/eduke32-csrefactor.git#tag=NetDuke32_v1.2.1"
        "${pkgname}.png"
        "${pkgname}.desktop")
sha256sums=('SKIP'
            '1654ddd36ec513ceb91adac09ecd5986f176612384d897b58cf70385a96882a3'
            'dcd83d9b403cc5fa51a4bd8848c8341009aac0ed1b97b2ed504be2f870e4bbee')

prepare() {
  cd "$srcdir/${pkgname}"

  # fix the == operator bug in libdivide
  sed -i 's|\(return div\.denom\.magic == other\)\.denom\.magic|\1.div\.denom.magic|' \
         source/build/include/libdivide.h
  sed -i 's|\(div\.denom\.more == other\)\.denom\.more|\1.div\.denom.more|' \
         source/build/include/libdivide.h
}
 
build() {
  cd "$srcdir/${pkgname}"

  # obtain the SHA of the tag we're checking out
  local rev=$(git rev-parse --short HEAD)

  # add cxxflags, set revision
  make PACKAGE_REPOSITORY=1 VC_REV="$rev" netduke32 #PRETTY_OUTPUT=0
}

package() {
  cd "$srcdir/${pkgname}"

  # install binaries, license, icon and desktop files
  install -d "$pkgdir"/usr/bin
  install -m755 netduke32 "$pkgdir"/usr/bin/netduke32
  install -Dm644 ../${pkgname}.png "$pkgdir"/usr/share/pixmaps/${pkgname}.png
  install -Dm644 ../${pkgname}.desktop "$pkgdir"/usr/share/applications/${pkgname}.desktop
}

If this is now correct, I'm happy to upload it to the AUR straight away!

Offline

#4 2025-07-09 20:30:46

loqs
Member
Registered: 2014-03-06
Posts: 18,475

Re: PKGBUILD Review: netduke32-git

provides=("${pkgname}")
conflicts=("${pkgname}")

All packages provide and conflict themselves making these lines redundant.

install=${pkgname}.install

What is the contents of netduke32.install?

source=("${pkgname}::git+https://voidpoint.io/StrikerTheHedgefox/eduke32-csrefactor.git#tag=NetDuke32_v1.2.1"

Why hardcode the version instead of using $pkgver?

sha256sums=('SKIP'

Why skip the checksum for the git tag?

Offline

#5 2025-07-09 23:11:14

Pahheb
Member
Registered: 2025-07-09
Posts: 3

Re: PKGBUILD Review: netduke32-git

Hi loqs,

I very much appreciate your input and for helping me out! The netduke32.install file has the following contents:

post_install() {
  echo "Remember you need 'Duke Nukem 3D' data files to play. You can put them under"
  echo "'/usr/share/games/netduke32/' for all users or '~/.config/netduke32/' for yourself."
}

post_upgrade() {
  post_install
}

I've also adjusted the PKGBUILD according to your suggestions, which now looks like this:

# Maintainer: Konstantin Rannev <konstantin.rannev@gmail.com>

pkgname=netduke32
pkgver=1.2.1
pkgrel=1
pkgdesc="An advanced Duke Nukem 3D source port with improved multiplayer functionality"
arch=('x86_64')
url="https://voidpoint.io/StrikerTheHedgefox/eduke32-csrefactor"
license=('GPL-2.0-or-later')
depends=('libvpx' 'sdl2' 'flac' 'libvorbis' 'alsa-lib')
makedepends=('mesa' 'glu' 'git')
optdepends=('freepats-general-midi: a free soundfont for music'
            'fluidsynth: alternative midi sequencer'
            'eduke32-shareware-episode: Duke Nukem 3D Demo')
install=${pkgname}.install
source=("${pkgname}::git+https://voidpoint.io/StrikerTheHedgefox/eduke32-csrefactor.git#tag=NetDuke32_v${pkgver}"
        "${pkgname}.png"
        "${pkgname}.desktop")
sha256sums=('4347a3dba92502b7e9e0c775226501ab974b7f92153b7660cacf03b6f179595e'
            '1654ddd36ec513ceb91adac09ecd5986f176612384d897b58cf70385a96882a3'
            'dcd83d9b403cc5fa51a4bd8848c8341009aac0ed1b97b2ed504be2f870e4bbee')

prepare() {
  cd "$srcdir/${pkgname}"

  # fix the == operator bug in libdivide
  sed -i 's|\(return div\.denom\.magic == other\)\.denom\.magic|\1.div\.denom.magic|' \
         source/build/include/libdivide.h
  sed -i 's|\(div\.denom\.more == other\)\.denom\.more|\1.div\.denom.more|' \
         source/build/include/libdivide.h
}
 
build() {
  cd "$srcdir/${pkgname}"

  # obtain the SHA of the tag we're checking out
  local rev=$(git rev-parse --short HEAD)

  # add cxxflags, set revision
  make PACKAGE_REPOSITORY=1 VC_REV="$rev" netduke32 #PRETTY_OUTPUT=0
}

package() {
  cd "$srcdir/${pkgname}"

  # install binaries, license, icon and desktop files
  install -d "$pkgdir"/usr/bin
  install -m755 netduke32 "$pkgdir"/usr/bin/netduke32
  install -Dm644 ../${pkgname}.png "$pkgdir"/usr/share/pixmaps/${pkgname}.png
  install -Dm644 ../${pkgname}.desktop "$pkgdir"/usr/share/applications/${pkgname}.desktop
}

I've also verified that the package builds in a chroot by running:

pkgctl build

Offline

Board footer

Powered by FluxBB