[glade] Added build/mingw-w64 directory with script tp cross compile and create windows installer using nsis



commit a894a9b3029f66c1f26530598e4bcf4505afe9cc
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Tue May 29 18:59:43 2012 -0300

    Added build/mingw-w64 directory with script tp cross compile and create windows installer using nsis

 COPYING.GPL                            |   60 -----------
 COPYING.LGPL                           |   45 --------
 build/mingw-w64/README                 |   19 ++++
 build/mingw-w64/glade.nsi.in           |  123 ++++++++++++++++++++++
 build/mingw-w64/nsis_make_installer.sh |  178 ++++++++++++++++++++++++++++++++
 configure.ac                           |    1 +
 src/glade.rc.in                        |    4 +-
 7 files changed, 323 insertions(+), 107 deletions(-)
---
diff --git a/COPYING.GPL b/COPYING.GPL
index d60c31a..5a965fb 100644
--- a/COPYING.GPL
+++ b/COPYING.GPL
@@ -278,63 +278,3 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year  name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/COPYING.LGPL b/COPYING.LGPL
index bf50f20..191a97f 100644
--- a/COPYING.LGPL
+++ b/COPYING.LGPL
@@ -435,48 +435,3 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 DAMAGES.
 
 		     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public
-    License along with this library; if not, write to the 
-    Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
-    Boston, MA  02111-1307  USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/build/mingw-w64/README b/build/mingw-w64/README
new file mode 100644
index 0000000..fa6f5cc
--- /dev/null
+++ b/build/mingw-w64/README
@@ -0,0 +1,19 @@
+This script files is intended to cross compile glade for windows under linux
+using the mingw-w64 toolchain download-mingw-rpm [1] script to get precompiled depencies
+
+I develop it under Debian sid so it should also work on Ubuntu and others Debian
+based distributions.
+
+It does not really has any dependency on Debian other than it uses apt-get to
+install mingw-w64, nsis and p7zip-full packages. So if you have those packages
+installed on your system it should work out of the box on others linuxs and perhaps unices?
+BTW it needs python3 and wget, but those are probably already installed in your
+system.
+
+If you really want to compile on windows I guess a good aproach would be
+to install cygwin [2] to get a unix like env to run configure and shell scripts,
+install mingw gcc package using download-mingw-rpm [1] and update the script
+system env variables accordingly.
+
+[1] https://github.com/mkbosmans/download-mingw-rpm
+[2] http://www.cygwin.com/
diff --git a/build/mingw-w64/glade.nsi.in b/build/mingw-w64/glade.nsi.in
new file mode 100644
index 0000000..99526b5
--- /dev/null
+++ b/build/mingw-w64/glade.nsi.in
@@ -0,0 +1,123 @@
+;Include Modern UI
+!include "MUI2.nsh"
+!include "FileFunc.nsh"
+
+;General
+!define APPNAME "Glade Interface Designer"
+!define COMPANYNAME "GNOME Foundation"
+
+!define VERSIONMAJOR @GLADE_MAJOR_VERSION@
+!define VERSIONMINOR @GLADE_MINOR_VERSION@
+!define VERSIONBUILD @GLADE_MICRO_VERSION@
+
+!define HELPURL "http://bugzilla.gnome.org/browse.cgi?product=glade";
+!define UPDATEURL "http://glade.gnome.org";
+!define ABOUTURL "http://gnome.org";
+
+;Name and file
+Name "${APPNAME}"
+BrandingText "${COMPANYNAME}"
+outFile "glade- GLADE_MAJOR_VERSION@- GLADE_MINOR_VERSION@- GLADE_MICRO_VERSION@-installer.exe"
+
+;Default installation folder
+InstallDir "$LOCALAPPDATA\${COMPANYNAME}\${APPNAME}"
+
+;Request application privileges for Windows Vista
+RequestExecutionLevel user
+
+;Interface Settings
+!define MUI_ICON "glade.ico"
+!define MUI_ABORTWARNING
+
+;Pages
+!insertmacro MUI_PAGE_LICENSE "COPYING"
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+;Languages
+!insertmacro MUI_LANGUAGE "English"
+
+Function .onInit
+  ReadRegStr $R0 HKLM \
+  "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString"
+  StrCmp $R0 "" done
+ 
+  MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
+  "${APPNAME} is already installed. $\n$\nClick `OK` to remove the \
+  previous version or `Cancel` to cancel this upgrade." \
+  IDOK uninst
+  Abort
+ 
+;Run the uninstaller
+uninst:
+  ClearErrors
+  SetOverwrite on
+  ; Get old instalation directory
+  ${GetFileName} $R0 $1
+  ${GetParent} $R0 $2
+  ; Move old uninstaller
+  CopyFiles $R0 $TEMP
+  SetOverwrite off
+  ; execute old uninstaller
+  ExecWait '$TEMP\$1 _?=$2' $3
+  ; remove moved uninstaller
+  Delete $TEMP\$1
+done:
+ 
+FunctionEnd
+
+Section "Install"
+        SetOutPath "$INSTDIR"
+        file /r bin
+        file /r etc
+        !include install_files.nsh
+        file glade.ico
+  
+        ;Create uninstaller
+        WriteUninstaller "$INSTDIR\Uninstall.exe"
+        ;Create shortcuts
+        createDirectory "$SMPROGRAMS\${COMPANYNAME}"
+        createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\bin\glade.exe" "" "$INSTDIR\glade.ico"
+ 
+	; Registry information for add/remove programs
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" "${COMPANYNAME} - ${APPNAME}"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$INSTDIR\uninstall.exe /S"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$INSTDIR"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\glade.ico$\""
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "$\"${COMPANYNAME}$\""
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "HelpLink" "$\"${HELPURL}$\""
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\""
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLInfoAbout" "$\"${ABOUTURL}$\""
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "$\"${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}$\""
+	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMajor" ${VERSIONMAJOR}
+	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMinor" ${VERSIONMINOR}
+        WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMicro" ${VERSIONBUILD}
+	; There is no option for modifying or repairing the install
+	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoModify" 1
+	WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoRepair" 1
+SectionEnd
+
+Section "Uninstall"
+	; Remove Start Menu launcher
+	delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk"
+	; Try to remove the Start Menu folder - this will only happen if it is empty
+	rmDir "$SMPROGRAMS\${COMPANYNAME}"
+ 
+	; Remove files
+        delete "$INSTDIR\glade.ico"
+        !include uninstall_files.nsh
+
+	; Always delete uninstaller as the last action
+	delete "$INSTDIR\uninstall.exe"
+ 
+	; Try to remove the install directory - this will only happen if it is empty
+	rmDir "$INSTDIR"
+        rmDir "$LOCALAPPDATA\${COMPANYNAME}"
+ 
+	; Remove uninstaller information from the registry
+	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}"
+
+SectionEnd
diff --git a/build/mingw-w64/nsis_make_installer.sh b/build/mingw-w64/nsis_make_installer.sh
new file mode 100644
index 0000000..41536ba
--- /dev/null
+++ b/build/mingw-w64/nsis_make_installer.sh
@@ -0,0 +1,178 @@
+#!/bin/sh
+#
+# nsis_make_installer.sh
+# 
+# Copyright (C) 2012 - Juan pablo Ugarte
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+CWD=`pwd`             # save CWD
+ARG0=`readlink -f $0` # get absolute path of this script whihc is localted under build/mingw-w64
+WORK=`dirname $ARG0`  # work directory
+ROOTB=`dirname $WORK` # get Glade source root directory
+ROOT=`dirname $ROOTB` # get Glade source root directory
+
+if test -n "$2" -a -d "$2"; then
+  WORK=`readlink -f $2`
+fi
+
+MINGW_ROOT=$WORK/local # directory where all the win32 precompiled dependencies for building will be downloaded
+MINGW_ROOT_BIN=$WORK/usr/i686-w64-mingw32/sys-root/mingw #binaries deps
+
+# SYSTEM ENV
+export CC=i686-w64-mingw32-gcc
+export CXX=i686-w64-mingw32-g++
+export RANLIB=i686-w64-mingw32-ranlib
+export PKG_CONFIG_LIBDIR=$MINGW_ROOT/lib/pkgconfig
+export PKG_CONFIG_PATH=$MINGW_ROOT/share/pkgconfig
+export PKG_CONFIG="pkg-config --define-variable=prefix=$MINGW_ROOT"
+export CONFIGURE_ARGS="--host i686-w64-mingw32 --target i686-w64-mingw32 --enable-shared=yes --enable-static=no"
+
+case $1 in
+  shell)
+    echo "Use \$PKG_CONFIG instead pkg-config and \$CONFIGURE_ARGS as parameters for configure scripts"
+    bash
+    exit
+    ;;
+  makedev)
+    DEVELOPER="true"
+    MINGW_ROOT_BIN=$MINGW_ROOT
+    INCLUDE_DIR=include
+    EXCLUDE_FILES=
+    ;;
+  make)
+    DEVELOPER="false"
+    EXCLUDE_FILES="-o -name *.dll.a -o -name *.la"
+    INCLUDE_DIR=
+    ;;
+  *)
+    echo "Usage nsis_make_installer.sh command build_path -- Creates a Glade installer using nsis under build_path (defaults to script location)"
+    echo "     shell      Runs a shell with CC and PKG_CONFIG variables set for cross compiling"
+    echo "     make       Get deps and create windows installer"
+    echo "     makedev    Get deps and create windows installer with dev files"
+    exit
+    ;;
+esac
+
+# Install mingw-w64 if nescesary
+if test ! -e /usr/bin/i686-w64-mingw32-gcc; then
+sudo apt-get install mingw-w64
+fi
+
+# Install nsis if nescesary
+if test ! -e /usr/bin/makensis; then
+sudo apt-get install nsis
+fi
+
+# Install 7z if nescesary
+if test ! -e /usr/bin/7z; then
+sudo apt-get install p7zip-full
+fi
+
+echo cd $WORK
+cd $WORK
+
+#this python script is a helper to download binaries from OBS (OpenSuse build service)
+if test ! -e download-mingw-rpm.py; then
+  wget https://github.com/mkbosmans/download-mingw-rpm/raw/master/download-mingw-rpm.py
+fi
+
+if test ! -d $MINGW_ROOT; then
+  python3 download-mingw-rpm.py --deps gtk3-devel libxml2-devel
+  mv $MINGW_ROOT_BIN $MINGW_ROOT
+fi
+
+if test x"$DEVELOPER"=xfalse -a ! -d $MINGW_ROOT_BIN; then
+  python3 download-mingw-rpm.py --deps gtk3 hicolor-icon-theme
+fi
+
+if test ! -e $MINGW_ROOT_BIN/bin/glade.exe; then
+cd $ROOT && ./autogen.sh --prefix=$MINGW_ROOT_BIN $CONFIGURE_ARGS && make && make install
+
+# rename executables names
+if test -e $MINGW_ROOT_BIN/bin/i686-w64-mingw32-glade.exe; then
+  mv $MINGW_ROOT_BIN/bin/i686-w64-mingw32-glade.exe $MINGW_ROOT_BIN/bin/glade.exe
+  mv $MINGW_ROOT_BIN/bin/i686-w64-mingw32-glade-previewer.exe $MINGW_ROOT_BIN/bin/glade-previewer.exe
+fi
+
+fi
+
+#copy files to installer directory
+
+cp $ROOT/build/mingw-w64/glade.nsi $ROOT/data/icons/glade.ico $MINGW_ROOT_BIN
+
+#change to installer directory
+cd $MINGW_ROOT_BIN
+
+if test ! -d COPYING; then
+cat > COPYING << EOF
+Glade - A user interface designer for GTK+ and GNOME.
+
+Copyright © 2001-2006 Ximian, Inc.
+Copyright © 2001-2006 Joaquin Cuenca Abela, Paolo Borelli, et al.
+Copyright © 2001-2012 Tristan Van Berkom, Juan Pablo Ugarte, et al.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+EOF
+
+cat $ROOT/COPYING.GPL >> COPYING
+fi
+
+# Update schemas just in case
+glib-compile-schemas $MINGW_ROOT_BIN/share/glib-2.0/schemas
+
+if test x"$DEVELOPER"=xtrue; then
+cat > install_files.nsh << EOF
+        file /r /x locale lib
+        file /r /x locale share
+        file /r include
+EOF
+else
+cat > install_files.nsh << EOF
+        file /r /x locale /x pkgconfig /x *.dll.a /x *.la lib
+        file /r /x locale share
+EOF
+fi
+
+# Create a list of files to delete in the uninstaller
+# Note that we have to reverse the list to remove the directories once they are empty
+find bin etc lib share $INCLUDE_DIR \
+        \( -path share/locale -o -path lib/locale -o -path lib/pkgconfig $EXCLUDE_FILES \) -prune \
+        -o -type f -printf "delete \"\$INSTDIR\\\%p\"\n" -or -type d -printf "rmDir \"\$INSTDIR\\\%p\"\n" \
+        | sed 'y/\//\\/' | tac > uninstall_files.nsh
+
+# create installer
+makensis glade.nsi
+
+rm install_files.nsh uninstall_files.nsh
+
+#copy installer in build directory
+cp glade-*-installer.exe $CWD
+
+#go back to start
+cd $CWD
diff --git a/configure.ac b/configure.ac
index ec6145a..d9c1174 100644
--- a/configure.ac
+++ b/configure.ac
@@ -297,6 +297,7 @@ po/Makefile.in
 doc/Makefile
 doc/version.xml
 help/Makefile
