mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 19:46:31 +01:00
refactor(guile-gnutls): use default compile/install while preserving static-only outputs
This commit is contained in:
parent
51019e232f
commit
d150b48eef
3 changed files with 43 additions and 18 deletions
|
|
@ -52,18 +52,12 @@ src_compile() {
|
||||||
gnutls_static_libs="$(PKG_CONFIG_LIBDIR="${pkg_config_path}" PKG_CONFIG_PATH="${pkg_config_path}" \
|
gnutls_static_libs="$(PKG_CONFIG_LIBDIR="${pkg_config_path}" PKG_CONFIG_PATH="${pkg_config_path}" \
|
||||||
/usr/bin/pkg-config --static --libs gnutls)"
|
/usr/bin/pkg-config --static --libs gnutls)"
|
||||||
|
|
||||||
if [ -z "${guile_cflags}" ]; then
|
CPPFLAGS="${guile_cflags} ${gnutls_cflags} ${CPPFLAGS:-}" \
|
||||||
echo "guile-gnutls: pkg-config returned empty cflags for guile-3.0" >&2
|
|
||||||
false
|
|
||||||
fi
|
|
||||||
make "${MAKEJOBS}" -C guile/src \
|
|
||||||
CPPFLAGS="${guile_cflags} ${gnutls_cflags} ${CPPFLAGS:-}" \
|
|
||||||
GUILE_CFLAGS="${guile_cflags}" \
|
GUILE_CFLAGS="${guile_cflags}" \
|
||||||
GUILE_LDFLAGS="${guile_static_libs}" \
|
GUILE_LDFLAGS="${guile_static_libs}" \
|
||||||
GNUTLS_CFLAGS="${gnutls_cflags}" \
|
GNUTLS_CFLAGS="${gnutls_cflags}" \
|
||||||
GNUTLS_LIBS="${gnutls_static_libs}" \
|
GNUTLS_LIBS="${gnutls_static_libs}" \
|
||||||
guile-gnutls-v-2.la
|
default_src_compile
|
||||||
make "${MAKEJOBS}" -C guile modules/gnutls.scm GNUTLS_GUILE_CROSS_COMPILING=yes
|
|
||||||
|
|
||||||
mkdir -p static
|
mkdir -p static
|
||||||
ar rcs static/libguile-gnutls-static.a \
|
ar rcs static/libguile-gnutls-static.a \
|
||||||
|
|
@ -102,11 +96,8 @@ EOF_C
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
|
default_src_install
|
||||||
install -Dm755 static/guile "${DESTDIR}${PREFIX}/bin/guile"
|
install -Dm755 static/guile "${DESTDIR}${PREFIX}/bin/guile"
|
||||||
install -Dm644 guile/modules/gnutls.scm \
|
|
||||||
"${DESTDIR}${PREFIX}/share/guile/site/3.0/gnutls.scm"
|
|
||||||
install -Dm644 guile/modules/gnutls/extra.scm \
|
|
||||||
"${DESTDIR}${PREFIX}/share/guile/site/3.0/gnutls/extra.scm"
|
|
||||||
install -Dm644 static/libguile-gnutls-static.a \
|
install -Dm644 static/libguile-gnutls-static.a \
|
||||||
"${DESTDIR}${LIBDIR}/libguile-gnutls-static.a"
|
"${DESTDIR}${LIBDIR}/libguile-gnutls-static.a"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
--- guile-gnutls-v5.0.1/guile/src/Makefile.am
|
||||||
|
+++ guile-gnutls-v5.0.1/guile/src/Makefile.am
|
||||||
|
@@ -46,6 +46,10 @@ guileextension_LTLIBRARIES = guile-gnutls-v-2.la
|
||||||
|
# <https://lists.gnutls.org/pipermail/gnutls-devel/2014-December/007294.html>.
|
||||||
|
guile_gnutls_v_2_la_LDFLAGS = -module -no-undefined
|
||||||
|
|
||||||
|
+# When this specific libtool target is built directly, force generation of
|
||||||
|
+# Automake built sources (e.g. enums.h) first.
|
||||||
|
+guile-gnutls-v-2.la: $(BUILT_SOURCES)
|
||||||
|
+
|
||||||
|
guile_gnutls_v_2_la_SOURCES = core.c errors.c utils.c
|
||||||
|
guile_gnutls_v_2_la_CFLAGS = \
|
||||||
|
$(AM_CFLAGS) $(GNULIB_CFLAGS) $(GUILE_CFLAGS) $(GNUTLS_CFLAGS)
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
SPDX-License-Identifier: GPL-3.0-or-later
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
In static bootstrap profile, initialize bindings from symbols linked into the
|
Make Guile module initialization work in both static and shared builds without
|
||||||
main Guile executable rather than loading a shared extension object.
|
relying on GNUTLS_GUILE_CROSS_COMPILING. Prefer symbols linked into the main
|
||||||
|
program (static profile), and fall back to load-extension when they are not
|
||||||
|
available.
|
||||||
|
|
||||||
--- guile-gnutls-v5.0.1/guile/modules/gnutls.in
|
--- guile-gnutls-v5.0.1/guile/modules/gnutls.in
|
||||||
+++ guile-gnutls-v5.0.1/guile/modules/gnutls.in
|
+++ guile-gnutls-v5.0.1/guile/modules/gnutls.in
|
||||||
@@ -817,11 +817,9 @@
|
@@ -817,11 +817,18 @@
|
||||||
;; save 'extensiondir' only if it's different from what Guile expects.
|
;; save 'extensiondir' only if it's different from what Guile expects.
|
||||||
@maybe_guileextensiondir@))
|
@maybe_guileextensiondir@))
|
||||||
|
|
||||||
|
|
@ -14,9 +16,28 @@ main Guile executable rather than loading a shared extension object.
|
||||||
- (string-append %libdir "/guile-gnutls-v-2")
|
- (string-append %libdir "/guile-gnutls-v-2")
|
||||||
- "guile-gnutls-v-2")
|
- "guile-gnutls-v-2")
|
||||||
- "scm_init_gnutls")))
|
- "scm_init_gnutls")))
|
||||||
+ (unless (getenv "GNUTLS_GUILE_CROSS_COMPILING")
|
+ ;; Static profile: bindings are linked into the main program.
|
||||||
+ (dynamic-call "scm_init_gnutls"
|
+ ;; Shared profile: fall back to loading the extension.
|
||||||
+ (dynamic-link #f))))
|
+ (let* ((self-handle (false-if-exception (dynamic-link #f)))
|
||||||
|
+ (loaded-in-place?
|
||||||
|
+ (and self-handle
|
||||||
|
+ (false-if-exception
|
||||||
|
+ (dynamic-call "scm_init_gnutls" self-handle)))))
|
||||||
|
+ (unless loaded-in-place?
|
||||||
|
+ (load-extension (if %libdir
|
||||||
|
+ (string-append %libdir "/guile-gnutls-v-2")
|
||||||
|
+ "guile-gnutls-v-2")
|
||||||
|
+ "scm_init_gnutls"))))
|
||||||
|
|
||||||
(define-syntax define-deprecated
|
(define-syntax define-deprecated
|
||||||
(lambda (s)
|
(lambda (s)
|
||||||
|
@@ -866,7 +873,8 @@
|
||||||
|
(define certificate-verify/allow-any-x509-v1-ca-certificate #f)
|
||||||
|
(define certificate-verify/allow-x509-v1-ca-certificate #f)
|
||||||
|
|
||||||
|
-(unless (getenv "GNUTLS_GUILE_CROSS_COMPILING")
|
||||||
|
+(when (module-variable (current-module) 'protocol/ssl3)
|
||||||
|
+
|
||||||
|
;; Renaming.
|
||||||
|
(set! protocol/ssl-3 protocol/ssl3)
|
||||||
|
(set! protocol/tls-1.0 protocol/tls1-0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue