Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
howtos:win32:build [2014/06/22 13:51] – created enrico | howtos:win32:build [2016/08/08 09:23] (current) – Drop old Waf instructions and a redirect to the current build instructions enrico | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Build Geany on Windows ====== | + | ~~REDIRECT> |
- | + | ||
- | This howto describes how to set up a working build environment on Windows | + | |
- | to be able to compile, build and test Geany and Geany-Plugins. | + | |
- | + | ||
- | Furthermore, | + | |
- | generating the Windows installers. | + | |
- | + | ||
- | + | ||
- | The described setup is quite custom and might not be state-of-art and as clean as it could. | + | |
- | However, it worked for the author([[users/ | + | |
- | + | ||
- | Be careful about paths: this howto assumes everything is installed on the C: drive of a Windows | + | |
- | system (tested on Windows XP and 7). Furthermore, | + | |
- | utilities are installed into c:\libs. | + | |
- | It is recommended to keep these locations. If you need to change them, be careful and be sure | + | |
- | to adjust all paths mentioned in the following sections before executing them. | + | |
- | + | ||
- | Also note that in some of the linked helper scripts, the paths are hardcoded, so you need to adjust | + | |
- | them as well. | + | |
- | + | ||
- | + | ||
- | + | ||
- | ===== Prerequisites ===== | + | |
- | + | ||
- | Download and install the following tools | + | |
- | + | ||
- | ==== Git ==== | + | |
- | + | ||
- | Download and install from http:// | + | |
- | + | ||
- | ==== Python ==== | + | |
- | + | ||
- | Python is required for the Waf build system and various helper scripts. | + | |
- | Best to use the x86 (32bit) version of the latest Python 2 installer. | + | |
- | Download the installer, execute it and follow the instructions (install to c: | + | |
- | + | ||
- | https:// | + | |
- | + | ||
- | + | ||
- | ==== Perl ==== | + | |
- | + | ||
- | Download and install the Strawberry Perl distribution from http:// | + | |
- | This distribution also includes the mingw-gcc and related tools which will be used to compile Geany later. | + | |
- | Choose the 32bit installer and install Perl into c:\perl. | + | |
- | + | ||
- | http:// | + | |
- | + | ||
- | + | ||
- | ==== NSIS ==== | + | |
- | + | ||
- | To be able to Windows installers for Geany (most probably only interesting for Geany core devs), you need | + | |
- | the Nullsoft Scriptable Install System (NSIS). | + | |
- | + | ||
- | Download and install NSIS 2.46. | + | |
- | + | ||
- | http:// | + | |
- | + | ||
- | + | ||
- | ==== UnxUtils ==== | + | |
- | + | ||
- | UnxUtils contain lots of well known and useful tools from a Unix system, compiled for Windows (find, grep, etc.). | + | |
- | + | ||
- | Download the ZIP archive and unpack it to C: | + | |
- | + | ||
- | http:// | + | |
- | + | ||
- | + | ||
- | ==== GTK+ ==== | + | |
- | + | ||
- | And now to the exciting part: GTK+ on Windows. | + | |
- | + | ||
- | The easiest way is to download the whole GTK+ bundle (GTK+2.0, http:// | + | |
- | + | ||
- | http:// | + | |
- | + | ||
- | + | ||
- | ==== Gettext ==== | + | |
- | + | ||
- | Download the following archives and extract them to c:\libs. | + | |
- | + | ||
- | * http:// | + | |
- | * http:// | + | |
- | * http:// | + | |
- | + | ||
- | ==== Further dependencies (for geany-plugins) ==== | + | |
- | + | ||
- | If you want to compile geany-plugins as well, you need the following dependencies. | + | |
- | Download the archives and extract them into c:\libs. | + | |
- | + | ||
- | + | ||
- | * http:// | + | |
- | * http:// | + | |
- | * http:// | + | |
- | * http:// | + | |
- | * http:// | + | |
- | * http:// | + | |
- | * http:// | + | |
- | + | ||
- | + | ||
- | === Lua for Windows === | + | |
- | + | ||
- | Setting up Lua on Windows in our custom build environment requires a few additional steps. | + | |
- | + | ||
- | * Download lua-5.1.4_Win32_dll12_lib.zip from http:// | + | |
- | * Extract to c:\libs | + | |
- | * Move liblua5.1.* to c: | + | |
- | * Create c: | + | |
- | + | ||
- | <code ini lua.pc> | + | |
- | prefix=c: | + | |
- | exec_prefix=${prefix} | + | |
- | libdir=${exec_prefix}/ | + | |
- | includedir=${prefix}/ | + | |
- | datarootdir=${prefix}/ | + | |
- | datadir=${datarootdir} | + | |
- | localedir=${datarootdir}/ | + | |
- | + | ||
- | Name: Lua | + | |
- | Description: | + | |
- | Requires: gtk+-2.0 >= 2.8.0 | + | |
- | Version: 5.1 | + | |
- | Libs: -L${libdir} -llua5.1 | + | |
- | Cflags: -I${includedir} | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ===== Setup ===== | + | |
- | + | ||
- | ==== Modify %PATH% ==== | + | |
- | + | ||
- | For convenience and a working build system, you need to extend the %PATH% variable, so the newly installed tools will be available | + | |
- | without typing the whole path every time. | + | |
- | + | ||
- | To do so, open the //Control Panel// and choose //System and Security\System//, | + | |
- | In the newly opened dialog, click on // | + | |
- | + | ||
- | Edit it and add the following paths to the end of list (seperated with semicolon): | + | |
- | + | ||
- | < | + | |
- | C: | + | |
- | </ | + | |
- | + | ||
- | It might be some of the paths were already added by some installers. Adding them twice won't hurt but it is always better to check the whole list before saving. | + | |
- | + | ||
- | Then save and close all dialogs. | + | |
- | + | ||
- | To test the new setting, open a new command line window (Start -> Run -> " | + | |
- | + | ||
- | * python | + | |
- | * perl | + | |
- | * wget | + | |
- | * pkg-config | + | |
- | * makensis | + | |
- | + | ||
- | + | ||
- | ==== Clone the Geany repository from Github ==== | + | |
- | + | ||
- | Before starting with the rest, you need the Geany source code first (and the code of geany-plugins and the extra themes). | + | |
- | In a command line window, execute the following commands: | + | |
- | + | ||
- | < | + | |
- | mkdir \git | + | |
- | cd \git | + | |
- | git clone git:// | + | |
- | git clone git:// | + | |
- | git clone git:// | + | |
- | </ | + | |
- | + | ||
- | ===== Build and test ===== | + | |
- | + | ||
- | + | ||
- | ==== Build Geany ==== | + | |
- | + | ||
- | Now you are ready to compile and build Geany already. | + | |
- | + | ||
- | In a command line window, execute the following commands: | + | |
- | + | ||
- | < | + | |
- | cd \git\geany | + | |
- | python waf configure | + | |
- | python waf build | + | |
- | python waf install | + | |
- | </ | + | |
- | + | ||
- | If all went fine, you should have a full Geany for Windows build in \git\geany\geany-1.25 (or whatever is the current version of GIT Master). | + | |
- | + | ||
- | + | ||
- | === Copy include headers for later use === | + | |
- | + | ||
- | To be able to compile plugins against your current version of Geany, | + | |
- | you need to copy the header files and the pkg-config file geany.pc to | + | |
- | c:\libs so that pkg-config and the compiler will find those files. | + | |
- | + | ||
- | To do so easily, you can use the following script to copy the header files and the geany.pc | + | |
- | pkg-config file to c:\libs. | + | |
- | + | ||
- | <code python copy_headers.py> | + | |
- | # | + | |
- | + | ||
- | import os, shutil | + | |
- | + | ||
- | VERSION = ' | + | |
- | DEST = r' | + | |
- | + | ||
- | # header files | + | |
- | shutil.rmtree(r' | + | |
- | shutil.copytree(r' | + | |
- | # geany.pc | + | |
- | shutil.copy(r' | + | |
- | </ | + | |
- | + | ||
- | + | ||
- | ==== Build Geany-Plugins ==== | + | |
- | + | ||
- | After Geany has been compiled and the headers copied into the target location, you | + | |
- | should be able to compile Geany-Plugins as well. | + | |
- | In a command line window, execute the following commands: | + | |
- | + | ||
- | < | + | |
- | cd \git\geany | + | |
- | python waf configure | + | |
- | python waf build | + | |
- | python waf install | + | |
- | </ | + | |
- | + | ||
- | Carefully read the output of //python waf configure// and check whether the installed dependencies | + | |
- | have been found. At the time of writing, it is expected that the following dependencies will not | + | |
- | be found and/or are not really supported yet: | + | |
- | + | ||
- | * GpgMe | + | |
- | * GtkSpell | + | |
- | * PyGTK (an update to this tutorial for building GeanyPy using PyGTK on Windows is planned) | + | |
- | * VTE | + | |
- | * Vala | + | |
- | * WebKit | + | |
- | + | ||
- | + | ||
- | If all went fine, you should have the plugins built in \git\geany-plugins\geany-plugins-1.25 (or whatever is the current version of GIT Master). | + | |
- | + | ||
- | + | ||
- | ==== Test the Geany build ==== | + | |
- | + | ||
- | After you have built Geany and Geany-Plugins from source, you might want to run and test it. | + | |
- | This is a bit tricky but possible. | + | |
- | + | ||
- | === Initial test setup === | + | |
- | + | ||
- | Execute the following commands only once: | + | |
- | + | ||
- | * create directory: c: | + | |
- | * copy everything from c: | + | |
- | * copy bundled GTK runtine environment to c: | + | |
- | * copy everything from c: | + | |
- | * copy plugins dependencies from c: | + | |
- | + | ||
- | === Usage === | + | |
- | + | ||
- | Save the following script to \git\geany\ | + | |
- | + | ||
- | <code winbatch _geany_test.bat> | + | |
- | cd c: | + | |
- | + | ||
- | copy _build_\geany.exe c: | + | |
- | xcopy /Y _build_\*.dll c: | + | |
- | + | ||
- | cd c: | + | |
- | for /F " | + | |
- | # cleanup | + | |
- | rm c: | + | |
- | + | ||
- | cd c: | + | |
- | + | ||
- | geany.exe -v --socket-file ..\_geany_config\mysocket -c ..\_geany_config | + | |
- | </ | + | |
- | + | ||
- | Then whenever you want to test a Geany build, run _geany_test.bat from \git\geany. | + | |
- | + | ||
- | + | ||
- | ===== Release Geany and Geany-Plugins ===== | + | |
- | + | ||
- | + | ||
- | ==== Release Geany ==== | + | |
- | + | ||
- | + | ||
- | * edit release.py and update VERSION constant | + | |
- | * check for a clean working copy (e.g. no uncommitted changes) | + | |
- | * clean and build (adjust versions as necessary): | + | |
- | < | + | |
- | rmdir /S geany-1.24 | + | |
- | python waf clean | + | |
- | git pull | + | |
- | python waf configure --no-scm | + | |
- | python waf build | + | |
- | python waf install | + | |
- | python release.py | + | |
- | </ | + | |
- | * Party! | + | |
- | + | ||
- | + | ||
- | ==== Release Geany-Plugins ==== | + | |
- | + | ||
- | * edit: release.py and update VERSION constant | + | |
- | * check for a clean working copy (e.g. no uncommitted changes) | + | |
- | * clean and build (adjust versions as necessary): | + | |
- | < | + | |
- | rmdir /S geany-plugins-1.24 | + | |
- | python waf clean | + | |
- | git pull | + | |
- | python waf configure --no-scm | + | |
- | python waf build | + | |
- | python waf install | + | |
- | python release.py | + | |
- | </ | + | |
- | * Party! | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | ====== TODO ====== | + | |
- | + | ||
- | * document and provide stripped GTK bundle | + | |
- | * document and provide plugins contrib | + | |
- | * document release process in detail | + | |
- | * document PyGTK installation | + | |