Skip to content

Commit

Permalink
Add cygwin mintty to windows binary distribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
twadleigh authored and Tracy Wadleigh committed Aug 31, 2015
1 parent e3d2cb7 commit 05ad5ab
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
10 changes: 8 additions & 2 deletions Makefile
Expand Up @@ -419,13 +419,16 @@ endif

ifeq ($(OS), WINNT)
[ ! -d dist-extras ] || ( cd dist-extras && \
cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll libgfortran-3.dll libquadmath-0.dll libstdc++-6.dll libgcc_s_s*-1.dll libssp-0.dll $(bindir) && \
cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll libgfortran-3.dll libquadmath-0.dll libstdc++-6.dll libgcc_s_s*-1.dll libssp-0.dll $(bindir) && \
mkdir $(DESTDIR)$(prefix)/Git && \
7z x PortableGit.7z -o"$(DESTDIR)$(prefix)/Git" && \
echo "[core] eol = lf" >> "$(DESTDIR)$(prefix)/Git/etc/gitconfig" && \
sed -i "s/\bautocrlf = true$$/autocrlf = input/" "$(DESTDIR)$(prefix)/Git/etc/gitconfig" && \
cp busybox.exe $(DESTDIR)$(prefix)/Git/bin/echo.exe && \
cp busybox.exe $(DESTDIR)$(prefix)/Git/bin/printf.exe )
cp busybox.exe $(DESTDIR)$(prefix)/Git/bin/printf.exe && \
mkdir -p $(DESTDIR)$(prefix)/mintty/usr/bin && \
cd cygwin/usr/bin && \
cp mintty.exe stty.exe env.exe cygwin-console-helper.exe cygwin1.dll cygintl-8.dll cygiconv-2.dll cyggcc_s-1.dll $(DESTDIR)$(prefix)/mintty/usr/bin/ )
cd $(DESTDIR)$(bindir) && rm -f llvm* llc.exe lli.exe opt.exe LTO.dll bugpoint.exe macho-dump.exe

# create file listing for uninstall. note: must have Windows path separators and line endings.
Expand Down Expand Up @@ -569,3 +572,6 @@ endif
chmod a+x ./nsis/makensis.exe && \
chmod a+x busybox.exe && \
$(JLDOWNLOAD) PortableGit.7z https://github.com/msysgit/msysgit/releases/download/Git-1.9.5-preview20141217/PortableGit-1.9.5-preview20141217.7z
cd dist-extras && \
../contrib/windows/cygwin.sh

6 changes: 3 additions & 3 deletions contrib/windows/build-installer.nsi
Expand Up @@ -29,7 +29,7 @@ FunctionEnd
Function createDesktopLink
${NSD_GetState} $Checkbox $0
${If} $0 <> 0
CreateShortCut "$DESKTOP\julia.lnk" "$INSTDIR\bin\julia.exe"
CreateShortcut "$DESKTOP\julia.lnk" "$INSTDIR\mintty\usr\bin\env.exe" "HOME=%HOMEDRIVE%%HOMEPATH% $INSTDIR\mintty\usr\bin\mintty.exe -h always -i $INSTDIR\bin\julia.exe $INSTDIR\bin\julia.exe" "$INSTDIR\bin\julia.exe" 0 SW_SHOWNORMAL CTRL|ALT|J "The Julia REPL"
${EndIf}
FunctionEnd

Expand Down Expand Up @@ -69,7 +69,7 @@ Section "Dummy Section" SecDummy
SetOutPath $INSTDIR
File /a /r "julia-${Commit}\*"
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateShortcut "$INSTDIR\julia.lnk" "$INSTDIR\bin\julia.exe"
CreateShortcut "$INSTDIR\julia.lnk" "$INSTDIR\mintty\usr\bin\env.exe" "HOME=%HOMEDRIVE%%HOMEPATH% $INSTDIR\mintty\usr\bin\mintty.exe -h always -i $INSTDIR\bin\julia.exe $INSTDIR\bin\julia.exe" "$INSTDIR\bin\julia.exe" 0 SW_SHOWNORMAL CTRL|ALT|J "The Julia REPL"

# ARP entries
WriteRegStr HKCU "${ARP}" \
Expand Down Expand Up @@ -148,7 +148,7 @@ SectionEnd
# Helper function to create Start Menu folder and shortcuts
Function AddToStartMenu
CreateDirectory "$SMPROGRAMS\${JuliaStartMenuFolder}"
CreateShortcut "$SMPROGRAMS\${JuliaStartMenuFolder}\julia.lnk" "$INSTDIR\julia.lnk" "" "" "" "" "" "The Julia Language"
CreateShortcut "$SMPROGRAMS\${JuliaStartMenuFolder}\julia.lnk" "$INSTDIR\mintty\usr\bin\env.exe" "HOME=%HOMEDRIVE%%HOMEPATH% $INSTDIR\mintty\usr\bin\mintty.exe -h always -i $INSTDIR\bin\julia.exe $INSTDIR\bin\julia.exe" "$INSTDIR\bin\julia.exe" 0 SW_SHOWNORMAL CTRL|ALT|J "The Julia REPL"
CreateShortcut "$SMPROGRAMS\${JuliaStartMenuFolder}\Uninstall.lnk" "$instdir\Uninstall.exe"
FunctionEnd

Expand Down
33 changes: 33 additions & 0 deletions contrib/windows/cygwin.sh
@@ -0,0 +1,33 @@
#!/bin/bash
# This file is a part of Julia. License is MIT: http://julialang.org/license

set -e
mirror=http://mirrors.mit.edu/cygwin
platform=x86
packages="mintty cygwin coreutils libintl8 libiconv2 libgcc1"
local_path=./cygwin

# make place to put downloads
mkdir -p $local_path

# get setup.ini
curl $mirror/$platform/setup.bz2 -o $local_path/setup.ini.bz2
bunzip2 -f $local_path/setup.ini.bz2

# get and unpack packages
for package in $packages
do
# determine the relative URL
url=$(awk "BEGIN {RS = \"@ \"} ; \$1 == \"$package\" { print \$0 }" \
$local_path/setup.ini | awk '$1 == "install:" { print $2 }' - | \
head -1)

# determine the local filename
filename=${url##*/}

# download the file
curl $mirror/$url -o $local_path/$filename

# unpack it
tar xf $local_path/$filename --directory $local_path
done

0 comments on commit 05ad5ab

Please sign in to comment.