Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnutls: build Guile bindings #59490

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions Formula/gnutls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ class Gnutls < Formula
url "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.14.tar.xz"
mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.6/gnutls-3.6.14.tar.xz"
sha256 "5630751adec7025b8ef955af4d141d00d252a985769f51b4059e5affa3d39d63"
license "LGPL-2.1"
# license "LGPL-2.1-or-later AND GPL-3.0-only" - review syntax after resolving https://github.com/Homebrew/brew/pull/8260
license "GPL-3.0-only"

bottle do
sha256 "ed76b5d22e195a797c2d01ab2f4a8e769a023b056b17e86f11cb6b9af200babe" => :catalina
Expand All @@ -16,6 +17,7 @@ class Gnutls < Formula
depends_on "automake" => :build
depends_on "pkg-config" => :build
depends_on "gmp"
depends_on "guile"
depends_on "libidn2"
depends_on "libtasn1"
depends_on "libunistring"
Expand All @@ -35,7 +37,9 @@ def install
--prefix=#{prefix}
--sysconfdir=#{etc}
--with-default-trust-store-file=#{pkgetc}/cert.pem
--disable-guile
--with-guile-site-dir=#{share}/guile/site/3.0
--with-guile-site-ccache-dir=#{lib}/guile/3.0/site-ccache
--with-guile-extension-dir=#{lib}/guile/3.0/extensions
--disable-heartbeat-support
--with-p11-kit
]
Expand Down Expand Up @@ -74,7 +78,29 @@ def post_install
(pkgetc/"cert.pem").atomic_write(valid_certs.join("\n"))
end

def caveats
<<~EOS
If you are going to use the Guile bindings you will need to add the following
to your .bashrc or equivalent in order for Guile to find the TLS certificates
database:
export GUILE_TLS_CERTIFICATE_DIRECTORY=/usr/local/etc/gnutls/
EOS
end

test do
system bin/"gnutls-cli", "--version"

gnutls = testpath/"gnutls.scm"
gnutls.write <<~EOS
(use-modules (gnutls))
(gnutls-version)
EOS

ENV["GUILE_AUTO_COMPILE"] = "0"
ENV["GUILE_LOAD_PATH"] = HOMEBREW_PREFIX/"share/guile/site/3.0"
ENV["GUILE_LOAD_COMPILED_PATH"] = HOMEBREW_PREFIX/"lib/guile/3.0/site-ccache"
ENV["GUILE_SYSTEM_EXTENSIONS_PATH"] = HOMEBREW_PREFIX/"lib/guile/3.0/extensions"

system "guile", gnutls
end
end