Skip to content

Commit

Permalink
create osx build
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed May 21, 2017
1 parent da34639 commit 3942a6b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
language: julia
os:
- linux
# - osx
- osx
julia:
- release
- nightly
Expand Down
17 changes: 14 additions & 3 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@ oldwdir = pwd()
wdir = dirname(@__FILE__)
date = "2017-05-16"
rsvn = "Reduce-svn4052-src"
rpsl = "redpsl"

if !is_windows()
try
try
process = spawn(`redpsl`)
process = spawn(`$rpsl`)
kill(process)
catch
if is_linux()
cmd = `$(joinpath(wdir,"usr","bin"))/redpsl`
cmd = `$(joinpath(wdir,"usr","bin"))/$rpsl`
elseif is_apple()
cmd = `$(joinpath(wdir,"psl"))/$rpsl`
else
cmd = `$(joinpath(wdir,rsvn,"bin"))/redpsl`
cmd = `$(joinpath(wdir,rsvn,"bin"))/$rpsl`
end
process = spawn(cmd)
kill(process)
Expand All @@ -34,6 +37,14 @@ if !is_windows()
println("Building redpsl ... ")
run(`tar -xvf reduce.tar.gz`)
run(`rm reduce.tar.gz`)
elseif is_apple()
snap = "/Reduce-snapshot"
download(http*date*"/"*snap*"_"*date*".dmg"*dl,joinpath(wdir,"$(snap)_$(date).dmg"))
println("Building redpsl")
run(`hdiutil attach $(wdir)$(snap)_$(date).dmg`)
run(`cp -r /Volumes/$(snap)/psl $(wdir)/psl`)
run(`hdiutil unmount /Volumes/$(snap)`)
run(`rm $(snap)_$(date).dmg`)
else
download(http*date*"/"*rsvn*".tar.gz"*dl,joinpath(wdir,"reduce.tar.gz"))
println("Building redpsl ... ")
Expand Down
9 changes: 6 additions & 3 deletions src/Reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ using Compat; import Compat.String
immutable PSL <: Base.AbstractPipe
input::Pipe; output::Pipe; process::Base.Process
function PSL()
rpsl = "redpsl"
try
# Setup pipes and reduce process
input = Pipe(); output = Pipe()
process = spawn(`redpsl`, (input, output, STDERR))
process = spawn(`$rpsl`, (input, output, STDERR))
# Close the unneeded ends of Pipes
close(input.out); close(output.in)
return new(input, output, process)
catch
# Setup pipes and reduce process
input = Pipe(); output = Pipe()
if is_linux()
cmd = `$(joinpath(dirname(@__FILE__),"..","deps","usr","bin"))/redpsl`
cmd = `$(joinpath(dirname(@__FILE__),"..","deps","usr","bin"))/$rpsl`
elseif is_apple()
cmd = `$(joinpath(dirname(@__FILE__),"..","deps","psl"))/$rpsl`
else
cmd = `$(joinpath(dirname(@__FILE__),"..","Reduce-svn4052-src","bin"))/redpsl`
cmd = `$(joinpath(dirname(@__FILE__),"..","Reduce-svn4052-src","bin"))/$rpsl`
end
process = spawn(cmd, (input, output, STDERR))
# Close the unneeded ends of Pipes
Expand Down

0 comments on commit 3942a6b

Please sign in to comment.