# License: CC0 # Cross Build # ## Using OpenSUSE Tumbleweed in a VM ## ### Host Preparation ### On the host need to ensure the viking-1.X.tar.gz file is available: cd code/viking make dist Generate help PDF dblatex help/C/viking.xml This could be done in the VM but installing dblatex requires ~650Mb install (so a waste if already available on the host). ### Guest Preparation (root) ### In the guest ensure availability of build dependent mingw32 packages (not in standard Tumbleweed repo ATM) # As root zypper ar -f http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Tumbleweed windows zypper ar -f http://download.opensuse.org/repositories/home:/ecsos/openSUSE_Tumbleweed windows-extra-ecsos zypper ar -f http://download.opensuse.org/repositories/home:/ecsos:/pipelight/openSUSE_Tumbleweed windows-extra-ecsos # Ensure a standard user account is available for the build e.g: #useradd -m build #passwd build Install build packages as listed in the .spec file or when running the rpmbuild it will tell you what packages are required zypper install mingw32-cross-gcc #etc... For the MSI generation you will need zypper install mingw32-cross-nsis And ensure FindProcDLL is available for NSIS if [ ! -e /usr/share/nsis/Plugins/FindProcDLL.dll ]; wget http://nsis.sourceforge.net/mediawiki/images/3/3c/FindProc.zip unzip FindProc.zip FindProcDLL.dll -d /usr/share/nsis/Plugins/ fi Make code accessible via a shared folder So add a suitable Shared Folder to the virtual machine Remember the build user will need mount access priviledges - if using VirtualBox then: #As root #usermod -a -G vboxsf ### Guest Preparation (builduser) ### Go to the code location cd /media/sf_Code/viking Copy source package as generated by make dist on the host to the package build area, or even just link to it e.g.: ln -s /media/sf_Code/viking/viking-1.6.1.tar.gz /home/build/rpmbuild/SOURCES/viking-1.6.1.tar.gz ### Build / Install / Run on Guest ### Now perform the build rpmbuild -ba mingw-viking.spec Install locally rpm -i /home/build/rpmbuild/RPMS/noarch/viking-*.noarch.rpm Generate .msi cd win32 ./installer-mingw.sh Install .msi wine install/viking-*.exe Run viking.exe with wine cd ~/.wine/drive_c/Program\ Files/Viking/ wine viking.exe ######################################################################### # Native Build # The build under Windows follows the same process as the traditional Linux build: cd ../src sh configure make There is a separate installer method using NSIS to generate the viking-1.X.Y.Z.exe installer file. To generate the installer (once the code has been compiled as above) run the installer.bat For further details (especially about how to set up the development dependencies) see: http://sourceforge.net/apps/mediawiki/viking/index.php?title=WindowsBuildInstructions These instructions have now been turned turned into a series of scripts to produce the Viking installer: 1. prepare.bat 2a. configure_and_make.bat 2b. make.bat 3. installer.bat The scripts are aimed at a pristine Windows XP installation. Using *prepare.bat* will attempt to *download* and *install* various Open Source software to aid this process. An administrator level account is needed to run this which will *modify* your system. The other scripts simply make use of these (assumed) available system programs. This setup is for dedicated usage to build Viking, primarily under Wine with: ./generate_install.sh 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. From Viking 1.4 to 1.6.X this was how the Windows viking-W.X.Y.Z.exe installer file was produced. Notionally the standard configure + make stages should still work, but the Cross build is now the supported method. Thus the prepare + installer scripts are no longer maintained and are for reference only.