чување 85a2f2c564e6d2b3b88fc8267d9cb70939e38e56
родитељ 39a190dac7490bbd151076f715535c174c7d808f
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Thu, 15 Sep 2022 14:48:04 +0200
neomutt: Adjust for static building, with ncurses and OpenSSL
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 7, додавања: 81(+), брисања: 56(-)
diff --git a/TODO b/TODO
@@ -1,10 +1,6 @@
TODO
====
-[ ] neomutt: Add real code of missing ncurses functions instead of placeholders?
- What would be the license of the combined work? Alternatively, revisit one
- more time replacing netbsd-curses with ncurses?
-
[ ] Add SASL, rebuild s-nail, neomutt, isync
[ ] Add urlview
@@ -17,6 +13,12 @@ TODO
Done
----
+[x] neomutt: Add real code of missing ncurses functions instead of placeholders?
+ What would be the license of the combined work? Alternatively, revisit one
+ more time replacing netbsd-curses with ncurses?
+ - Ultimately decided to add ncurses after all. Also replaced LibreSSL with
+ OpenSSL, and adjusted neomutt for complete static compilation.
+
[x] Add isync
[x] Add neomutt
diff --git a/neomutt/mkfile b/neomutt/mkfile
@@ -10,7 +10,7 @@ SYSCONFDIR= /etc
LOCALSTATEDIR= /var
MAILPATH= $LOCALSTATEDIR/spool/mail
CFLAGS= -Os -pipe -static --static -fcommon -fPIC
-LDFLAGS= -static --static -fcommon -s
+LDFLAGS= -static --static -fcommon -zmuldefs -s
$PKGBASE:QV:
for patch in $(find pat -type f | sort); do
@@ -32,7 +32,11 @@ $PKGBASE:QV:
--disable-idn \
--pcre2 \
--with-mailpath=$MAILPATH
+ cp Makefile Makefile~
+ sed -e '/^LIBS *=/s/$/ -lnotmuch -lxapian -lgpgme -lassuan -lgpg-error -lssl -lcrypto -lgmime-3.0 -lgio-2.0 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lm -lffi -ltalloc -lstdc++ -lpcre -lz -lzstd/' \
+ -e '/^LDFLAGS *=/s/$/ -static-libgcc -static-libstdc++/' Makefile~ > Makefile
printf " MAKE\n"
+ make
install:QV: $PKGBASE install-legal
printf " MAKE\t%s\n" "DESTDIR=$(realpath $DESTDIR) install"
@@ -47,7 +51,7 @@ install-legal:QV: $PKGBASE
clean:QV:
if [ -e Makefile ]; then
printf " MAKE\tclean\n"
- make clean
+ #make clean
fi
<$mkpklib/package.mk
diff --git a/neomutt/pat/dynamic-lib-function-return-pointer-segfault.patch b/neomutt/pat/dynamic-lib-function-return-pointer-segfault.patch
@@ -1,11 +0,0 @@
---- a/gui/terminal.c 2022-08-30 21:03:56.266551230 +0200
-+++ b/gui/terminal.c 2022-08-30 21:04:08.314551549 +0200
-@@ -38,6 +38,8 @@
- #include <ncurses/term.h> // IWYU pragma: keep
- #endif
-
-+#include <term.h>
-+
- bool TsSupported; ///< Terminal Setting is supported
-
- /* de facto standard escapes for tsl/fsl */
diff --git a/neomutt/pat/missing-funcs.patch b/neomutt/pat/missing-funcs.patch
@@ -1,39 +0,0 @@
---- a/keymap.c 2022-04-29 14:15:32.000000000 +0200
-+++ b/keymap.c 2022-08-30 21:20:27.637577465 +0200
-@@ -978,6 +978,24 @@
- return 0;
- }
-
-+/* TODO */
-+static bool _use_ext_names = false;
-+
-+int
-+use_extended_names(bool enable)
-+{
-+ bool prev_value = _use_ext_names;
-+ _use_ext_names = enable;
-+ return prev_value;
-+}
-+
-+int
-+key_defined(const char* definition)
-+{
-+ return 0;
-+}
-+/* /TODO */
-+
- /**
- * init_extended_keys - Initialise map of ncurses extended keys
- *
---- a/gui/mutt_curses.h 2022-04-29 14:15:32.000000000 +0200
-+++ b/gui/mutt_curses.h 2022-08-30 21:20:37.174577717 +0200
-@@ -45,6 +45,9 @@
- #define CI_is_return(ch) (((ch) == '\r') || ((ch) == '\n'))
- #endif
-
-+int use_extended_names(bool enable);
-+int key_defined(const char* definition);
-+
- /**
- * enum MuttCursorState - Cursor states for mutt_curses_set_cursor()
- */
diff --git a/neomutt/pat/neomutt-dont-detect-notmuch.patch b/neomutt/pat/neomutt-dont-detect-notmuch.patch
@@ -0,0 +1,37 @@
+--- a/auto.def 2022-09-14 23:37:44.502062866 +0200
++++ b/auto.def 2022-09-14 23:38:12.878063695 +0200
+@@ -661,21 +661,21 @@
+ ###############################################################################
+ # Notmuch
+ if {[get-define want-notmuch]} {
+- if {![check-inc-and-lib notmuch [opt-val with-notmuch $prefix] \
+- notmuch.h notmuch_database_open notmuch]} {
+- user-error "Unable to find Notmuch"
+- }
++ #if {![check-inc-and-lib notmuch [opt-val with-notmuch $prefix] \
++ # notmuch.h notmuch_database_open notmuch]} {
++ # user-error "Unable to find Notmuch"
++ #}
+ define USE_NOTMUCH
+- msg-checking "Checking for Notmuch API version 3..."
+- if {[cctest -includes {notmuch.h} -libs {-lnotmuch} -link 1 \
+- -code { notmuch_database_open(NULL, 0, NULL); }]} {
++ #msg-checking "Checking for Notmuch API version 3..."
++ #if {[cctest -includes {notmuch.h} -libs {-lnotmuch} -link 1 \
++ # -code { notmuch_database_open(NULL, 0, NULL); }]} {
+ define NOTMUCH_API_3
+- msg-result "yes"
+- } else {
+- msg-result "no"
+- }
+- cc-check-function-in-lib notmuch_database_index_file notmuch
+- cc-check-function-in-lib notmuch_database_open_with_config notmuch
++ # msg-result "yes"
++ #} else {
++ # msg-result "no"
++ #}
++ #cc-check-function-in-lib notmuch_database_index_file notmuch
++ #cc-check-function-in-lib notmuch_database_open_with_config notmuch
+ }
+
+ ###############################################################################
diff --git a/neomutt/pat/neomutt-dont-detect-openssl.patch b/neomutt/pat/neomutt-dont-detect-openssl.patch
@@ -0,0 +1,21 @@
+--- a/auto.def 2022-09-14 23:41:30.021069458 +0200
++++ b/auto.def 2022-09-14 23:42:04.372070462 +0200
+@@ -813,12 +813,12 @@
+ set ssl_cflags -I$ssl_prefix/include
+ set ssl_ldflags -L$ssl_prefix/$::libdir_tail
+ cc-with [list -libs $ssl_ldflags -cflags $ssl_cflags] {
+- if {![cc-check-includes openssl/bio.h openssl/err.h openssl/ssl.h] ||
+- ![cc-check-function-in-lib X509_STORE_CTX_new crypto] ||
+- ![cc-check-function-in-lib SSL_new ssl] ||
+- ![cc-with {-includes openssl/ssl.h} {cc-check-decls SSL_set_mode}]} {
+- user-error "Unable to find OpenSSL"
+- }
++ #if {![cc-check-includes openssl/bio.h openssl/err.h openssl/ssl.h] ||
++ # ![cc-check-function-in-lib X509_STORE_CTX_new crypto] ||
++ # ![cc-check-function-in-lib SSL_new ssl] ||
++ # ![cc-with {-includes openssl/ssl.h} {cc-check-decls SSL_set_mode}]} {
++ # user-error "Unable to find OpenSSL"
++ #}
+ define-append CFLAGS $ssl_cflags
+ define-append LDFLAGS $ssl_ldflags
+ }
diff --git a/neomutt/pat/neomutt-update-dtd.patch b/neomutt/pat/neomutt-update-dtd.patch
@@ -0,0 +1,11 @@
+--- a/auto.def 2022-09-14 23:10:59.848015956 +0200
++++ b/auto.def 2022-09-14 23:11:09.670016244 +0200
+@@ -452,7 +452,7 @@
+ }
+
+ msg-checking "Checking for DocBook DTDs..."
+- set res [exec xmlcatalog --shell << {public "-//OASIS//DTD DocBook XML V4.2//EN"}]
++ set res [exec xmlcatalog --shell << {public "-//OASIS//DTD DocBook XML V4.5//EN"}]
+ if {[string match {> No entry*} $res]} {
+ msg-result "no"
+ user-error "Install DocBook DTDs or './configure --disable-doc'"