From c867b2b6d58d43fca796a1a763f72c65f128d137 Mon Sep 17 00:00:00 2001 From: lufebe16 Date: Thu, 19 Oct 2023 18:39:59 +0200 Subject: [PATCH] Android - Build procedure adapted to load cardsets from PySolFC-Cardsets. (hopefully a temporary change) --- buildozer/minimal.txt | 31 ++++++++++++++++ buildozer/mkcards | 85 ++++++++++++++++++++++++++++++++----------- 2 files changed, 94 insertions(+), 22 deletions(-) create mode 100644 buildozer/minimal.txt diff --git a/buildozer/minimal.txt b/buildozer/minimal.txt new file mode 100644 index 00000000..9e9fe3f1 --- /dev/null +++ b/buildozer/minimal.txt @@ -0,0 +1,31 @@ +cardset-2000 +cardset-blaren-7x7 +cardset-crystal-mahjongg +cardset-dashavatara-ganjifa +cardset-dashavatara-ganjifa-xl +cardset-dojouji-3x3 +cardset-dondorf +cardset-eternal-dragon-10x10 +cardset-gnome-mahjongg-1 +cardset-hanafuda-200-years +cardset-hexadeck +cardset-hofamterspiel-9x9 +cardset-hokusai-6x6 +cardset-knave-of-hearts-4x4 +cardset-louie-mantia-hanafuda +cardset-matching +cardset-matching-xl +cardset-matrix +cardset-mid-winter-eve-8x8 +cardset-mughal-ganjifa +cardset-mughal-ganjifa-xl +cardset-neo +cardset-neo-hex +cardset-neo-tarock +cardset-next-matrix +cardset-oxymoron +cardset-standard +cardset-tuxedo +cardset-uni-mahjongg +cardset-victoria-falls-5x5 +cardset-vienna-2k diff --git a/buildozer/mkcards b/buildozer/mkcards index 9ef2f79a..b35d97fa 100755 --- a/buildozer/mkcards +++ b/buildozer/mkcards @@ -1,32 +1,73 @@ #!/bin/bash set -eux -cardsets_dir=PySolFC-Cardsets--Minimal-2.2.0 -cardsets_file=${cardsets_dir}.tar.xz +#loadmode="forge" +loadmode="" rm -rf cardsets -echo '### prepare cardsets' +if [ $loadmode == "forge" ]; then + cardsets_dir=PySolFC-Cardsets--Minimal-2.2.0 + cardsets_file=${cardsets_dir}.tar.xz -if [ ! -f ${cardsets_file} ]; then - echo '### downloading cardsets' - wget https://netix.dl.sourceforge.net/project/pysolfc/PySolFC-Cardsets/minimal/${cardsets_file} + echo '### prepare cardsets' + + if [ ! -f ${cardsets_file} ]; then + echo '### downloading cardsets' + wget https://netix.dl.sourceforge.net/project/pysolfc/PySolFC-Cardsets/minimal/${cardsets_file} + fi + + if [ ! -d ${cardsets_dir} ]; then + echo '### extracting cardsets' + tar -xf ${cardsets_file} + fi + + echo '### processing cardsets' + ( + cd ${cardsets_dir} + ../../scripts/cardconv gif png + for i in cardset-*-png; do + rm -rf `basename $i -png` + done + ) + + ln -s ${cardsets_dir} cardsets + +else + cardsets_dir=PySolFC-Cardsets + + if [ ! -d ${cardsets_dir} ]; then + echo '### downloading cardset repo' + + mkdir ${cardsets_dir} + pushd ${cardsets_dir} + + mkdir repo + pushd repo + git init + git remote add -t master origin https://github.com/shlomif/PySolFC-Cardsets.git + git fetch --depth 1 origin ae08657f931328439c5697165503a6360a75a7a6 + git checkout -q FETCH_HEAD + popd + + echo '### choose a minimal set' + + for d in $(cat ../minimal.txt) + do + mv repo/${d} . + done + rm repo -rf + + echo '### processing cardsets' + + ../../scripts/cardconv gif png + for i in cardset-*-png; do + rm -rf `basename $i -png` + done + popd + fi + + ln -s ${cardsets_dir} cardsets fi -if [ ! -d ${cardsets_dir} ]; then - echo '### extracting cardsets' - tar -xf ${cardsets_file} -fi - -echo '### processing cardsets' -( - cd ${cardsets_dir} - ../../scripts/cardconv gif png - for i in cardset-*-png; do - rm -rf `basename $i -png` - done -) - -ln -s ${cardsets_dir} cardsets - echo '### end cardsets'