PIKApp/build/windows/jhbuild/mkarchive

96 lines
2.2 KiB
Bash

#!/bin/bash
dll_loc_32=${DLL_LOC_i686:-/usr/i686-w64-mingw32/bin}
dll_loc_64=${DLL_LOC_x86_64:-/usr/x86_64-w64-mingw32/bin}
add_dll (){
cp --reflink=auto $1/$2 ./bin/
}
dostuff (){
f=$1-$4-`date +%Y-%m-%d`
mkdir -p combined/$f
cp -R -d -L --reflink=auto ./pika-common$3-$4/* combined/$f
cp -R -d -L --reflink=auto ./$1-$4/* combined/$f
pushd combined
pushd $f
mv lib/libicu*.dll bin/
rm -rf _jhbuild
rm -rf man
rm -rf share/doc
rm -rf share/gtk-doc
rm -rf share/gtk-2.0/demo
rm -rf share/applications
rm -rf share/info
rm -rf share/man
rm -rf share/gdb
rm -rf share/gettext
rm -f etc/gconf/2/path.jhbuild
rm -f `find -name *.exe | sed -e /pika/d -e /gspawn/d -e /gdb.exe/d`
if [ "$4" == "i686" ]; then
add_dll $dll_loc_32 libstdc++-6.dll
add_dll $dll_loc_32 libgcc_s_sjlj-1.dll
add_dll $dll_loc_32 libwinpthread-1.dll
elif [ "$4" == "x86_64" ]; then
add_dll $dll_loc_64 libstdc++-6.dll
add_dll $dll_loc_64 libgcc_s_seh-1.dll
add_dll $dll_loc_64 libwinpthread-1.dll
fi
pushd bin
rm -f `ls | sed -e /.exe/d -e /.dll/d`
popd
rm -f `find -name *.html`
rm -f `find -name *.htm`
rm -f `find -name *.a`
rm -f `find -name *.def`
rm -f `find -name *.sh`
rm -f `find -name *.h`
rm -f `find -name *.c`
rm -f `find -name *.hxx`
rm -f `find -name *.pc`
rm -f `find -name *.m4`
rm -f `find -name *.manifest`
find -depth -type d -empty -exec rmdir {} \;
echo "@echo off
start %~dp0bin\\$2" | unix2dos > run_pika.bat
echo "gtk-fallback-icon-theme='gnome'" >> etc/gtk-2.0/gtkrc
popd
if [ -e $f/bin/pika-2.*.exe ]; then
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on /tmp/$f.7z $f
cat ~/bin/7z.sfx /tmp/$f.7z > $f.exe
rm -f /tmp/$f.7z
else
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "!! PIKA EXECUTABLE NOT FOUND !!"
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
fi
rm -rf $f
popd
}
cd targets
dostuff pika-stable pika-2.8.exe "" i686
dostuff pika-dev pika-2.9.exe "" i686
dostuff pika-stable-dbg pika-2.8.exe "-dbg" i686
dostuff pika-dev-dbg pika-2.9.exe "-dbg" i686
dostuff pika-stable pika-2.8.exe "" x86_64
dostuff pika-dev pika-2.9.exe "" x86_64
dostuff pika-stable-dbg pika-2.8.exe "-dbg" x86_64
dostuff pika-dev-dbg pika-2.9.exe "-dbg" x86_64