Trac is being migrated to new services! Issues can be found in our new
YouTrack instance and WIKI pages can be found on our
website.
- Timestamp:
-
May 15, 2018, 1:04:43 AM (6 years ago)
- Author:
-
Maiku
- Comment:
-
Update cross compile instructions to meson
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v10
|
v11
|
|
17 | 17 | To begin, you'll need to install MinGW. On !Debian/Ubuntu, this involves installing packages `mingw-w64` and `mingw-w64-tools`. On other distributions, the packages may be named differently. |
18 | 18 | |
19 | | Next, you need to set up a MinGW development directory and populate it with all of the Pidgin dependencies. Start by defining that in an environment variable. The exactly location can be changed to fit your filesystem: |
| 19 | Next, you need to set up a MinGW development directory and populate it with all of the Pidgin dependencies. Start by defining that in an environment variable. The exact location can be changed to fit your filesystem: |
20 | 20 | {{{ |
21 | | export WIN_DEV_DIR=${HOME}/win32-dev/ |
| 21 | export WIN_DEV_DIR=${HOME}/win-dev/ |
22 | 22 | }}} |
23 | 23 | |
24 | | Actually fetch the dependencies using the [https://bitbucket.org/snippets/CMaiku/pon5L/pidgin-for-windows-bootstrap-script bootstrap script]: |
| 24 | Fetch the dependencies using the [https://bitbucket.org/snippets/CMaiku/pon5L/pidgin-for-windows-bootstrap-script bootstrap script]: |
25 | 25 | {{{ |
26 | | wget -nv -P"$WIN_DEV_DIR" "https://bitbucket.org/%21api/2.0/snippets/CMaiku/pon5L/9318f8fcc219fb123174a2a777a1c58a1da8ba3f/files/pidgin-bootstrap.sh" |
| 26 | wget -nv -P"$WIN_DEV_DIR" "https://bitbucket.org/%21api/2.0/snippets/CMaiku/pon5L/files/pidgin-bootstrap.sh" |
27 | 27 | chmod +x "${WIN_DEV_DIR}/pidgin-bootstrap.sh" |
28 | 28 | ${WIN_DEV_DIR}/pidgin-bootstrap.sh |
29 | 29 | }}} |
30 | 30 | |
31 | | When compiling from hg, you'll need to generate a `configure` script: |
| 31 | Create a cross compile file for meson. It should be named win32_cross.txt for following this guide. Details can be found [http://mesonbuild.com/Cross-compilation.html here], and an example you can edit to your system is [https://bitbucket.org/snippets/CMaiku/deba8x/meson-win32-cross-compile-file-example here]. It's important to include these lines in the properties section: |
32 | 32 | {{{ |
33 | | NOCONFIGURE=indeed ./autogen.sh |
| 33 | [properties] |
| 34 | c_args = ['-I/path/to/win-dev-dir/mingw32/include/'] |
| 35 | c_link_args = ['-static-libgcc'] |
| 36 | |
34 | 37 | }}} |
35 | 38 | |
36 | | Set up pkgconfig (this may vary, depending on Linux distribution): |
| 39 | Edit the `c_args` line to point to the full path of `${WIN_DEV_DIR}/mingw32/include/`. The `c_link_args` line is unnecessary for 64-bit. |
| 40 | |
| 41 | Set up pkg-config: |
37 | 42 | {{{ |
38 | | export PKG_CONFIG="/usr/bin/i686-w64-mingw32-pkg-config --define-prefix=${WIN_DEV_DIR}" |
39 | | export PKG_CONFIG_PATH="${WIN_DEV_DIR}/lib/pkgconfig" |
| 43 | export PKG_CONFIG_SYSROOT_DIR=${WIN_DEV_DIR} |
| 44 | export PKG_CONFIG_PATH="${WIN_DEV_DIR}/mingw32/lib/pkgconfig" |
40 | 45 | }}} |
41 | 46 | |
42 | | Run configure with the cross-compile option. You may choose FHS or classic directory layout (default is classic). For now (when installer is missing), FHS will be easier to install and run. The rest of this script assumes you're using FHS. The actual compiler used in the CC environment variable may vary depending on Linux distribution. Unfortunately this override is needed to bypass an [http://mingw.org/wiki/HOWTO_Sneak_GCC_Switches_Past_Libtool issue with libtool]. |
| 47 | Create your build directory with the `--cross-file` option. You may choose FHS or classic directory layout (default is classic). For now (while the installer is missing), FHS will be easier to install and run. The rest of this script assumes you're using FHS. Make sure to have the Pidgin source tree as a child of the current directory. |
43 | 48 | {{{ |
44 | | CC="i686-w64-mingw32-gcc -static-libgcc" ./configure --host=i686-w64-mingw32 --with-win32-dirs=<fhs|classic> --disable-vv --prefix=/ CFLAGS="-I${WIN_DEV_DIR}/include/" |
| 49 | meson pidgin build-win32 --cross-file win32_cross.txt --prefix=/mingw32/ -Dconsoleui=false -Dvv=false -Dintrospection=false -Dwin32-dirs=fhs |
45 | 50 | }}} |
46 | 51 | |
47 | | Then build it. |
| 52 | Change into the build directory and build it: |
48 | 53 | {{{ |
49 | | make |
| 54 | cd build-win32 |
| 55 | ninja |
50 | 56 | }}} |
51 | 57 | |
52 | | At last, install Pidgin, Finch and its dependencies. It can be installed anywhere, but it needs dependencies which are, according to this guide, already in `${WIN_DEV_DIR}`. So for simplicity, this guide installs it there. |
| 58 | And last, install Pidgin and its dependencies. It can be installed anywhere, but it needs dependencies which are, according to this guide, already in `${WIN_DEV_DIR}/mingw32`. So for simplicity, this guide installs them there. |
53 | 59 | {{{ |
54 | | make DESTDIR=${WIN_DEV_DIR} install |
| 60 | DESTDIR=${WIN_DEV_DIR} ninja install |
55 | 61 | }}} |
56 | 62 | |
57 | | Now you're done. `${WIN_DEV_DIR}` can be copied to a Windows machine and run as is (`${WIN_DEV_DIR}/bin/pidgin.exe`). However, see below regarding TLS certificates. |
| 63 | Now you're done. `${WIN_DEV_DIR}/mingw32/` can be copied to a Windows machine and run as is (`${WIN_DEV_DIR}/mingw32/bin/pidgin.exe`). However, see below regarding TLS certificates. |
58 | 64 | |
59 | 65 | === TLS Certificates === |
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!