+build/mingw-w64/glade.nsi
 ])
 
 AC_OUTPUT
diff --git a/src/glade.rc.in b/src/glade.rc.in
index 09a8641..6669a2c 100644
--- a/src/glade.rc.in
+++ b/src/glade.rc.in
@@ -12,10 +12,10 @@ VS_VERSION_INFO VERSIONINFO
     BEGIN
       BLOCK "040904B0"
       BEGIN
-        VALUE "CompanyName", "The GNOME Foundation"
+        VALUE "CompanyName", "GNOME Foundation"
         VALUE "FileDescription", "Glade Interface Designer @GLADE_MAJOR_VERSION  @GLADE_MINOR_VERSION  @GLADE_MICRO_VERSION@"
         VALUE "FileVersion", "@GLADE_MAJOR_VERSION  @GLADE_MINOR_VERSION  @GLADE_MICRO_VERSION  0"
-        VALUE "LegalCopyright", "Copyright © 2007 The GNOME Foundation"
+        VALUE "LegalCopyright", "Copyright © 2012 The GNOME Foundation"
         VALUE "OriginalFilename", "glade.exe"
         VALUE "ProductName", "Glade Interface Designer"
         VALUE "ProductVersion", "@GLADE_MAJOR_VERSION  @GLADE_MINOR_VERSION  @GLADE_MICRO_VERSION  0"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]