abinfo "Building SourceGit directly..."
dotnet publish \
    "$SRCDIR"/src/SourceGit.csproj \
    -c Release \
    -p:DisableUpdateDetection=true \
    -o "$PKGDIR"/usr/lib/sourcegit

abinfo "Move the debug symbol"
mkdir -pv "$SYMDIR"/usr/lib/sourcegit
mv -v "$PKGDIR"/usr/lib/sourcegit/SourceGit.dbg "$SYMDIR"/usr/lib/sourcegit/

abinfo "Link the main program"
mkdir -v "$PKGDIR"/usr/bin
ln -sv ../lib/sourcegit/SourceGit "$PKGDIR"/usr/bin/sourcegit

abinfo "Change the desktop entry"
desktop-file-edit "$SRCDIR"/build/resources/_common/applications/sourcegit.desktop \
    --set-key Exec \
    --set-value /usr/bin/sourcegit

abinfo "Installing desktop entry"
install -Dvm644 "$SRCDIR"/build/resources/_common/applications/sourcegit.desktop \
    "$PKGDIR"/usr/share/applications/sourcegit.desktop
install -Dvm644 "$SRCDIR"/build/resources/_common/icons/sourcegit.png \
    "$PKGDIR"/usr/share/icons/sourcegit.png
