/mkinstalldirs
/omf.make
/viking.spec
+/mingw-viking.spec
/xmldocs.make
/test-driver
/compile
gnome-doc-utils.make \
ChangeLog.0 \
viking.spec \
+ mingw-viking.spec \
$(INTLTOOL)
.PHONY: generate-changelog
AC_PREREQ(2.64)
AC_INIT(viking, 1.6.1, , viking, http://viking.sf.net/)
+
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
+
AM_INIT_AUTOMAKE([dist-bzip2 dist-zip subdir-objects])
dnl AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([src/config.h])
AC_PROG_RANLIB
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
+ac_mingw32=no
+case $target_os in
+ *mingw32*)
+ ac_mingw32=yes
+ ;;
+ *)
+ ;;
+esac
+
# I18N
GETTEXT_PACKAGE=viking
AC_SUBST(GETTEXT_PACKAGE)
case $ac_cv_enable_bzip2 in
yes)
AC_CHECK_HEADERS([bzlib.h],[],[AC_MSG_ERROR([bzlib.h is needed but not found - you will need to install package 'libbz2-dev' or similar. The feature can be disabled with --disable-bzip2])])
- AC_CHECK_LIB(bz2, BZ2_bzBuffToBuffDecompress, [], [AC_MSG_ERROR([libbz2 is needed but not found.])])
+ if test "$ac_mingw32" = "yes"; then
+ # Using the cross compiler it bizarrely fails to detect BZ2_bzRead during the configure stage
+ # I SWEAR THIS WORKED AT SOME POINT - BUT ON A DIFFERENT DAY IT DOESN'T = MORE SWEARING
+ BZ2FUNC=main
+ AC_CHECK_LIB(bz2, [$BZ2FUNC], [], [LIBS="-lbz2 $LIBS"
+ AC_MSG_WARN([libbz2 not found! Forcing it anyway!])])
+ else
+ BZ2FUNC=BZ2_bzRead
+ AC_CHECK_LIB(bz2, [$BZ2FUNC], [], [AC_MSG_ERROR([libbz2 is needed but not found.])])
+ fi
;;
esac
AM_CONDITIONAL([BZIP2], [test x$ac_cv_enable_bzip2 = xyes])
# Configuration
AC_CONFIG_FILES([
viking.spec
+ mingw-viking.spec
Makefile
src/Makefile
src/icons/Makefile
--- /dev/null
+# Public Domain CC0
+%{?mingw_package_header}
+%define _pkg_name viking
+Name: mingw32-%{_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}-%{release}-root-%(%{__id_u} -n)
+BuildArch: noarch
+
+# Only 32bit ATM
+
+# Programs to enable the cross build
+BuildRequires: mingw32-filesystem
+BuildRequires: mingw32-binutils
+BuildRequires: mingw32-runtime
+BuildRequires: mingw32-cross-binutils
+BuildRequires: mingw32-cross-gcc
+BuildRequires: mingw32-cross-pkg-config
+BuildRequires: mingw32-gettext-tools
+BuildRequires: mingw32-gnome-doc-utils-devel
+BuildRequires: intltool
+BuildRequires: gdk-pixbuf-devel
+# ^For gdk-pixbuf-csource
+
+# Code
+# Not worried about versions ATM
+BuildRequires: mingw32-gtk2-devel
+# ATM gtk2-devel auto includes at least devel versions of glib2, gobject, zlib and more
+
+# Mandatory libraries
+BuildRequires: mingw32-libexpat-devel
+BuildRequires: mingw32-libcurl-devel
+# Optional libraries
+BuildRequires: mingw32-libexif-devel
+BuildRequires: mingw32-libbz2-devel
+BuildRequires: mingw32-file-devel
+BuildRequires: mingw32-libmagic1
+BuildRequires: mingw32-libbz2-1
+BuildRequires: mingw32-sqlite-devel
+BuildRequires: mingw32-libzip-devel
+
+# Libs for runtime (and thus also available for the NSIS installer to include the dependencies)
+Requires: mingw32-gtk2
+Requires: mingw32-libexpat1
+Requires: mingw32-libcurl4
+Requires: mingw32-libexif12
+Requires: mingw32-libsqlite3-0
+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}
+
+%build
+# Create Icon
+pushd win32/installer/pixmaps
+%{_mingw32_windres} viking_icon.rc -o viking_icon.o
+popd
+
+#
+# Specifics for Windows build - i.e. no Mapnik, no gexiv2 & no GPSD
+%{_mingw32_configure}\
+ --with-libexif \
+ --disable-realtime-gps-tracking \
+ --disable-mapnik \
+ --disable-scrollkeeper \
+ --enable-windows \
+ CFLAGS="-DWINDOWS -DWIN32 -mwindows"
+
+%{_mingw32_make} %{?_smp_mflags}
+
+%install
+pushd src
+%{_mingw32_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/
+%{_mingw32_bindir}/*%{_pkg_name}.exe
+%{_mingw32_datadir}/applications/%{_pkg_name}.desktop
+%{_mingw32_datadir}/%{_pkg_name}
+%{_mingw32_datadir}/icons/hicolor/*/apps/%{_pkg_name}.*
+%exclude %{_mingw32_datadir}/icons/hicolor/icon-theme.cache
+#%{_mingw32_mandir}/man1/*
+
+%changelog
# License: CC0
EXTRA_DIST = \
+ installer-mingw.sh \
prepare.bat \
configure_and_make.bat \
make.bat \
# License: CC0\r
-#\r
+\r
+# Cross Build #\r
+\r
+## Using OpenSUSE Tumbleweed in a VM ##\r
+\r
+### Host Preparation ###\r
+\r
+On the host need to ensure the viking-1.X.tar.gz file is available:\r
+ cd code/viking\r
+ make dist\r
+\r
+Generate help PDF\r
+ dblatex help/C/viking.xml\r
+This could be done in the VM but installing dblatex requires ~650Mb install (so a waste if already available on the host).\r
+\r
+### Guest Preparation (root) ###\r
+\r
+In the guest ensure availability of build dependent mingw32 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/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
+ # Ensure a standard user account is available for the build e.g:\r
+ #useradd -m build\r
+ #passwd build\r
+\r
+Install build packages as listed in the .spec file or when running the rpmbuild it will tell you what packages are required\r
+ zypper install mingw32-cross-gcc\r
+ #etc...\r
+\r
+For the MSI generation you will need\r
+ zypper install mingw32-cross-nsis\r
+\r
+And ensure FindProcDLL is available for NSIS\r
+if [ ! -e /usr/share/nsis/Plugins/FindProcDLL.dll ];\r
+ wget http://nsis.sourceforge.net/mediawiki/images/3/3c/FindProc.zip\r
+ unzip FindProc.zip FindProcDLL.dll -d /usr/share/nsis/Plugins/\r
+fi\r
+\r
+Make code accessible via a shared folder\r
+So add a suitable Shared Folder to the virtual machine\r
+Remember the build user will need mount access priviledges - if using VirtualBox then:\r
+ #As root\r
+ #usermod -a -G vboxsf <builduser>\r
+\r
+### Guest Preparation (builduser) ###\r
+\r
+Go to the code location\r
+ cd /media/sf_Code/viking\r
+\r
+Copy source package as generated by make dist on the host to the package build area, or even just link to it e.g.:\r
+ ln -s /media/sf_Code/viking/viking-1.6.1.tar.gz /home/build/rpmbuild/SOURCES/viking-1.6.1.tar.gz\r
+\r
+### Build / Install / Run on Guest ###\r
+\r
+Now perform the build\r
+ rpmbuild -ba mingw-viking.spec\r
+\r
+Install locally\r
+ rpm -i /home/build/rpmbuild/RPMS/noarch/viking-*.noarch.rpm\r
+\r
+Generate .msi\r
+ cd win32\r
+ ./installer-mingw.sh\r
+\r
+Install .msi\r
+ wine install/viking-*.exe\r
+\r
+Run viking.exe with wine\r
+ cd ~/.wine/drive_c/Program\ Files/Viking/\r
+ wine viking.exe\r
+\r
+#########################################################################\r
+\r
+# Native Build #\r
+\r
The build under Windows follows the same process as the traditional Linux build:\r
\r
cd ../src\r
\r
Such that any Windows system (or of course a Virtual Machine) can be simply deleted (e.g. rm -rf /.wine) and recreated fully via the scripts.\r
\r
-From Viking 1.4 onwards this is how the Windows viking-W.X.Y.Z.exe installer file is produced.\r
+From Viking 1.4 to 1.6.X this was how the Windows viking-W.X.Y.Z.exe installer file was produced.\r
+\r
+Notionally the standard configure + make stages should still work, but the Cross build is now the supported method.\r
+Thus the prepare + installer scripts are no longer maintained and are for reference only.\r
--- /dev/null
+#!/bin/bash
+# License: CC0
+#
+# A version of the installer.bat for mingw build
+# Similarily basily copy all dependent files from the host system
+# to be available for the NSIS stage
+#
+# Remember to have installed the generated mingw-viking package first so the
+# binaries are available from the default location
+# (e.g. as root rpm -i mingw32-viking-1.7-1.noarch.rpm)
+#
+# 'MINGW' and 'DESTINATION' values can be defined to override inbuilt defaults
+#
+
+if [ -z "$DESTINATION" ]; then
+ DESTINATION=installer/bin
+fi
+mkdir -p $DESTINATION
+
+if [ -z "$MINGW" ]; then
+ MINGW=/usr/i686-w64-mingw32/sys-root/mingw
+fi
+MINGW_BIN=$MINGW/bin
+echo MINGW=$MINGW
+
+echo Make language copies
+for x in $(ls ../po/*.gmo); do
+ mkdir -p $DESTINATION/locale/$(basename -s .gmo $x)/LC_MESSAGES
+ cp $MINGW/share/locale/$(basename -s .gmo $x)/LC_MESSAGES/viking.mo $DESTINATION/locale/$(basename -s .gmo $x)/LC_MESSAGES/
+done
+
+echo Copying Viking
+cp $MINGW_BIN/*viking.exe $DESTINATION/viking.exe
+cp ../COPYING $DESTINATION/COPYING_GPL.txt
+cp ../AUTHORS $DESTINATION/AUTHORS.txt
+cp ../NEWS $DESTINATION/NEWS.txt
+cp ../README $DESTINATION/README.txt
+# PDF generation if required
+if [ ! -e ../help/C/viking.pdf ]; then
+ pushd ../help/C
+ dblatex viking.xml
+ if [ $? != 0 ]; then
+ echo "Help PDF generation failed."
+ exit
+ fi
+fi
+cp ../help/C/viking.pdf $DESTINATION
+cp ../tools/viking-cache.py $DESTINATION
+cp installer/translations/*nsh $DESTINATION
+cp installer/pixmaps/viking_icon.ico $DESTINATION
+
+echo Copying Extension Configuration Data
+mkdir $DESTINATION/data
+cp ../data/*.xml $DESTINATION/data
+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
+
+echo Copying Libraries
+# Core libs
+cp $MINGW_BIN/libatk*.dll $DESTINATION
+cp $MINGW_BIN/libcairo*.dll $DESTINATION
+cp $MINGW_BIN/libgcc*.dll $DESTINATION
+cp $MINGW_BIN/libgcrypt*.dll $DESTINATION
+cp $MINGW_BIN/libgdk*.dll $DESTINATION
+cp $MINGW_BIN/libgettext*.dll $DESTINATION
+cp $MINGW_BIN/libgio*.dll $DESTINATION
+cp $MINGW_BIN/libglib*.dll $DESTINATION
+cp $MINGW_BIN/libgmodule*.dll $DESTINATION
+cp $MINGW_BIN/libgnurx*.dll $DESTINATION
+cp $MINGW_BIN/libgobject*.dll $DESTINATION
+cp $MINGW_BIN/libgpg*.dll $DESTINATION
+cp $MINGW_BIN/libgtk*.dll $DESTINATION
+cp $MINGW_BIN/libintl*.dll $DESTINATION
+cp $MINGW_BIN/libffi*.dll $DESTINATION
+cp $MINGW_BIN/libfontconfig*.dll $DESTINATION
+cp $MINGW_BIN/libfreetype*.dll $DESTINATION
+cp $MINGW_BIN/libharfbuzz*.dll $DESTINATION
+cp $MINGW_BIN/libjasper*.dll $DESTINATION
+cp $MINGW_BIN/libjpeg*.dll $DESTINATION
+cp $MINGW_BIN/liblzma*.dll $DESTINATION
+cp $MINGW_BIN/libpng*.dll $DESTINATION
+cp $MINGW_BIN/libpango*.dll $DESTINATION
+cp $MINGW_BIN/libpixman*.dll $DESTINATION
+cp $MINGW_BIN/libtiff*.dll $DESTINATION
+cp $MINGW_BIN/libxml2*.dll $DESTINATION
+cp $MINGW_BIN/zlib1.dll $DESTINATION
+cp $MINGW_BIN/libzip*.dll $DESTINATION
+
+# Extras
+cp $MINGW_BIN/libexpat*.dll $DESTINATION
+# Curl 7.17+ has quite a few dependencies for SSL support
+cp $MINGW_BIN/libcurl*.dll $DESTINATION
+cp $MINGW_BIN/libssh*.dll $DESTINATION
+cp $MINGW_BIN/libidn*.dll $DESTINATION
+cp $MINGW_BIN/libnspr*.dll $DESTINATION
+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
+
+cp $MINGW_BIN/libexif*.dll $DESTINATION
+cp $MINGW_BIN/libbz*.dll $DESTINATION
+cp $MINGW_BIN/libmagic*.dll $DESTINATION
+cp $MINGW/share/misc/magic* $DESTINATION
+cp $MINGW_BIN/libsqlite3*.dll $DESTINATION
+
+echo Copying GPSBabel Installer
+mkdir $DESTINATION/Optional
+# ATM GPSBabel needs to be in 'cache' dir
+cp cache/GPSBabel-1.5.2-Setup.exe $DESTINATION/Optional
+
+pushd installer
+if [ -z "$DEBUG" ]; then
+ makensis -X"SetCompressor lzma" viking-installer.nsi
+else
+ # Speedier install generation when testing
+ makensis -X"SetCompress off" viking-installer.nsi
+fi
+popd
echo Running NSIS (command line version)\r
pushd installer\r
if exist "%ProgramFiles%\NSIS" (\r
- "%ProgramFiles%\NSIS\makensis.exe" viking-installer.nsi\r
+ "%ProgramFiles%\NSIS\makensis.exe" /X"SetCompressor /SOLID lzma" viking-installer.nsi\r
) else (\r
echo NSIS Not installed in known location\r
)\r
EXTRA_DIST = \
+ FileAssociation.nsh \
viking-installer.nsi \
langmacros.nsh
;The name var is set in .onInit
Name $name
+;Allow overiding location of binary components for the install
+!ifndef BINARIES
+ !define BINARIES ".\bin"
+!endif
+
OutFile "viking-${VIKING_VERSION}.exe"
-SetCompressor /SOLID lzma
+;NB Using /SOLID method on a mingw32 setup seems to generate an exe that fails the CRC check
+;So now don't set the compressor here - it can be set by the calling command/script if necessary.
+;SetCompressor /SOLID bzip2
ShowInstDetails show
ShowUninstDetails show
SetDateSave on
;Pages
!insertmacro MUI_PAGE_WELCOME
- !insertmacro MUI_PAGE_LICENSE ".\bin\COPYING_GPL.txt"
+ !insertmacro MUI_PAGE_LICENSE "${BINARIES}\COPYING_GPL.txt"
!insertmacro MUI_PAGE_COMPONENTS
; Viking install dir page
;; Start Install Sections ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-LicenseData ".\bin\COPYING_GPL.txt"
+LicenseData "${BINARIES}\COPYING_GPL.txt"
LicenseForceSelection checkbox
;--------------------------------
; Copy only specific items as now some components (e.g. GPSBabel) are optional.
; This is mostly to get a more accurate install size value (especially as saved into the registry)
- File .\bin\viking*
- ; Not sure we really need any of the gtk executables but copy them anyway:
- File .\bin\*.exe
- File .\bin\*.dll
- File .\bin\*.txt
- File .\bin\magic.mgc
- File /r .\bin\data
- File /r .\bin\etc
- File /r .\bin\gtk2-runtime
- File /r .\bin\lib
- File /r .\bin\locale
- File /r .\bin\share
+ File ${BINARIES}\viking*
+ File ${BINARIES}\g*.exe
+ File ${BINARIES}\*.dll
+ File ${BINARIES}\*.txt
+ File ${BINARIES}\magic.mgc
+ File /r ${BINARIES}\data
+ File /r ${BINARIES}\locale
; Estimate install size based on files in $INSTDIR
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
; GPSBabel Install Section
;
Section $(VIKING_GPSBABEL_SECTION_TITLE) SecGPSBabel
- File "bin\Optional\GPSBabel-1.5.2-Setup.exe"
+ File "${BINARIES}\Optional\GPSBabel-1.5.2-Setup.exe"
ExecWait '"$INSTDIR\GPSBabel-1.5.2-Setup.exe" /SILENT'
Delete "$INSTDIR\GPSBabel-1.5.2-Setup.exe"
SectionEnd
Delete "$INSTDIR\data\*txt"
Delete "$INSTDIR\data\*xml"
RMDir "$INSTDIR\data"
- RMDir /r "$INSTDIR\etc"
- RMDir /r "$INSTDIR\gtk2-runtime"
- RMDir /r "$INSTDIR\lib"
RMDir /r "$INSTDIR\locale"
- RMDir /r "$INSTDIR\share"
RMDir "$INSTDIR"
; Shortcuts..
FunctionEnd
!macroend
-!insertmacro RunCheckMacro ""
-!insertmacro RunCheckMacro "un."
+;!insertmacro RunCheckMacro ""
+;!insertmacro RunCheckMacro "un."
;Installer extra configuration at execution time: language, path, ...
Function .onInit
Push $R2
;Check if viking is running
- Call RunCheck
+ ;Call RunCheck
StrCpy $name "Viking ${VIKING_VERSION}"
ClearErrors
Function un.onInit
;Check if viking is running
- Call un.RunCheck
+ ;Call un.RunCheck
StrCpy $name "Viking ${VIKING_VERSION}"
; Get stored language preference