Skip to content

Commit

Permalink
openssl: improve compatibility with older versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Doekin committed Dec 31, 2024
1 parent d6a3f76 commit c86fa6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
17 changes: 5 additions & 12 deletions packages/o/openssl/configure/patch.lua
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,9 @@ function _replace_NUL_with_null()
end

function main(package)
try {
function()
_remove_unused_pod_usage()
_replace_NUL_with_null()
_fix_overlong_make_recipe()
end,
catch {
function (errors)
cprint("${color.error}" .. errors .. "${clear}\n")
end
}
}
_remove_unused_pod_usage()
if not package:gitref() and package:version():ge("1.1.1") then
_replace_NUL_with_null()
_fix_overlong_make_recipe()
end
end
11 changes: 7 additions & 4 deletions packages/o/openssl/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ package("openssl")
on_install("windows", function (package)
import("package.tools.jom", {try = true})
import("package.tools.nmake")
local configs = {"Configure", "no-tests"}
local configs = {"Configure"}
if not package:gitref() and package:version():ge("1.1.1") then
table.insert(configs, "no-tests")
end
local target
if package:is_arch("x86", "i386") then
target = "VC-WIN32"
Expand All @@ -96,14 +99,14 @@ package("openssl")
table.insert(configs, package:config("shared") and "shared" or "no-shared")
table.insert(configs, "--prefix=" .. package:installdir())
table.insert(configs, "--openssldir=" .. package:installdir())
if jom then
if jom and (not package:gitref() and package:version():ge("1.1.1")) then
table.insert(configs, "no-makedepend")
table.insert(configs, "/FS")
end
import("configure.patch")(package)
os.vrunv("perl", configs)

if jom then
if jom and (not package:gitref() and package:version():ge("1.1.1")) then
jom.build(package)
jom.make(package, {"install_sw"})
else
Expand All @@ -114,7 +117,7 @@ package("openssl")

on_install("linux", "macosx", "bsd", "cross", "android", "iphoneos", "mingw", function (package)
-- https://wiki.openssl.org/index.php/Compilation_and_Installation#PREFIX_and_OPENSSLDIR
local configs = {"no-tests"}
local configs = (not package:gitref() and package:version():ge("1.1.1")) and {"no-tests"} or {}
if package:is_cross() or package:is_plat("mingw") then
local target_plat, target_arch
if package:is_plat("macosx") then
Expand Down

0 comments on commit c86fa6e

Please sign in to comment.