4 bin=false; dev=false; ext=false;
5 eval set -- "`getopt -n "$0" -o bdx -l bin,dev,ext -- "$@"`"
6 while [ ! "$1" == "--" ]; do
16 sub=$(basename "${zip/.zip/}")
18 $ext && unzip "$zip" -d "$tmp/$sub" \
19 || unzip "$zip" -d "$tmp"
20 $dev && rsync -a "$tmp/$sub/" "$DEV/"
21 $bin && rsync -a "$tmp/$sub/" "$BIN/"
25 # Install custom programs
26 # grits - DESTDIR=/usr/$MINGW make install
27 # rsl - DESTDIR=/usr/$MINGW make install
28 # aweather - DESTDIR=/usr/$MINGW make install
31 GTK_URI='http://www.tarnyko.net/repo/GTK+-Bundle-3.6.1_(TARNYKO).exe'
32 SOUP_BIN='http://ftp.gnome.org/pub/gnome/binaries/win32/libsoup/2.26/libsoup_2.26.3-1_win32.zip'
33 SOUP_DEV='http://ftp.gnome.org/pub/gnome/binaries/win32/libsoup/2.26/libsoup-dev_2.26.3-1_win32.zip'
34 BZIP_BIN='http://downloads.sourceforge.net/project/gnuwin32/bzip2/1.0.5/bzip2-1.0.5-bin.zip'
35 BZIP_DEV='http://downloads.sourceforge.net/project/gnuwin32/bzip2/1.0.5/bzip2-1.0.5-lib.zip'
40 CLEAN="/usr/mingw32-clean"
41 BIN="/home/andy/src/aweather-win32/local/gtk-3.6.1"
42 EXT="/home/andy/src/aweather-win32/local/packages"
43 GTK="/home/andy/.wine/drive_c/Program Files (x86)/GTK+-Bundle-3.6.1"
45 # Create download dir, if needed
49 wget -O "$EXT/$(basename $GTK_URI)" "$GTK_URI"
50 wget -O "$EXT/$(basename $SOUP_BIN)" "$SOUP_BIN"
51 wget -O "$EXT/$(basename $SOUP_DEV)" "$SOUP_DEV"
52 wget -O "$EXT/$(basename $BZIP_BIN)" "$BZIP_BIN"
53 wget -O "$EXT/$(basename $BZIP_DEV)" "$BZIP_DEV"
56 wine extern/gtk-3.6.1-dev.exe
59 rsync -a --delete "$CLEAN/" "$DEV/"
60 rsync -a "$GTK/" "$DEV/"
61 rsync -a --delete "$GTK/" "$BIN/"
64 extract -bdx "$EXT/$(basename $SOUP_BIN)"
65 extract -dx "$EXT/$(basename $SOUP_DEV)"
66 extract -bdx "$EXT/$(basename $BZIP_BIN)"
67 extract -dx "$EXT/$(basename $BZIP_DEV)"
69 # Cleanup install folders
71 rm -rf $BIN/{contrib,include,man,manifest,*.exe}
72 rm -rf $BIN/share/{aclocal,bash,doc,gdb,glib,gtk,info,locale,man}*
73 rm -f $BIN/lib/GNU.Gettext.dll
74 find "$BIN/bin/" "$BIN/lib/" -type f \
75 -and -not -name '*.dll' \
76 -and -not -name '*.cache' \
77 -and -not -name 'gspawn-*' \
79 find "$BIN/bin/" "$BIN/lib/" -type f \
80 -and -not -name 'libxml*dll' \
81 -and -not -name 'iconv.dll' \
82 -exec strip -s "{}" ";"
83 find "$BIN" -type d -delete 2>/dev/null
86 $GCC -Wall -mwindows -o $BIN/bin/xdg-open.exe xdg-open.c
89 mkdir -p $BIN/etc/{gtk-3.0,pango}
90 cp gtkrc3 $BIN/etc/gtk-3.0/gtkrc
91 cp pango.aliases $BIN/etc/pango/pango.aliases
94 sed -i "s!^prefix=.*!prefix=$DEV!" $DEV/lib/pkgconfig/*.pc