Skip to content

Commit 66a2e65

Browse files
authored
Using the libraries built by binary builders (#75)
* Using the libraries built by binary builders Requires: Julia 1.3 * Dropping 32-bit suport * Revert "Dropping 32-bit suport" This reverts commit b2d5f94. * Revert "Using the libraries built by binary builders" This reverts commit 2310320. * Ensuring 1.0 support is kept intact as well.
1 parent d8111c7 commit 66a2e65

File tree

5 files changed

+78
-66
lines changed

5 files changed

+78
-66
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: julia
22

33
julia:
44
- 1.0
5-
- 1.2
5+
- 1.3
66
- nightly
77

88
os:

appveyor.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
environment:
22
matrix:
33
- julia_version: 1.0
4-
- julia_version: 1.2
4+
- julia_version: 1.3
55
- julia_version: nightly
66

77
platform:
88
- x86 # 32-bit
99
- x64 # 64-bit
1010

11-
# # Uncomment the following lines to allow failures on nightly julia
12-
# # (tests will run but not make your overall status red)
13-
# matrix:
14-
# allow_failures:
15-
# - julia_version: latest
11+
# Uncomment the following lines to allow failures on nightly julia
12+
# (tests will run but not make your overall status red)
13+
matrix:
14+
allow_failures:
15+
- julia_version: nightly
1616

1717
branches:
1818
only:

deps/build.jl

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,78 @@
11
using BinDeps
2+
3+
@static if Base.VERSION < v"1.3-" || (Sys.iswindows() && Sys.WORD_SIZE == 32)
4+
@BinDeps.setup()
25

3-
@BinDeps.setup()
4-
5-
using Libdl
6+
using Libdl
67

7-
function validate_libz_version(name, handle)
8-
f = Libdl.dlsym_e(handle, "zlibVersion")
9-
f == C_NULL && return false
10-
ver = VersionNumber(unsafe_string(ccall(f, Cstring, ())))
11-
println("Version Libz is: $ver")
12-
# Version 1.2.8 or above
13-
return ver >= v"1.2.8"
14-
end
8+
function validate_libz_version(name, handle)
9+
f = Libdl.dlsym_e(handle, "zlibVersion")
10+
f == C_NULL && return false
11+
ver = VersionNumber(unsafe_string(ccall(f, Cstring, ())))
12+
println("Version Libz is: $ver")
13+
# Version 1.2.8 or above
14+
return ver >= v"1.2.8"
15+
end
1516

16-
function validate_openssl_version(name, handle)
17-
f = Libdl.dlsym_e(handle, "OpenSSL_version_num")
18-
f == C_NULL && return false
19-
v = ccall(f, Culong, ())
20-
println("Version OpenSSL is: $(string(v, base=16))")
21-
# Version 1.1.0 or above
22-
return v >= 0x1010000f
23-
end
17+
function validate_openssl_version(name, handle)
18+
f = Libdl.dlsym_e(handle, "OpenSSL_version_num")
19+
f == C_NULL && return false
20+
v = ccall(f, Culong, ())
21+
println("Version OpenSSL is: $(string(v, base=16))")
22+
# Version 1.1.0 or above
23+
return v >= 0x1010000f
24+
end
2425

25-
libz = library_dependency("libz", aliases=["libz", "libzlib", "zlib1"], validate=validate_libz_version)
26-
libcrypto = library_dependency("libcrypto", aliases=["libcrypto", "libcrypto-1_1-x64", "libcrypto-1_1"], validate=validate_openssl_version)
26+
libz = library_dependency("libz", aliases=["libz", "libzlib", "zlib1"], validate=validate_libz_version)
27+
libcrypto = library_dependency("libcrypto", aliases=["libcrypto", "libcrypto-1_1-x64", "libcrypto-1_1"], validate=validate_openssl_version)
2728

28-
prefix = joinpath(@__DIR__, "usr")
29+
prefix = joinpath(@__DIR__, "usr")
2930

30-
if !Sys.iswindows()
31-
provides(Sources,
32-
URI("https://github.com/madler/zlib/archive/v1.2.11.tar.gz"),
33-
libz, unpacked_dir="zlib-1.2.11")
34-
provides(SimpleBuild,
35-
(@build_steps begin
36-
GetSources(libz)
37-
@build_steps begin
38-
ChangeDirectory(joinpath(BinDeps.depsdir(libz), "src", "zlib-1.2.11"))
31+
if !Sys.iswindows()
32+
provides(Sources,
33+
URI("https://github.com/madler/zlib/archive/v1.2.11.tar.gz"),
34+
libz, unpacked_dir="zlib-1.2.11")
35+
provides(SimpleBuild,
36+
(@build_steps begin
37+
GetSources(libz)
38+
@build_steps begin
39+
ChangeDirectory(joinpath(BinDeps.depsdir(libz), "src", "zlib-1.2.11"))
3940
`./configure --prefix=$prefix`
4041
`make`
4142
`make install`
4243
end
4344
end), libz, os = :Unix)
4445

45-
osslver = "1_1_0k"
46-
osslfn = "OpenSSL_$(osslver)"
47-
ossldir = "openssl-$(osslfn)"
48-
osslpkg = "$(osslfn).tar.gz"
46+
osslver = "1_1_0k"
47+
osslfn = "OpenSSL_$(osslver)"
48+
ossldir = "openssl-$(osslfn)"
49+
osslpkg = "$(osslfn).tar.gz"
4950

50-
provides(Sources,
51-
URI("https://github.com/openssl/openssl/archive/$(osslpkg)"),
52-
libcrypto, unpacked_dir="$(ossldir)")
53-
provides(SimpleBuild,
54-
(@build_steps begin
55-
GetSources(libcrypto)
56-
@build_steps begin
51+
provides(Sources,
52+
URI("https://github.com/openssl/openssl/archive/$(osslpkg)"),
53+
libcrypto, unpacked_dir="$(ossldir)")
54+
provides(SimpleBuild,
55+
(@build_steps begin
56+
GetSources(libcrypto)
57+
@build_steps begin
5758
ChangeDirectory(joinpath(BinDeps.depsdir(libcrypto), "src", "$(ossldir)"))
5859
`./config --prefix=$prefix`
5960
`make depend`
6061
`make install`
6162
end
6263
end), libcrypto, os = :Unix)
6364

64-
else
65-
zlib_bn = "zlib-1.2.11-win$(Sys.WORD_SIZE)-mingw"
66-
zlib_fn = "$(zlib_bn).zip"
67-
zlib_uri = "https://bintray.com/vszakats/generic/download_file?file_path=$(zlib_fn)"
68-
provides(Binaries, URI(zlib_uri), libz, filename="$(zlib_fn)", unpacked_dir="$(zlib_bn)")
65+
else
66+
zlib_bn = "zlib-1.2.11-win$(Sys.WORD_SIZE)-mingw"
67+
zlib_fn = "$(zlib_bn).zip"
68+
zlib_uri = "https://bintray.com/vszakats/generic/download_file?file_path=$(zlib_fn)"
69+
provides(Binaries, URI(zlib_uri), libz, filename="$(zlib_fn)", unpacked_dir="$(zlib_bn)")
6970

70-
openssl_bn = "openssl-1.1.0i-win$(Sys.WORD_SIZE)-mingw"
71-
openssl_fn = "$(openssl_bn).zip"
72-
openssl_uri = "https://bintray.com/vszakats/generic/download_file?file_path=$(openssl_fn)"
73-
provides(Binaries, URI(openssl_uri), libcrypto, filename="$(openssl_fn)", unpacked_dir="$(openssl_bn)")
74-
end
71+
openssl_bn = "openssl-1.1.0i-win$(Sys.WORD_SIZE)-mingw"
72+
openssl_fn = "$(openssl_bn).zip"
73+
openssl_uri = "https://bintray.com/vszakats/generic/download_file?file_path=$(openssl_fn)"
74+
provides(Binaries, URI(openssl_uri), libcrypto, filename="$(openssl_fn)", unpacked_dir="$(openssl_bn)")
75+
end
7576

76-
@BinDeps.install Dict([:libz => :libz, :libcrypto => :libcrypto])
77+
@BinDeps.install Dict([:libz => :libz, :libcrypto => :libcrypto])
78+
end

src/Inflate.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,15 @@ const Z_MEM_ERROR = -4
4545
const Z_BUF_ERROR = -5
4646
const Z_VERSION_ERROR = -6
4747

48-
@static isfile(joinpath(dirname(@__FILE__),"..","deps","deps.jl")) ||
48+
@static if Base.VERSION > v"1.3-" && !(Sys.iswindows() && Sys.WORD_SIZE == 32)
49+
using Pkg
50+
Pkg.add("Zlib_jll")
51+
using Zlib_jll: libz
52+
else
53+
isfile(joinpath(dirname(@__FILE__),"..","deps","deps.jl")) ||
4954
error("PDFIO not properly installed. Please run Pkg.build(\"PDFIO\")")
50-
51-
include("../deps/deps.jl")
55+
include("../deps/deps.jl")
56+
end
5257

5358
_zlibVersion() = ccall((:zlibVersion, libz), Ptr{Cstring}, ())
5459

src/LibCrypto.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
@static isfile(joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")) ||
1+
@static if Base.VERSION > v"1.3-" && !(Sys.iswindows() && Sys.WORD_SIZE == 32)
2+
using Pkg
3+
Pkg.add("OpenSSL_jll")
4+
using OpenSSL_jll: libcrypto
5+
else
6+
isfile(joinpath(dirname(@__FILE__), "..", "deps", "deps.jl")) ||
27
error("PDFIO not properly installed. Please run Pkg.build(\"PDFIO\")")
3-
4-
include("../deps/deps.jl")
8+
include("../deps/deps.jl")
9+
end
510

611
using Base: SecretBuffer, SecretBuffer!
712
import Base: copy

0 commit comments

Comments
 (0)