1# Creating a Windows cross-build system using Fedora Linux 2 3**WARNING**: Work in progress, do not use these instructions yet! 4 5 6## Test machine setup details 7 8I'll be using a Fedora 30 64-bit VM using VirtualBox (6.0.x). Fedora provides all packages required to cross-compile Gtk applications, unlike Debian. Hopefully we can use this as a guide for a Debian cross-build system by using `alien` for any packages Debian doesn't provide. 9 10The install image I'll be using is the netinstall x86\_64 image: 11<https://download.fedoraproject.org/pub/fedora/linux/releases/30/Workstation/x86_64/iso/Fedora-Workstation-netinst-x86_64-30-1.2.iso> 12 13### VM install details 14 15In VBox select 'New machine' and create a Fedora 64-bit VM. 16 17I've changed the following settings from the defaults: 18 19* HDD: 64GB, growing 20* 2GB memory, 2 CPU cores (adjust to host capabilities) 21* Enable bidirectional for shared clipboard and drag'n'drop (no idea if it'll work) 22* Disable 'floppy' in the boot order 23* Change chipset to ICH9 24* Video memory: 128MB, or whatever the max is 25* Graphics controller: VMSVGA, enable 3D 26 (I haven't actually gotten VICE's OpenGL to actually work with any driver) 27* Network: Bridged 28 29#### Install from ISO 30 31In Vbox attach the ISO and start the VM. 32 33As soon as the Grub shell appears, hit 'Tab' and add 'inst.text' to the boot line and hit 'Enter', this will run the installer in text mode, 34Select '2' when given a choice between VNC and text mode. 35 36There should be menu: 37 38* 1) I stuck to EN-US 39* 2) Timezone (optional), I used 1,1,1 (Europe/Amsterdam) 40* 3) Installation source: already set to 'closest mirror', should be okay 41* 4) Software selection, this is important for later. 42 Select '2', (Minimal), then 'c' continue 43 Then select '8' (C Development Tools and Libraries) and perhaps '38' (Text based internet) 44* 5) Install dest: VBox HDD: 2 - use all space 45* 6) Network: (optional, defaults to DHCP) 46* 7) Set root password to 'vicerulez' or so, 'vice' is too short 47* 8) Create normal user 48 - 3 - vice 49 - 4 - use password 50 - 5 - set password (vicerulez) 51 - 6 - make Admin 52 - 7 - groups: add 'wheel' 53 54 55Press 'b' to begin install and wait. 56 57Reboot after install (don't forget to remove ISO) 58 59#### Basic setup of the VM 60 61Now login as 'vice' 62 63Optional: set passwords 64 65``` 66$ su 67$ passwd 68# enter 'vice' as password 69$ passwd vice 70# enter 'vice' as password 71``` 72Fedora will bitch, but it works. 73 74 75##### Install VBox Guest Additions 76 77This is obviously only required, or even optional, when running a VM. 78 79``` 80$ su 81$ dnf update kernel* 82``` 83If this actually updates the kernel, reboot. 84 85Insert the VBox Guest Additions ISO via the VBox menu. 86And then mount it: 87``` 88$ mkdir /media/vbox 89$ mount -r /dev/cdrom /media/vbox 90``` 91 92Now install a few packages: 93``` 94$ dnf install gcc kernel-devel kernel-headers dkms make bzip2 perl libxcrypt-compat 95``` 96 97Set env var to the kernel source dir (do we need this?) 98``` 99$ export KERN_DIR=/usr/src/kernels/`uname -r` 100``` 101 102Build and install VBox kernel modules: 103``` 104$ cd /media/vbox 105$ ./VBoxLinuxAdditions.run 106$ shutdown -r now 107``` 108 109 110## Install packages required for cross-compiling Gtk3 111``` 112$ su 113$ dnf install mingw64-gtk3 mingw64-glew glib2-devel xa 114``` 115 116Install svn: 117``` 118$ dnf install subversion 119``` 120 121Check out trunk and create configure (as vice, not root) 122``` 123$ svn checkout --username=$USER svn+ssh://$USER@svn.code.sf.net/p/vice-emu/code/trunk vice-trunk 124$ cd vice-trunk/vice 125$ ./autogen.sh 126``` 127This should result in a proper build system. 128 129 130### Create builddir and test system 131``` 132$ cd .. 133$ mkdir gtk3-build 134$ cd gtk3-build 135$ ../vice/configure --enable-native-gtk3ui --host=x86_64-w64-mingw32 --enable-arch=no 136``` 137 138 139Barfs at 'Making all in readmes' 140 141``` 142$ dnf install texinfo 143$ dnf install texlive 144``` 145Will install a crapload of packages and still not create vice.pdf =) 146 147 148 149### Create bindist 150 151``` 152$ make bindistzip 153`` 154 155**Note**: 156 157Current make-bindist_win32.sh contains some hackish code to make GdkPixbuf recognize the SVG loader. which will break as soons as gdkpixbuf updates its version number. 158So we'll probably need a bit of `pkg-config --modversion` magic to update the code to handle newer versions of GdkPixbuf. 159 160 161 162## Update (2020-11-29): Use Fedora 33 Workstation x64 163 164### Install and setup 165 166(I used a VBox VM for this, which already comes with VBox guest additions 167 installed, which is nice) 168 169First update and reboot: 170 171``` 172$ sudo dnf update 173$ shutdown -r now 174``` 175 176When using VBox, make sure your VBox version matches the guest additions that 177Fedora uses. I had a slightly old VBox than the additions and got some weird 178rendering issues in Gnome Shell. 179 180 181#### Install Mingw packages 182 183``` 184$ sudo dnf install \ 185 automake \ 186 autoconf \ 187 byacc \ 188 flex \ 189 glib2-devel \ 190 icoutils \ 191 make \ 192 mingw64-gtk3 \ 193 mingw64-glew \ 194 subversion\ 195 xa 196``` 197 198This will install a lot of packages required to cross-compile VICE, so some 199patience is required. 200 201 202#### Get current trunk 203 204``` 205$ svn checkout --username=<sf-username> svn+ssh://<sf-username>@svn.code.sf.net/p/vice-emu/code/trunk vice-trunk 206``` 207If you get a message about a key, just say Yes. 208 209Create the buildsystem: 210``` 211$ cd vice-trunk/vice 212$ ./autogen.sh 213``` 214 215Try to configure a minimal build of the Gtk3 port: 216``` 217$ ./configure --enable-native-gtk3ui --enable-arch=no --disable-pdf-docs --host=x86_64-w64-mingw32 LDFLAGS="-lssp" 218``` 219 220 221