Difference between revisions of "Installation MSYS2"

From GNUstepWiki
Jump to navigation Jump to search
(Explain that 32bit now works fine and limitations of co-existence with 64bit)
(pre instead of code for code snippets)
 
(2 intermediate revisions by the same user not shown)
Line 11: Line 11:
  
 
Essential tools:
 
Essential tools:
<code>
+
<pre>
 
  msys/make
 
  msys/make
 
  mingw64/mingw-w64-x86_64-pkg-config  
 
  mingw64/mingw-w64-x86_64-pkg-config  
 
  msys/pkg-config
 
  msys/pkg-config
 
  msys/tar
 
  msys/tar
</code>
+
</pre>
  
  
 
== For GCC ==
 
== For GCC ==
  
<code>
+
<pre>
 
  mingw64/mingw-w64-x86_64-gcc  
 
  mingw64/mingw-w64-x86_64-gcc  
 
  mingw64/mingw-w64-x86_64-gcc-objc
 
  mingw64/mingw-w64-x86_64-gcc-objc
Line 27: Line 27:
 
  msys/gcc-libs 9.1.0-2
 
  msys/gcc-libs 9.1.0-2
 
  mingw64/mingw-w64-x86_64-gcc-libs
 
  mingw64/mingw-w64-x86_64-gcc-libs
</code>
+
</pre>
  
 
== For Clang + libobjc2 ==
 
== For Clang + libobjc2 ==
  
 
This will install clang and the latest gcc, since clang gets it's headers from that installation...  This is the instance of clang usable from MSYS2, you will need to install another later for use under Windows to build libobjc2...
 
This will install clang and the latest gcc, since clang gets it's headers from that installation...  This is the instance of clang usable from MSYS2, you will need to install another later for use under Windows to build libobjc2...
<code>
+
<pre>
  ./tools-scripts/install-dependencies-msys2-64bit
+
./tools-scripts/install-dependencies-msys2-64bit
</code>
+
</pre>
  
 
Go to chocolatey software and follow the instructions there:
 
Go to chocolatey software and follow the instructions there:
Line 41: Line 41:
 
Here is the script used in Azure CI to build the library, you can follow this pretty easily:
 
Here is the script used in Azure CI to build the library, you can follow this pretty easily:
  
<code>
+
<pre>
 
  - job: Windows
 
  - job: Windows
 
     displayName: Windows-2016
 
     displayName: Windows-2016
Line 93: Line 93:
 
         ninja
 
         ninja
 
         echo Ninja completed.
 
         echo Ninja completed.
</code>
+
</pre>
  
 
Once this is complete you should have a build of libobjc2 in the build dir.
 
Once this is complete you should have a build of libobjc2 in the build dir.
Line 99: Line 99:
 
= Patches needed =
 
= Patches needed =
  
'''git master needs no patches'''
+
'''git master and current release needs no patches'''
  
