summaryrefslogtreecommitdiff
path: root/scripts/context/stubs/install
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2014-01-24 12:00:17 +0200
committerMarius <mariausol@gmail.com>2014-01-24 12:00:17 +0200
commitd45943afbc4a24ed10f87162b238af07cde73ac5 (patch)
tree5aa69c2b86f3cda7f13d9abca5b9f59421ae1301 /scripts/context/stubs/install
parent3234906ac7cb4eac2077af3dff2b3db452514cd0 (diff)
downloadcontext-d45943afbc4a24ed10f87162b238af07cde73ac5.tar.gz
beta 2014.01.24 10:20
Diffstat (limited to 'scripts/context/stubs/install')
-rw-r--r--scripts/context/stubs/install/first-setup.bat87
-rw-r--r--scripts/context/stubs/install/first-setup.sh120
2 files changed, 207 insertions, 0 deletions
diff --git a/scripts/context/stubs/install/first-setup.bat b/scripts/context/stubs/install/first-setup.bat
new file mode 100644
index 000000000..f06ad0e6b
--- /dev/null
+++ b/scripts/context/stubs/install/first-setup.bat
@@ -0,0 +1,87 @@
+@echo off
+
+setlocal
+
+:fetch
+
+set OWNPATH=%~dp0
+set PATH=%OWNPATH%bin;%PATH%
+set PLATFORM=mswin
+
+set CYGWIN=nontsec
+
+if defined ProgramFiles(x86) (
+ set PLATFORM=win64
+) else (
+ if "%PROCESSOR_ARCHITEW6432%"=="AMD64" set PLATFORM=win64
+)
+
+REM ~ copy /y bin\mtx-update.lua bin\x.lua
+
+if "%PLATFORM%" == "win64" goto update-win64
+
+:update-win32
+
+rsync -av --exclude 'rsync.exe' --exclude 'cygwin1.dll' --exclude 'cygiconv-2.dll' rsync://contextgarden.net/minimals/setup/mswin/bin/ bin
+
+goto update
+
+:update-win64
+
+rsync -av --exclude 'rsync.exe' --exclude 'cygwin1.dll' --exclude 'cygiconv-2.dll' rsync://contextgarden.net/minimals/setup/win64/bin/ bin
+
+goto update
+
+:update
+
+REM ~ copy /y bin\x.lua bin\mtx-update.lua
+
+REM --mingw --nofiledatabase --engine=luatex
+
+mtxrun --script ./bin/mtx-update.lua --update --force --make --engine=all --context=beta --texroot=%OWNPATH%tex %*
+
+echo.
+echo.
+echo When you want to use context, you need to initialize the tree with:
+echo.
+echo %OWNPATH%tex\setuptex.bat %OWNPATH%tex
+echo.
+echo You can associate this command with a shortcut to the cmd prompt.
+echo.
+echo Alternatively you can add %OWNPATH%tex\texmf-%PLATFORM%\bin to your PATH
+echo variable.
+echo.
+echo If you run from an editor you can specify the full path to mtxrun.exe:
+echo.
+echo. %OWNPATH%tex\texmf-%PLATFORM%\bin\mtxrun.exe --autogenerate --script context --autopdf ...
+echo.
+
+:ruby
+
+echo okay > ok.log
+
+ruby -e "File.delete('ok.log')"
+
+if not exist "ok.log" goto end
+
+echo.
+echo The distribution has been downloaded but if you want to run pdfTeX and/or XeTeX you
+echo need to run this script with the following directive:
+echo.
+echo --platform=all
+echo.
+echo You then also need to install Ruby in order to be able to use texexec. After
+echo installing Ruby you can run this script again which will give you the formats
+echo needed, or you can run:
+echo.
+echo texexec --make --pdftex
+echo texexec --make --xetex
+echo.
+
+:okay
+
+del /q ok.log
+
+:end
+
+endlocal
diff --git a/scripts/context/stubs/install/first-setup.sh b/scripts/context/stubs/install/first-setup.sh
new file mode 100644
index 000000000..9249fd2e0
--- /dev/null
+++ b/scripts/context/stubs/install/first-setup.sh
@@ -0,0 +1,120 @@
+#!/bin/sh
+
+# Takes the same arguments as mtx-update
+
+# you may change this if you want ...
+CONTEXTROOT="$PWD/tex"
+
+# suggested by Tobias Florek to check for ruby & rsync
+if [ ! -x "`which rsync`" ]; then
+ echo "You need to install rsync first."
+ exit 1
+fi
+if [ ! -x "`which ruby`" ]; then
+ echo "You might want to install Ruby first if you want to use pdfTeX or XeTeX."
+fi
+
+system=`uname -s`
+cpu=`uname -m`
+
+case "$system" in
+ # linux
+ Linux)
+ case "$cpu" in
+ i*86) platform="linux" ;;
+ x86_64|ia64) platform="linux-64" ;;
+ # a little bit of cheating with ppc64 (won't work on Gentoo)
+ ppc|ppc64) platform="linux-ppc" ;;
+ # we currently support just mipsel, but Debian is lying (reports mips64)
+ # we need more hacks to fix the situation, this is just a temporary solution
+ mips|mips64|mipsel|mips64el) platform="linux-mipsel" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # Mac OS X
+ Darwin)
+ case "$cpu" in
+ i*86) platform="osx-intel" ;;
+ x86_64) platform="osx-64" ;;
+ ppc*|powerpc|power*|Power*) platform="osx-ppc" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # FreeBSD
+ FreeBSD|freebsd)
+ case "$cpu" in
+ i*86) platform="freebsd" ;;
+ x86_64) platform="freebsd" ;; # no special binaries are available yet
+ amd64) platform="freebsd-amd64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # kFreeBSD (debian)
+ GNU/kFreeBSD)
+ case "$cpu" in
+ i*86) platform="kfreebsd-i386" ;;
+ x86_64|amd64) platform="kfreebsd-amd64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # cygwin
+ CYGWIN*)
+ case "$cpu" in
+ i*86) platform="cygwin" ;;
+ x86_64|ia64) platform="cygwin-64" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ # SunOS/Solaris
+ SunOS)
+ case "$cpu" in
+ sparc) platform="solaris-sparc" ;;
+ i86pc) platform="solaris-intel" ;;
+ *) platform="unknown" ;;
+ esac ;;
+ *) platform="unknown"
+esac
+
+# temporary patch for 64-bit Leopard with 32-bit kernel
+if test "$platform" = "osx-intel"; then
+ # if running Snow Leopard or later
+ # better: /usr/bin/sw_vers -productVersion
+ if test `uname -r|cut -f1 -d"."` -ge 10 ; then
+ # if working on 64-bit hardware
+ if test `sysctl -n hw.cpu64bit_capable` = 1; then
+ # snowleopard32=TRUE
+ platform="osx-64"
+ fi
+ fi
+fi
+
+if test "$platform" = "unknown" ; then
+ echo "Error: your system \"$system $cpu\" is not supported yet."
+ echo "Please report to the ConTeXt mailing-list (ntg-context@ntg.nl)"
+ exit
+fi
+
+# if you want to enforce some specific platform
+# (when 'uname' doesn't agree with true architecture), uncomment and modify next line:
+# platform=linux
+
+# download or rsync the latest scripts first
+rsync -rlptv rsync://contextgarden.net/minimals/setup/$platform/bin .
+
+# download or update the distribution
+# you may remove the --context=beta switch if you want to use "current"
+# you can use --engine=luatex if you want just mkiv
+env PATH="$PWD/bin:$CONTEXTROOT/texmf-$platform/bin:$PATH" \
+mtxrun --script ./bin/mtx-update.lua --force --update --make --context=beta --platform=$platform --texroot="$CONTEXTROOT" $@
+
+echo
+echo "When you want to use context, you need to initialize the tree by typing:"
+echo
+echo " . $CONTEXTROOT/setuptex"
+echo
+echo "in your shell or add"
+echo " \"$CONTEXTROOT/texmf-$platform/bin\""
+echo "to PATH variable if you want to set it permanently."
+echo "This can usually be done in .bashrc, .bash_profile"
+echo "(or whatever file is used to initialize your shell)."
+echo
+
+if [ ! -x "`which ruby`" ]; then
+ echo "You might want to install Ruby first if you want to use pdfTeX or XeTeX."
+ echo
+fi