You are not logged in.
Hello!
I'm the author of the two packages (nitrocid-25, and nitrocid-25-git) that I'd like to get feedback on before submitting to the AUR. These packages are from one software, but with multiple versions, called Nitrocid KS. It's written in C# with the modern .NET 8.0 framework.
I've tried making the PKGBUILD for these two packages (one stable release and one Git release), trying to follow both the Arch packaging guidelines and AUR submission guidelines, and here's what I have so far: (with e-mails edited here, but not pushed yet to GitHub)
# Maintainer: Aptivi CEO <ceo at aptivi dot anonaddy dot com>
# Contributor: Aptivi CEO <ceo at aptivi dot anonaddy dot com>
pkgname=nitrocid-25
pkgver=3.0.25.453+0.1.0.36
pkgrel=1
pkgdesc="Simulates our future-planned kernel"
arch=('x86_64' 'aarch64')
url="https://aptivi.github.io"
license=('GPL-3.0-or-later')
depends=('dotnet-runtime-8.0' 'tzdata')
makedepends=('git' 'dotnet-sdk-8.0' 'make' 'which')
optdepends=('jack2: Jack support for BassBoom addon'
'portaudio: PortAudio support for BassBoom addon'
'openal: OpenAL support for BassBoom addon'
'sdl2: SDL support for BassBoom addon'
'libpulse: PulseAudio support for BassBoom addon')
provides=("${pkgname}-git")
conflicts=("${pkgname}-git")
install=
source=("${pkgname}::git+https://github.com/Aptivi/Nitrocid#tag=v0.1.0.36")
sha256sums=('SKIP')
prepare() {
cd "$srcdir/${pkgname%}" || exit $?
chmod +x tools/initializeoffline.sh
./tools/initializeoffline.sh
}
build() {
cd "$srcdir/${pkgname%}" || exit $?
HOME="$srcdir/homedir" make
}
package() {
cd "$srcdir/${pkgname%}" || exit $?
# Some necessary variables
MODAPI=25
OUTPUT="public/Nitrocid/KSBuild/net8.0"
BINARIES="assets/ks-n assets/ks-jl"
MANUALS="assets/ks.1 assets/ks-jl.1"
DESKTOPS="assets/ks.desktop"
BRANDINGS="public/Nitrocid/OfficialAppIcon-NitrocidKS-512.png"
ARCH=$(sh -c 'if [ `uname -m` = "x86_64" ]; then echo "linux-x64"; else echo "linux-arm64"; fi')
printf "Preparing package for $ARCH...\n"
# Install binaries and manuals
mkdir -m 755 -p \
"$pkgdir/usr/bin" \
"$pkgdir/usr/lib/ks-$MODAPI" \
"$pkgdir/usr/share/applications" \
"$pkgdir/usr/share/man/man1"
install -m 755 -t "$pkgdir/usr/bin/" $BINARIES
install -m 755 -t "$pkgdir/usr/share/man/man1/" $MANUALS
printf "Binaries and manpages installed.\n"
# Create directory structure
cp -r $OUTPUT/* "$pkgdir/usr/lib/ks-$MODAPI/"
find "$pkgdir/usr/lib/ks-$MODAPI" -mindepth 1 -type d -exec chmod 0755 {} \;
find "$pkgdir/usr/lib/ks-$MODAPI" -mindepth 1 -type f -exec chmod 0644 {} \;
printf "Directory structure readied.\n"
# Install branding logo and desktop file
install -m 755 -t "$pkgdir/usr/share/applications/" $DESKTOPS
install -m 755 -t "$pkgdir/usr/lib/ks-$MODAPI/" $BRANDINGS
printf "Branding logo and desktop file installed.\n"
# Add mod API indicator to allow cross-installs
printf "Patching files for mod API $MODAPI...\n"
mv "$pkgdir/usr/bin/ks-n" "$pkgdir/usr/bin/ks-$MODAPI"
mv "$pkgdir/usr/bin/ks-jl" "$pkgdir/usr/bin/ks-jl-$MODAPI"
mv "$pkgdir/usr/share/man/man1/ks.1" "$pkgdir/usr/share/man/man1/ks-$MODAPI.1"
mv "$pkgdir/usr/share/man/man1/ks-jl.1" "$pkgdir/usr/share/man/man1/ks-jl-$MODAPI.1"
mv "$pkgdir/usr/share/applications/ks.desktop" "$pkgdir/usr/share/applications/ks-$MODAPI.desktop"
sed -i "s|/usr/lib/ks|/usr/lib/ks-$MODAPI|g" $pkgdir/usr/bin/ks-*
sed -i "s|/usr/lib/ks|/usr/lib/ks-$MODAPI|g" "$pkgdir/usr/share/applications/ks-$MODAPI.desktop"
sed -i "s|/usr/bin/ks|/usr/bin/ks-$MODAPI|g" "$pkgdir/usr/share/applications/ks-$MODAPI.desktop"
printf "Patched for mod API $MODAPI.\n"
# Compress manpages
gzip "$pkgdir/usr/share/man/man1/ks-$MODAPI.1"
gzip "$pkgdir/usr/share/man/man1/ks-jl-$MODAPI.1"
# Trim unnecessary runtimes
printf "Trimming unnecessary runtimes...\n"
ARCH=$(sh -c 'if [ `uname -m` = "x86_64" ]; then echo "linux-x64"; else echo "linux-arm64"; fi') find "$pkgdir/usr/lib/" -type d -name "runtimes" -exec sh -c 'find $0 -mindepth 1 -maxdepth 1 -not -name $ARCH -type d -exec rm -rf \{\} \;' {} \;
printf "Trimmed.\n"
}
# Maintainer: Aptivi CEO <ceo at aptivi dot anonaddy dot com>
# Contributor: Aptivi CEO <ceo at aptivi dot anonaddy dot com>
pkgname=nitrocid-25-git
pkgver=v0.1.0.r325.c7b25e183
pkgrel=1
pkgdesc="Simulates our future-planned kernel"
arch=('x86_64' 'aarch64')
url="https://aptivi.github.io"
license=('GPL-3.0-or-later')
depends=('dotnet-runtime-8.0' 'tzdata')
makedepends=('git' 'dotnet-sdk-8.0' 'make' 'which')
optdepends=('jack2: Jack support for BassBoom addon'
'portaudio: PortAudio support for BassBoom addon'
'openal: OpenAL support for BassBoom addon'
'sdl2: SDL support for BassBoom addon'
'libpulse: PulseAudio support for BassBoom addon')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
install=
source=("${pkgname}::git+https://github.com/Aptivi/Nitrocid#branch=v0.1.0.x-saas")
sha256sums=('SKIP')
pkgver() {
cd "$srcdir/${pkgname%}" || exit $?
printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}
prepare() {
cd "$srcdir/${pkgname%}" || exit $?
chmod +x tools/initializeoffline.sh
./tools/initializeoffline.sh
}
build() {
cd "$srcdir/${pkgname%}" || exit $?
HOME="$srcdir/homedir" make
}
package() {
cd "$srcdir/${pkgname%}" || exit $?
# Some necessary variables
MODAPI=25
OUTPUT="public/Nitrocid/KSBuild/net8.0"
BINARIES="assets/ks-n assets/ks-jl"
MANUALS="assets/ks.1 assets/ks-jl.1"
DESKTOPS="assets/ks.desktop"
BRANDINGS="public/Nitrocid/OfficialAppIcon-NitrocidKS-512.png"
ARCH=$(sh -c 'if [ `uname -m` = "x86_64" ]; then echo "linux-x64"; else echo "linux-arm64"; fi')
printf "Preparing package for $ARCH...\n"
# Install binaries and manuals
mkdir -m 755 -p \
"$pkgdir/usr/bin" \
"$pkgdir/usr/lib/ks-$MODAPI" \
"$pkgdir/usr/share/applications" \
"$pkgdir/usr/share/man/man1"
install -m 755 -t "$pkgdir/usr/bin/" $BINARIES
install -m 755 -t "$pkgdir/usr/share/man/man1/" $MANUALS
printf "Binaries and manpages installed.\n"
# Create directory structure
cp -r $OUTPUT/* "$pkgdir/usr/lib/ks-$MODAPI/"
find "$pkgdir/usr/lib/ks-$MODAPI" -mindepth 1 -type d -exec chmod 0755 {} \;
find "$pkgdir/usr/lib/ks-$MODAPI" -mindepth 1 -type f -exec chmod 0644 {} \;
printf "Directory structure readied.\n"
# Install branding logo and desktop file
install -m 755 -t "$pkgdir/usr/share/applications/" $DESKTOPS
install -m 755 -t "$pkgdir/usr/lib/ks-$MODAPI/" $BRANDINGS
printf "Branding logo and desktop file installed.\n"
# Add mod API indicator to allow cross-installs
printf "Patching files for mod API $MODAPI...\n"
mv "$pkgdir/usr/bin/ks-n" "$pkgdir/usr/bin/ks-$MODAPI"
mv "$pkgdir/usr/bin/ks-jl" "$pkgdir/usr/bin/ks-jl-$MODAPI"
mv "$pkgdir/usr/share/man/man1/ks.1" "$pkgdir/usr/share/man/man1/ks-$MODAPI.1"
mv "$pkgdir/usr/share/man/man1/ks-jl.1" "$pkgdir/usr/share/man/man1/ks-jl-$MODAPI.1"
mv "$pkgdir/usr/share/applications/ks.desktop" "$pkgdir/usr/share/applications/ks-$MODAPI.desktop"
sed -i "s|/usr/lib/ks|/usr/lib/ks-$MODAPI|g" $pkgdir/usr/bin/ks-*
sed -i "s|/usr/lib/ks|/usr/lib/ks-$MODAPI|g" "$pkgdir/usr/share/applications/ks-$MODAPI.desktop"
sed -i "s|/usr/bin/ks|/usr/bin/ks-$MODAPI|g" "$pkgdir/usr/share/applications/ks-$MODAPI.desktop"
printf "Patched for mod API $MODAPI.\n"
# Compress manpages
gzip "$pkgdir/usr/share/man/man1/ks-$MODAPI.1"
gzip "$pkgdir/usr/share/man/man1/ks-jl-$MODAPI.1"
# Trim unnecessary runtimes
printf "Trimming unnecessary runtimes...\n"
ARCH=$(sh -c 'if [ `uname -m` = "x86_64" ]; then echo "linux-x64"; else echo "linux-arm64"; fi') find "$pkgdir/usr/lib/" -type d -name "runtimes" -exec sh -c 'find $0 -mindepth 1 -maxdepth 1 -not -name $ARCH -type d -exec rm -rf \{\} \;' {} \;
printf "Trimmed.\n"
}
It builds locally and with no Internet connection at the build stage after all the NuGet packages are restored in the prepare stage. It also installs the package and runs the main application perfectly with the supplied binary script, which is ks-25.
Do I need to modify something in the PKGBUILD files before going ahead to submit to the AUR?
Thanks in advance.
Aptivi... where tech changes
Offline
common practice is to use aur usernames on maintainer/contributor lines , underscore are allowed but I very much doubt spaces are .
Maybe Aptivi_CEO is better ?
- You can't be maintainer and contributor, use maintainer for now .
- All makepkg internal functions use $srcdir as PWD, just cd directly to the folder needed.
- makepkg has it's own logic to abort when commands fail, || exit $? is rarely needed
- non-vcs packages are considered to be default version and don't need to conflict with vcs packages .
-
chmod +x tools/initializeoffline.sh
./tools/initializeoffline.sh
initializeoffline.sh is not in the source array but in the source code.
Personally I'd prefer if the code that script executes was implemented in the prepare function .
Archlinux wiki does not have dotnet package guidelines, and there are very few packages using dotnet in repos.
Maybe https://gitlab.archlinux.org/archlinux/ … s/marksman can help ?
Others will probably have more comments.
Last edited by Lone_Wolf (2025-01-12 11:28:56)
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
Why not move all that package() stuff into the Makefile? You already have a Debian version there, which is pretty similar.
Para todos todo, para nosotros nada
Offline
Thank you for suggestions! I will try to implement all these suggestions as soon as possible. It's going to take a bit of time, because of electricity issues, but I will make sure that the updated PKGBUILD files are ready as soon as possible. The Marksman PKGBUILD that you've linked is a very good reference, so I'll refer to it while making sure that Nitrocid works properly when installed.
Aptivi... where tech changes
Offline
I've made changes to the two PKGBUILD files as per your suggestions while adhering to the Nitrocid KS requirements, and the build succeeded, the package installed, and Nitrocid ran perfectly. Here's the new PKGBUILD files:
# Maintainer: Aptivi <ceo at aptivi dot anonaddy dot com>
pkgname=nitrocid-25
pkgver=3.0.25.453+0.1.0.36
pkgrel=1
pkgdesc="Simulates our future-planned kernel"
arch=('x86_64' 'aarch64')
url="https://aptivi.github.io"
license=('GPL-3.0-or-later')
depends=('dotnet-runtime-8.0' 'tzdata')
makedepends=('git' 'dotnet-sdk-8.0' 'make' 'which')
optdepends=('jack2: Jack support for BassBoom addon'
'portaudio: PortAudio support for BassBoom addon'
'openal: OpenAL support for BassBoom addon'
'sdl2: SDL support for BassBoom addon'
'libpulse: PulseAudio support for BassBoom addon')
options=('!strip')
source=("${pkgname}::git+https://github.com/Aptivi/Nitrocid#tag=v0.1.0.36")
sha256sums=('SKIP')
prepare() {
cd "${pkgname}"
HOME=`pwd`/nuget DOTNET_CLI_TELEMETRY_OPTOUT=1 dotnet restore Nitrocid.sln
mkdir -p deps
cp nuget/.nuget/packages/*/*/*.nupkg deps/
rm -rf nuget
cp tools/OfflineNuGet.config ./NuGet.config
}
build() {
cd "${pkgname}"
HOME="$srcdir/homedir" DOTNET_CLI_TELEMETRY_OPTOUT=1 make debian-all-offline
}
package() {
cd "${pkgname}"
make debian-install
cp -dr --no-preserve='ownership' debian/${pkgname%-git}/usr "$pkgdir"
}
# Maintainer: Aptivi <ceo at aptivi dot anonaddy dot com>
pkgname=nitrocid-25-git
pkgver=v0.1.0.r328.c259b8a5b
pkgrel=1
pkgdesc="Simulates our future-planned kernel"
arch=('x86_64' 'aarch64')
url="https://aptivi.github.io"
license=('GPL-3.0-or-later')
depends=('dotnet-runtime-8.0' 'tzdata')
makedepends=('git' 'dotnet-sdk-8.0' 'make' 'which')
optdepends=('jack2: Jack support for BassBoom addon'
'portaudio: PortAudio support for BassBoom addon'
'openal: OpenAL support for BassBoom addon'
'sdl2: SDL support for BassBoom addon'
'libpulse: PulseAudio support for BassBoom addon')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=('!strip')
source=("${pkgname}::git+https://github.com/Aptivi/Nitrocid#branch=v0.1.0.x-saas")
sha256sums=('SKIP')
pkgver() {
cd "${pkgname}"
printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}
prepare() {
cd "${pkgname}"
HOME=`pwd`/nuget DOTNET_CLI_TELEMETRY_OPTOUT=1 dotnet restore Nitrocid.sln
mkdir -p deps
cp nuget/.nuget/packages/*/*/*.nupkg deps/
rm -rf nuget
cp tools/OfflineNuGet.config ./NuGet.config
}
build() {
cd "${pkgname}"
HOME="$srcdir/homedir" DOTNET_CLI_TELEMETRY_OPTOUT=1 make debian-all-offline
}
package() {
cd "${pkgname}"
make debian-install
cp -dr --no-preserve='ownership' debian/${pkgname%-git}/usr "$pkgdir"
}
Is it better?
Last edited by Aptivi (2025-01-12 16:53:16)
Aptivi... where tech changes
Offline
If you change the debian-install target to a general install target you can drop the dh_auto_install override in debian/rules.
Not really relevant for Arch but it does simplify things generally, especially for packaging in other distributions.
Para todos todo, para nosotros nada
Offline
Good idea! I was thinking of exactly the same thing a long time ago, but haven't had much time. I'll consider your suggestion and make relevant changes soon. I'll backlog the generic "install" target internally. That will make packaging Nitrocid easier.
Aptivi... where tech changes
Offline