|
| 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 |
0 commit comments