Skip to content

Commit

Permalink
Add OpenSSL_JLL
Browse files Browse the repository at this point in the history
  • Loading branch information
fxcoudert committed Mar 29, 2024
1 parent d253691 commit c52bdd7
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 3 deletions.
4 changes: 2 additions & 2 deletions stdlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ DIRS := $(build_datarootdir)/julia/stdlib/$(VERSDIR) $(build_prefix)/manifest/$(
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))

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

# Initialize this with JLLs that aren't in "deps/$(LibName).version"
JLL_NAMES := MozillaCACerts_jll
Expand Down
5 changes: 5 additions & 0 deletions stdlib/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ deps = ["Artifacts", "Libdl"]
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
version = "0.8.1+2"

[[deps.OpenSSL_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "3.0.13+0"

[[deps.PCRE2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "efcefdf7-47ab-520b-bdef-62a2eaa19f15"
Expand Down
16 changes: 16 additions & 0 deletions stdlib/OpenSSL_jll/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name = "OpenSSL_jll"
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
version = "3.0.13+0"

[deps]
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"

[compat]
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
53 changes: 53 additions & 0 deletions stdlib/OpenSSL_jll/src/OpenSSL_jll.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

## dummy stub for https://github.com/JuliaBinaryWrappers/OpenSSL_jll.jl

baremodule OpenSSL_jll
using Base, Libdl

const PATH_list = String[]
const LIBPATH_list = String[]

export libcrypto, libssl

# These get calculated in __init__()
const PATH = Ref("")
const LIBPATH = Ref("")
artifact_dir::String = ""
libcrypto_handle::Ptr{Cvoid} = C_NULL
libcrypto_path::String = ""
libssl_handle::Ptr{Cvoid} = C_NULL
libssl_path::String = ""

if Sys.iswindows()
const libcrypto = "libcrypto.dll"
const libssl = "libssl.dll"
elseif Sys.isapple()
const libcrypto = "@rpath/libcrypto.3.dylib"
const libssl = "@rpath/libssl.3.dylib"
else
const libcrypto = "libcrypto.so.3"
const libssl = "libssl.so.3"
end

function __init__()
global libcrypto_handle = dlopen(libcrypto)
global libcrypto_path = dlpath(libcrypto_handle)
global libssl_handle = dlopen(libssl)
global libssl_path = dlpath(libssl_handle)
global artifact_dir = dirname(Sys.BINDIR)
LIBPATH[] = dirname(libssl_path)
push!(LIBPATH_list, LIBPATH[])
end

# JLLWrappers API compatibility shims. Note that not all of these will really make sense.
# For instance, `find_artifact_dir()` won't actually be the artifact directory, because
# there isn't one. It instead returns the overall Julia prefix.
is_available() = true
find_artifact_dir() = artifact_dir
dev_jll() = error("stdlib JLLs cannot be dev'ed")
best_wrapper = nothing
get_libcrypto_path() = libcrypto_path
get_libssl_path() = libssl_path

end # module OpenSSL_jll
10 changes: 10 additions & 0 deletions stdlib/OpenSSL_jll/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test, Libdl, OpenSSL_jll

@testset "OpenSSL_jll" begin
major = ccall((:OPENSSL_version_major, libcrypto), Cuint, ())
minor = ccall((:OPENSSL_version_minor, libcrypto), Cuint, ())
patch = ccall((:OPENSSL_version_patch, libcrypto), Cuint, ())
@test VersionNumber(major, minor, patch) == v"3.0.13"
end
1 change: 1 addition & 0 deletions stdlib/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ MozillaCACerts_jll = "14a3606d-f60d-562e-9121-12d972cd8159"
NetworkOptions = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
OpenBLAS_jll = "4536629a-c528-5b80-bd46-f80d51c5b363"
OpenLibm_jll = "05823500-19ac-5b8b-9628-191a04bc5112"
OpenSSL_jll = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
PCRE2_jll = "efcefdf7-47ab-520b-bdef-62a2eaa19f15"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Expand Down
2 changes: 1 addition & 1 deletion stdlib/stdlib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ INDEPENDENT_STDLIBS := \
SparseArrays Statistics StyledStrings SuiteSparse_jll Tar Test TOML Unicode UUIDs \
dSFMT_jll GMP_jll libLLVM_jll LLD_jll LLVMLibUnwind_jll LibUnwind_jll LibUV_jll \
LibCURL_jll LibSSH2_jll LibGit2_jll nghttp2_jll MozillaCACerts_jll MbedTLS_jll \
MPFR_jll OpenLibm_jll PCRE2_jll p7zip_jll Zlib_jll
MPFR_jll OpenLibm_jll OpenSSL_jll PCRE2_jll p7zip_jll Zlib_jll

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

0 comments on commit c52bdd7

Please sign in to comment.