[arch-commits] Commit in claws-mail/trunk (PKGBUILD glibc_2.28.patch)

Andreas Radke andyrtr at archlinux.org
Wed Aug 8 19:15:49 UTC 2018


    Date: Wednesday, August 8, 2018 @ 19:15:48
  Author: andyrtr
Revision: 331255

upgpkg: claws-mail 3.16.0-5

add missing pygtk optdep - FS#59141; apply upstream fix for glibc dropped encrypt function in 2.28

Added:
  claws-mail/trunk/glibc_2.28.patch
Modified:
  claws-mail/trunk/PKGBUILD

------------------+
 PKGBUILD         |   12 ++++--
 glibc_2.28.patch |   99 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 108 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-08-08 18:21:16 UTC (rev 331254)
+++ PKGBUILD	2018-08-08 19:15:48 UTC (rev 331255)
@@ -3,7 +3,7 @@
 
 pkgname=claws-mail
 pkgver=3.16.0
-pkgrel=4
+pkgrel=5
 pkgdesc="A GTK+ based e-mail client."
 arch=('x86_64')
 license=('GPL3')
@@ -17,6 +17,7 @@
              'docbook-utils')
              #'libchamplain' needed for geolocation plugin, disabled for now - most time it's not compatible with current gnome releases
 optdepends=('python2:           needed for some tools and python plugin'
+            'pygtk:             needed for python plugin'
             'perl:              needed for some tools and perl plugin'
             'spamassassin:      adds support for spamfiltering'
             'bogofilter:        adds support for spamfiltering'
@@ -36,10 +37,12 @@
 conflicts=('claws-mail-extra-plugins')
 provides=('claws')
 source=(http://www.claws-mail.org/download.php?file=releases/claws-mail-$pkgver.tar.xz{,.asc}
-       dillo-plugin.diff)
+       dillo-plugin.diff
+       glibc_2.28.patch)
 sha256sums=('c212133d3d962129d8c7995c1c7d973faef2a8914481c0c74578217bf4c897ab'
             'SKIP'
-            'ab08ca513145e847d30a29d9e5a9ae63b94222423e88c1b375fd5cfcb427d6c5')
+            'ab08ca513145e847d30a29d9e5a9ae63b94222423e88c1b375fd5cfcb427d6c5'
+            '417b15cedb28f06028d2fb2922f597f1b5bab0a510db900bc866a81a2f181643')
 validpgpkeys=('8B3B297A03468356692F8D592CD716D654D6BBD4') # Paul <paul at claws-mail.org>
 
 prepare() {
@@ -47,6 +50,9 @@
   # upstream reintroduction of dillo plugin - after fancy plugin dropped
   patch -Np1 -i ../dillo-plugin.diff
 
+  # apply upstream fix to compile with recent glibc that removed encrypt function
+  patch -Np1 -i ../glibc_2.28.patch
+
   # fix new versioned enchant pkgconfig detection
   sed -i "s:PKG_CHECK_MODULES(ENCHANT, enchant >= 1.4.0:PKG_CHECK_MODULES(ENCHANT, enchant-2 >= 1.4.0:" configure.ac
   sed -i "s:--cflags enchant:--cflags enchant-2:" configure.ac

Added: glibc_2.28.patch
===================================================================
--- glibc_2.28.patch	                        (rev 0)
+++ glibc_2.28.patch	2018-08-08 19:15:48 UTC (rev 331255)
@@ -0,0 +1,99 @@
+From 9bbbdf372a261a5aa7716830f98d6368db38a2e2 Mon Sep 17 00:00:00 2001
+From: Paul <paul at claws-mail.org>
+Date: Tue, 15 May 2018 09:59:20 +0100
+Subject: [PATCH] require nettle, following removal of libcrypt from glibc
+
+based on the fedora patch, thanks!
+---
+ configure.ac           |   18 ++----------------
+ src/Makefile.am        |    1 +
+ src/common/passcrypt.c |   15 +++++++++++----
+ 3 files changed, 14 insertions(+), 20 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 50d6866..5fabeaf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -493,22 +493,8 @@ if test "x$enable_gnutls" != "xno"; then
+         AC_SUBST(GNUTLS_CFLAGS)
+ fi
+ 
+-dnl password encryption
+-OLDLIBS=$LIBS
+-LIBS=
+-case $host_os in
+-	*dragonfly*)
+-		AC_SEARCH_LIBS(encrypt, cipher, [], AC_MSG_ERROR(['encrypt'-function not found.]))
+-	;;
+-	freebsd*)
+-	;; # not used
+-	*)
+-		AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
+-	;;
+-esac
+-CRYPT_LIBS=$LIBS
+-AC_SUBST(CRYPT_LIBS)
+-LIBS=$OLDLIBS
++PKG_CHECK_MODULES(NETTLE, nettle)
++AC_SUBST(NETTLE_LIBS)
+ 
+ AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
+ 	    with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 460c182..d2d1548 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -598,6 +598,7 @@ claws_mail_LDADD = \
+ 	$(GTK_LIBS) \
+ 	$(LDAP_LIBS) \
+ 	$(GNUTLS_LIBS) \
++	$(NETTLE_LIBS) \
+ 	$(COMPFACE_LIBS) \
+ 	$(JPILOT_LIBS) \
+ 	$(PTHREAD_LIBS) \
+diff --git a/src/common/passcrypt.c b/src/common/passcrypt.c
+index 7b125aa..5fceb73 100644
+--- a/src/common/passcrypt.c
++++ b/src/common/passcrypt.c
+@@ -29,6 +29,7 @@
+ #include <ctype.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <nettle/des.h>
+ 
+ #if defined (__FreeBSD__)
+ #include <rpc/des_crypt.h>
+@@ -82,11 +83,10 @@ static void
+ crypt_cfb_buf(const char key[8], unsigned char *buf, unsigned len,
+ 	      unsigned chunksize, int decrypt)
+ {
++	struct des_ctx ctx;
+ 	unsigned char temp[64];
+ 
+-	memcpy(temp, key, 8);
+-	crypt_unpack(temp);
+-	setkey((const char *) temp);
++	des_set_key(&ctx,(const uint8_t*) key);
+ 	memset(temp, 0, sizeof(temp));
+ 
+ 	memset(crypt_cfb_iv, 0, sizeof(crypt_cfb_iv));
+@@ -96,7 +96,14 @@ crypt_cfb_buf(const char key[8], unsigned char *buf, unsigned len,
+ 
+ 	while (len) {
+ 		memcpy(temp, crypt_cfb_iv, sizeof(temp));
+-		encrypt((char *) temp, 0);
++		/* simulate encrypt() via Nettle */
++		char temp2[8];
++		memset(temp2,0,sizeof(temp2));
++		crypt_cfb_xor(temp2,temp,sizeof(temp)/sizeof(temp2));
++		des_encrypt(&ctx,sizeof(temp2),(uint8_t*)temp2,(uint8_t*)temp2);
++		memcpy(temp,temp2,sizeof(temp2));
++		crypt_unpack(temp);
++		/* */
+ 		if (chunksize > len)
+ 			chunksize = len;
+ 		if (decrypt)
+-- 
+1.7.10.4
+
+



More information about the arch-commits mailing list