]> Pileus Git - ~andy/aweather-pkg/commitdiff
Initial import
authorAndy Spencer <andy753421@gmail.com>
Thu, 29 Dec 2011 01:14:38 +0000 (01:14 +0000)
committerAndy Spencer <andy753421@gmail.com>
Thu, 29 Dec 2011 01:48:57 +0000 (17:48 -0800)
17 files changed:
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
config.mk.sample [new file with mode: 0644]
mac/Makefile [new file with mode: 0644]
mac/aweather.bundle [new file with mode: 0644]
mac/aweather.gtkrc [new file with mode: 0644]
mac/aweather.icns [new file with mode: 0644]
mac/aweather.launcher [new file with mode: 0755]
mac/aweather.modules [new file with mode: 0644]
mac/aweather.plist [new file with mode: 0644]
src/Makefile [new file with mode: 0644]
win/Makefile [new file with mode: 0644]
win/aweather.nsi [new file with mode: 0644]
win/gtkrc [new file with mode: 0644]
win/pango.aliases [new file with mode: 0644]
win/setup-mingw.sh [new file with mode: 0755]
win/xdg-open.c [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..aedc5d0
--- /dev/null
@@ -0,0 +1,6 @@
+*~
+*.swp
+*.tar.gz
+*.exe
+*.dmg
+config.mk
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..f6b8651
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+all:
+       make -C src all
+       make -C mac all
+       make -C win all
diff --git a/config.mk.sample b/config.mk.sample
new file mode 100644 (file)
index 0000000..7c3df8c
--- /dev/null
@@ -0,0 +1,18 @@
+FILES        = /scratch/aweather-pkg/files
+
+VER_AWEATHER = 0.6.1
+VER_GRITS    = 0.6.1
+VER_RSL      = 1.42
+
+SRC_AWEATHER = /scratch/aweather
+SRC_GRITS    = /scratch/grits
+SRC_RSL      = /scratch/rsl
+
+WIN_AWEATHER = /scratch/aweather-win32
+WIN_GRITS    = /scratch/grits-win32
+WIN_RSL      = /scratch/rsl-win32
+
+MAC_HOST     = d
+MAC_AWEATHER = /Users/andy/src/aweather
+MAC_GRITS    = /Users/andy/src/grits
+MAC_RSL      = /Users/andy/src/rsl
diff --git a/mac/Makefile b/mac/Makefile
new file mode 100644 (file)
index 0000000..43d9810
--- /dev/null
@@ -0,0 +1,41 @@
+include ../config.mk
+
+DESTDIR  = $(MAC_AWEATHER)/build
+PACKAGES = $(FILES)/aweather-$(VER_AWEATHER).dmg
+GTKINST  = /Users/andy/gtk/inst
+export DESTDIR GTKINST MAC_AWEATHER
+
+all-mac: $(PACKAGES)
+       @echo all-mac
+
+$(DESTDIR): $(MAC_AWEATHER)/src/aweather
+       make -C $(MAC_AWEATHER) install
+       make -C $(MAC_GRITS)    install
+       make -C $(MAC_RSL)      install
+       find $(DESTDIR) -name '*.a'  -delete
+       find $(DESTDIR) -name '*.la' -delete
+       rm -rf $(DESTDIR)/share/rsl/colors
+       rm -rf $(DESTDIR)/include
+       touch $@
+
+$(PACKAGES): $(DESTDIR)
+       rsync -uav $(DESTDIR)/ $(GTKINST)/
+       jhbuild run gtk-mac-bundler aweather.bundle
+       create-dmg --volname 'AWeather-$(VER_AWEATHER)' \
+               $(MAC_AWEATHER)/aweather-$(VER_AWEATHER).dmg \
+               $(MAC_AWEATHER)/AWeather.app
+       $(MAC_AWEATHER)/aweather-$(VER_AWEATHER).dmg
+       cp $(FILES)
+
+aweather-gen:
+       PKG_CONFIG_PATH="../grits/src/" \
+       ./autogen.sh "--enable-relative" \
+               CFLAGS="-g -Werror $(CFLAGS)"
+
+grits-gen:
+       ./autogen.sh \
+               --enable-shared \
+               --disable-static \
+               "--libdir=$(MAC_GRITS)/src/.libs" \
+               "--includedir=$(MAC_GRITS)/include" \
+               CFLAGS="-g -Werror"
diff --git a/mac/aweather.bundle b/mac/aweather.bundle
new file mode 100644 (file)
index 0000000..64d5f9d
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" standalone="no"?>
+<app-bundle>
+       <meta>
+               <prefix name="default">${env:GTKINST}</prefix>
+               <destination overwrite="yes">${env:MAC_AWEATHER}</destination>
+               <image></image>
+               <run-install-name-tool/>
+               <launcher-script>${project}/aweather.launcher</launcher-script>
+               <gtk>gtk+-2.0</gtk>
+       </meta>
+
+       <plist>${project}/aweather.plist</plist>
+       <main-binary>${prefix}/bin/aweather</main-binary>
+
+       <binary>${prefix}/bin/wsr88ddec</binary>
+       <binary>${prefix}/bin/grits-demo</binary>
+       <binary>${prefix}/bin/xdg-open</binary>
+       <binary>${prefix}/lib/aweather/*.so</binary>
+       <binary>${prefix}/lib/grits2/*.so</binary>
+       <data>${prefix}/share/aweather</data>
+       <data>${prefix}/share/doc/aweather</data>
+       <data>${prefix}/share/rsl/*.dat</data>
+       <data>${prefix}/share/icons/hicolor/16x16/apps/aweather.png</data>
+       <data>${prefix}/share/icons/hicolor/22x22/apps/aweather.png</data>
+       <data>${prefix}/share/icons/hicolor/24x24/apps/aweather.png</data>
+       <data>${prefix}/share/icons/hicolor/32x32/apps/aweather.png</data>
+       <data>${prefix}/share/icons/hicolor/48x48/apps/aweather.png</data>
+       <data>${prefix}/share/icons/hicolor/scalable/apps/aweather.svg</data>
+       <data dest="${bundle}/Contents/Resources">${project}/aweather.icns</data>
+
+       <binary>${prefix}/lib/${gtkdir}/modules/*.so</binary>
+       <binary>${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/*.so</binary>
+       <binary>${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so</binary>
+       <binary>${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so</binary>
+
+       <data>${prefix}/share/themes/Clearlooks</data>
+       <data>${prefix}/share/themes/Default</data>
+       <data>${prefix}/share/themes/Mac</data>
+       <data>${prefix}/share/themes/Quartz</data>
+       <data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">${project}/aweather.gtkrc</data>
+</app-bundle>
diff --git a/mac/aweather.gtkrc b/mac/aweather.gtkrc
new file mode 100644 (file)
index 0000000..e032c59
--- /dev/null
@@ -0,0 +1,3 @@
+include "../../share/themes/Clearlooks/gtk-2.0/gtkrc"
+gtk-icon-theme-name = "Tango"
+gtk-enable-mnemonics = 0
diff --git a/mac/aweather.icns b/mac/aweather.icns
new file mode 100644 (file)
index 0000000..e4c98eb
Binary files /dev/null and b/mac/aweather.icns differ
diff --git a/mac/aweather.launcher b/mac/aweather.launcher
new file mode 100755 (executable)
index 0000000..63a2980
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+cd "$(dirname $0)/../Resources/bin"
+
+PREFIX="$(dirname "$(pwd)")"
+
+export DYLD_LIBRARY_PATH="$PREFIX/lib"
+export XDG_CONFIG_DIRS="$PREFIX/etc/xdg"
+export XDG_DATA_DIRS="$PREFIX/share"
+export GTK_DATA_PREFIX="$PREFIX"
+export GTK_EXE_PREFIX="$PREFIX"
+export GTK_PATH="$PREFIX"
+
+export GTK2_RC_FILES="$PREFIX/etc/gtk-2.0/gtkrc"
+export GTK_IM_MODULE_FILE="$PREFIX/etc/gtk-2.0/gtk.immodules"
+export GDK_PIXBUF_MODULE_FILE="$PREFIX/etc/gtk-2.0/gdk-pixbuf.loaders"
+export PANGO_RC_FILE="$PREFIX/etc/pango/pangorc"
+
+export PATH="$PATH:$PREFIX/bin"
+
+[[ "$1" = '-psn_'* ]] && shift
+../../MacOS/AWeather-bin "$@"
diff --git a/mac/aweather.modules b/mac/aweather.modules
new file mode 100644 (file)
index 0000000..fc11b3b
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
+<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?>
+<moduleset>
+       <include href="http://git.gnome.org/browse/gtk-osx/plain/modulesets-stable/gtk-osx.modules"/>
+       <repository type="git" name="lug.rose-hulman.edu" default="yes" href="git://lug.rose-hulman.edu/"/>
+       <autotools id="rsl">
+               <branch module="~spenceal/rsl" checkoutdir="rsl" revision="aweather" />
+       </autotools>
+       <autotools id="grits" autogenargs="--enable-relative" makeinstallargs="DESTDIR=${PREFIX}">
+               <branch module="proj/grits" checkoutdir="grits" revision="mac" />
+               <dependencies>
+                       <dep package="gtk+"/>
+                       <dep package="libsoup"/>
+               </dependencies>
+       </autotools>
+       <autotools id="aweather" autogenargs="--enable-relative" makeinstallargs="DESTDIR=${PREFIX}">
+               <branch module="proj/aweather" checkoutdir="aweather" revision="mac" />
+               <dependencies>
+                       <dep package="rsl"/>
+                       <dep package="grits"/>
+               </dependencies>
+       </autotools>
+</moduleset>
diff --git a/mac/aweather.plist b/mac/aweather.plist
new file mode 100644 (file)
index 0000000..85e4abd
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+       <dict>
+               <key>CFBundleDevelopmentRegion</key>
+               <string>English</string>
+
+               <key>CFBundleExecutable</key>
+               <string>AWeather</string>
+
+               <key>CFBundleGetInfoString</key>
+               <string>0.6.3, (C) 2011 Andy Spencer</string>
+
+               <key>CFBundleIconFile</key>
+               <string>aweather.icns</string>
+
+               <key>CFBundleIdentifier</key>
+               <string>edu.rose-hulman.lug.aweather</string>
+
+               <key>CFBundleInfoDictionaryVersion</key>
+               <string>6.0</string>
+
+               <key>CFBundlePackageType</key>
+               <string>APPL</string>
+
+               <key>CFBundleShortVersionString</key>
+               <string>0.6.3</string>
+
+               <key>CFBundleSignature</key>
+               <string>????</string>
+
+               <key>CFBundleVersion</key>
+               <string>0.6.3</string>
+
+               <key>NSHumanReadableCopyright</key>
+               <string>Copyright 2011 Andy Spencer, GNU General Public License.</string>
+
+               <key>LSMinimumSystemVersion</key>
+               <string>10.4</string>
+       </dict>
+</plist>
diff --git a/src/Makefile b/src/Makefile
new file mode 100644 (file)
index 0000000..b1d740b
--- /dev/null
@@ -0,0 +1,39 @@
+include ../config.mk
+
+PACKAGES = $(FILES)/aweather-$(VER_AWEATHER).tar.gz \
+           $(FILES)/grits-$(VER_GRITS).tar.gz \
+           $(FILES)/rsl-$(VER_RSL).tar.gz
+
+all: $(PACKAGES)
+       @echo all-src
+
+clean:
+       @echo clean-src
+       rm -f $(PACKAGES)
+
+$(PACKAGES):
+       make -C $(SRC_AWEATHER) dist
+       make -C $(SRC_GRITS)    dist
+       make -C $(SRC_RSL)      dist
+       cp -t $(FILES) \
+               $(SRC_AWEATHER)/aweather-$(VER_AWEATHER).tar.gz \
+               $(SRC_GRITS)/grits-$(VER_GRITS).tar.gz \
+               $(SRC_RSL)/rsl-$(VER_RSL).tar.gz
+
+aweather-gen:
+       cd $(SRC_AWEATHER); \
+       PKG_CONFIG_PATH="$(MAC_GRITS)" \
+       LIBS="-L$(MAC_GRITS)" \
+       CPPFLAGS="-I$(MAC_GRITS)" \
+       ./autogen.sh \
+               --enable-shared \
+               --disable-static \
+               CFLAGS="-g -Werror $CFLAGS"
+
+grits-gen:
+       cd $(SRC_GRITS); \
+       ./autogen.sh \
+               "--enable-gtk-doc" \
+               "--libdir=$(SRC_GRITS)/src/.libs" \
+               "--includedir=$(SRC_GRITS)/include" \
+               CFLAGS="-g -Werror $(CFLAGS)"
diff --git a/win/Makefile b/win/Makefile
new file mode 100644 (file)
index 0000000..e4c63d4
--- /dev/null
@@ -0,0 +1,49 @@
+include ../config.mk
+
+export \
+DESTDIR    = $(WIN_AWEATHER)/build
+
+INSTALLERS = $(FILES)/aweather-$(VER_AWEATHER).exe \
+             $(FILES)/aweather-$(VER_AWEATHER)-gtk.exe
+
+all: $(INSTALLERS)  
+       @echo all-win
+
+clean:
+       @echo clean-win
+       rm -f $(INSTALLERS)
+
+$(DESTDIR):
+       make -C $(WIN_AWEATHER) install
+       make -C $(WIN_GRITS)    install
+       make -C $(WIN_RSL)      install
+       find $(DESTDIR) -name '*.a'  -delete
+       find $(DESTDIR) -name '*.la' -delete
+       rm -rf $(DESTDIR)/share/rsl/colors
+       rm -rf $(DESTDIR)/include
+       touch $@
+
+$(INSTALLERS): $(DESTDIR)
+       cd $(WIN_AWEATHER); \
+       makensis -DVERSION=$(VER_AWEATHER) aweather.nsi; \
+       makensis -DVERSION=$(VER_AWEATHER) -DUSE_GTK aweather.nsi
+       cp $(WIN_AWEATHER)/aweather-$(VERSION)*.exe $(FILES)
+
+aweather-gen:
+       cd $(WIN_AWEATHER); \
+       PKG_CONFIG_PATH="$(WIN_GRITS)" \
+       LIBS="-L$(WIN_GRITS)"\
+       CPPFLAGS="-I$(WIN_GRITS)"\
+       CFLAGS="-g -Werror -Wno-unused -O3"\
+       ./autogen.sh \
+               --enable-shared \
+               --disable-static \
+               --host=i686-pc-mingw32
+
+grits-gen:
+       cd $(WIN_GRITS); \
+       ./autogen.sh \
+               --enable-shared \
+               --disable-static \
+               --host=i686-pc-mingw32 \
+               CFLAGS="-g -Werror -Wno-unused -O3"
diff --git a/win/aweather.nsi b/win/aweather.nsi
new file mode 100644 (file)
index 0000000..e7bf623
--- /dev/null
@@ -0,0 +1,97 @@
+SetCompressor /SOLID lzma
+!define MULTIUSER_EXECUTIONLEVEL Highest
+!define MULTIUSER_MUI
+!define MULTIUSER_INSTALLMODE_COMMANDLINE
+!define MULTIUSER_INSTALLMODE_INSTDIR AWeather
+!include "MultiUser.nsh"
+!include "MUI2.nsh"
+
+Function .onInit
+       !insertmacro MULTIUSER_INIT
+FunctionEnd
+
+Function un.onInit
+       !insertmacro MULTIUSER_UNINIT
+FunctionEnd
+
+Name "AWeather"
+!ifndef VERSION
+       !define VERSION LATEST
+!endif
+!ifdef USE_GTK
+       OutFile "aweather-${VERSION}-gtk.exe"
+!else
+       OutFile "aweather-${VERSION}.exe"
+!endif
+InstallDir AWeather
+Icon "${ROOT}/data/icons/48x48/aweather.ico"
+
+!define MUI_ABORTWARNING
+
+!insertmacro MUI_PAGE_LICENSE "${ROOT}/COPYING"
+!insertmacro MULTIUSER_PAGE_INSTALLMODE
+!insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+!insertmacro MUI_LANGUAGE "English"
+
+Section "AWeather (required)" SecAWeather
+       SectionIn RO
+
+       SetOutPath $INSTDIR
+       File /r build/*
+       !ifdef USE_GTK
+               file /r gtk/*
+       !endif
+       
+       StrCmp $MultiUser.InstallMode "AllUsers" 0 +4
+               WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "DisplayName" "AWeather"
+               WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "UninstallString" "$INSTDIR\uninstaller.exe"
+       Goto +3
+               WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "DisplayName" "AWeather"
+               WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "UninstallString" "$INSTDIR\uninstaller.exe"
+
+       FileOpen $0 $INSTDIR\instmode.dat w
+       FileWrite $0 $MultiUser.InstallMode
+       FileClose $0
+       
+       WriteUninstaller $INSTDIR\uninstaller.exe
+SectionEnd
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+!insertmacro MUI_DESCRIPTION_TEXT ${SecAWeather} "AWeather core files."
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
+Section "Desktop Icons"
+       SetOutPath $INSTDIR\bin
+       CreateShortCut "$DESKTOP\AWeather.lnk" "$INSTDIR\bin\aweather.exe" "" "$INSTDIR\bin\aweather.exe" 0
+SectionEnd
+
+Section "Start Menu Shortcuts"
+       SetOutPath $INSTDIR\bin
+       CreateDirectory "$SMPROGRAMS\AWeather"
+       CreateShortCut  "$SMPROGRAMS\AWeather\Uninstall AWeather.lnk" "$INSTDIR\uninstaller.exe"  "" "$INSTDIR\uninstaller.exe"  0
+       CreateShortCut  "$SMPROGRAMS\AWeather\AWeather.lnk"           "$INSTDIR\bin\aweather.exe" "" "$INSTDIR\bin\aweather.exe" 0
+       CreateShortCut  "$SMPROGRAMS\AWeather\AWeather (debug).lnk" "cmd.exe" "/K aweather-dbg.exe -d 7" "$INSTDIR\bin\aweather-dbg.exe" 0
+SectionEnd
+
+Section "Uninstall"
+       FileOpen $0 $INSTDIR\instmode.dat r
+       FileRead $0 $1
+       FileClose $0
+
+       StrCmp $1 "AllUsers" 0 +4
+               SetShellVarContext all
+               DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather"
+       Goto +3
+               SetShellVarContext current
+               DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather"
+
+       Delete $DESKTOP\AWeather.exe.lnk
+
+       RMDir /r $SMPROGRAMS\AWeather
+       RMDir /r $INSTDIR
+SectionEnd
diff --git a/win/gtkrc b/win/gtkrc
new file mode 100644 (file)
index 0000000..c9b5095
--- /dev/null
+++ b/win/gtkrc
@@ -0,0 +1,8 @@
+gtk-theme-name               = "MS-Windows"
+gtk-icon-theme-name          = "Tango"
+gtk-fallback-icon-theme      = "hicolor"
+gtk-alternative-button-order = 1
+gtk-alternative-sort-arrows  = 1
+gtk-auto-mnemonics           = 1
+gtk-show-input-method-menu   = 0
+gtk-show-unicode-menu        = 0
diff --git a/win/pango.aliases b/win/pango.aliases
new file mode 100644 (file)
index 0000000..afdce43
--- /dev/null
@@ -0,0 +1,7 @@
+courier    = "courier new,courier monothai"
+mono       = "consolas,courier new,lucida console,courier monothai,mingliu,simsun,gulimche,ms gothic,kartika,latha,mangal,raavi"
+monospace  = "consolas,courier new,lucida console,courier monothai,mingliu,simsun,gulimche,ms gothic,kartika,latha,mangal,raavi"
+sans       = "arial,lucida sans unicode,browallia new,mingliu,simhei,gulimche,ms gothic,kartika,latha,mangal,raavi"
+"segoe ui" = "segoe ui,meiryo,malgun gothic,microsoft jhenghei,microsoft yahei,gisha,leelawadee"
+serif      = "times new roman,angsana new,mingliu,simsun,gulimche,ms gothic,kartika,latha,mangal,raavi"
+tahoma     = "tahoma,lucida sans unicode,browallia new,mingliu,simhei,gulimche,ms gothic,kartika,latha,mangal,raavi"
diff --git a/win/setup-mingw.sh b/win/setup-mingw.sh
new file mode 100755 (executable)
index 0000000..eae6515
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+function extract {
+       bin=false; dev=false; ext=false;
+       eval set -- "`getopt -n "$0" -o bdx -l bin,dev,ext -- "$@"`"
+       while [ ! "$1" == "--" ]; do
+               case "$1" in
+                       -b|--bin) bin=true ;;
+                       -d|--dev) dev=true ;;
+                       -x|--ext) ext=true ;;
+               esac
+               shift
+       done
+
+       zip=$2
+       sub=$(basename "${zip/.zip/}")
+       tmp=`mktemp -d`
+       $ext && unzip "$zip" -d "$tmp/$sub" \
+            || unzip "$zip" -d "$tmp"
+       $dev && rsync -a "$tmp/$sub/" "$DEV/"
+       $bin && rsync -a "$tmp/$sub/" "$BIN/"
+       rm -rf "$tmp"
+}
+
+# Install locations
+DEV=/usr/i686-pc-mingw32-2.24
+BIN=/scratch/aweather-win32/local/gtk/gtk-2.24
+
+# Copy clean folder
+rsync -a /usr/i686-pc-mingw32-clean/ "$DEV/"
+
+# Extract packages
+extract -bdx /scratch/aweather/local/extern/gtk+-bundle_2.24.8-20111122_win32.zip
+extract -bd  /scratch/aweather/local/extern/iconv-1.9.2.win32.zip
+extract -bd  /scratch/aweather/local/extern/libxml2-2.7.6.win32.zip
+extract -bx  /scratch/aweather/local/extern/libsoup_2.26.3-1_win32.zip
+extract -dx  /scratch/aweather/local/extern/libsoup-dev_2.26.3-1_win32.zip
+extract -bx  /scratch/aweather/local/extern/bzip2-1.0.5-bin.zip
+extract -dx  /scratch/aweather/local/extern/bzip2-1.0.5-lib.zip
+
+# Cleanup install folders
+rm  -f $DEV/lib/*.la
+rm -rf $BIN/{contrib,include,man,manifest,src,*.txt}
+rm -rf $BIN/share/{aclocal,glib,gtk,locale,man,doc}*
+rm  -f $BIN/lib/GNU.Gettext.dll
+rm -rf $BIN/etc/bash_completion.d
+find "$BIN/bin/" "$BIN/lib/" -type f \
+       -and -not -name '*.dll'      \
+       -and -not -name '*.cache'    \
+       -and -not -name 'gspawn-*'   \
+       -delete
+find "$BIN/bin/" "$BIN/lib/" -type f \
+       -and -not -name 'libxml*dll' \
+       -and -not -name 'iconv.dll'  \
+       -exec strip -s "{}" ";"
+find "$BIN" -type d -delete 2>/dev/null
+
+# Fix broken packages
+cp /usr/lib/pkgconfig/libxml-2.0.pc $DEV/lib/pkgconfig
+rename libxml2.dll libxml2-2.dll {$DEV,$BIN}/bin/*
+
+i686-pc-mingw32-gcc -Wall -mwindows -o $BIN/bin/xdg-open.exe mingw/xdg-open.c
+cp mingw/gtkrc $BIN/etc/gtk-2.0/gtkrc
+cp mingw/pango.aliases $BIN/etc/pango/pango.aliases
+
+# Fix pkg-config
+sed -i 's!^prefix=.*!prefix=/usr/i686-pc-mingw32!' \
+       $DEV/lib/pkgconfig/*.pc
+
+# Install custom programs
+#   grits    - DESTDIR=/usr/i686-pc-mingw32 make install
+#   rsl      - DESTDIR=/usr/i686-pc-mingw32 make install
+#   aweather - DESTDIR=/usr/i686-pc-mingw32 make install
diff --git a/win/xdg-open.c b/win/xdg-open.c
new file mode 100644 (file)
index 0000000..33c171e
--- /dev/null
@@ -0,0 +1,8 @@
+#include <windows.h>
+#include <shellapi.h>
+int main(int argc, char* argv[])
+{
+       if (argc > 1)
+               ShellExecute(NULL, "open", argv[1], "", NULL, SW_SHOWNORMAL);
+       return 0;
+}