2018-10-03 12:11:54 -04:00
|
|
|
Building wxGTK port with Win32 MSys2 GDK backend {#plat_msw_msys2_gtk}
|
|
|
|
------------------------------------------------
|
|
|
|
|
|
|
|
GTK+ widget toolkit has multiple GDK backends and one of them is Win32.
|
|
|
|
It is a wrapper around Windows API.
|
|
|
|
|
|
|
|
These notes don't consider building wxGTK with X11 backend under Windows.
|
|
|
|
|
|
|
|
The MSys2 website is http://www.msys2.org/
|
|
|
|
|
|
|
|
These building steps are NOT the normal way to build MSys2 MinGW packages.
|
|
|
|
But, they are a way the wxWidgets developers can test that wxWidgets
|
|
|
|
can build the wxGTK/Win32 libraries under MSys2 MinGW.
|
|
|
|
|
|
|
|
For the MSys2 way please see
|
|
|
|
https://github.com/Alexpux/MINGW-packages and
|
|
|
|
https://github.com/msys2/msys2/wiki/Creating-packages
|
|
|
|
|
|
|
|
Building steps:
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
A. Install the MSys2 mingw packages needed to build wxGTK/Win32 using the
|
2018-10-03 12:11:54 -04:00
|
|
|
configure/make build method.
|
2020-02-22 10:41:50 -05:00
|
|
|
From the MSys2 MinGW prompt:
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
pacman -S --needed --noconfirm make
|
2020-02-22 10:41:50 -05:00
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-libjpeg-turbo
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-libpng
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-libtiff
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-gcc
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-pkg-config
|
|
|
|
## gtk3 can take a long time to update/find fonts
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-gtk3
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
|
|
|
|
Packages that are needed but are normally installed already.
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-gcc-libs
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-expat
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-xz
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-zlib
|
|
|
|
pacman -S --needed --noconfirm ${MINGW_PACKAGE_PREFIX}-gdk-pixbuf2
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
B. Build the wxGTK/Win32 static library
|
2018-10-03 12:11:54 -04:00
|
|
|
1. Open MSys2 MinGW Prompt
|
2020-02-22 10:41:50 -05:00
|
|
|
(These steps were tested on MinGW64; but, should work under MinGW32)
|
2018-10-03 12:11:54 -04:00
|
|
|
2. Use the cd command to change directory to the wxWidgets top folder.
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
3. Create the "build-${MSYSTEM_CARCH}-gtk3-static" folder to build the static libraries
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
mkdir -p build-${MSYSTEM_CARCH}-gtk3-static
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
4. Configure wxWidgets
|
|
|
|
Option "--disable-precomp-headers" is NOT needed.
|
|
|
|
It is being used to test for compile issues.
|
|
|
|
|
|
|
|
Remove configure option "--disable-wxdib" to set wxUSE_WXDIB to 1.
|
|
|
|
The directions docs/msw/gtk.txt results in wxUSE_WXDIB set to 1.
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd build-${MSYSTEM_CARCH}-gtk3-static && \
|
|
|
|
../configure --with-gtk=3 \
|
2018-10-03 12:11:54 -04:00
|
|
|
--disable-wxdib \
|
|
|
|
--disable-shared \
|
|
|
|
--disable-precomp-headers \
|
|
|
|
&& cd ..
|
|
|
|
|
|
|
|
5. clean the wxGTK static libraries
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd build-${MSYSTEM_CARCH}-gtk3-static && make clean && cd ..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
6. make the wxGTK static libraries
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd build-${MSYSTEM_CARCH}-gtk3-static && make && cd ..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
C. Build and run the minimal static sample
|
2018-10-03 12:11:54 -04:00
|
|
|
1. Clean the minimal sample
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd build-${MSYSTEM_CARCH}-gtk3-static/samples/minimal && make clean && cd ../../..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
2. Build the minimal sample
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd build-${MSYSTEM_CARCH}-gtk3-static/samples/minimal && make && cd ../../..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
3. Run the minimal sample
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
./build-${MSYSTEM_CARCH}-gtk3-static/samples/minimal/minimal.exe
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
D. Build most of the static samples
|
2018-10-03 12:11:54 -04:00
|
|
|
1. Clean most of the static samples
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd build-${MSYSTEM_CARCH}-gtk3-static/samples && make clean && cd ../..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
2. Build most of the static samples
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd build-${MSYSTEM_CARCH}-gtk3-static/samples && make && cd ../..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
E. Run the drawing static sample
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd samples/drawing && ../../build-${MSYSTEM_CARCH}-gtk3-static/samples/drawing/drawing.exe && cd ../..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
F. Run the splash static sample
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd samples/splash && ../../build-${MSYSTEM_CARCH}-gtk3-static/samples/splash/splash.exe && cd ../..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
G. Run the widgets static sample
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd samples/widgets && ../../build-${MSYSTEM_CARCH}-gtk3-static/samples/widgets/widgets.exe && cd ../..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
H. Run the toolbar static sample
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd samples/toolbar && ../../build-${MSYSTEM_CARCH}-gtk3-static/samples/toolbar/toolbar.exe && cd ../..
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
I. Run the image static sample
|
2018-10-03 12:11:54 -04:00
|
|
|
|
2020-02-22 10:41:50 -05:00
|
|
|
cd samples/image && ../../build-${MSYSTEM_CARCH}-gtk3-static/samples/image/image.exe && cd ../..
|