'''For release, please:'''
+
'''Old releases release:'''
[https://sourceforge.net/p/mingw-w64/bugs/820/ shlwapi.h Fix]
 
  
For a successful build, MSYS2 headers need to be patched.
+
For a successful build, MSYS2 headers need to be patched. [https://sourceforge.net/p/mingw-w64/bugs/820/ shlwapi.h Fix]
Please apply following proposed fix:
 
  
 
= Build instructions =
 
= Build instructions =
Line 124: Line 122:
  
 
Essential base libraries, headers included:
 
Essential base libraries, headers included:
<code>
+
<pre>
 
  msys/libxslt-devel 1.1.34-1 (development) [installed]
 
  msys/libxslt-devel 1.1.34-1 (development) [installed]
 
  msys/libxslt 1.1.34-1 (libraries) [installed]
 
  msys/libxslt 1.1.34-1 (libraries) [installed]
Line 142: Line 140:
  
 
  mingw64/mingw-w64-x86_64-icu 67.1-1 [installed]
 
  mingw64/mingw-w64-x86_64-icu 67.1-1 [installed]
</code>
+
</pre>
  
  
 
If all dependencies are installed, no difficulties then:
 
If all dependencies are installed, no difficulties then:
  
<code>
+
<pre>
 
  ./configure
 
  ./configure
 
  make install
 
  make install
</code>
+
</pre>
  
 
== Gui ==
 
== Gui ==
  
 
Essential gui libraries:
 
Essential gui libraries:
<code>
+
<pre>
 
  mingw64/mingw-w64-x86_64-libjpeg-turbo
 
  mingw64/mingw-w64-x86_64-libjpeg-turbo
  
Line 163: Line 161:
  
 
  mingw64/mingw-w64-x86_64-giflib
 
  mingw64/mingw-w64-x86_64-giflib
</code>
+
</pre>
  
  
 
Then installation is as simple as:
 
Then installation is as simple as:
  
<code>
+
<pre>
 
  ./configure
 
  ./configure
 
  make install
 
  make install
</code>
+
</pre>
  
 
== Back / winlib ==
 
== Back / winlib ==
  
 
Essential back libraries:
 
Essential back libraries:
<code>
+
<pre>
 
  mingw64/mingw-w64-x86_64-freetype
 
  mingw64/mingw-w64-x86_64-freetype
</code>
+
</pre>
  
 
Then installation for the 'native windows' backend is as simple as:
 
Then installation for the 'native windows' backend is as simple as:
  
<code>
+
<pre>
 
  ./configure --enable-graphics=winlib
 
  ./configure --enable-graphics=winlib
 
  make install
 
  make install
</code>
+
</pre>
  
 
You may want to try cairo if you prefer, install also cairo libraries before...
 
You may want to try cairo if you prefer, install also cairo libraries before...
Line 192: Line 190:
  
 
Essential back libraries:
 
Essential back libraries:
<code>
+
<pre>
 
  mingw64/mingw-w64-x86_64-freetype
 
  mingw64/mingw-w64-x86_64-freetype
 
  mingw64/mingw-w64-x86_64-cairo
 
  mingw64/mingw-w64-x86_64-cairo
</code>
+
</pre>
  
 
Then install like this...
 
Then install like this...
  
<code>
+
<pre>
 
  ./configure --enable-graphics=cairo
 
  ./configure --enable-graphics=cairo
 
  make install
 
  make install
</code>
+
</pre>

Latest revision as of 11:15, 9 January 2024

Packages needed

Be very sure to install the packages correct for your architecture. The Guide refers to intel-64bit. The 32bit packages have "i686" as architecture in the name: using them works also perfectly. One can also have both 32bit and 64bit versions on a 64bit machine, for testing and build purposes, since they live in /mingw32 and /mingw64. However beware that applications cannot run together, since the daemons will not work. Run at once either all 64bit or all 32bit apps, do not mix.

One package is msys, the other for mingw64

Use 'pacman -S packagename' to install a package.

Be sure to work in the correct shell: for the 64bit example, launch and work inside MSYS2 MinGW 64-bit

Essential tools:

 msys/make
 mingw64/mingw-w64-x86_64-pkg-config 
 msys/pkg-config
 msys/tar


For GCC

 mingw64/mingw-w64-x86_64-gcc 
 mingw64/mingw-w64-x86_64-gcc-objc

 msys/gcc-libs 9.1.0-2
 mingw64/mingw-w64-x86_64-gcc-libs

For Clang + libobjc2

This will install clang and the latest gcc, since clang gets it's headers from that installation... This is the instance of clang usable from MSYS2, you will need to install another later for use under Windows to build libobjc2...

 ./tools-scripts/install-dependencies-msys2-64bit

Go to chocolatey software and follow the instructions there:

https://chocolatey.org/docs/installation

Here is the script used in Azure CI to build the library, you can follow this pretty easily:

 - job: Windows
    displayName: Windows-2016
    pool:
      vmImage: vs2017-win2016
    strategy:
      matrix:
        Debug-32:
          BuildType: Debug
          Arch: x64_x86
          Flags: -m32
        Release-32:
          BuildType: Release
          Arch: x64_x86
          Flags: -m32
        Debug-64:
          BuildType: Debug
          Arch: x64
          Flags: -m64
        Release-64:
          BuildType: Release
          Arch: x64
          Flags: -m64
    steps:
    - checkout: self
      submodules: true
    - script: |
        choco.exe install ninja
        choco.exe install llvm
    - script: |
        echo Creating build directory...
        mkdir build
        cd build
        echo Importing visual studio environment variables...
        call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" $(Arch)
        echo Checking that we're calling the correct link.exe
        where link.exe
        set CFLAGS=$(Flags)
        set CXXFLAGS=$(Flags)
        echo Running cmake...
        cmake .. -G Ninja -DTESTS=ON -DCMAKE_C_COMPILER="c:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_CXX_COMPILER="c:/Program Files/LLVM/bin/clang-cl.exe" -DCMAKE_BUILD_TYPE=$(BuildType)
        echo CMake completed.
      failOnStderr: false
      displayName: 'CMake'
    - script: |
        cd build
        echo Importing visual studio environment variables...
        call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" $(Arch)
        set CCC_OVERRIDE_OPTIONS=x-TC x-TP x/TC x/TP
        echo Running ninja...
        ninja
        echo Ninja completed.

Once this is complete you should have a build of libobjc2 in the build dir.

Patches needed

git master and current release needs no patches

Old releases release:

For a successful build, MSYS2 headers need to be patched. shlwapi.h Fix

Build instructions

Make

Configure and install as:

./configure --with-layout=gnustep 
make install

then, remember, to source the script from the respective MinGW shell version, e.g. the 64 bit is in:

. /mingw64/System/Library/Makefiles/GNUstep.sh

Base

Essential base libraries, headers included:

 msys/libxslt-devel 1.1.34-1 (development) [installed]
 msys/libxslt 1.1.34-1 (libraries) [installed]
 mingw64/mingw-w64-x86_64-libxslt 1.1.34-2 [installed]

 msys/libffi 3.2.1-3 (libraries) [installed]
 mingw64/mingw-w64-x86_64-libffi 3.2.1-4 [installed]
 msys/libffi-devel 3.2.1-3 (development) [installed]

 msys/libxml2-devel 2.9.10-2 (development) [installed]
 msys/libxml2 2.9.10-2 (libraries) [installed]
 mingw64/mingw-w64-x86_64-libxml2 2.9.10-3 [installed]

 msys/libgnutls-devel 3.6.11.1-1 (development) [installed]
 msys/libgnutls 3.6.11.1-1 (libraries) [installed]
 mingw64/mingw-w64-x86_64-gnutls 3.6.11.1-1 [installed]

 mingw64/mingw-w64-x86_64-icu 67.1-1 [installed]


If all dependencies are installed, no difficulties then:

 ./configure
 make install

Gui

Essential gui libraries:

 mingw64/mingw-w64-x86_64-libjpeg-turbo

 mingw64/mingw-w64-x86_64-libtiff

 mingw64/mingw-w64-x86_64-libpng

 mingw64/mingw-w64-x86_64-giflib


Then installation is as simple as:

 ./configure
 make install

Back / winlib

Essential back libraries:

 mingw64/mingw-w64-x86_64-freetype

Then installation for the 'native windows' backend is as simple as:

 ./configure --enable-graphics=winlib
 make install

You may want to try cairo if you prefer, install also cairo libraries before...

Back / cairo

Essential back libraries:

 mingw64/mingw-w64-x86_64-freetype
 mingw64/mingw-w64-x86_64-cairo

Then install like this...

 ./configure --enable-graphics=cairo
 make install