1 Compiling LyX 2.2 for Win32 and creating Windows installer
2 ==========================================================
4 It's recommended to compile LyX using Microsoft Visual C++ 2010 and CMake.
5 Pre-compiled packages with dependencies are provided for this environment.
8 Compiling with Microsoft Visual C++
9 ===================================
11 These instructions assume the LyX source code is in C:\LyX\lyx-21
12 You can also use another directory if you prefer.
16 If you don't have Visual C++ 2010 installed, get the free Express edition from
17 http://www.microsoft.com/express/Downloads/
19 (All dependencies are linked against the MSVC 2010 runtime and won't work in
20 combination with MSVC 2008. You'll get crashes and other unexpected issues.)
24 Download the latest Qt for Open Source C++ development on Windows (VS2010)
25 from http://qt-project.org/downloads
29 Install the latest Python 2.x version (not Python 3.x !) from
30 http://www.python.org/download/
34 Install the latest CMake from http://www.cmake.org
40 - Set the source code path to C:\LyX\lyx-21
41 Set the build path to C:\LyX\lyx-21-build
42 Click Configure and set the generator to Visual Studio 10.
44 - Enable LYX_DEPENDENCIES_DOWNLOAD and click Configure.
45 Pre-compiled dependencies will automatically be downloaded.
47 - Set QT_QMAKE_EXECUTABLE to e.g.
48 C:\Qt\qt-everywhere-opensource-src-4.8.4\bin\qmake.exe
51 - Enable the LYX_INSTALL option, set CMAKE_INSTALL_PREFIX to
52 C:\LyX\lyx-21-install and click Configure.
54 - Check the Advanced checkbox.
55 Set GETTEXT_MSGFMT_EXECUTABLE to
56 C:\LyX\lyx-21-build\msvc2010-deps\deps20\gettext-tools\msgfmt.exe,
57 and do the same for the other gettext tools.
63 A Microsoft Visual C++ solution should have been generated at
64 C:\LyX\lyx-21-build\lyx.sln
65 Compile the INSTALL project to get a LyX installation in
71 - C:\LyX\lyx-21-build\msvc2010-deps\deps20\bin
72 - C:\LyX\lyx-21-build\msvc2010-deps\deps20\imagemagick
73 - C:\LyX\lyx-21-build\msvc2010-deps\deps20\python
74 - C:\LyX\lyx-21-build\msvc2010-deps\deps20\ghostscript
75 - C:\LyX\lyx-21-build\msvc2010-deps\deps20\Resources
76 to C:\LyX\lyx-21-install
78 And copy from the Qt bin directory
82 QtCore4d.dll (if compiling Debug version)
83 QtGui4d.dll (if compiling Debug version)
84 to C:\LyX\lyx-21-install\bin
88 Add the following line to C:\LyX\lyx-21-install\Resources\lyxrc.dist,
89 so LyX will find the bundled tools such as Python, ImageMagick
92 \path_prefix "$LyXDir\bin;$LyXDir\python;$LyXDir\imagemagick;$LyXDir\ghostscript"
94 You may also add the location of your LaTeX installation if it's not on the
95 system PATH, and the location of JabRef.
99 C:\LyX\lyx-21-install\bin\lyx.exe
102 Creating the Installer
103 ======================
105 - Get NSIS from http://nsis.sourceforge.net
106 - In the LyX source directory, go to development\Win32\packaging\installer
107 - Copy the 3 dll-files from there to the DLL folder of the NSIS installation
108 - Check whether the file locations/paths in settings.nsh match your setup.
109 - Right-click on lyx.nsi and click "Compile NSIS Script".
112 Compiling with GCC with MinGW64 + MSYS2 Environment using autotools
113 ===================================================================
114 1 Install MSYS2, MINGW64, Qt5+
115 https://wiki.qt.io/MSYS2
116 2 Install bc (Bench calculater), which autotools uses for some reason to compile LyX
118 3 Run the standard autotools install (Adapt paths and arguments accordingly)
120 ./configure --without-x --enable-qt5 --disable-debug --enable-optimization --prefix=/mingw64
125 Cross-Compiling on unix with MXE using autotools
126 =================================================
127 1 Install MXE: http://mxe.cc
128 You can either install from sources, the generic .tar binaries or debian .deb packages.
129 Installing the following .deb packages will drag in all needed dependencies:
130 mxe-x86-64-w64-mingw32.shared-file
131 mxe-x86-64-w64-mingw32.shared-gcc
132 mxe-x86-64-w64-mingw32.shared-libiconv
133 mxe-x86-64-w64-mingw32.shared-qtimageformats
134 mxe-x86-64-w64-mingw32.shared-qtsvg
135 mxe-x86-64-w64-mingw32.shared-qtwinextras
136 Of course you can also use the static and/or 32bit versions.
137 2 Run the standard autotools install (Adapt paths and arguments accordingly)
141 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
142 PATH="/usr/lib/mxe/usr/bin:$PATH" make
143 PATH="/usr/lib/mxe/usr/bin:$PATH" DESTDIR=/tmp/lyxinstall make install
144 This uses the paths from the 64bit shared MXE version installed from .deb packages.
145 3 If you want to run the resulting lyx.exe from the build directory using wine,
146 create symlinks for all needed .dlls:
147 cd builddir-mingw/src
148 ln -s /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/bin/*.dll .
149 ln -s /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/bin/*.dll .