fix libsodium (#274)

pull/276/head
ruki 4 years ago committed by GitHub
parent ae0f48d72d
commit 3bdf407a3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      packages/l/libsodium/xmake.lua
  2. 18
      packages/m/m4/xmake.lua

@ -4,15 +4,18 @@ package("libsodium")
set_description("Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more.")
if is_plat("windows") then
set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version)-stable-msvc.zip")
add_versions("1.0.18", "91a9b6eeb296ecfdf111a6051275dc52dbbfc2774673b18218e98803b96765fb")
set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version)-msvc.zip",
"https://github.com/jedisct1/libsodium/releases/download/$(version)-RELEASE/libsodium-$(version)-msvc.zip")
add_versions("1.0.18", "c1d48d85c9361e350931ffe5067559cd7405a697c655d26955fb568d1084a5f4")
elseif is_plat("linux", "macosx") then
add_deps("autoconf", "automake", "libtool", "pkg-config")
set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version)-stable.tar.gz")
add_versions("1.0.18", "bc850f28c6909d78c1f40eaff83fafb4d6940a142e72fedb970296ce82f90632")
set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version).tar.gz",
"https://github.com/jedisct1/libsodium/releases/download/$(version)-RELEASE/libsodium-$(version).tar.gz")
add_versions("1.0.18", "6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1")
elseif is_plat("mingw") then
set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version)-stable-mingw.tar.gz")
add_versions("1.0.18", "68d67d4566c1eaccf46481e7ec370efc28fd627fb01fde8d164ecf95603200af")
set_urls("https://download.libsodium.org/libsodium/releases/libsodium-$(version)-mingw.tar.gz",
"https://github.com/jedisct1/libsodium/releases/download/$(version)-RELEASE/libsodium-$(version)-mingw.tar.gz")
add_versions("1.0.18", "e499c65b1c511cbc6700e436deb3771c3baa737981114c9e9f85f2ec90176861")
end
on_load(function (package)

@ -15,6 +15,24 @@ package("m4")
end
on_install("@macosx", "@linux", "@msys", "@cygwin", function (package)
if package:is_plat("linux") then
-- fix freadahead.c:92:3: error: #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread, ungetc on your system, then report this to bug-gnulib."
-- https://git.savannah.gnu.org/cgit/gnulib.git
for _, gnulib_file in ipairs(os.files("lib/*.c")) do
io.replace(gnulib_file, "defined _IO_ftrylockfile", "defined _IO_EOF_SEEN || defined _IO_ftrylockfile")
end
local file = io.open("lib/stdio-impl.h", "a+")
file:write([[
#if defined _IO_EOF_SEEN
# if !defined _IO_UNBUFFERED
# define _IO_UNBUFFERED 0x2
# endif
# if !defined _IO_IN_BACKUP
# define _IO_IN_BACKUP 0x100
# endif
#endif]])
file:close()
end
import("package.tools.autoconf").install(package, {"--disable-dependency-tracking"})
end)

Loading…
Cancel
Save