Skip to content

Commit

Permalink
Fix some 0.7 deprecation warnings (#346)
Browse files Browse the repository at this point in the history
* Fix some 0.7 deprecation warnings

* Bump Compat requirement
  • Loading branch information
ararslan authored Jan 10, 2018
1 parent 803ca79 commit 708a180
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
julia 0.6
URIParser
SHA
Compat 0.27.0
Compat 0.44.0
12 changes: 6 additions & 6 deletions src/BinDeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ function find_library(pkg,libname,files)
for filename in files
dl = Libdl.dlopen_e(joinpath(Pkg.dir(),pkg,"deps","usr","lib",filename))
if dl != C_NULL
ccall(:add_library_mapping,Cint,(Ptr{Cchar},Ptr{Void}),libname,dl)
ccall(:add_library_mapping,Cint,(Ptr{Cchar},Ptr{Cvoid}),libname,dl)
return true
end

dl = Libdl.dlopen_e(filename)
if dl != C_NULL
ccall(:add_library_mapping,Cint,(Ptr{Cchar},Ptr{Void}),libname,dl)
ccall(:add_library_mapping,Cint,(Ptr{Cchar},Ptr{Cvoid}),libname,dl)
return true
end
end
Expand Down Expand Up @@ -138,7 +138,7 @@ mutable struct SynchronousStepCollection
SynchronousStepCollection() = new(Any[],"","")
end

import Base.push!, Base.run, Base.(|)
import Base: push!, run, |
push!(a::SynchronousStepCollection,args...) = push!(a.steps,args...)

mutable struct ChangeDirectory <: BuildStep
Expand Down Expand Up @@ -179,7 +179,7 @@ mutable struct MakeTargets <: BuildStep
targets::Vector{String}
env::Dict
MakeTargets(dir,target;env = Dict{AbstractString,AbstractString}()) = new(dir,target,env)
MakeTargets{S<:AbstractString}(target::Vector{S};env = Dict{AbstractString,AbstractString}()) = new("",target,env)
MakeTargets(target::Vector{<:AbstractString};env = Dict{AbstractString,AbstractString}()) = new("",target,env)
MakeTargets(target::String;env = Dict{AbstractString,AbstractString}()) = new("",[target],env)
MakeTargets(;env = Dict{AbstractString,AbstractString}()) = new("",String[],env)
end
Expand Down Expand Up @@ -349,7 +349,7 @@ function lower(s::ChangeDirectory,collection)
end
collection.cwd = s.dir
end
lower(s::Void,collection) = nothing
lower(s::Nothing,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 Expand Up @@ -573,7 +573,7 @@ other platforms, returns `nothing`.
"""
function glibc_version()
Compat.Sys.islinux() || return
libc = ccall(:jl_dlopen, Ptr{Void}, (Ptr{Void}, UInt32), C_NULL, 0)
libc = ccall(:jl_dlopen, Ptr{Cvoid}, (Ptr{Cvoid}, UInt32), C_NULL, 0)
ptr = Libdl.dlsym_e(libc, :gnu_get_libc_version)
ptr == C_NULL && return # non-glibc
v = unsafe_string(ccall(ptr, Ptr{UInt8}, ()))
Expand Down
14 changes: 7 additions & 7 deletions src/dependencies.jl
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function reread_sonames()
have_sonames[] = false
nothing
else
ccall(:jl_read_sonames, Void, ())
ccall(:jl_read_sonames, Cvoid, ())
end
end

Expand Down Expand Up @@ -612,10 +612,10 @@ function generate_steps(dep::LibraryDependency, h::Autotools, provider_opts)
opts[:srcdir] = joinpath(opts[:srcdir],opts[:configure_subdir])
delete!(opts, :configure_subdir)
end
unshift!(opts[:include_dirs],includedir(dep))
unshift!(opts[:lib_dirs],libdir(dep))
unshift!(opts[:rpath_dirs],libdir(dep))
unshift!(opts[:pkg_config_dirs],joinpath(libdir(dep),"pkgconfig"))
pushfront!(opts[:include_dirs],includedir(dep))
pushfront!(opts[:lib_dirs],libdir(dep))
pushfront!(opts[:rpath_dirs],libdir(dep))
pushfront!(opts[:pkg_config_dirs],joinpath(libdir(dep),"pkgconfig"))
env = Dict{String,String}()
env["PKG_CONFIG_PATH"] = join(opts[:pkg_config_dirs],":")
delete!(opts,:pkg_config_dirs)
Expand Down Expand Up @@ -649,7 +649,7 @@ function _find_library(dep::LibraryDependency; provider = Any)

# Allow user to override installation path
if haskey(opts,:installed_libpath) && isdir(opts[:installed_libpath])
unshift!(paths,opts[:installed_libpath])
pushfront!(paths,opts[:installed_libpath])
end

ppaths = libdir(p,dep)
Expand Down Expand Up @@ -711,7 +711,7 @@ end

function check_path!(ret, dep, opath)
flags = Libdl.RTLD_LAZY
handle = ccall(:jl_dlopen, Ptr{Void}, (Cstring, Cuint), opath, flags)
handle = ccall(:jl_dlopen, Ptr{Cvoid}, (Cstring, Cuint), opath, flags)
try
check_system_handle!(ret, dep, handle)
finally
Expand Down
6 changes: 1 addition & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using Compat
using Compat.Test, Compat.Unicode
using BinDeps
if VERSION < v"0.7.0-DEV.2004"
using Base.Test
else
using Test
end

Pkg.build("Cairo") # Tests apt-get code paths
using Cairo
Expand Down

0 comments on commit 708a180

Please sign in to comment.