Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:win32:msys2 [2016/03/13 17:39] – Add bundle and installer creation notes enrico | howtos:win32:msys2 [2024/09/12 18:15] (current) – Provides the /usr/share/gettext/archive.dir.tar.xz that autopoint wants dnabre | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
- | |||
====== Build Geany on Windows (using MSYS2) ====== | ====== Build Geany on Windows (using MSYS2) ====== | ||
- | *** UNDER CONSTRUCTION *** | + | Msys2 is a successor to msys which offers a unix-like environment on Windows combined with a pacman-based package manager. |
- | + | It's purpose is to simplify win32 compiliations, | |
- | Msys2 is a successor to msys which offers a unix-like environment on Windows combined with a pacman-based package manager. It's purpose is to simplify win32 compiliations, | + | In fact, it's so good it should become the default method of compiling Geany on Windows. |
See http:// | See http:// | ||
- | This page aims at showing how to use msys2 to build Geany on Windows, both GTK+2 and GTK+3 versions. | + | This page aims at showing how to use MSYS2 to build Geany on Windows. |
- | ===== One-time | + | ===== Initial |
- | Download the installer from [[http:// | + | Download the installer from https:// |
+ | not whether you target a 32bit or 64bit compilation of Geany (this guide will always compile for 64bit). | ||
- | Run the installer and follow the instructions. In the following we will assume that you installed the 32bit version to C:\mingw32. | + | Run the installer and follow the instructions. In the following we will assume that you installed the 64bit version to C:\mingw64. |
- | After installation, | + | After installation, |
- | '' | + | `Start Menu -> All Programs -> MSYS2 64bit -> MSYS2 MinGW x64` |
Next, execute: | Next, execute: | ||
- | pacman --needed -Sy bash pacman pacman-mirrors msys2-runtime | ||
- | Now exit and re-open the msys2 environment and perform a system update: | + | pacman |
- | | + | |
- | Restart msys2 once more, in case '' | + | Now exit and re-open the MSYS2 environment |
- | Finally, install the dependencies needed by Geany. | + | pacman -Su |
- | | + | Restart msys2 once more, in case `pacman -Su` updated environment related packages. |
- | pacman -S mingw-w64-i686-binutils mingw-w64-i686-gcc mingw-w64-i686-gdb | + | |
- | # make and Autotools | + | Finally, install the dependencies needed by Geany: |
- | pacman -S make pkgconfig | + | |
- | # gtk familiy | + | |
- | pacman -S mingw-w64-i686-gtk2 mingw-w64-i686-gtk3 | + | pacman -S mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb |
- | # for building html docs | + | # make and Autotools |
- | pacman -S mingw-w64-i686-python2 | + | pacman -S make mingw-w64-x86_64-libtool mingw-w64-x86_64-pkgconf |
- | # and if you fancy building from git | + | # gtk family |
- | pacman -S git | + | pacman -S mingw-w64-x86_64-gtk3 |
- | # necessary for GTK bundle and installer steps | + | # for building html docs |
- | pacman -S rsync | + | pacman -S mingw-w64-x86_64-python3 |
- | + | # and if you fancy building from git | |
- | At last, you want to add '' | + | pacman -S git |
+ | # necessary for GTK bundle and installer steps | ||
+ | pacman -S rsync | ||
+ | # for GTK bundle creation and release creation | ||
+ | pacman -S curl tar dos2unix zip unzip mingw-w64-x86_64-osslsigncode mingw-w64-x86_64-nsis patch | ||
+ | |||
+ | Make sure you have not installed both `gcc` and `mingw-w64-x86_64-gcc`, | ||
+ | |||
+ | At last, you might want to add `C:\msys64\mingw64\bin` to your `PATH` environment variable, in order to run Geany from the Windows Explorer. | ||
In case you want also compile the combined Geany-Plugins collection, you need the following dependencies: | In case you want also compile the combined Geany-Plugins collection, you need the following dependencies: | ||
- | | + | |
- | pacman -S mingw-w64-i686-check mingw-w64-i686-enchant mingw-w64-i686-lua51 mingw-w64-i686-gpgme mingw-w64-i686-libsoup mingw-w64-i686-libgit2 mingw-w64-i686-gtkspell | + | pacman -S mingw-w64-x86_64-check mingw-w64-x86_64-enchant mingw-w64-x86_64-lua51 mingw-w64-x86_64-gpgme mingw-w64-x86_64-libsoup mingw-w64-x86_64-libgit2 mingw-w64-x86_64-gtkspell3 |
- | | + | |
- | ===== GTK+3 compilation ===== | + | Note: Pacman will probably suggest to replace `mingw-w64-x86_64-lua51` by `mingw-w64-x86_64-luajit`. |
+ | Deny this suggestion and keep installing `mingw-w64-x86_64-lua51`. | ||
+ | Otherwise building the GeanyLua plugin might and creating a release installer will break. | ||
- | This is effectively the same procedure as cross-compiling on Linux. You can either clone the source code from the GIT repository or download a release tarball (1.27 or later) and unpack it. | + | ===== Geany Compilation ===== |
- | curl -L -o geany-master.zip https:// | + | You can either clone the source code from the GIT repository or download a release tarball |
- | unzip geany-master.zip | + | |
- | cd geany-master | + | |
- | # autogen.sh is not needed for tarballs! | + | |
- | NOCONFIGURE=1 ./ | + | |
- | # configure | + | |
- | | + | |
- | make -j2 | + | |
- | make install | + | |
- | After that, you can run Geany either through msys2 shell ('' | + | cd |
+ | curl -L -o geany-master.zip https://github.com/geany/geany/archive/ | ||
+ | unzip geany-master.zip | ||
+ | cd geany-master | ||
+ | # autogen.sh is not needed for release tarballs! | ||
+ | NOCONFIGURE=1 ./ | ||
+ | # configure | ||
+ | | ||
+ | make -j2 | ||
+ | make install | ||
- | The first run should look like this, on GTK+ 3.18.6\\ | + | After that, you can run Geany either through MSYS2 shell (`/c/geany/ |
- | {{: | + | |
- | ===== GTK+2 compilation ===== | + | The first run should look like this, on GTK+ 3.18.6 {{: |
- | This is effectively the same procedure as cross-compiling on Linux. You can either clone the source code from the GIT repository or download a release tarball (1.27 or later) and unpack it. | + | ===== Geany-Plugins Compilation ===== |
- | curl -L -o geany-master.zip https:// | + | You can either clone the source code from the GIT repository or download a release tarball |
- | unzip geany-master.zip | + | |
- | cd geany-master | + | |
- | # autogen.sh is not needed for tarballs! | + | |
- | NOCONFIGURE=1 ./ | + | |
- | # configure | + | |
- | | + | |
- | make -j2 | + | |
- | make install | + | |
- | After that, you can run Geany either through msys2 shell (''/ | + | cd |
+ | curl -L -o geany-plugins-master.zip https:// | ||
+ | unzip geany-plugins-master.zip | ||
+ | cd geany-plugins-master | ||
+ | # autogen.sh is not needed for release tarballs! | ||
+ | NOCONFIGURE=1 ./ | ||
+ | # configure and make take a while, don't panic | ||
+ | ./configure --prefix=/ | ||
+ | make -j2 | ||
+ | make install | ||
- | The first run should look like this, on GTK+ 2.24.28 \\ | ||
- | {{: | ||
===== Creating a GTK runtime bundle ===== | ===== Creating a GTK runtime bundle ===== | ||
Line 98: | Line 103: | ||
installation. | installation. | ||
In case you want to create an installer, leave the directories as they are and read on. | In case you want to create an installer, leave the directories as they are and read on. | ||
- | |||
==== Geany ==== | ==== Geany ==== | ||
- | The script | + | The script |
- | To run it, simply create a new directory where the GTK runtime environment should be | + | To run the script, simply create a new directory where the GTK runtime environment should be |
unpacked and change into this directory. | unpacked and change into this directory. | ||
Then call the script and wait a bit. It will download all necessary MSYS2 packages and extract them. | Then call the script and wait a bit. It will download all necessary MSYS2 packages and extract them. | ||
- | Finally it will download the sources for *grep* and then compile *grep*. | ||
- | | + | |
- | | + | |
- | | + | cd ~/geany_build/ |
- | cd /h/geany-bundle | + | bash ~/geany-master/ |
- | bash ~/ | + | |
- | rsync -a --delete / | + | |
There are a few command line options for this script. Run it with " | There are a few command line options for this script. Run it with " | ||
- | The most important option is "-2" and "-3" which defines the GTK version to be used. | + | The most important option is "-3" and "-4" which defines the GTK version to be used. |
- | + | ||
- | The trailing " | + | |
==== Geany-Plugins ==== | ==== Geany-Plugins ==== | ||
For Geany-Plugins, | For Geany-Plugins, | ||
- | The script for Geany-Plugins is available | + | The script for Geany-Plugins is available |
- | + | ||
- | cd | + | |
- | curl -L -o geany-plugins-gtk-bundle-from-msys2.sh https:// | + | |
- | mkdir / | + | |
- | cd / | + | |
- | bash ~/ | + | |
- | rsync -a --delete / | + | |
- | The trailing " | + | cd |
+ | mkdir -p ~/ | ||
+ | cd ~/ | ||
+ | bash ~/ | ||
===== Creating an installer / Making a release ===== | ===== Creating an installer / Making a release ===== | ||
Line 147: | Line 142: | ||
Build instructions to build Geany in order to create a Windows installer (within MSYS2 shell): | Build instructions to build Geany in order to create a Windows installer (within MSYS2 shell): | ||
- | | + | |
- | VERSION=" | + | VERSION=" |
- | cd ~/geany | + | cd ~/geany-master |
- | make distclean | + | make distclean |
- | ./ | + | ./ |
- | ./configure --prefix=${DESTINATON}/ | + | mkdir _build |
- | make -j 2 | + | cd _build |
- | make install | + | ../configure --prefix=${DESTINATON}/ |
- | make DESTDIR=${DESTINATON}/ | + | make -j 2 |
- | rsync -a --delete ${DESTINATON}/ | + | make install |
+ | rm -rf $DESTINATON/release/geany-orig | ||
+ | rsync -a --delete ${DESTINATON}/build/ | ||
- | The used destination here is "/ | + | You can use any other location as installation target |
- | You can use any other location as installation target. | + | Then we compile Geany and install it normally. |
- | Then we compile Geany and install it normally | + | |
- | another location. | + | |
- | The normal installation is for Geany-Plugins so they can easily find the Geany installation | + | |
- | while the DESTDIR installation is used to move the installed files into the source directory | + | |
- | back for the installer creation. | + | |
- | + | ||
- | This process can probably be optimized and shortened but for now it works this way. | + | |
The following actually creates the installer. | The following actually creates the installer. | ||
- | The installer script expects that you have Python and NSIS 2.x (http:// | ||
- | installed in your normal Windows system (not in MSYS2). In the future, it would be cool to build the | ||
- | installer from within the MSYS2 environment but currently only NSIS 3.0 Beta is available in MSYS2. | ||
- | For the following steps, a little Python is necessary to automate the further installer creation. | + | For the following steps, a little Python |
The script can be downloaded here: {{: | The script can be downloaded here: {{: | ||
Open the script in your editor of choice and change paths at the beginning of the script as needed. | Open the script in your editor of choice and change paths at the beginning of the script as needed. | ||
- | The script will also use SignCode | + | The script will also use `osslsigncode` |
- | Either | + | Either |
- | Finally, | + | Finally, |
- | cd c: | + | python3 ~/geany-release.py |
- | python ..\geany-release.py | + | |
This will strip and sign all binaries (geany.exe and various .dll files) and | This will strip and sign all binaries (geany.exe and various .dll files) and | ||
also convert documentation text files to CRLF format. | also convert documentation text files to CRLF format. | ||
- | At the end, you should get two installer | + | At the end, you should get an installer |
==== Geany-Plugins ==== | ==== Geany-Plugins ==== | ||
Line 194: | Line 179: | ||
Build instructions to build Geany-Plugins in order to create a Windows installer (within MSYS2 shell): | Build instructions to build Geany-Plugins in order to create a Windows installer (within MSYS2 shell): | ||
- | | + | |
- | VERSION=" | + | VERSION=" |
- | cd ~/ | + | cd ~/ |
- | make distclean | + | make distclean |
- | ./ | + | ./ |
- | ./configure --prefix=${DESTINATON}/ | + | mkdir _build |
- | make -j 2 | + | cd _build |
- | make install | + | ../configure --prefix=${DESTINATON}/ |
- | | + | make -j 2 |
- | rsync -a --delete ${DESTINATON}/ | + | make DESTDIR=${DESTINATON}/build/ |
+ | rsync -a --delete ${DESTINATON}/build/ | ||
- | For the following steps, a little Python is necessary to automate the further installer creation. | + | For the following steps, a little Python |
The script can be downloaded here: {{: | The script can be downloaded here: {{: | ||
Open the script in your editor of choice and change paths at the beginning of the script as needed. | Open the script in your editor of choice and change paths at the beginning of the script as needed. | ||
- | The script will also use SignCode | + | The script will also use `osslsigncode` |
- | Either | + | Either |
- | Finally, | + | Finally, |
- | cd c: | + | python3 ~/geany-plugins-release.py |
- | python ..\geany-plugins-release.py | + | |
This will strip and sign all binaries (various .dll files) and | This will strip and sign all binaries (various .dll files) and | ||
also convert documentation text files to CRLF format. | also convert documentation text files to CRLF format. | ||
- | At the end, you should get an installer executable in ~/ | + | At the end, you should get an installer executable in `$DESTINATON`. |
- | + | ||
- | + | ||
- | ===== Automated build via MAKEPKG file ===== | + | |
- | TODO | + | {{tag> |
- | {{tag> |