You are not logged in.

#1 2024-12-06 06:10:44

mittonk
Member
Registered: 2024-12-06
Posts: 2

[SOLVED] PKGBUILD review: dice-emu

Discrete Integrated Circuit Emulator (DICE) for TTL-based arcade games like Pong.

The latest upstream release is from 2014 and based on Qt4 and SDL1.2, and is difficult to run out-of-the-box on most of my Linux systems.  I've gotten it running using those old dependencies from AUR and would like to share.

Especially looking for feedback on:

  1. How to differentiate between sdl and sdl12-compat in dependencies?  DICE hits some of the incompatible edge cases between these two packages.

# Maintainer: Ken Mitton <mittonk at alum dot mit dot edu>

pkgname=dice-emu
pkgver=0.9
pkgrel=1
pkgdesc='Discrete Integrated Circuit Emulator (DICE) for TTL-based arcade games like Pong.'
arch=('x86_64')
url='https://adamulation.blogspot.com/'
license=('GPL-3.0-or-later')
depends=('qt4' 'sdl' 'glu')
# Note this requires real SDL 1.2 and won't work with sdl12-compat, failure mode is:
# =====
# $ dice
# Unable to set video mode:
# The specified window isn't an OpenGL window
# =====
makedepends=()
source=("${pkgname}-${pkgver}.zip::http://sourceforge.net/projects/dice/files/DICE/DICE%200.9/dice.0.9.src.zip/download")
sha256sums=('3f89640cce1dc21d9e632b914fcf089a82efa868bad487b634ac9a76fc81257b')

prepare() {
    # Explicitly use the qt4 version of moc.
    sed -i "s|moc -i|moc-qt4 -i|" Makefile
}

build() {
    make
}

package() {
    install -Dm755 dice ${pkgdir}/usr/bin/dice
}

Build succeeds using those two AUR packages:

makechrootpkg -c -r $CHROOT -I ~/builds/sdl/sdl-1\:1.2.15+r556+g0237f339-1-x86_64.pkg.tar.zst -I ~/builds/qt4/qt4-4.8.7-36-x86_64.pkg.tar.zst

Long-term, the right move might be to update dependencies to Qt5 (or Qt6) and SDL2, either upstream or in a fork. I'll poke that, but it's a bigger project and beyond the scope of a PKGBUILD.

Thank you for the code review!

Last edited by mittonk (2024-12-06 14:52:26)

Offline

#2 2024-12-06 10:12:11

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,038

Re: [SOLVED] PKGBUILD review: dice-emu

Usually depending on an exact version would help, but sdl12-compat provides the same version as aur sdl package .

Not sure if it will work, but try adding a conflict with sdl12-compat .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2024-12-06 14:09:21

mittonk
Member
Registered: 2024-12-06
Posts: 2

Re: [SOLVED] PKGBUILD review: dice-emu

That works!

Added:

conflicts=('sdl12-compat')                                                                                                        

And got enough of a warning to send people to the pointers that'll be in the PKGBUILD and AUR listing:

$ sudo pacman -U dice-emu-0.9-1-x86_64.pkg.tar.zst 
loading packages...
resolving dependencies...
looking for conflicting packages...
:: dice-emu-0.9-1 and sdl12-compat-1.2.68-2 are in conflict. Remove sdl12-compat? [y/N] y
error: failed to prepare transaction (could not satisfy dependencies)
:: unable to satisfy dependency 'sdl' required by dice-emu
:: removing sdl12-compat breaks dependency 'sdl>=1.2.13' required by sdl_image

Thanks for the help!  Moving on to submission.

Offline

Board footer

Powered by FluxBB