Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Add cygwin mintty to windows binary distribution. #12879

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions LICENSE.md
Expand Up @@ -87,3 +87,5 @@ Julia bundles the following external programs and libraries on some platforms:
- [GIT](http://git-scm.com/about/free-and-open-source)
- [ZLIB](http://zlib.net/zlib_license.html)
- [LIBEXPAT](http://expat.cvs.sourceforge.net/viewvc/expat/expat/README)
- [CYGWIN](https://cygwin.com/licensing.html)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also link to https://github.com/mintty/mintty/blob/master/LICENSE since it's somewhat separate

- [MINTTY](https://github.com/mintty/mintty/blob/master/LICENSE)
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)/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)/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\usr\bin\env.exe" "HOME=%HOMEDRIVE%%HOMEPATH% $INSTDIR\usr\bin\mintty.exe -h error -i $INSTDIR\bin\julia.exe $INSTDIR\bin\julia.exe" "$INSTDIR\bin\julia.exe" 0 SW_SHOWNORMAL "" "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\usr\bin\env.exe" "HOME=%HOMEDRIVE%%HOMEPATH% $INSTDIR\usr\bin\mintty.exe -h error -i $INSTDIR\bin\julia.exe $INSTDIR\bin\julia.exe" "$INSTDIR\bin\julia.exe" 0 SW_SHOWNORMAL "" "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\usr\bin\env.exe" "HOME=%HOMEDRIVE%%HOMEPATH% $INSTDIR\usr\bin\mintty.exe -h error -i $INSTDIR\bin\julia.exe $INSTDIR\bin\julia.exe" "$INSTDIR\bin\julia.exe" 0 SW_SHOWNORMAL "" "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##*/}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a bashism, so #!/bin/bash would be a more honest shebang. A set -e early on would also be a good idea.


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

# unpack it
tar xf $local_path/$filename --directory $local_path
done
2 changes: 1 addition & 1 deletion contrib/windows/juliarc.jl
@@ -1,6 +1,6 @@
# This file is a part of Julia. License is MIT: http://julialang.org/license

let user_data_dir
ENV["PATH"] = JULIA_HOME*";"*joinpath(JULIA_HOME,"..","Git","bin")*";"*ENV["PATH"]
ENV["PATH"] = JULIA_HOME*";"*joinpath(JULIA_HOME,"..","Git","bin")*";"*ENV["PATH"]*";"*joinpath(JULIA_HOME,"..","usr","bin")
#haskey(ENV,"JULIA_EDITOR") || (ENV["JULIA_EDITOR"] = "start") #start is not a program, so this doesn't work
end