Skip to content

Commit

Permalink
gnutls: build Guile bindings
Browse files Browse the repository at this point in the history
Closes #59490.

Signed-off-by: Sean Molenaar <[email protected]>
Signed-off-by: BrewTestBot <[email protected]>
  • Loading branch information
aconchillo authored and BrewTestBot committed Aug 26, 2020
1 parent 156572f commit d284041
Showing 1 changed file with 28 additions and 2 deletions.
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

0 comments on commit d284041

Please sign in to comment.