view installer-files/post-install.bat @ 5531:eae508c12529

Add build rule for build-octave (bug #49503). * src/build-octave.mk: Add new build rule for build-octave which can be used for cross-building binary packages that depend on Octave as a build tool. * dist-files.mk: Add new file to list. * index.html: Add new package to list. * src/of-communications.mk, src/of-image.mk, src/of-mapping.mk, src/of-optiminterp.mk, src/of-sparsersb.mk, src/of-statistics.mk, src/of-windows.mk: Add optional dependency on build-octave. * configure.ac: Add new configure switch "--disable-system-octave" that is needed to build the build-octave package. * Makefile.in: Add variable "USE_SYSTEM_OCTAVE". Exclude build-octave from the default build tools and build it only if a package explicitly depends on it. Display warning about missing native Octave version only if necessary.
author Markus Mützel <markus.muetzel@gmx.de>
date Tue, 08 Sep 2020 23:04:38 +0200
parents 9057112edb8e
children 74d9b433846a
line wrap: on
line source

@echo off
Rem   Run on initial install /update
set ROOT_DIR=%~dp0
Rem Convert to 8.3 format so we don't have to worry about spaces.
for %%I in ("%ROOT_DIR%") do set ROOT_DIR=%%~sI

set MSYSDIR=%ROOT_DIR%
set MSYSTEM=MSYS

if NOT EXIST %ROOT_DIR%\bin\msys-1.0.dll set MSYSDIR=%ROOT_DIR%\usr
if EXIST %ROOT_DIR%\mingw32\bin\octave.bat set MSYSTEM=MINGW32
if EXIST %ROOT_DIR%\mingw64\bin\octave.bat set MSYSTEM=MINGW64

if %MSYSTEM%==MSYS (
 set OCTAVE_HOME=%ROOT_DIR%
) else (
 if %MSYSTEM%==MINGW32 (
 set OCTAVE_HOME=%ROOT_DIR%mingw32
) else (
 set OCTAVE_HOME=%ROOT_DIR%mingw64
))

Rem QT subdir path
IF EXIST "%OCTAVE_HOME%\qt5" (
  set QT_SUBDIR=qt5/
) ELSE (
  set QT_SUBDIR=
)

Rem Create qt.conf
set QT_CONF=%OCTAVE_HOME%\bin\qt.conf
echo [Paths] > %QT_CONF%
echo Prefix=%OCTAVE_HOME:\=/% >> %QT_CONF%
echo Documentation=%QT_SUBDIR%doc >> %QT_CONF%
echo Headers=%QT_SUBDIR%include >> %QT_CONF%
echo Libraries=%QT_SUBDIR%libs >> %QT_CONF%
echo Plugins=%QT_SUBDIR%plugins >> %QT_CONF%
echo Translations=%QT_SUBDIR%translations >> %QT_CONF%

Rem run bash to to regitser the initial envorinment
echo "Setting up MSYS system ..."
"%MSYSDIR%\bin\bash.exe" --login -c echo
echo "Updating fc-cache (may take a while) ..."
"%OCTAVE_HOME%\bin\fc-cache.exe" -v
echo "Updating octave packages ..."
"%OCTAVE_HOME%\bin\octave.bat" --no-gui -W -H -f -q --eval "if version()(1) < '6', pkg rebuild, end"