Skip to content

Commit

Permalink
Remove a few more unecessary compat macros and fix dep for 0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
musm committed Jan 17, 2017
1 parent 2d61eff commit 0cbd186
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/BinDeps.jl
Expand Up @@ -3,7 +3,7 @@ __precompile__()
module BinDeps

using Compat
using Compat.String
using Compat: String, KERNEL

export @make_run, @build_steps, find_library, download_cmd, unpack_cmd,
Choice, Choices, CCompile, FileDownloader, FileRule,
Expand Down Expand Up @@ -209,7 +209,7 @@ function run(c::Choices)
end
while true
print("Plese select desired method: ")
method = @compat Symbol(chomp(readline(STDIN)))
method = Symbol(chomp(readline(STDIN)))
for x in c.choices
if(method == x.name)
return run(x.step)
Expand Down Expand Up @@ -333,7 +333,7 @@ function lower(s::ChangeDirectory,collection)
end
collection.cwd = s.dir
end
@compat lower(s::Void,collection) = nothing
lower(s::Void,collection) = nothing
lower(s::Function,collection) = push!(collection,s)
lower(s::CreateDirectory,collection) = @dependent_steps ( DirectoryRule(s.dest,()->(mkpath(s.dest))), )
lower(s::RemoveDirectory,collection) = @dependent_steps ( `rm -rf $(s.dest)` )
Expand Down
18 changes: 11 additions & 7 deletions src/dependencies.jl
@@ -1,6 +1,6 @@
# This is the high level interface for building dependencies using the declarative BinDeps Interface
import Base: show
const OSNAME = is_windows() ? :Windows : Compat.KERNEL
const OSNAME = is_windows() ? :Windows : KERNEL

# A dependency provider, if successfully executed will satisfy the dependency
abstract DependencyProvider
Expand All @@ -18,8 +18,8 @@ end
type LibraryDependency
name::AbstractString
context::PackageContext
providers::Vector{@compat Tuple{DependencyProvider,Dict{Symbol,Any}}}
helpers::Vector{@compat Tuple{DependencyHelper,Dict{Symbol,Any}}}
providers::Vector{Tuple{DependencyProvider,Dict{Symbol,Any}}}
helpers::Vector{Tuple{DependencyHelper,Dict{Symbol,Any}}}
properties::Dict{Symbol,Any}
libvalidate::Function
end
Expand Down Expand Up @@ -57,7 +57,7 @@ function _library_dependency(context::PackageContext, name; properties...)
group = v
end
end
r = LibraryDependency(name,context,Array(@compat(Tuple{DependencyProvider,Dict{Symbol,Any}}),0),Array(@compat(Tuple{DependencyHelper,Dict{Symbol,Any}}),0),Dict{Symbol,Any}(properties),validate)
r = LibraryDependency(name,context,Array(Tuple{DependencyProvider,Dict{Symbol,Any}},0),Array(Tuple{DependencyHelper,Dict{Symbol,Any}},0),Dict{Symbol,Any}(properties),validate)
if group !== nothing
push!(group.deps,r)
else
Expand Down Expand Up @@ -288,7 +288,7 @@ provider(::Type{Binaries},uri::URI; opts...) = RemoteBinaries(uri)
provider(::Type{Binaries},path::AbstractString; opts...) = CustomPathBinaries(path)
provider(::Type{SimpleBuild},steps; opts...) = SimpleBuild(steps)
provider{T<:BuildProcess}(::Type{BuildProcess},p::T; opts...) = provider(T,p; opts...)
@compat provider(::Type{BuildProcess},steps::Union{BuildStep,SynchronousStepCollection}; opts...) = provider(SimpleBuild,steps; opts...)
provider(::Type{BuildProcess},steps::Union{BuildStep,SynchronousStepCollection}; opts...) = provider(SimpleBuild,steps; opts...)
provider(::Type{Autotools},a::Autotools; opts...) = a

provides(provider::DependencyProvider,dep::LibraryDependency; opts...) = push!(dep.providers,(provider,Dict{Symbol,Any}(opts)))
Expand Down Expand Up @@ -884,7 +884,11 @@ macro install(_libmaps...)
println(depsfile_buffer)
println(depsfile_buffer, "# Load-hooks")
println(depsfile_buffer, join(load_hooks,"\n"))
depsfile_content = chomp(takebuf_string(depsfile_buffer))
if VERSION < v"0.6.0-dev.1256"
depsfile_content = chomp(takebuf_string(depsfile_buffer))
else
depsfile_content = chomp(String(take!(depsfile_buffer)))
end
if !isfile(depsfile_location) || readchomp(depsfile_location) != depsfile_content
# only overwrite if deps.jl file does not yet exist or content has changed
open(depsfile_location, "w") do depsfile
Expand Down Expand Up @@ -1001,7 +1005,7 @@ macro load_dependencies(args...)
error("Can't deal with argument type $(typeof(arg1)). See usage instructions!")
end
end
s = @compat Symbol(sym)
s = Symbol(sym)
errorcase = Expr(:block)
push!(errorcase.args,:(error("Could not load library "*$(dep.name)*". Try running Pkg.build() to install missing dependencies!")))
push!(ret.args,quote
Expand Down

0 comments on commit 0cbd186

Please sign in to comment.