]> git.street.me.uk Git - andy/viking.git/commitdiff
[WINDOWS] Enable Windows 64bit cross build
authorRob Norris <rw_norris@hotmail.com>
Wed, 13 Jan 2016 00:47:15 +0000 (00:47 +0000)
committerRob Norris <rw_norris@hotmail.com>
Fri, 12 Feb 2016 00:06:52 +0000 (00:06 +0000)
.gitignore
Makefile.am
configure.ac
mingw-viking.spec.in
mingw64-viking.spec.in [new file with mode: 0644]
win32/README.txt
win32/installer-mingw.sh
win32/installer/viking-installer.nsi

index d7623e125045696370dbb2ac2fd3e59473f25a9a..b4ab06dec15513b5a3e98deb049ba0128b358107 100644 (file)
@@ -32,6 +32,7 @@ gnome-doc-utils.m4
 /omf.make
 /viking.spec
 /mingw-viking.spec
+/mingw64-viking.spec
 /xmldocs.make
 /test-driver
 /compile
index 4d374e25d7b10ecd506a245213c1c7d4bdc37521..9e2760777715d67b75bb57aa15aade3bffdb8a5f 100644 (file)
@@ -15,6 +15,7 @@ EXTRA_DIST = \
        ChangeLog.0 \
        viking.spec \
        mingw-viking.spec \
+       mingw64-viking.spec \
        $(INTLTOOL)
 
 .PHONY: generate-changelog
