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:
25 # The installee should regenerate them by running configure on his machine.
27 QT_DLL="$HOME/qt3/bin/qt-mt3.dll"
28 LIBICONV_DLL="/j/MinGW/bin/libiconv-2.dll"
29 MINGW_DLL="/j/MinGW/bin/mingwm10.dll"
30 CLEAN_DVI_PY="clean_dvi.py"
32 DT2DV="$DTL_DIR/dt2dv.exe"
33 DV2DT="$DTL_DIR/dv2dt.exe"
35 LYX_INSTALL_DIR="../../../build/installprefix"
37 # Change this to 'mv -f' when you are confident that
38 # the various sed scripts are working correctly.
43 # Install the necessary .dlls and clean_dvi stuff.
44 for file in "${QT_DLL}" "${LIBICONV_DLL}" "${MINGW_DLL}" "${DT2DV}" "${DV2DT}"
46 cp "${file}" "$LYX_INSTALL_DIR"/bin/. || {
47 echo "Failed to copy ${file} to the LyX package" >&2
52 cp "${CLEAN_DVI_PY}" "$LYX_INSTALL_DIR"/Resources/lyx/scripts/. || {
53 echo "Failed to copy ${CLEAN_DVI_PY} to the LyX package" >&2
57 # Strip the executables
59 cd "${LYX_INSTALL_DIR}/bin"
66 # Modify the configure script,
68 # * change the latex->dvi converter to latex->dvi2
69 # * add a dvi2->dvi converter
70 # * fix the generated chkconfig.sed so that it works with versions of
71 # sed that get confused by sed scripts with DOS line endings.
73 CONFIGURE="${LYX_INSTALL_DIR}"/Resources/lyx/configure
74 # Do this to make it easy to compare the before and after files.
75 dos2unix "${CONFIGURE}"
77 # (Note that this sed script contains TAB characters.)
78 # Append the dvi2 format after the dvi format.
79 /^ *\\\\Format[ ]\{1,\}dvi[ ]\{1,\}/a\
80 \\\\Format dvi2 dvi DraftDVI ""
82 # Change the latex->dvi converter to latex->dvi2
83 # and append the dvi2->dvi converter
84 /^ *\\\\converter[ ]\{1,\}latex[ ]\{1,\}dvi[ ]\{1,\}/{
87 \\\\converter dvi2 dvi "python \\\$\\\$s/scripts/clean_dvi.py \\\$\\\$i \\\$\\\$o" ""
89 ' "${CONFIGURE}" > "${TMP}"
90 cmp -s "${CONFIGURE}" "${TMP}" || {
91 diff -u "${CONFIGURE}" "${TMP}"
92 ${MV} "${TMP}" "${CONFIGURE}"
96 # Strip the executables
98 cd "${LYX_INSTALL_DIR}/Resources/lyx"
99 for file in doc/LaTeXConfig.lyx lyxrc.defaults packages.lst textclass.lst
107 windows_packaging || exit 1