Skip to content

Commit c52bdd7

Browse files
committed
Add OpenSSL_JLL
1 parent d253691 commit c52bdd7

File tree

7 files changed

+88
-3
lines changed

7 files changed

+88
-3
lines changed

stdlib/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ DIRS := $(build_datarootdir)/julia/stdlib/$(VERSDIR) $(build_prefix)/manifest/$(
1818
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
1919

2020
JLLS = DSFMT GMP CURL LIBGIT2 LLVM LIBSSH2 LIBUV MBEDTLS MPFR NGHTTP2 \
21-
BLASTRAMPOLINE OPENBLAS OPENLIBM P7ZIP PCRE LIBSUITESPARSE ZLIB \
22-
LLVMUNWIND CSL UNWIND LLD
21+
BLASTRAMPOLINE OPENBLAS OPENLIBM OPENSSL P7ZIP PCRE LIBSUITESPARSE \
22+
ZLIB LLVMUNWIND CSL UNWIND LLD
2323

2424
# Initialize this with JLLs that aren't in "deps/$(LibName).version"
2525
JLL_NAMES := MozillaCACerts_jll

stdlib/Manifest.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ deps = ["Artifacts", "Libdl"]
171171
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
172172
version = "0.8.1+2"
173173

174+
[[deps.OpenSSL_jll]]
175+
deps = ["Artifacts", "Libdl"]
176+
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
177+
version = "3.0.13+0"
178+
174179
[[deps.PCRE2_jll]]
175180
deps = ["Artifacts", "Libdl"]
176181
uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15"

stdlib/OpenSSL_jll/Project.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name = "OpenSSL_jll"
2+
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
3+
version = "3.0.13+0"
4+
5+
[deps]
6+
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
7+
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
8+
9+
[compat]
10+
julia = "1.6"
11+
12+
[extras]
13+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
14+
15+
[targets]
16+
test = ["Test"]

stdlib/OpenSSL_jll/src/OpenSSL_jll.jl

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This file is a part of Julia. License is MIT: https://julialang.org/license
2+
3+
## dummy stub for https://github.com/JuliaBinaryWrappers/OpenSSL_jll.jl
4+
5+
baremodule OpenSSL_jll
6+
using Base, Libdl
7+
8+
const PATH_list = String[]
9+
const LIBPATH_list = String[]
10+
11+
export libcrypto, libssl
12+
13+
# These get calculated in __init__()
14+
const PATH = Ref("")
15+
const LIBPATH = Ref("")
16+
artifact_dir::String = ""
17+
libcrypto_handle::Ptr{Cvoid} = C_NULL
18+
libcrypto_path::String = ""
19+
libssl_handle::Ptr{Cvoid} = C_NULL
20+
libssl_path::String = ""
21+
22+
if Sys.iswindows()
23+
const libcrypto = "libcrypto.dll"
24+
const libssl = "libssl.dll"
25+
elseif Sys.isapple()
26+
const libcrypto = "@rpath/libcrypto.3.dylib"
27+
const libssl = "@rpath/libssl.3.dylib"
28+
else
29+
const libcrypto = "libcrypto.so.3"
30+
const libssl = "libssl.so.3"
31+
end
32+
33+
function __init__()
34+
global libcrypto_handle = dlopen(libcrypto)
35+
global libcrypto_path = dlpath(libcrypto_handle)
36+
global libssl_handle = dlopen(libssl)
37+
global libssl_path = dlpath(libssl_handle)
38+
global artifact_dir = dirname(Sys.BINDIR)
39+
LIBPATH[] = dirname(libssl_path)
40+
push!(LIBPATH_list, LIBPATH[])
41+
end
42+
43+
# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
44+
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
45+
# there isn't one. It instead returns the overall Julia prefix.
46+
is_available() = true
47+
find_artifact_dir() = artifact_dir
48+
dev_jll() = error("stdlib JLLs cannot be dev'ed")
49+
best_wrapper = nothing
50+
get_libcrypto_path() = libcrypto_path
51+
get_libssl_path() = libssl_path
52+
53+
end # module OpenSSL_jll

stdlib/OpenSSL_jll/test/runtests.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file is a part of Julia. License is MIT: https://julialang.org/license
2+
3+
using Test, Libdl, OpenSSL_jll
4+
5+
@testset "OpenSSL_jll" begin
6+
major = ccall((:OPENSSL_version_major, libcrypto), Cuint, ())
7+
minor = ccall((:OPENSSL_version_minor, libcrypto), Cuint, ())
8+
patch = ccall((:OPENSSL_version_patch, libcrypto), Cuint, ())
9+
@test VersionNumber(major, minor, patch) == v"3.0.13"
10+
end

stdlib/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ MozillaCACerts_jll = "14a3606d-f60d-562e-9121-12d972cd8159"
3434
NetworkOptions = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
3535
OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363"
3636
OpenLibm_jll = "05823500-19ac-5b8b-9628-191a04bc5112"
37+
OpenSSL_jll = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
3738
PCRE2_jll = "efcefdf7-47ab-520b-bdef-62a2eaa19f15"
3839
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
3940
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"

stdlib/stdlib.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ INDEPENDENT_STDLIBS := \
99
SparseArrays Statistics StyledStrings SuiteSparse_jll Tar Test TOML Unicode UUIDs \
1010
dSFMT_jll GMP_jll libLLVM_jll LLD_jll LLVMLibUnwind_jll LibUnwind_jll LibUV_jll \
1111
LibCURL_jll LibSSH2_jll LibGit2_jll nghttp2_jll MozillaCACerts_jll MbedTLS_jll \
12-
MPFR_jll OpenLibm_jll PCRE2_jll p7zip_jll Zlib_jll
12+
MPFR_jll OpenLibm_jll OpenSSL_jll PCRE2_jll p7zip_jll Zlib_jll
1313

1414
STDLIBS := $(STDLIBS_WITHIN_SYSIMG) $(INDEPENDENT_STDLIBS)
1515
VERSDIR := v$(shell cut -d. -f1-2 < $(JULIAHOME)/VERSION)

0 commit comments

Comments
 (0)