index 4ddc6a5cc57438c10fb20236378819085eb3cb25..bd80c6773ceb733c1b0728180f5626a663b8b5bc 100644 (file)
@@ -465,6 +465,7 @@ AC_DEFINE_UNQUOTED(THEYEAR, "`date +%Y`", [The Year])
 AC_CONFIG_FILES([
                viking.spec
                mingw-viking.spec
+               mingw64-viking.spec
                Makefile
                src/Makefile
                src/icons/Makefile
index f6ac8abe17494dc4bf6469de75314a65bdba2844..11aee9bf9841214dafcf9c7902f1bde84f37ffa1 100644 (file)
@@ -12,7 +12,7 @@ Source0:      %{_pkg_name}-%{version}.tar.gz
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:     noarch
 
-# Only 32bit ATM
+# 32bit version only in this file. See mingw64-viking.spec for the 64bit version
 
 # Programs to enable the cross build
 BuildRequires: mingw32-filesystem
@@ -55,21 +55,12 @@ Requires:   mingw32-libzip4
 # Currently running makensis in seperate script - so you will need it then
 #Requires:     mingw32-cross-nsis
 
-
 %description
 Viking is a free/open source program to manage GPS data.
 You can import, plot and create tracks, routes and waypoints, show OSM and other maps, see real-time GPS position, control items, etc.
 Other advanced capabilities include Geotagging Images, generate Maps (using Mapnik), Upload and Download tracks from OSM, Routing from OSRM or Google, Name Searches from OSM Nominatim or Google and more.
 It is written in mainly in C with some C++ and uses the GTK+2 toolkit.
 
-#
-# TODO 64bit version - possibly like this...
-#
-#%package -n mingw64-%{_pkg_name}
-#Summary:      %{summary}
-#
-#%description -n mingw64-%{_pkg_name}
-#%{description}
 %prep
 %setup -q -n %{_pkg_name}-%{version}
 
diff --git a/mingw64-viking.spec.in b/mingw64-viking.spec.in
new file mode 100644 (file)
index 0000000..1a56bc4
--- /dev/null
@@ -0,0 +1,107 @@
+# Public Domain CC0
+%{?mingw_package_header}
+%define _pkg_name viking
+Name:          mingw64-%{_pkg_name}
+Version:       @VERSION@
+Release:       1
+Summary:       GPS data editor and analyzer
+Group:         Applications/Productivity
+License:       GPLv2
+URL:           http://sourceforge.net/projects/viking/
+Source0:       %{_pkg_name}-%{version}.tar.gz
+BuildRoot:     %{_tmppath}/%{name}-%{version}-build
+BuildArch:     noarch
+
+# 64bit version only in this file. See mingw-viking.spec for the 32bit version
+
+# Programs to enable the cross build
+BuildRequires: mingw64-filesystem
+BuildRequires: mingw64-binutils
+BuildRequires: mingw64-runtime
+BuildRequires: mingw64-cross-binutils
+BuildRequires: mingw64-cross-gcc
+BuildRequires: mingw64-cross-pkg-config
+BuildRequires: mingw64-gettext-tools
+BuildRequires: mingw64-gnome-doc-utils-devel
+BuildRequires: intltool
+BuildRequires: gdk-pixbuf-devel
+# ^For gdk-pixbuf-csource
+
+# Code
+# Not worried about versions ATM
+BuildRequires: mingw64-gtk2-devel
+# ATM gtk2-devel auto includes at least devel versions of glib2, gobject, zlib and more
+
+# Mandatory libraries
+BuildRequires: mingw64-libexpat-devel
+BuildRequires: mingw64-libcurl-devel
+# Optional libraries
+BuildRequires: mingw64-libgexiv2-devel
+BuildRequires: mingw64-libbz2-devel
+BuildRequires: mingw64-file-devel
+BuildRequires: mingw64-libmagic1
+BuildRequires: mingw64-libbz2-1
+BuildRequires: mingw64-sqlite-devel
+BuildRequires: mingw64-libzip-devel
+
+# Libs for runtime (and thus also available for the NSIS installer to include the dependencies)
+Requires:      mingw64-gtk2
+Requires:      mingw64-libexpat1
+Requires:      mingw64-libcurl4
+Requires:      mingw64-libgexiv2
+Requires:      mingw64-libstdc++6
+Requires:      mingw64-libsqlite3-0
+Requires:      mingw64-libzip4
+# Currently running makensis in seperate script - so you will need it then
+# NB No 64bit version available
+#Requires:     mingw32-cross-nsis
+
+%description
+Viking is a free/open source program to manage GPS data.
+You can import, plot and create tracks, routes and waypoints, show OSM and other maps, see real-time GPS position, control items, etc.
+Other advanced capabilities include Geotagging Images, generate Maps (using Mapnik), Upload and Download tracks from OSM, Routing from OSRM or Google, Name Searches from OSM Nominatim or Google and more.
+It is written in mainly in C with some C++ and uses the GTK+2 toolkit.
+
+%prep
+%setup -q -n %{_pkg_name}-%{version}
+
+%build
+# Create Icon
+pushd win32/installer/pixmaps
+%{_mingw64_windres} viking_icon.rc -o viking_icon.o
+popd
+
+#
+# Specifics for Windows build - i.e. no Mapnik & no GPSD
+%{_mingw64_configure}\
+  --disable-realtime-gps-tracking \
+  --disable-mapnik \
+  --disable-scrollkeeper \
+  --enable-windows \
+  CFLAGS="-DWINDOWS -DWIN32 -mwindows"
+# NB not sure if '-DWIN32' is necessary/applicable for a 64bit build...
+
+%{_mingw64_make} %{?_smp_mflags}
+%install
+pushd src
+%{_mingw64_strip} -g %{_pkg_name}.exe
+popd
+
+%make_install
+
+%find_lang %{_pkg_name}
+
+%clean
+rm -rf %{buildroot}
+
+%files -f %{_pkg_name}.lang
+%defattr(-,root,root)
+%doc AUTHORS ChangeLog COPYING NEWS README doc/
+%{_mingw64_bindir}/*%{_pkg_name}.exe
+%{_mingw64_datadir}/applications/%{_pkg_name}.desktop
+%{_mingw64_datadir}/%{_pkg_name}
+%{_mingw64_datadir}/icons/hicolor/*/apps/%{_pkg_name}.*
+%exclude %{_mingw64_datadir}/icons/hicolor/icon-theme.cache
+
+%changelog
index 4c2ffb6e409138bd5fc38eba17cd394a41143ce7..f3c0ade2b541b7a24d3179d4bef1c1974c6465a1 100644 (file)
@@ -16,11 +16,12 @@ This could be done in the VM but installing dblatex requires ~650Mb install (so
 \r
 ### Guest Preparation (root) ###\r
 \r
-In the guest ensure availability of build dependent mingw32 packages (not in standard Tumbleweed repo ATM)\r
+In the guest ensure availability of build dependent mingw32 / mingw64 packages (not in standard Tumbleweed repo ATM)\r
        # As root\r
        zypper ar -f http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Tumbleweed windows\r
+       zypper ar -f http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Tumbleweed windows64\r
        zypper ar -f http://download.opensuse.org/repositories/home:/ecsos/openSUSE_Tumbleweed windows-extra-ecsos\r
-       zypper ar -f http://download.opensuse.org/repositories/home:/ecsos:/pipelight/openSUSE_Tumbleweed windows-extra-ecsos\r
+       zypper ar -f http://download.opensuse.org/repositories/home:/ecsos:/pipelight/openSUSE_Tumbleweed windows-extra-ecsos2\r
        # Ensure a standard user account is available for the build e.g:\r
        #useradd -m build\r
        #passwd build\r
@@ -58,7 +59,7 @@ Now perform the build
        rpmbuild -ba mingw-viking.spec\r
 \r
 Install locally\r
-       rpm -i /home/build/rpmbuild/RPMS/noarch/viking-*.noarch.rpm\r
+       sudo rpm -i /home/build/rpmbuild/RPMS/noarch/ming*-viking-*.noarch.rpm\r
 \r
 Generate .msi\r
        cd win32\r
index 84e1702d70f1e2cab0534adfacd0cbc68537bc20..60c9a893bcebb3c91d98f6d1d43c38dd1cc74ba5 100755 (executable)
 if [ -z "$DESTINATION" ]; then
        DESTINATION=installer/bin
 fi
+# General clean out tmp copy location so 32v64 versions can't conflict
+if [ -z "$NOCLEAN" ]; then
+       rm -rf installer/bin
+fi
 mkdir -p $DESTINATION
 
 if [ -z "$MINGW" ]; then
-  MINGW=/usr/i686-w64-mingw32/sys-root/mingw
+       if [ "$HOSTTYPE" == "x86_64" ]; then
+               MINGW=/usr/x86_64-w64-mingw32/sys-root/mingw
+       else
+               MINGW=/usr/i686-w64-mingw32/sys-root/mingw
+       fi
 fi
 MINGW_BIN=$MINGW/bin
 echo MINGW=$MINGW
@@ -56,7 +64,11 @@ cp ../data/latlontz.txt $DESTINATION/data
 
 echo Copying Helper Apps
 # Needed when spawning other programs (e.g. when invoking GPSBabel)
-cp $MINGW_BIN/gspawn-win32-helper.exe $DESTINATION
+if [ "$HOSTTYPE" == "x86_64" ]; then
+       cp $MINGW_BIN/gspawn-win64-helper.exe $DESTINATION
+else
+       cp $MINGW_BIN/gspawn-win32-helper.exe $DESTINATION
+fi
 
 echo Copying Libraries
 # Core libs
@@ -100,7 +112,11 @@ cp $MINGW_BIN/libplc*.dll $DESTINATION
 cp $MINGW_BIN/libplds*.dll $DESTINATION
 cp $MINGW_BIN/nss*.dll $DESTINATION
 cp $MINGW_BIN/ssl*.dll $DESTINATION
-cp /usr/share/doc/packages/mingw32-libcurl-devel/COPYING $DESTINATION/COPYING_curl.txt
+if [ "$HOSTTYPE" == "x86_64" ]; then
+       cp /usr/share/doc/packages/mingw64-libcurl-devel/COPYING $DESTINATION/COPYING_curl.txt
+else
+       cp /usr/share/doc/packages/mingw32-libcurl-devel/COPYING $DESTINATION/COPYING_curl.txt
+fi
 
 cp $MINGW_BIN/libexiv2.dll $DESTINATION
 cp $MINGW_BIN/libgexiv2*.dll $DESTINATION
@@ -122,4 +138,10 @@ else
        # Speedier install generation when testing
        makensis -X"SetCompress off" viking-installer.nsi
 fi
+
+if [ "$HOSTTYPE" == "x86_64" ]; then
+       rename viking viking-win64 viking-[0-9].[0-9].[0-9].[0-9].exe
+else
+       rename viking viking-win32 viking-[0-9].[0-9].[0-9].[0-9].exe
+fi
 popd
index 98ebf789d092dbb96f2d86bce932fbfdb379dba0..94d01eba9905420d8821179d614b34ecc722cf0e 100644 (file)
@@ -35,6 +35,7 @@ SetDateSave on
 !include "Sections.nsh"
 !include "WinVer.nsh"
 !include "LogicLib.nsh"
+!include "x64.nsh"
 ;; http://nsis.sourceforge.net/File_Association
 !include "FileAssociation.nsh"
 
@@ -244,7 +245,11 @@ Section $(VIKING_SECTION_TITLE) SecViking
     ; Common settings
     WriteRegStr SHCTX ${VIKING_REG_KEY} "" "$INSTDIR"
     WriteRegStr SHCTX ${VIKING_REG_KEY} "Version" "${VIKING_VERSION}"
-    WriteRegStr SHCTX "${VIKING_UNINSTALL_KEY}" "DisplayName" "Viking"
+    ${If} ${RunningX64}
+      WriteRegStr SHCTX "${VIKING_UNINSTALL_KEY}" "DisplayName" "Viking (x86)"
+    ${Else}
+      WriteRegStr SHCTX "${VIKING_UNINSTALL_KEY}" "DisplayName" "Viking (x64)"
+    ${EndIf}
     WriteRegStr SHCTX "${VIKING_UNINSTALL_KEY}" "DisplayVersion" "${VIKING_VERSION}"
     WriteRegStr SHCTX "${VIKING_UNINSTALL_KEY}" "DisplayIcon" "$INSTDIR\viking_icon.ico"
     WriteRegStr SHCTX "${VIKING_UNINSTALL_KEY}" "HelpLink" "http://sourceforge.net/p/viking/wikiallura"
@@ -546,8 +551,12 @@ Function .onInit
   Pop $R0
 
   StrCmp $R0 "HKLM" 0 user_dir
-    StrCpy $INSTDIR "$PROGRAMFILES\Viking"
-    Goto instdir_done
+  ${If} ${RunningX64}
+    StrCpy $INSTDIR "$PROGRAMFILES64\Viking"
+  ${Else}
+    StrCpy $INSTDIR "$PROGRAMFILES\Viking" ; $PROGRAMFILES32 also works
+  ${EndIf}
+  Goto instdir_done
   user_dir:
     Push $SMPROGRAMS
     ${GetParent} $SMPROGRAMS $R2