3 # This script aims to do averything necessary to automate the packaging
4 # of LyX/Win ready for an Windows Installer to be built.
6 # It copies these files into the appropriate places in the LyX tree.
14 # It strips the executables.
16 # It adds formats and converters to the Resources/lyx/configure script to
17 # ensure that the generated .dvi file is usable.
19 # It removes all stuff generated by running configure:
26 # The installee should regenerate them by running configure on his machine.
28 QT_DLL="$HOME/qt3/bin/qt-mt3.dll"
29 LIBICONV_DLL="/j/MinGW/bin/libiconv-2.dll"
30 MINGW_DLL="/j/MinGW/bin/mingwm10.dll"
31 CLEAN_DVI_PY="clean_dvi.py"
33 DT2DV="$DTL_DIR/dt2dv.exe"
34 DV2DT="$DTL_DIR/dv2dt.exe"
36 LYX_INSTALL_DIR="../../../build/installprefix"
38 # Change this to 'mv -f' when you are confident that
39 # the various sed scripts are working correctly.
44 # Install the necessary .dlls and clean_dvi stuff.
45 for file in "${QT_DLL}" "${LIBICONV_DLL}" "${MINGW_DLL}" "${DT2DV}" "${DV2DT}"
47 cp "${file}" "$LYX_INSTALL_DIR"/bin/. || {
48 echo "Failed to copy ${file} to the LyX package" >&2
53 cp "${CLEAN_DVI_PY}" "$LYX_INSTALL_DIR"/Resources/lyx/scripts/. || {
54 echo "Failed to copy ${CLEAN_DVI_PY} to the LyX package" >&2
58 # Strip the executables
60 cd "${LYX_INSTALL_DIR}/bin"
67 # Modify the configure script,
69 # * change the latex->dvi converter to latex->dvi2
70 # * add a dvi2->dvi converter
71 # * fix the generated chkconfig.sed so that it works with versions of
72 # sed that get confused by sed scripts with DOS line endings.
74 CONFIGURE="${LYX_INSTALL_DIR}"/Resources/lyx/configure
75 # Do this to make it easy to compare the before and after files.
76 dos2unix "${CONFIGURE}"
78 # (Note that this sed script contains TAB characters.)
79 # Append the dvi2 format after the dvi format.
80 /^ *\\\\Format[ ]\{1,\}dvi[ ]\{1,\}/a\
81 \\\\Format dvi2 dvi DraftDVI ""
83 # Change the latex->dvi converter to latex->dvi2
84 # and append the dvi2->dvi converter
85 /^ *\\\\converter[ ]\{1,\}latex[ ]\{1,\}dvi[ ]\{1,\}/{
88 \\\\converter dvi2 dvi "python \\\$\\\$s/scripts/clean_dvi.py \\\$\\\$i \\\$\\\$o" ""
90 ' "${CONFIGURE}" > "${TMP}"
91 cmp -s "${CONFIGURE}" "${TMP}" || {
92 diff -u "${CONFIGURE}" "${TMP}"
93 ${MV} "${TMP}" "${CONFIGURE}"
97 # Strip the executables
99 cd "${LYX_INSTALL_DIR}/Resources/lyx"
101 for file in doc/LaTeXConfig.lyx lyxrc.defaults packages.lst textclass.lst
109 windows_packaging || exit 1