Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:win32:msys2 [2022/07/23 08:20] – Update Windows MSYS2 howto enricohowtos:win32:msys2 [2025/02/01 17:04] (current) – use git clean -dfx as distclean may fail if there was no configure yet giuspen
Line 2: Line 2:
  
 Msys2 is a successor to msys which offers a unix-like environment on Windows combined with a pacman-based package manager. Msys2 is a successor to msys which offers a unix-like environment on Windows combined with a pacman-based package manager.
-It'purpose is to simplify win32 compiliations, and it's doing great at that for GTK+ stack and related projects+Its purpose is to simplify win32 compiliations, and it's doing great at that for GTK+ stack and related projects.
-In fact, it's so good it should become the default method of compiling Geany on Windows.+
  
 See http://sourceforge.net/projects/msys2/ and http://msys2.github.io/ See http://sourceforge.net/projects/msys2/ and http://msys2.github.io/
Line 11: Line 10:
 ===== Initial Setup ===== ===== Initial Setup =====
  
-Download the installer from https://msys2.github.io/Choose the 32bit or 64bit version depending on your Windows version, +Download the installer from https://msys2.github.io/Only the 64bit version is currently available/supported.
-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 64bit version to C:\mingw64. Run the installer and follow the instructions. In the following we will assume that you installed the 64bit version to C:\mingw64.
Line 34: Line 32:
     pacman -S mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb     pacman -S mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc mingw-w64-x86_64-gdb
     # make and Autotools     # make and Autotools
-    pacman -S make mingw-w64-x86_64-libtool mingw-w64-x86_64-pkgconf autoconf automake gettext+    pacman -S make mingw-w64-x86_64-libtool mingw-w64-x86_64-pkgconf autoconf automake gettext gettext-devel
     # gtk family     # gtk family
     pacman -S mingw-w64-x86_64-gtk3     pacman -S mingw-w64-x86_64-gtk3
     # for building html docs     # for building html docs
-    pacman -S mingw-w64-x86_64-python3 mingw-w64-x86_64-python-lxml+    pacman -S mingw-w64-x86_64-python mingw-w64-x86_64-python-lxml mingw-w64-x86_64-python-docutils
     # and if you fancy building from git     # and if you fancy building from git
     pacman -S git     pacman -S git
Line 44: Line 42:
     pacman -S rsync     pacman -S rsync
     # for GTK bundle creation and release creation     # for GTK bundle creation and release creation
-    pacman -S curl tar dos2unix zip unzip mingw-w64-x86_64-osslsigncode mingw-w64-x86_64-nsis+    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`, or you may get errors when building Geany. Make sure you have not installed both `gcc` and `mingw-w64-x86_64-gcc`, or you may get errors when building Geany.
  
-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.+At last, you might want to add `C:\geany\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:
Line 63: Line 61:
 You can either clone the source code from the GIT repository or download a release tarball and unpack it. You can either clone the source code from the GIT repository or download a release tarball and unpack it.
  
-    cd +    mkdir ~/git 
-    curl -L -o geany-master.zip https://github.com/geany/geany/archive/master.zip +    cd ~/git 
-    unzip geany-master.zip +    git clone https://github.com/geany/geany.git 
-    cd geany-master+    cd geany
     # autogen.sh is not needed for release tarballs!     # autogen.sh is not needed for release tarballs!
     NOCONFIGURE=1 ./autogen.sh     NOCONFIGURE=1 ./autogen.sh
     # configure and make take a while, don't panic     # configure and make take a while, don't panic
 +    export lt_cv_deplibs_check_method=${lt_cv_deplibs_check_method='pass_all'}
     ./configure --prefix=/c/geany     ./configure --prefix=/c/geany
-    make -j2+    make -j
     make install     make install
  
Line 82: Line 81:
 You can either clone the source code from the GIT repository or download a release tarball and unpack it. You can either clone the source code from the GIT repository or download a release tarball and unpack it.
  
-    cd +    cd ~/git 
-    curl -L -o geany-plugins-master.zip https://github.com/geany/geany-plugins/archive/master.zip +    git clone https://github.com/geany/geany-plugins.git 
-    unzip geany-plugins-master.zip +    cd geany-plugins
-    cd geany-plugins-master+
     # autogen.sh is not needed for release tarballs!     # autogen.sh is not needed for release tarballs!
     NOCONFIGURE=1 ./autogen.sh     NOCONFIGURE=1 ./autogen.sh
     # configure and make take a while, don't panic     # configure and make take a while, don't panic
 +    export lt_cv_deplibs_check_method=${lt_cv_deplibs_check_method='pass_all'}
     ./configure --prefix=/c/geany --with-geany-libdir=/c/geany/lib     ./configure --prefix=/c/geany --with-geany-libdir=/c/geany/lib
-    make -j2+    make -j
     make install     make install
  
Line 113: Line 112:
  
     cd     cd
