* add libpq

* add readline

* pass readline

* disable readline for libpq
pull/840/head
ruki 3 years ago committed by GitHub
parent 59bc2c5b65
commit 6faae87242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 36
      packages/l/libpq/xmake.lua
  2. 27
      packages/r/readline/xmake.lua

@ -0,0 +1,36 @@
package("libpq")
set_homepage("https://www.postgresql.org/docs/14/libpq.html")
set_description("Postgres C API library")
set_license("PostgreSQL")
add_urls("https://ftp.postgresql.org/pub/source/v$(version)/postgresql-$(version).tar.bz2", {alias = "home"})
add_urls("https://github.com/postgres/postgres/archive/refs/tags/REL_$(version).tar.gz", {alias = "github", version = function (version)
return version:gsub("%.", "_")
end})
add_versions("home:14.1", "4d3c101ea7ae38982f06bdc73758b53727fb6402ecd9382006fa5ecc7c2ca41f")
add_versions("github:14.1", "14809c9f669851ab89b344a50219e85b77f3e93d9df9e255b9781d8d60fcfbc9")
add_deps("krb5", "openssl", "zlib")
if is_plat("linux") then
add_deps("flex", "bison")
end
on_install("macosx", "linux", function (package)
local configs = {"--with-openssl", "--without-readline"}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
if package:is_plat("macosx") then
table.insert(configs, "--with-gssapi")
end
if package:debug() then
table.insert(configs, "--enable-debug")
end
if package:config("pic") ~= false then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs, {packagedeps = {"openssl", "zlib"}})
end)
on_test(function (package)
assert(package:has_cfuncs("PQconnectdb", {includes = "libpq-fe.h"}))
end)

@ -0,0 +1,27 @@
package("readline")
set_homepage("https://tiswww.case.edu/php/chet/readline/rltop.html")
set_description("Library for command-line editing")
set_license("GPL-3.0-or-later")
add_urls("https://ftp.gnu.org/gnu/readline/readline-$(version).tar.gz",
"https://ftpmirror.gnu.org/readline/readline-8.1.tar.gz")
add_versions("8.1", "f8ceb4ee131e3232226a17f51b164afc46cd0b9e6cef344be87c65962cb82b02")
add_deps("ncurses")
on_install("linux", "macosx", function (package)
local configs = {"--with-curses"}
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
if package:debug() then
table.insert(configs, "--enable-debug")
end
if package:config("pic") ~= false then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs)
end)
on_test(function (package)
assert(package:has_cfuncs("readline", {includes = {"stdio.h", "readline/readline.h"}}))
end)
Loading…
Cancel
Save