diff --git a/build/build-arch.sh b/build/build-arch.sh index e7b255d8e..87b257246 100755 --- a/build/build-arch.sh +++ b/build/build-arch.sh @@ -17,23 +17,37 @@ build_arch() { echo "build colormc-$main_version$version-$1.pkg.tar.zst" - base_dir=./src/build_out/$1-dotnet + base=./src/build_out/$1-dotnet + base_dir="$base/colormc_arch" + + mkdir $base_dir + + pdbs=("ColorMC.Gui.pdb" "ColorMC.Core.pdb" "Live2DCSharpSDK.App.pdb" + "Live2DCSharpSDK.Framework.pdb" "ColorMC.Launcher.pdb" "X11.pdb" + "libHarfBuzzSharp.so" "libSDL2-2.0.so" "libSkiaSharp.so" "ColorMC.Launcher") + + for line in ${pdbs[@]} + do + cp $base/$line \ + $base_dir/$line + done + info=./build/info/linux/usr/share cp ./build/info/arch/PKGBUILD $base_dir/PKGBUILD - cp ./build/info/arch/install $base_dir/.INSTALL + cp ./build/info/arch/colormc.install $base_dir/colormc.install cp $info/applications/ColorMC.desktop $base_dir/ColorMC.desktop cp $info/icons/colormc.png $base_dir/colormc.png sed -i "s/%version%/$version/g" $base_dir/PKGBUILD sed -i "s/%arch%/$2/g" $base_dir/PKGBUILD - cd ./src/build_out/$1-dotnet + cd $base_dir makepkg -f - cd ../../../ + cd ../../../../ - mv $base_dir/colormc-$version-1-$2.pkg.tar.zst \ + cp $base_dir/colormc-$version-1-$2.pkg.tar.zst \ ./build_out/colormc-$main_version$version-1-$2.pkg.tar.zst echo "colormc-$main_version$version-$1.pkg.tar.zst build done" @@ -43,23 +57,35 @@ build_arch_aot() { echo "build colormc-$main_version$version-$1-aot.pkg.tar.zst" - base_dir=./src/build_out/$1-aot + base=./src/build_out/$1-dotnet + base_dir="$base/colormc_arch" + + mkdir $base_dir + + pdbs=("libHarfBuzzSharp.so" "libSDL2-2.0.so" "libSkiaSharp.so" "ColorMC.Launcher") + + for line in ${pdbs[@]} + do + cp $base/$line \ + $base_dir/$line + done + info=./build/info/linux/usr/share cp ./build/info/arch/PKGBUILD-AOT $base_dir/PKGBUILD - cp ./build/info/arch/install $base_dir/.INSTALL + cp ./build/info/arch/colormc.install $base_dir/colormc.install cp $info/applications/ColorMC.desktop $base_dir/ColorMC.desktop cp $info/icons/colormc.png $base_dir/colormc.png sed -i "s/%version%/$version/g" $base_dir/PKGBUILD sed -i "s/%arch%/$2/g" $base_dir/PKGBUILD - cd ./src/build_out/$1-aot + cd $base_dir makepkg -f - cd ../../../ + cd ../../../../ - mv $base_dir/colormc-$version-1-$2.pkg.tar.zst \ + cp $base_dir/colormc-$version-1-$2.pkg.tar.zst \ ./build_out/colormc-$main_version$version-1-$2-aot.pkg.tar.zst echo "colormc-$main_version$version-$1-aot.pkg.tar.zst build done" @@ -68,4 +94,4 @@ build_arch_aot() build_arch linux-x64 x86_64 # build_arch linux-arm64 aarch64 build_arch_aot linux-x64 x86_64 -# build_arch_aot linux-arm64 aarch64 \ No newline at end of file +# build_arch_aot linux-arm64 aarch64 diff --git a/build/info/arch/PKGBUILD b/build/info/arch/PKGBUILD index 50cd0fb84..4b2502a2b 100644 --- a/build/info/arch/PKGBUILD +++ b/build/info/arch/PKGBUILD @@ -10,11 +10,11 @@ install=".INSTALL" sha512sums=("SKIP" "SKIP" "SKIP" "SKIP" "SKIP" "SKIP" "SKIP" "SKIP" "SKIP" "SKIP" "SKIP" "SKIP") options=("!strip" "libtool" "staticlibs") - source=("ColorMC.Gui.pdb" "ColorMC.Core.pdb" "Live2DCSharpSDK.App.pdb" "Live2DCSharpSDK.Framework.pdb" "ColorMC.Launcher.pdb" "X11.pdb" "libHarfBuzzSharp.so" "libSDL2-2.0.so" "libSkiaSharp.so" "ColorMC.Launcher" "ColorMC.desktop" "colormc.png") +install=colormc.install package() { mkdir -p ${pkgdir}/usr/share/ColorMC diff --git a/build/info/arch/PKGBUILD-AOT b/build/info/arch/PKGBUILD-AOT index 85c6a242c..88e920971 100644 --- a/build/info/arch/PKGBUILD-AOT +++ b/build/info/arch/PKGBUILD-AOT @@ -9,8 +9,9 @@ license=("Apache 2.0") install=".INSTALL" sha512sums=("SKIP" "SKIP" "SKIP" "SKIP" "SKIP" "SKIP") options=("!strip" "libtool" "staticlibs") - -source=("libHarfBuzzSharp.so" "libSDL2-2.0.so" "libSkiaSharp.so" "ColorMC.Launcher" "ColorMC.desktop" "colormc.png") +source=("libHarfBuzzSharp.so" "libSDL2-2.0.so" "libSkiaSharp.so" + "ColorMC.Launcher" "ColorMC.desktop" "colormc.png") +install=colormc.install package() { mkdir -p ${pkgdir}/usr/share/ColorMC diff --git a/build/info/arch/install b/build/info/arch/colormc.install similarity index 63% rename from build/info/arch/install rename to build/info/arch/colormc.install index a40367294..43d88f52e 100644 --- a/build/info/arch/install +++ b/build/info/arch/colormc.install @@ -1,3 +1,9 @@ +post_remove() { + echo "Removing colormc desktop icon..." + rm -f ${pkgdir}/usr/share/icons/colormc.png + rm -f ${pkgdir}/usr/share/applications/ColorMC.desktop +} + post_install() { chmod a+x ${pkgdir}/usr/share/applications/ColorMC.desktop chmod a+x ${pkgdir}/usr/share/ColorMC/ColorMC.Launcher