-    mkdir -p ~/bundle/geany +    mkdir -p ~/geany_build/bundle/geany-gtk 
-    cd ~/bundle/geany +    cd ~/geany_build/bundle/geany-gtk 
-    bash ~/geany-master/scripts/gtk-bundle-from-msys2.sh -3+    bash ~/git/geany/scripts/gtk-bundle-from-msys2.sh -3
  
 There are a few command line options for this script. Run it with "-h" for details. There are a few command line options for this script. Run it with "-h" for details.
Line 126: Line 125:
  
     cd     cd
-    mkdir -p ~/bundle/geany-plugins +    mkdir -p ~/geany_build/bundle/geany-plugins-dependencies 
-    cd ~/bundle/geany-plugins +    cd ~/geany_build/bundle/geany-plugins-dependencies 
-    bash ~/geany-plugins-master/build/gtk-bundle-from-msys2.sh -3+    bash ~/git/geany-plugins/build/gtk-bundle-from-msys2.sh -3
  
 ===== Creating an installer / Making a release ===== ===== Creating an installer / Making a release =====
Line 142: Line 141:
 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):
  
-    DESTINATON=/release +    DESTINATON=$HOME/geany_build 
-    VERSION="1.39+    VERSION="2.1
-    cd ~/geany-master +    cd ~/git/geany 
-    make distclean +    git clean -dfx 
-    ./autogen.sh+    NOCONFIGURE=1 ./autogen.sh 
 +    export lt_cv_deplibs_check_method=${lt_cv_deplibs_check_method='pass_all'}
     mkdir _build     mkdir _build
     cd _build     cd _build
-    ../configure --prefix=${DESTINATON}/geany_install --disable-silent-rules +    ../configure --prefix=${DESTINATON}/build/geany --disable-silent-rules 
-    make -j 2+    make -j
     make install     make install
-    make DESTDIR=${DESTINATON}/geany-orig install+    rm -rf $DESTINATON/release/geany-orig 
 +    mkdir -p $DESTINATON/release/geany-orig 
 +    rsync -a --delete ${DESTINATON}/build/geany/ $DESTINATON/release/geany-orig
  
 You can use any other location as installation target by adjusting `DESTINATON`. You can use any other location as installation target by adjusting `DESTINATON`.
-Then we compile Geany and install it normally and additionally using DESTDIR to +Then we compile Geany and install it normally.
-another location. +
-The normal installation is used 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.
  
-For the following steps, a little Python is necessary to automate the further installer creation.+For the following steps, a little Python script is necessary to automate the further installer creation.
 The script can be downloaded here: {{:howtos:win32:geany-release.py.txt|}} The script can be downloaded here: {{:howtos:win32:geany-release.py.txt|}}
 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.
Line 174: Line 170:
 Finally, run the script: Finally, run the script:
  
-    cd /release/geany 
     python3 ~/geany-release.py     python3 ~/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 executables in `/release`.+At the end, you should get an installer executable in `$DESTINATON`.
  
 ==== Geany-Plugins ==== ==== Geany-Plugins ====
Line 185: Line 180:
 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):
  
-    DESTINATON=/release +    DESTINATON=$HOME/geany_build 
-    VERSION="1.29+    VERSION="2.1
-    cd ~/geany-plugins-master +    cd ~/git/geany-plugins 
-    make distclean +    git clean -dfx 
-    ./autogen.sh+    NOCONFIGURE=1 ./autogen.sh 
 +    export lt_cv_deplibs_check_method=${lt_cv_deplibs_check_method='pass_all'}
     mkdir _build     mkdir _build
     cd _build     cd _build
-    ../configure --prefix=${DESTINATON}/geany_install --with-geany-libdir=${DESTINATON}/geany_install/lib --disable-silent-rules +    ../configure --prefix=${DESTINATON}/build/geany --with-geany-libdir=${DESTINATON}/build/geany/lib --disable-silent-rules 
-    make -j 2 +    make -j 
-    make DESTDIR=${DESTINATON}/geany-plugins-orig install+    make DESTDIR=${DESTINATON}/build/geany-plugins install 
 +    rm -rf $DESTINATON/release/geany-plugins-orig 
 +    mkdir -p $DESTINATON/release/geany-plugins-orig 
 +    rsync -a --delete ${DESTINATON}/build/geany-plugins/${DESTINATON}/build/geany/ $DESTINATON/release/geany-plugins-orig
  
-For the following steps, a little Python is necessary to automate the further installer creation.+For the following steps, a little Python script is necessary to automate the further installer creation.
 The script can be downloaded here: {{:howtos:win32:geany-plugins-release.py.txt|}} The script can be downloaded here: {{:howtos:win32:geany-plugins-release.py.txt|}}
 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.
Line 205: Line 204:
 Finally, run the script: Finally, run the script:
  
-    cd /release/geany-plugins 
     python3 ~/geany-plugins-release.py     python3 ~/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 `/release`.+At the end, you should get an installer executable in `$DESTINATON`.
  
-{{tag>howto win32 msys2 build build-from-source}}+{{tag>howto windows msys2 build build-from-source}}
  
Print/export