Kurosu wrote:
4) I have updated the cross_setup.sh so as to use it within a cross-compilation environment. The cross-compiler name-prefix and path are editable in it.
This should read: "I have updated the create_setup.sh script (see 
cross_setup.diff) ..."
And here is the updated version to make it work under windows/mingw at least.
Index: tools/win32_setup/create_setup.sh
===================================================================
--- tools/win32_setup/create_setup.sh   (revision 934)
+++ tools/win32_setup/create_setup.sh   (working copy)
@@ -2,14 +2,13 @@
 
 ## Programs 
 PKG_CONFIG=pkg-config
-MAKE_NSIS=makensis
 
+# For cross-compiler
+CROSSDIR="/usr/local/i386-mingw32"
+
 # Path to which all others are relative
 WORMUXDIR="../.."
 
-# Path of MinGW installation
-MINGWDIR=/mingw
-
 # Windows registry software path
 HKLM_PATH="SOFTWARE\Games\Wormux"
 
@@ -25,13 +24,24 @@
 rm -rf $NSIS $DEST
 
 # Prepare stuff
-WIN_WORMUXDIR=$(cd "$WORMUXDIR" && cmd /c cd)
-LOCAL_PATH=$(cmd /c cd)
+if [ "$OSTYPE" == "linux-gnu" ]; then
+  MAKE_NSIS="makensis -NOCD"
+  WIN_WORMUXDIR="../.."
+  LOCAL_PATH=$PWD
+  SEP='/'
+else
+  MAKE_NSIS="makensis //NOCD"
+  WIN_WORMUXDIR=$(cd "$WORMUXDIR" && cmd /c cd)
+  LOCAL_PATH=$(cmd /c cd)
+  SEP='\\'
+fi
+
 mkdir -p $DEST
 
 function pkg_path
 {
-  if [ -z "$1" ]; then return ""; fi
+  if [ "$OSTYPE" == "linux-gnu" ]; then echo $CROSSDIR; return; fi
+  if [ -z "$1" ]; then echo ""; return; fi
   var=$($PKG_CONFIG --variable=prefix $1 2>/dev/null)
   if [ -z "$var" ]; then echo "Couldn't find $1, aborting..." 1>&2; exit 1; fi
   echo "Found $1 in $var" 1>&2
@@ -53,8 +63,8 @@
 # Create head
 cat > $NSIS <<EOF
 ;based on MUI Welcome/Finish Page Example Script written by Joost Verburg
-!define MUI_ICON  "${WIN_WORMUXDIR}\src\wormux.ico"
-!define MUI_UNICON  ${LOCAL_PATH}\uninstall.ico
+!define MUI_ICON  "${WIN_WORMUXDIR}${SEP}src${SEP}wormux.ico"
+!define MUI_UNICON  ${LOCAL_PATH}${SEP}uninstall.ico
 !define MUI_COMPONENTSPAGE_SMALLDESC
 !define MUI_LANGDLL_ALWAYSSHOW
 !include "MUI.nsh"
@@ -65,7 +75,7 @@
 Name "Wormux"
 
 ;General
-OutFile "${LOCAL_PATH}\Wormux-Setup-${WORMUX_VERSION}.exe"
+OutFile "${LOCAL_PATH}${SEP}Wormux-Setup-${WORMUX_VERSION}.exe"
 SetCompressor $COMPRESSION
 
 !define MUI_LANGDLL_REGISTRY_ROOT "HKLM" 
@@ -89,42 +99,42 @@
 
 ;Languages
 !insertmacro MUI_LANGUAGE "English"
-LicenseLangString WormuxLicense "English" 
"${WIN_WORMUXDIR}\doc\license\COPYING.en.txt"
+LicenseLangString WormuxLicense "English" 
"${WIN_WORMUXDIR}${SEP}doc${SEP}license${SEP}COPYING.en.txt"
 LangString TITLE_Wormux "English" "Wormux"
 LangString DESC_Wormux  "English" "Installs the game Wormux, version 
${WORMUX_VERSION}"
 
 !insertmacro MUI_LANGUAGE "French"
-LicenseLangString WormuxLicense "French" 
"${WIN_WORMUXDIR}\doc\license\COPYING.fr.txt"
+LicenseLangString WormuxLicense "French" 
"${WIN_WORMUXDIR}${SEP}doc${SEP}license${SEP}COPYING.fr.txt"
 LangString TITLE_Wormux "French" "Wormux"
 LangString DESC_Wormux  "French" "Installe le jeu Wormux, en version 
${WORMUX_VERSION}"
 
 !insertmacro MUI_LANGUAGE "German"
-LicenseLangString WormuxLicense "German" 
"${WIN_WORMUXDIR}\doc\license\COPYING.de.txt"
+LicenseLangString WormuxLicense "German" 
"${WIN_WORMUXDIR}${SEP}doc${SEP}license${SEP}COPYING.de.txt"
 LangString TITLE_Wormux "German" "Wormux"
 LangString DESC_Wormux  "German" "Das Spiel Wormux, Version ${WORMUX_VERSION} 
anbringen"
 
 !insertmacro MUI_LANGUAGE "Spanish"
-LicenseLangString WormuxLicense "Spanish" 
"${WIN_WORMUXDIR}\doc\license\COPYING.es.txt"
+LicenseLangString WormuxLicense "Spanish" 
"${WIN_WORMUXDIR}${SEP}doc${SEP}license${SEP}COPYING.es.txt"
 LangString TITLE_Wormux "Spanish" "Wormux"
 LangString DESC_Wormux  "Spanish" "Instala el juego Wormux, versin 
${WORMUX_VERSION}"
 
 !insertmacro MUI_LANGUAGE "Dutch"
-LicenseLangString WormuxLicense "Dutch" 
"${WIN_WORMUXDIR}\doc\license\COPYING.nl.txt"
+LicenseLangString WormuxLicense "Dutch" 
"${WIN_WORMUXDIR}${SEP}doc${SEP}license${SEP}COPYING.nl.txt"
 LangString TITLE_Wormux "Dutch" "Wormux"
 LangString DESC_Wormux  "Dutch" "Wormux ${WORMUX_VERSION}"
 
 !insertmacro MUI_LANGUAGE "Polish"
-LicenseLangString WormuxLicense "Polish" 
"${WIN_WORMUXDIR}\doc\license\COPYING.pl.txt"
+LicenseLangString WormuxLicense "Polish" 
"${WIN_WORMUXDIR}${SEP}doc${SEP}license${SEP}COPYING.pl.txt"
 LangString TITLE_Wormux "Polish" "Wormux"
 LangString DESC_Wormux  "Polish" "Wormux ${WORMUX_VERSION}"
 
 !insertmacro MUI_LANGUAGE "Russian"
-LicenseLangString WormuxLicense "Russian" 
"${WIN_WORMUXDIR}\doc\license\COPYING.ru.txt"
+LicenseLangString WormuxLicense "Russian" 
"${WIN_WORMUXDIR}${SEP}doc${SEP}license${SEP}COPYING.ru.txt"
 LangString TITLE_Wormux "Russian" "Wormux"
 LangString DESC_Wormux  "Russian" "Wormux ${WORMUX_VERSION}"
 
 !insertmacro MUI_LANGUAGE "Slovenian"
-LicenseLangString WormuxLicense "Slovenian" 
"${WIN_WORMUXDIR}\doc\license\COPYING.sk.txt"
+LicenseLangString WormuxLicense "Slovenian" 
"${WIN_WORMUXDIR}${SEP}doc${SEP}license${SEP}COPYING.sk.txt"
 LangString TITLE_Wormux "Slovenian" "Wormux"
 LangString DESC_Wormux  "Slovenian" "Wormux ${WORMUX_VERSION}"
 
@@ -142,10 +152,10 @@
 Section \$(TITLE_Wormux) Sec_Wormux
   ; Set output path to the installation directory.
   SetOutPath \$INSTDIR
-  File "${WIN_WORMUXDIR}\src\wormux.ico"
+  File "${WIN_WORMUXDIR}${SEP}src${SEP}wormux.ico"
   ; Executing in tmpdir, looking for file in folder below
-  File "${LOCAL_PATH}\uninstall.ico"
-  File "${WIN_WORMUXDIR}\src\wormux.exe"
+  File "${LOCAL_PATH}${SEP}uninstall.ico"
+  File "${WIN_WORMUXDIR}${SEP}src${SEP}wormux.exe"
 EOF
 
 # Glib (gobject, gthread, glib & gmodule)
@@ -167,10 +177,13 @@
 
 # Clean up before non-strippable files
 # WARNING Stripping some dlls corrupts them beyond use
-strip "$DEST/"*.dll "$WORMUXDIR/src/"*.exe
+if [ "$OSTYPE" == "linux-gnu" ]; then STRIP=i386-mingw32-strip
+else STRIP=strip; fi
+$STRIP "$DEST/"*.dll "$WORMUXDIR/src/"*.exe
 
 # Files that must not be stripped (all of SDL)
-SDL_PATH=$(sdl-config --prefix)
+if [ "$OSTYPE" == "linux-gnu" ]; then SDL_PATH=$CROSSDIR
+else SDL_PATH=$(sdl-config --prefix); fi
 cp "$SDL_PATH/bin/SDL_mixer.dll" "$SDL_PATH/bin/SDL_ttf.dll"   \
    "$SDL_PATH/bin/SDL_image.dll" "$SDL_PATH/bin/SDL.dll"       \
    "$SDL_PATH/bin/SDL_net.dll" "$GLIB_PATH/bin/intl.dll"       \
@@ -180,7 +193,7 @@
 # Continue producing installer
 cat >> $NSIS <<EOF
   ; Dlls and co
-  File "*.dll"
+  File "$DEST${SEP}*.dll"
 EOF
 
 ## Locale
@@ -189,20 +202,20 @@
   lg=${gmo%%.gmo}
   lg=${lg//.*\//}
   echo "  SetOutPath \$INSTDIR\\locale\\$lg\\LC_MESSAGES" >> $NSIS
-  echo "  File /oname=wormux.mo \"$WIN_WORMUXDIR\\po\\$lg.gmo\"" >> $NSIS
+  echo "  File /oname=wormux.mo \"$WIN_WORMUXDIR${SEP}po${SEP}$lg.gmo\"" >> 
$NSIS
 done
 
 ## Data - I love this syntax
 cat >> $NSIS <<EOF
   ; Data
   SetOutPath \$INSTDIR
-  File /r /x .svn /x Makefile* /x Makefile.* "${WIN_WORMUXDIR}\\data"
+  File /r /x .svn /x Makefile* /x Makefile.* "${WIN_WORMUXDIR}${SEP}data"
 EOF
 
 ## License
 cat >> $NSIS <<EOF
   ; Licenses
-  File /r /x .svn "${WIN_WORMUXDIR}\\doc\\license"
+  File /r /x .svn "${WIN_WORMUXDIR}${SEP}doc${SEP}license"
 EOF
 
 # End
_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev

Répondre à