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 committed Aug 30, 2015
1 parent e3d2cb7 commit 95ec42e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 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 $(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

29 changes: 29 additions & 0 deletions contrib/windows/cygwin.sh
@@ -0,0 +1,29 @@
#!/bin/sh

mirror=http://mirrors.mit.edu/cygwin
platform=x86
toinstall="mintty cygwin coreutils libintl8 libiconv2"
local_path=./cygwin

# make place to put downloads
mkdir -p $local_path

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

# get and unpack packages
for f in $toinstall
do
# determine the relative URL
url=$(awk "BEGIN {RS = \"@ \"} ; \$1 == \"$f\" { 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 > $local_path/$filename

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

0 comments on commit 95ec42e

Please sign in to comment.