diff --git a/buildozer/buildozer.init b/buildozer/buildozer.init index 27068ecd..45b3ba0f 100755 --- a/buildozer/buildozer.init +++ b/buildozer/buildozer.init @@ -34,6 +34,6 @@ cp -a cardsets/* ${tmpdir}/data echo '### eval version' -./version.py > ${tmpdir}/version.txt +./version ${tmpdir} > ${tmpdir}/version.txt echo '### end init' diff --git a/buildozer/fdroid.init b/buildozer/fdroid.init index 2db0dbb8..c7efe9ad 100755 --- a/buildozer/fdroid.init +++ b/buildozer/fdroid.init @@ -2,8 +2,6 @@ set -eux tmpdir=.. -cardsets_dir=PySolFC-Cardsets--Minimal-2.2.0 -cardsets_file=${cardsets_dir}.tar.xz echo '### prepare source' @@ -24,7 +22,7 @@ echo '### resize 4k images' echo '### eval version' -./version.py > ${tmpdir}/version.txt +./version ${tmpdir} > ${tmpdir}/version.txt echo '### prepare buildozer' diff --git a/buildozer/mkcards b/buildozer/mkcards index 7eaeac09..642d89a0 100755 --- a/buildozer/mkcards +++ b/buildozer/mkcards @@ -6,7 +6,7 @@ loadmode=" " rm -rf cardsets -if [ $loadmode == "forge" ]; then +if [ "$loadmode" == "forge" ]; then cardsets_dir=PySolFC-Cardsets--Minimal-2.2.0 cardsets_file=${cardsets_dir}.tar.xz @@ -66,11 +66,14 @@ else done popd fi + # cp -a ${cardsets_dir} ${cardsets_dir}-orig ln -s ${cardsets_dir} cardsets fi pushd cardsets + echo '### resize big cardsets' + for i in cardset-*; do ../resizecards $i done diff --git a/buildozer/resizecards b/buildozer/resizecards index c7911dd6..5c6d2f01 100755 --- a/buildozer/resizecards +++ b/buildozer/resizecards @@ -75,6 +75,9 @@ yoffs = int(math.ceil(yoffs*scale)) #print (cardw,cardh) #print (xoffs,yoffs) +first = True +effw = cardw +effh = cardh for fn in os.listdir(path=carddir): file = carddir+'/'+fn fileo = carddir+'/conv-'+fn @@ -85,6 +88,10 @@ for fn in os.listdir(path=carddir): #print (cmd) os.system(cmd) os.system(cmd2) + if first: + effw,effh = img_size(file) + #print ('eff-size:',effw,effh) + first = False if fn.endswith('.png') and fn.startswith('shadow'): w,h = img_size(file) @@ -101,6 +108,8 @@ for fn in os.listdir(path=carddir): # 4: rewrite the config file. print ('rescaled by',scale,':',carddir) +cardw = effw +cardh = effh lines_list[2] = str(cardw)+" "+str(cardh)+" "+str(cardd) lines_list[3] = str(xoffs)+" "+str(yoffs)+" "+str(sxoffs)+" "+str(syoffs) #print (lines_list) diff --git a/buildozer/version.py b/buildozer/version similarity index 100% rename from buildozer/version.py rename to buildozer/version