I do believe that LyX 1.3.6 is looking like a realistic prospect :) What else is planned?

I see that bugzilla comes up with five bugs in the 1.3.x series: http://tinyurl.com/7aghm

(Incidentally, http://bugzilla.lyx.org/buglist.cgi?target_milestone=1.3.6
comes up with only three bugs.)

I've managed to write a script to automate the process of producing a LyX/Win package. I describe below what it does; have I missed anything? (I propose not to package python, perl or a shell environment. Instead I think we should tell people to go and get their own.)

The script uses the MinGW/MinSYS environment and compiler.
It asks whether the Qt and LyX cvs trees are up to date.
    (It's not easy to use TortoiseCVS from the command line.)
It asks whether the Qt library has been compiled.
    (Qt/WinFree must be compiled from a cmd shell, not a
     mingw console.)
It checks that qt-mt3.dll, libiconv-2.dll, mingw10.dll and
     clean_dvi.py exist.
It compiles the dv2dt and dt2dv utilites.
It compiles and installs the Aspell library.
It compiles and installs LyX.
It copies the dv2dt and dt2dv utilites, the .dlls and
     clean_dvi.py to the lyx package.
It modifies the Resources/lyx/configure script to
     ensure that the generated .dvi file is usable.

Finally, it strips the executables and zips the entire contents into a .zip archive (8.8MB). Unzipping it will produce a directory LyX that can be installed as the user chooses.

I've been using this package installed at C:\Program Files\LyX without any problems. Moreover, the mods described above to integrate the clean_dvi.py script mean that I can produce usable .dvi and .ps files. (I could already produce pdf files with pdflatex.)

Are we getting to the stage where we could shove a pre-release on the wiki and ask some hardy souls to try it out?

Angus


#! /bin/sh

# This script aims to do averything necessary to automate the building
# of a LyX/Win package.

# Notes:
# It uses the MinGW/MinSYS environment and compiler.

# It asks whether the Qt and LyX cvs trees are up to date.
# It asks whether the Qt library has been compiled.
# It checks that qt-mt3.dll, libiconv-2.dll, 
#   mingw10.dll and clean_dvi.py exist.
# It compiles the dv2dt and dt2dv utilites.
# It compiles and installs the Aspell library.
# It compiles and installs LyX.
# It copies the dv2dt and dt2dv utilites, the .dlls and
#   clean_dvi.py to the lyx package.
# It modifies the Resources/lyx/configure script to
#   ensure that the generated .dvi file is usable.

# Finally, it strips the executables and zips the
# entire contents into an archive.
# Unzipping it will produce a directory LyX that can
# be installed as the user chooses.

# The script compiles the .dll version of the Qt libraries. Linking of lyx
# against this will, therefore, take "some time".

# It compiles the static version of the Aspell libraries because no
# .dll version exists.

QT_DIR=$HOME/qt3
ASPELL_DIR=$HOME/aspell-0.50.5
LYX_DIR=$HOME/lyx/13x
DTL_DIR=$HOME/dtl
CLEAN_DVI_DIR=$HOME/lyx

ASPELL_INSTALL_DIR="/j/Programs/Aspell-0.50.5"
LYX_INSTALL_DIR="J:/Programs/LyX"

# These are all installed in the final LyX package
QT_DLL="${QT_DIR}/bin/qt-mt3.dll"
LIBICONV_DLL="/j/MinGW/bin/libiconv-2.dll"
MINGW_DLL="/j/MinGW/bin/mingwm10.dll"

DT2DV="$DTL_DIR/dt2dv.exe"
DV2DT="$DTL_DIR/dv2dt.exe"
CLEAN_DVI_PY="$CLEAN_DVI_DIR/clean_dvi.py"

# If everything in this succeeds, then it will
# create this archive. (With a .zip extension)
ARCHIVEBASE="lyx_win32_13x_"`date +%d%b%y`

# Change this to 'mv -f' when you are confident that
# the various sed scripts are working correctly.
MV='mv -i'

for dir in "$QT_DIR" "$ASPELL_DIR" "$LYX_DIR" "$DTL_DIR" "$CLEAN_DVI_DIR"
do
  test -d "$dir" || {
      echo "$dir does not exist" >&2
      exit 1
  }
done

echo "Please ensure that the Qt and LyX cvs trees are up to date"
echo "Press any key to continue"
read ans

echo "Please ensure that the Qt library is compiled and ready to go"
echo "Press any key to continue"
read ans

# Check that the dlls and clean_dvi.py exist
for file in "${QT_DLL}" "${LIBICONV_DLL}" "${MINGW_DLL}" "${CLEAN_DVI_PY}"
do
  test -r "${file}" || {
      echo "$file does not exist" >&2
      exit 1
  }
done

# dt2dv and dv2dt
(
cd "$DTL_DIR" || {
    echo "Unable to cd $DTL_DIR" >&2
    exit 1
}

make || {
    echo "Failed to make $DTL_DIR" >&2
    exit 1
}
)

for file in "${DT2DV}" "${DV2DT}"
do
  test -x "$file" || {
      echo "${file} does not exist or is not executable" >&2
      exit 1
  }
done

# Aspell
(
cd "$ASPELL_DIR" || {
    echo "Unable to cd $ASPELL_DIR" >&2
    exit 1
}

./configure --enable-static --disable-shared --prefix="${ASPELL_INSTALL_DIR}" 
|| {
    echo "Failed to configure $ASPELL_DIR" >&2
    exit 1
}

# We have to clean up two of the generated Makefiles.
TMP=tmp.$$
MAKEFILE=examples/Makefile
sed '
# Replace "CC = gcc" with "CC = g++"
s/^ *\(CC *= *\)gcc *$/\1g++/
# Remove trailing "/" from the -I directory.
[EMAIL PROTECTED] *\(INCLUDES *= *-I\${top_srcdir}/interfaces/cc\)/ [EMAIL 
PROTECTED]@
' "${MAKEFILE}" > "${TMP}"
cmp -s "${MAKEFILE}" "${TMP}" && {
    echo "${MAKEFILE} is unchanged" 2>&1
} || {
    diff -u "${MAKEFILE}" "${TMP}"
    ${MV} "${TMP}" "${MAKEFILE}"
}
rm -f "${TMP}"

MAKEFILE=prog/Makefile
sed '
# Remove trailing "/" from the -I directories.
/^ *INCLUDES *= *-I\${top_srcdir}\/common/{
:loop
$!{
N
/\n *$/!bloop
}
s@/ *\(\\ *\n\)@ [EMAIL PROTECTED]
}' "${MAKEFILE}" > "${TMP}"
cmp -s "${MAKEFILE}" "${TMP}" && {
    echo "${MAKEFILE} is unchanged" 2>&1
} || {
    diff -u "${MAKEFILE}" "${TMP}"
    ${MV} "${TMP}" "${MAKEFILE}"
}
rm -f "${TMP}"

make || {
    echo "Failed to make $ASPELL_DIR" >&2
    exit 1
}

rm -fr "$ASPELL_INSTALL_DIR" || {
    echo "Failed to remove $ASPELL_INSTALL_DIR prior to installing Aspell" >&2
    exit 1
}

make install || {
    echo "Failed to install $ASPELL_DIR" >&2
    exit 1
}
)

# LyX
(
cd "${LYX_DIR}" || {
    echo "Unable to cd ${LYX_DIR}" >&2
    exit 1
}

./autogen.sh || {
    echo "autogen.sh failed" >&2
    exit 1
}

BUILDDIR=build
test ! -d "${BUILDDIR}" && {
    mkdir "${BUILDDIR}" || \
        Error "Unable to create build dir, ${BUILDDIR}."
}

FRONTEND_FLAGS="--with-qt-dir=$QT_DIR"
CONFIGURE="../configure --prefix='${LYX_INSTALL_DIR}' --enable-maintainer-mode 
--without-x  --with-pspell --with-extra-prefix='${ASPELL_INSTALL_DIR}' 
--with-included-gettext --with-frontend=qt --with-qt-dir='$QT_DIR'"

echo "${CONFIGURE}"
cd "${BUILDDIR}"
echo "${PWD}"
eval "${CONFIGURE}" || {
    echo "Failed to configure LyX" >&2
    exit 1
}

make || {
    echo "Failed to make $LYX_DIR" >&2
    exit 1
}

rm -fr "$LYX_INSTALL_DIR" || {
    echo "Failed to remove $LYX_INSTALL_DIR prior to installing LyX" >&2
    exit 1
}

make install || {
    echo "Failed to install $LYX_DIR" >&2
    exit 1
}
)

# Final bit and pieces
# Install the necessary .dlls and clean_dvi.py
for file in "${QT_DLL}" "${LIBICONV_DLL}" "${MINGW_DLL}" "${DT2DV}" "${DV2DT}"
do
  cp "${file}" "$LYX_INSTALL_DIR"/bin/. || {
      echo "Failed to copy ${file} to the LyX package" >&2
      exit 1
  }
done

cp "${CLEAN_DVI_PY}" "$LYX_INSTALL_DIR"/Resources/lyx/scripts/. || {
    echo "Failed to copy ${CLEAN_DVI_PY} to the LyX package" >&2
    exit 1
}

# Modify the configure script,
# * add a dvi2 format
# * change the latex->dvi converter to latex->dvi2
# * add a dvi2->dvi converter
TMP=tmp.$$
CONFIGURE="${LYX_INSTALL_DIR}"/Resources/lyx/configure
sed '
# (Note that this sed script contains TAB characters.)
# Append the dvi2 format after the dvi format.
/^ *\\\\Format[  ]\{1,\}dvi[     ]\{1,\}/a\
\\\\Format dvi2   dvi   DirtyDVI        ""

# Change the latex->dvi converter to latex->dvi2
# and append the dvi2->dvi converter
/^ *\\\\converter[       ]\{1,\}latex[   ]\{1,\}dvi[     ]\{1,\}/{
s/dvi/dvi2/
a\
\\\\converter dvi2 dvi "python \\\$\\\$s/scripts/clean_dvi.py \\\$\\\$i 
\\\$\\\$o" ""
}
' "${CONFIGURE}" > "${TMP}"
unix2dos "${TMP}"
cmp -s "${CONFIGURE}" "${TMP}" || {
    diff -u "${CONFIGURE}" "${TMP}"
    ${MV} "${TMP}" "${CONFIGURE}"
}
rm -f "${TMP}"

# Strip the executables
(
cd "${LYX_INSTALL_DIR}/bin"
for file in *.exe
do
  strip $file
done
)

# zip the installed package ready for shipping.
ARCHIVE="${ARCHIVEBASE}".zip
rm -f "${ARCHIVE}"
(
cd "${LYX_INSTALL_DIR}"/..
DIR=`basename "${LYX_INSTALL_DIR}"`
zip -r -9 "${ARCHIVEBASE}" "${DIR}" || {
    echo "Failed to zip the archive" >&2
    exit 1
}
)
mv -f "${LYX_INSTALL_DIR}/../${ARCHIVE}" .

# The end

Reply via email to