1 Compiling LyX 2.3 for Win32 and creating Windows installer
2 ==========================================================
4 It's recommended to compile LyX using Microsoft Visual C++ 2015 and CMake.
7 Compiling with Microsoft Visual C++
8 ===================================
10 These instructions assume the LyX source code is in C:\LyX\lyx-23
11 You can also use another directory if you prefer.
15 If you don't have Visual C++ 2015 installed, get the free Community edition
16 from https://www.visualstudio.com/
20 Download the latest Qt for Open Source C++ development on Windows (VS2015)
21 from https://qt.io/download-open-source/
22 Qt 5.6.x is recommended, but 5.7.x or later versions should work as well.
26 Install the latest Python 2.x or 3.x version from
27 https://www.python.org/downloads/
31 Install the latest CMake from http://www.cmake.org
37 - Set the source code path to C:\LyX\lyx-23
38 Set the build path to C:\LyX\lyx-23-build
39 Click Configure and set the generator to Visual Studio 14.
41 - Enable LYX_DEPENDENCIES_DOWNLOAD and click Configure.
42 Pre-compiled dependencies will automatically be downloaded.
44 - Set QT_QMAKE_EXECUTABLE to e.g.
45 C:\Qt\qt-everywhere-opensource-src-5.6.1\bin\qmake.exe
48 - Enable the LYX_INSTALL option, set CMAKE_INSTALL_PREFIX to
49 C:\LyX\lyx-23-install and click Configure.
51 - Check the Advanced checkbox.
52 Set GETTEXT_MSGFMT_EXECUTABLE to
53 C:\LyX\lyx-23-build\msvc2015-deps\lyx-windows-deps-msvc2015\gettext-tools\msgfmt.exe,
54 and do the same for the other gettext tools.
60 A Microsoft Visual C++ solution should have been generated at
61 C:\LyX\lyx-23-build\lyx.sln
62 Compile the INSTALL project to get a LyX installation in
68 - C:\LyX\lyx-23-build\msvc2015-deps\lyx-windows-deps-msvc2015\bin
69 - C:\LyX\lyx-23-build\msvc2015-deps\lyx-windows-deps-msvc2015\imagemagick
70 - C:\LyX\lyx-23-build\msvc2015-deps\lyx-windows-deps-msvc2015\python
71 - C:\LyX\lyx-23-build\msvc2015-deps\lyx-windows-deps-msvc2015\ghostscript
72 - C:\LyX\lyx-23-build\msvc2015-deps\lyx-windows-deps-msvc2015\Resources
73 to C:\LyX\lyx-23-install
75 And copy from the Qt bin directory
79 QtCore5d.dll (if compiling Debug version)
80 QtGui5d.dll (if compiling Debug version)
81 to C:\LyX\lyx-23-install\bin
85 Add the following line to C:\LyX\lyx-23-install\Resources\lyxrc.dist,
86 so LyX will find the bundled tools such as Python, ImageMagick
89 \path_prefix "$LyXDir\bin;$LyXDir\python;$LyXDir\imagemagick;$LyXDir\ghostscript"
91 You may also add the location of your LaTeX installation if it's not on the
92 system PATH, and the location of JabRef.
96 C:\LyX\lyx-23-install\bin\lyx.exe
99 Creating the Installer
100 ======================
102 - Get NSIS from http://nsis.sourceforge.net
103 - In the LyX source directory, go to development\Win32\packaging\installer
104 - Copy the 3 dll-files from there to the DLL folder of the NSIS installation
105 - Check whether the file locations/paths in settings.nsh match your setup.
106 - Right-click on lyx.nsi and click "Compile NSIS Script".
109 Compiling with GCC with MinGW64 + MSYS2 Environment using autotools
110 ===================================================================
111 1 Install MSYS2, MINGW64, Qt5+
112 https://wiki.qt.io/MSYS2
113 2 Install bc (Bench calculater), which autotools uses for some reason to compile LyX
115 3 Run the standard autotools install (Adapt paths and arguments accordingly)
117 ./configure --without-x --enable-qt5 --disable-debug --enable-optimization --prefix=/mingw64
122 Cross-Compiling on unix with MXE using autotools
123 =================================================
124 1 Install MXE: http://mxe.cc
125 You can either install from sources, the generic .tar binaries or debian .deb packages.
126 Installing the following .deb packages will drag in all needed dependencies:
127 mxe-x86-64-w64-mingw32.shared-file
128 mxe-x86-64-w64-mingw32.shared-gcc
129 mxe-x86-64-w64-mingw32.shared-libiconv
130 mxe-x86-64-w64-mingw32.shared-qtimageformats
131 mxe-x86-64-w64-mingw32.shared-qtsvg
132 mxe-x86-64-w64-mingw32.shared-qtwinextras
133 Of course you can also use the static and/or 32bit versions.
134 2 Run the standard autotools install (Adapt paths and arguments accordingly)
138 PATH="/usr/lib/mxe/usr/bin:$PATH" ../configure --host=x86-64-w64-mingw32.shared --with-qt-dir=/usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5 --enable-qt5 --with-included-boost --with-included-hunspell --with-included-mythes --disable-debug --enable-optimization --prefix=/mingw64
139 PATH="/usr/lib/mxe/usr/bin:$PATH" make
140 PATH="/usr/lib/mxe/usr/bin:$PATH" DESTDIR=/tmp/lyxinstall make install
141 This uses the paths from the 64bit shared MXE version installed from .deb packages.
142 3 If you want to run the resulting lyx.exe from the build directory using wine,
143 create symlinks for all needed .dlls:
144 cd builddir-mingw/src
145 ln -s /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/bin/*.dll .
146 ln -s /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/bin/*.dll .