ShadowTheAge/yafc

[Feature request] AUR submission

Closed this issue · 7 comments

Ive put together a PKGBUILD for building this software on Arch Linux / Manjaro. Im no expert on doing so, though, so before submitting it to the AUR, Id like a few eyes on it here if convenient, to maybe catch any obvious errors on my part. The full text follows.

pkgname=yafc-git
pkgver=0.5.8.r33.g7e7225e
pkgrel=1
pkgdesc="A Factorio calculator, planner and analyser for heavily modded games."
arch=('x86_64')
url="https://github.com/ShadowTheAge/yafc"
license=('GPL')
depends=('dotnet-runtime>=3.1' 'sdl2' 'sdl2_image' 'sdl2_ttf' 'opengl-driver')
makedepends=('git' 'dotnet-sdk>=3.1')
options=('staticlibs')
source=("${pkgname}::git+${url}")
md5sums=('SKIP') 
pkgver() {
    cd "$pkgname"
    git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "$pkgname"
    rm -rf "$pkgname"
    MSBUILDDISABLENODEREUSE=1 DOTNET_CLI_TELEMETRY_OPTOUT=1 dotnet publish YAFC/YAFC.csproj --configuration Release --runtime linux-x64 --self-contained true /p:PublishTrimmed=true --output "$pkgname"
}

package() {
    cd "$pkgname"
  
    install -d $pkgdir/usr/{bin,lib}
    cp -r $pkgname "$pkgdir/usr/lib/"
    ln -s "/usr/lib/$pkgname/YAFC" "$pkgdir/usr/bin/${pkgname%-git}"
}

Ideally, this could be tested by at least one other person than myself. Id also like eyes on the build options Ive got here for dotnet publish - the output appeared to work, but there were many build warnings during compilation.

slightly off topic

Ideally, this could be tested by at least one other person than myself.

I wish I could help, but my Manjaro KDE (Arch + Plasma) computer's GPU is dying, keeps falling off the bus when I try to render the DE to the HDMI display out.

Back on topic, When I was trying to get this app to run on my Arch computer as precompiled linux, the dotnet runtime package I had installed did not satisfy some arbitrary dependency. It ran very smoothly under Proton, with the only problem being that it didn't auto-detect any Factorio install/userdata folders in my Arch user home directory.

depends=('dotnet-runtime>=3.1'

the dependency version is wrong, should be >=6.0
7e7225e#r91275269

I see. I did get the version from the https://github.com/ShadowTheAge/yafc/blob/master/Docs/LinuxOsxInstall.md instructions, but I guess they are out of date perhaps. So update the minimum required dotnet-runtime then.

Supposedly, self-contained apps are supposed to not require dotnet at all at runtime, but I havent been game to try uninstalling it to find out.

veger commented

dotnet-sdk -> dotnet-runtime

The SDK contains tools, and other development files as well, so you'd need this only when building the package

Edit: It would be nice to add a desktop file as well

The SDK contains tools, and other development files as well, so you'd need this only when building the package

That's why it's a makedepends, rather than a depends.

I've added a simple .desktop file on my own system. It should be straightforward to submit I believe.

veger commented

That's why it's a makedepends, rather than a depends.

oh sorry you are right, I was looking careful enough :)

This can probably be closed, as I can see someone has now done so - and their AUR submission also features a .desktop entry as well. https://aur.archlinux.org/packages/factorio-yafc-git