@@ -4,7 +4,8 @@ class Gnutls < Formula
44 url "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.14.tar.xz"
55 mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.6/gnutls-3.6.14.tar.xz"
66 sha256 "5630751adec7025b8ef955af4d141d00d252a985769f51b4059e5affa3d39d63"
7- license "LGPL-2.1"
7+ # license "LGPL-2.1-or-later AND GPL-3.0-only" - review syntax after resolving https://github.com/Homebrew/brew/pull/8260
8+ license "GPL-3.0-only"
89
910 bottle do
1011 sha256 "ed76b5d22e195a797c2d01ab2f4a8e769a023b056b17e86f11cb6b9af200babe" => :catalina
@@ -16,6 +17,7 @@ class Gnutls < Formula
1617 depends_on "automake" => :build
1718 depends_on "pkg-config" => :build
1819 depends_on "gmp"
20+ depends_on "guile"
1921 depends_on "libidn2"
2022 depends_on "libtasn1"
2123 depends_on "libunistring"
@@ -35,7 +37,9 @@ def install
3537 --prefix=#{ prefix }
3638 --sysconfdir=#{ etc }
3739 --with-default-trust-store-file=#{ pkgetc } /cert.pem
38- --disable-guile
40+ --with-guile-site-dir=#{ share } /guile/site/3.0
41+ --with-guile-site-ccache-dir=#{ lib } /guile/3.0/site-ccache
42+ --with-guile-extension-dir=#{ lib } /guile/3.0/extensions
3943 --disable-heartbeat-support
4044 --with-p11-kit
4145 ]
@@ -74,7 +78,29 @@ def post_install
7478 ( pkgetc /"cert.pem" ) . atomic_write ( valid_certs . join ( "\n " ) )
7579 end
7680
81+ def caveats
82+ <<~EOS
83+ If you are going to use the Guile bindings you will need to add the following
84+ to your .bashrc or equivalent in order for Guile to find the TLS certificates
85+ database:
86+ export GUILE_TLS_CERTIFICATE_DIRECTORY=/usr/local/etc/gnutls/
87+ EOS
88+ end
89+
7790 test do
7891 system bin /"gnutls-cli" , "--version"
92+
93+ gnutls = testpath /"gnutls.scm"
94+ gnutls . write <<~EOS
95+ (use-modules (gnutls))
96+ (gnutls-version)
97+ EOS
98+
99+ ENV [ "GUILE_AUTO_COMPILE" ] = "0"
100+ ENV [ "GUILE_LOAD_PATH" ] = HOMEBREW_PREFIX /"share/guile/site/3.0"
101+ ENV [ "GUILE_LOAD_COMPILED_PATH" ] = HOMEBREW_PREFIX /"lib/guile/3.0/site-ccache"
102+ ENV [ "GUILE_SYSTEM_EXTENSIONS_PATH" ] = HOMEBREW_PREFIX /"lib/guile/3.0/extensions"
103+
104+ system "guile" , gnutls
79105 end
80106end
0 commit comments