Skip to content

Commit

Permalink
create windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed May 21, 2017
1 parent 109689b commit 57511ad
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
15 changes: 13 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,19 @@ if !is_windows()
end
println("DONE")
end
else
warn("Windows build of redpsl not currently supported.")
else
try
cmd = `\"%programfiles%\\Reduce\\bin\\redpsl.bat\"`
process = spawn(cmd)
kill(process)
catch
cd(wdir)
setup = "Reduce-Setup"
download(http*date*"/"*setup*"_"*date*".exe"*dl,joinpath(wdir,"$(setup)_$(date).exe"))
run(`$(setup)_$(date).exe`)
run(`DEL $(setup)_$(date).exe`)
end
#warn("Windows build of redpsl not currently supported.")
end

cd(oldwdir)
43 changes: 27 additions & 16 deletions src/Reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,39 @@ 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(`$rpsl`, (input, output, STDERR))
# Close the unneeded ends of Pipes
close(input.out); close(output.in)
return new(input, output, process)
catch
if !is_windows()
try
# Setup pipes and reduce process
input = Pipe(); output = Pipe()
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"))/$rpsl`
elseif is_apple()
cmd = `$(joinpath(dirname(@__FILE__),"..","deps","psl"))/$rpsl`
else
cmd = `$(joinpath(dirname(@__FILE__),"..","Reduce-svn4052-src","bin"))/$rpsl`
end
process = spawn(cmd, (input, output, STDERR))
# Close the unneeded ends of Pipes
close(input.out); close(output.in)
return new(input, output, process)
end
else
# Setup pipes and reduce process
input = Pipe(); output = Pipe()
if is_linux()
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"))/$rpsl`
end
cmd = `\"%programfiles%\\Reduce\\bin\\redpsl.bat\"`
process = spawn(cmd, (input, output, STDERR))
# Close the unneeded ends of Pipes
close(input.out); close(output.in)
return new(input, output, process)
end; end; end
end
end; end

Base.kill(rs::PSL) = kill(rs.process)
Base.process_exited(rs::PSL) = process_exited(rs.process)
Expand Down

0 comments on commit 57511ad

Please sign in to comment.