diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 59 |
1 files changed, 39 insertions, 20 deletions
@@ -2,44 +2,63 @@ pkgname=mgcb-editor-git pkgver=3.8.0 -pkgrel=2 -pkgdesc="The MonoGame Content Pipeline tool" +pkgrel=3 +pkgdesc="Creates platform specific content files." arch=('x86_64') url="https://www.monogame.net/" license=('custom') -depends=('git' 'dotnet-sdk-3.1') -makedepends=('git' 'dotnet-sdk-3.1') +depends=("dotnet-runtime-5.0") +makedepends=('dotnet-sdk-3.1' 'dotnet-sdk-5.0') prepare() { - cd $srcdir - git clone --recursive https://github.com/MonoGame/MonoGame.git + # Using the "official" way of including a source does not work for MonoGame... + # The workaround is to clone the repository in prepare() + if [ ! -d $srcdir/MonoGame ]; then + git clone --recursive https://github.com/MonoGame/MonoGame.git + else + cd $srcdir/MonoGame + git submodule update + fi + + cd $srcdir/MonoGame + git reset --hard + + # Apply the patch to make sure the tool will pick up the mgcb.dll file + git apply ../../mgcb-search-path.diff } build() { cd $srcdir/MonoGame + dotnet tool restore dotnet cake - - - - - #cd $srcdir/MonoGame/Tools/MonoGame.Content.Builder.Editor - #dotnet restore MonoGame.Content.Builder.Editor.Linux.csproj - #dotnet build MonoGame.Content.Builder.Editor.Linux.csproj -c Release } package() { - cd $srcdir/MonoGame/Artifacts/MonoGame.Content.Builder.Editor/Launcher/Release + cd $srcdir/MonoGame/Artifacts/MonoGame.Content.Builder.Editor.Launcher/Release/publish + # Copy the binary output to the right directory mkdir -p $pkgdir/opt/mgcb-editor cp -r * $pkgdir/opt/mgcb-editor - cd $pkgdir/opt/mgcb-editor/Content + # Copy the .desktop file to the right location + mkdir -p $pkgdir/usr/share/applications/ + cp $pkgdir/opt/mgcb-editor/mgcb-editor-linux/mgcb-editor.desktop $pkgdir/usr/share/applications/ + + # Replace the .desktop placeholders to the correct binary + sed -i 's/{Exec}/\/opt\/mgcb-editor\/mgcb-editor/' $pkgdir/usr/share/applications/mgcb-editor.desktop + sed -i 's/{TryExec}/\/opt\/mgcb-editor\/mgcb-editor/' $pkgdir/usr/share/applications/mgcb-editor.desktop + # Copy the icon file to /usr/share + mkdir -p $pkgdir/usr/share/icons + cp $pkgdir/opt/mgcb-editor/mgcb-editor-linux/monogame.svg $pkgdir/usr/share/icons + + # Copy the mime type definition to /usr/share mkdir -p $pkgdir/usr/share/mime/text - cp x-mgcb.xml $pkgdir/usr/share/mime/text - - cd $srcdir/.. + cp $pkgdir/opt/mgcb-editor/mgcb-editor-linux/x-mgcb.xml $pkgdir/usr/share/mime/text + + cd $srcdir/MonoGame/Artifacts/MonoGame.Content.Builder/Release/publish - mkdir -p $pkgdir/usr/share/applications - cp mgcb-editor.desktop $pkgdir/usr/share/applications + # Copy the mgcb binaries to the correct location + mkdir -p $pkgdir/opt/mgcb-editor/mgcb + cp -r * $pkgdir/opt/mgcb-editor/mgcb } |