From b428196b5ef415ef65a4a3e5e873ff3958f8ee7b Mon Sep 17 00:00:00 2001 From: cathugger Date: Tue, 17 May 2022 16:01:52 +0000 Subject: [PATCH] more stuff --- calcest.c | 3 ++ contrib/winbuild/.gitignore | 5 ++- contrib/winbuild/buildwin.sh | 59 +++++++++++++++++++++++++++++++----- 3 files changed, 57 insertions(+), 10 deletions(-) diff --git a/calcest.c b/calcest.c index 0315a3a..4670598 100644 --- a/calcest.c +++ b/calcest.c @@ -19,6 +19,9 @@ const int charcounts[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10 }; int main(int argc,char **argv) { + // TODO + (void) argc; + (void) argv; printf(" |"); for (size_t i = 0; i < sizeof(probs)/sizeof(probs[0]); ++i) { diff --git a/contrib/winbuild/.gitignore b/contrib/winbuild/.gitignore index 6b0e2e7..1603eac 100644 --- a/contrib/winbuild/.gitignore +++ b/contrib/winbuild/.gitignore @@ -1,3 +1,2 @@ -/winepfx -/x86_64 -/i686 +/build +/out diff --git a/contrib/winbuild/buildwin.sh b/contrib/winbuild/buildwin.sh index d059c5d..9c29299 100755 --- a/contrib/winbuild/buildwin.sh +++ b/contrib/winbuild/buildwin.sh @@ -1,33 +1,78 @@ #!/bin/sh -set -e +set -eux + +V=$1 D=$(realpath "$0") D=$(dirname "$D") cd "$D" +mkdir -p build + export WINEARCH=win64 -export WINEPREFIX=$(realpath ./winepfx) +export WINEPREFIX=$(realpath ./build/winepfx) OPATH=$PATH +rm -rf out +mkdir -p out + +# prepare source +SV=mkp224o-$V +SO=$(realpath ./out/$SV) +git clone ../../ "$SO" +cd "$SO" +rm -rf .git +./autogen.sh +echo v$V > version.txt +cd ../.. + +# build windows bins +B=$(realpath ./build) for w in x86_64 i686 do - rm -rf "$w" - mkdir "$w" - cd "$w" + cd "$B" + rm -rf $w + mkdir $w + cd $w p=$w-w64-mingw32 case $w in i686) CFLAGS="-march=i686 -mtune=generic" + W=32 ;; x86_64) CFLAGS="-march=x86-64 -mtune=generic" + W=64 ;; esac CFLAGS="-O3 $CFLAGS -fomit-frame-pointer" export PATH=/usr/$p/bin:$OPATH - ../../../configure --enable-regex --enable-donna --with-pcre2="/usr/$p/bin/pcre2-config" CC="$p-gcc" CFLAGS="$CFLAGS" - make + ../../out/$SV/configure --enable-regex --enable-donna --with-pcre2="/usr/$p/bin/pcre2-config" CC="${p}-gcc" CFLAGS="$CFLAGS" + make main util + $p-strip mkp224o.exe + $p-strip calcest.exe cd .. + + BO="$SO-w$W" + mkdir -p "$BO" + cp $w/mkp224o.exe "$BO/" + cp $w/calcest.exe "$BO/" + cd "$BO" + $p-ldd mkp224o.exe | grep -v 'not found' | awk '{print $3}' | xargs -r cp -v -t ./ done +export PATH=$OPATH + +# compress stuff +cd "$D/out" +export TZ=UTC + +tar --portability --no-acls --no-selinux --no-xattrs --owner root:0 --group=root:0 --sort=name -c -f $SV.tar $SV +zopfli -c $SV.tar > $SV.tar.gz +zstd -19 -f $SV.tar -o $SV.tar.zst +rm $SV.tar + +zip -9 -X -r $SV-w32.zip $SV-w32 +zip -9 -X -r $SV-w64.zip $SV-w64 +