Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:win32:build [2015/04/12 09:53] – Update copy_headers.py script to also copy geany.dll 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:// | ||
- | |||
- | ==== DocUtils (rst2html) ==== | ||
- | |||
- | Download the tarball from http:// | ||
- | Enter the folder and execute the following commands: | ||
- | |||
- | < | ||
- | cd docutils-0.12 | ||
- | python setup.py install | ||
- | cp Tools\rst2html.py c:\python27 | ||
- | </ | ||
- | |||
- | |||
- | ==== 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:\libs\lib | ||
- | * 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 glob, os, shutil | ||
- | |||
- | VERSION = ' | ||
- | DEST = r' | ||
- | |||
- | # header files | ||
- | shutil.rmtree(r' | ||
- | shutil.copytree(r' | ||
- | # geany-0.dll | ||
- | dlls = glob.glob(r' | ||
- | for filename in dlls: | ||
- | # copy it to lib\ instead bin\ so the lookup works | ||
- | # rename the file to geany.dll, as the linker uses ' | ||
- | # this loop will overwrite previously copied files if there is more | ||
- | # one geany*.dll in the source directory, this should not happen | ||
- | shutil.copy(filename, | ||
- | # 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. | ||
- | |||
- | |||
- | |||
- | ===== Create a stripped down GTK runtime environment ===== | ||
- | |||
- | To create a stripped down GTK runtime environment used to embed into the Windows installer, | ||
- | we first download the latest GTK (currently GTK2) bundle from www.gtk.org. | ||
- | |||
- | For this example the bundle gtk+-bundle_2.24.10-20120208_win32.zip was used. | ||
- | Extract the bundle into a new folder. | ||
- | |||
- | Then execute the following commands to remove any not necessary files: | ||
- | < | ||
- | rm -rf bin\envsubst.exe | ||
- | rm -rf bin\fc-cache.exe | ||
- | rm -rf bin\fc-cat.exe | ||
- | rm -rf bin\fc-list.exe | ||
- | rm -rf bin\freetype-config | ||
- | rm -rf bin\gdbus.exe | ||
- | rm -rf bin\gdk-pixbuf-csource.exe | ||
- | rm -rf bin\gdk-pixbuf-query-loaders.exe | ||
- | rm -rf bin\gettext.exe | ||
- | rm -rf bin\gettext.sh | ||
- | rm -rf bin\gio-querymodules.exe | ||
- | rm -rf bin\glib-compile-schemas.exe | ||
- | rm -rf bin\glib-genmarshal.exe | ||
- | rm -rf bin\glib-gettextize | ||
- | rm -rf bin\glib-mkenums | ||
- | rm -rf bin\gobject-query.exe | ||
- | rm -rf bin\gtk-builder-convert | ||
- | rm -rf bin\gtk-demo.exe | ||
- | rm -rf bin\gtk-query-immodules-2.0.exe | ||
- | rm -rf bin\gtk-update-icon-cache.exe | ||
- | rm -rf bin\gtk-update-icon-cache.exe.manifest | ||
- | rm -rf bin\libasprintf-0.dll | ||
- | rm -rf bin\libcairo-script-interpreter-2.dll | ||
- | rm -rf bin\libgcc_s_dw2-1.dll | ||
- | rm -rf bin\ngettext.exe | ||
- | rm -rf bin\pango-querymodules.exe | ||
- | rm -rf bin\pango-view.exe | ||
- | rm -rf bin\pkg-config.exe | ||
- | rm -rf bin\xmlwf.exe | ||
- | rm -rf etc\bash_completion.d | ||
- | rm -rf gtk+-bundle_2.*README.txt | ||
- | rm -rf include | ||
- | rm -rf lib\*.a | ||
- | rm -rf lib\*.def | ||
- | rm -rf lib\*.dll | ||
- | rm -rf lib\*.lib | ||
- | rm -rf lib\gdk-pixbuf-2.0 | ||
- | rm -rf lib\glib-2.0 | ||
- | rm -rf lib\pkgconfig | ||
- | rm -rf man | ||
- | rm -rf manifest | ||
- | rm -rf share\aclocal | ||
- | rm -rf share\doc | ||
- | rm -rf share\glib-2.0 | ||
- | rm -rf share\gtk-2.0 | ||
- | rm -rf share\gtk-doc | ||
- | rm -rf share\man | ||
- | rm -rf src | ||
- | </ | ||
- | |||
- | Then create a subdirectory " | ||
- | the remaining bundle contents into the " | ||
- | the bin-etc-lib-share directory structure: | ||
- | |||
- | Et voila: you got a stripped down GTK runtime environment ready to use for Geany on Windows. | ||
- | |||
- | |||
- | ===== 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 plugins contrib | ||
- | * document release process in detail | ||
- | * document PyGTK installation | ||
- | |||
- | |||
- | {{tag> |