Edit Links |
LyX /
LyX on CygwinCategories: Cygwin << | Page list | >>This page describes how to use LyX under Cygwin on Windows by building Qt/Win and LyX from source using Cygwin tools. If you don't want or need to compile LyX yourself, you can download LyX-2.0.3-cygwin.tar.gz from the binary distribution site, un-tar it (using the cygwin tar, not native tools), and follow the instructions. Note that official Cygwin packages for the various Qt4 libraries are now available in the Cygwin distribution for the X11 backend, so, if you want a Qt4/X11 version, you can simply install one or more of those. Instead, if you want a cygwin version of Qt4 but using the native Windows graphics backend, you can continue reading. Building Qt and LyXPlease note that the procedure outlined here applies to Qt 4.7.4 only. It cannot be used with a different version, unless you adapt the provided patches. Also note that this Qt port has only been tested with LyX and further patches may be needed when using configuration switches different from the ones reported here. Cygwin packagesWe need quite a slew of tools to build Qt and LyX. Be sure to install at least the cygwin packages listed below. Due to a dependency mechanism, all other tools not listed here should also be marked for installation (I hope I forgot nothing).
Instead of using the setup program, if you've installed wget you can install everything from the command line using the apt-cyg script:
Qt4 Open Source EditionGrab the Qt sources qt-everywhere-opensource-src-4.7.4.tar.gz and unpack the archive somewhere, eg. in /usr/local/src cd /usr/local/src tar zxvf /path/to/qt-everywhere-opensource-src-4.7.4.tar.gz Now rename the newly created directory mv qt-everywhere-opensource-src-4.7.4 qtwin-4.7.4 This step is not strictly necessary, but we will be building only for Windows
and in the following instructions it is assumed that the Qt sources are located
in a directory called qtwin-4.7.4 in /usr/local/src. If you unpacked the
sources somewhere else, simply replace In order to build Qt for cygwin, simply follow the next procedure.
Note: using the above command line, Qt will be installed in /usr/local/qt/4.7.4.
Change this path if you want to install it somewhere else.
Note: if you have installed one of the Qt4 devel packages from the Cygwin
distribution, you have to create the following symlinks (change
/usr/local/qt/4.7.4 to match the actual directory where you installed Qt):
ln -s moc.exe /usr/local/qt/4.7.4/bin/moc-qt4 ln -s uic.exe /usr/local/qt/4.7.4/bin/uic-qt4 otherwise, when configuring for LyX, the wrong moc and uic compilers will be
picked.
You can now move to building LyX. LyX
Note! There seems to be some bugs in the script lyxconfig-cygwin. Line 78: Invalid argument send to linker. Should be '-Wl,-s' Line 88: Prematurely running 'chmod u+x' on 'configure' Here is a patch that corrects the bugs so configure can complete.
--- lyxconfig-cygwin-orig 2012-05-11 21:44:11.000000000 +0200
+++ lyxconfig-cygwin 2012-05-11 23:20:56.000000000 +0200
@@ -75,7 +75,7 @@
LDFLAGS="-shared-libgcc -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import"
test "$BUILDTYPE" = "release" && {
OPTFLAG=""
- LDFLAGS="$LDFLAGS -Wl,s"
+ LDFLAGS="$LDFLAGS -Wl,-s"
ASSERTIONS="--disable-assertions"
WARNINGS="--disable-warnings"
} || {
@@ -85,11 +85,11 @@
}
CONFIGURE="../configure"
-chmod u+x ${SRCDIR}/configure
sed -e 's/gl_have_weak=yes/gl_have_weak=no/' \
"${SRCDIR}/configure" > "${SRCDIR}/configure-cygwin"
touch -r "${SRCDIR}/configure" "${SRCDIR}/configure-cygwin"
mv -f "${SRCDIR}/configure-cygwin" "${SRCDIR}/configure"
+chmod u+x ${SRCDIR}/configure
# Set up configure itself
#========================
Usage: Copy the framed (blue) area above to a text file in your favorit text-editor and save the file as 'lyxconfig-cygwin.patch' in the the same directory as you downloaded lyxconfig-cygwin. Make sure your file is saved with unix line-endings and add a newline at the end of the file as 'patch' otherwise complains. Then run: patch < lyxconfig-cygwin.patch before proceeding to the next step. -- Henrik Jensen 2012-05-11. PS. This note should probably be removed when lyxconfig-cygwin is fixed. PPS. The version of the buggy script has md5 checksum: b425072b64092422728c0846009fedc1 Check with:
If you installed Qt4 somewhere else than /usr/local/qt/4.7.4, then give the
directory where you actually installed it as second parameter
/path/to/lyxconfig-cygwin lyx-2.0.X --qtdir=<qt4dir>
Reverse DVI/PDF searchThe reverse search feature (also called inverse search) allows the cursor in LyX to automatically jump to the point corresponding to a given position in the DVI or PDF file being previewed. When a reverse search is started (xdvi uses ctrl-click, whereas yap and SumatraPDF use double click), the viewer calls an external program or script with two arguments, a filename and a line number. The called program should pass this info to a running instance of LyX. This can be done through the LyX server either by using a named pipe (lyxpipe), or the unix domain socket (lyxsocket) that lyx creates in its temporary directory (this is the way the lyxclient program communicates with LyX). The reverse search feature can be enabled in LyX as follows:
If you did no mistakes, and if src-specials are activated as previously described, whenever you ctrl-click in xdvi, or double click in yap or SumatraPDF, the cursor in LyX should jump to the desired location. Forward DVI/PDF searchThe forward search feature allows you to let a dvi/pdf viewer jump (near) to a
position corresponding to the cursor position in LyX. Forward search is enabled
in the same way as reverse search is (see the previous section) but you also
need to specify in the preferences a proper command for the used viewer.
If you use one of the already supported viewers, you can do this by selecting
one of the predefined commands in After positioning the cursor in LyX, a forward search is initiated by either
the Contributors
History
|