Skip to content

Commit

Permalink
up try fix arch
Browse files Browse the repository at this point in the history
  • Loading branch information
Coloryr committed May 6, 2024
1 parent cadb926 commit 20d9aaf
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 14 deletions.
48 changes: 37 additions & 11 deletions build/build-arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
# build_arch_aot linux-arm64 aarch64
2 changes: 1 addition & 1 deletion build/info/arch/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions build/info/arch/PKGBUILD-AOT
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions build/info/arch/install → build/info/arch/colormc.install
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 20d9aaf

Please sign in to comment.