From ebd1ba713cbefc9ad5dac609255e1344a328e360 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Sun, 26 Jul 2020 13:37:12 +0200 Subject: gnu: glibc: Remove old versions. * gnu/packages/patches/glibc-CVE-2015-5180.patch, gnu/packages/patches/glibc-CVE-2015-7547.patch, gnu/packages/patches/glibc-CVE-2016-3075.patch, gnu/packages/patches/glibc-CVE-2016-3706.patch, gnu/packages/patches/glibc-CVE-2016-4429.patch, gnu/packages/patches/glibc-CVE-2017-1000366-pt1.patch, gnu/packages/patches/glibc-CVE-2017-1000366-pt2.patch, gnu/packages/patches/glibc-CVE-2017-1000366-pt3.patch, gnu/packages/patches/glibc-o-largefile.patch, gnu/packages/patches/glibc-vectorized-strcspn-guards.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/base.scm (glibc-2.26, glibc-2.25, glibc-2.24, glibc-2.23, glibc-2.22): Remove variables. --- gnu/packages/patches/glibc-CVE-2015-5180.patch | 311 ----------- gnu/packages/patches/glibc-CVE-2015-7547.patch | 590 --------------------- gnu/packages/patches/glibc-CVE-2016-3075.patch | 43 -- gnu/packages/patches/glibc-CVE-2016-3706.patch | 188 ------- gnu/packages/patches/glibc-CVE-2016-4429.patch | 58 -- .../patches/glibc-CVE-2017-1000366-pt1.patch | 36 -- .../patches/glibc-CVE-2017-1000366-pt2.patch | 124 ----- .../patches/glibc-CVE-2017-1000366-pt3.patch | 206 ------- gnu/packages/patches/glibc-o-largefile.patch | 25 - .../patches/glibc-vectorized-strcspn-guards.patch | 23 - 10 files changed, 1604 deletions(-) delete mode 100644 gnu/packages/patches/glibc-CVE-2015-5180.patch delete mode 100644 gnu/packages/patches/glibc-CVE-2015-7547.patch delete mode 100644 gnu/packages/patches/glibc-CVE-2016-3075.patch delete mode 100644 gnu/packages/patches/glibc-CVE-2016-3706.patch delete mode 100644 gnu/packages/patches/glibc-CVE-2016-4429.patch delete mode 100644 gnu/packages/patches/glibc-CVE-2017-1000366-pt1.patch delete mode 100644 gnu/packages/patches/glibc-CVE-2017-1000366-pt2.patch delete mode 100644 gnu/packages/patches/glibc-CVE-2017-1000366-pt3.patch delete mode 100644 gnu/packages/patches/glibc-o-largefile.patch delete mode 100644 gnu/packages/patches/glibc-vectorized-strcspn-guards.patch (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/glibc-CVE-2015-5180.patch b/gnu/packages/patches/glibc-CVE-2015-5180.patch deleted file mode 100644 index 92e3740fc1..0000000000 --- a/gnu/packages/patches/glibc-CVE-2015-5180.patch +++ /dev/null @@ -1,311 +0,0 @@ -From b3b37f1a5559a7620e31c8053ed1b44f798f2b6d Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Sat, 31 Dec 2016 20:22:09 +0100 -Subject: [PATCH] CVE-2015-5180: resolv: Fix crash with internal QTYPE [BZ - #18784] - -Also rename T_UNSPEC because an upcoming public header file -update will use that name. - -(cherry picked from commit fc82b0a2dfe7dbd35671c10510a8da1043d746a5) ---- - ChangeLog | 14 ++++ - NEWS | 6 ++ - include/arpa/nameser_compat.h | 6 +- - resolv/Makefile | 5 ++ - resolv/nss_dns/dns-host.c | 2 +- - resolv/res_mkquery.c | 4 + - resolv/res_query.c | 6 +- - resolv/tst-resolv-qtypes.c | 185 ++++++++++++++++++++++++++++++++++++++++++ - 8 files changed, 221 insertions(+), 7 deletions(-) - create mode 100644 resolv/tst-resolv-qtypes.c - -diff --git a/include/arpa/nameser_compat.h b/include/arpa/nameser_compat.h -index 2e735ed..7c0deed 100644 ---- a/include/arpa/nameser_compat.h -+++ b/include/arpa/nameser_compat.h -@@ -1,8 +1,8 @@ - #ifndef _ARPA_NAMESER_COMPAT_ - #include - --/* Picksome unused number to represent lookups of IPv4 and IPv6 (i.e., -- T_A and T_AAAA). */ --#define T_UNSPEC 62321 -+/* The number is outside the 16-bit RR type range and is used -+ internally by the implementation. */ -+#define T_QUERY_A_AND_AAAA 439963904 - - #endif -diff --git a/resolv/Makefile b/resolv/Makefile -index 8be41d3..a4c86b9 100644 ---- a/resolv/Makefile -+++ b/resolv/Makefile -@@ -40,6 +40,9 @@ ifeq ($(have-thread-library),yes) - extra-libs += libanl - routines += gai_sigqueue - tests += tst-res_hconf_reorder -+ -+# This test sends millions of packets and is rather slow. -+xtests += tst-resolv-qtypes - endif - extra-libs-others = $(extra-libs) - libresolv-routines := gethnamaddr res_comp res_debug \ -@@ -117,3 +120,5 @@ tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace - $(objpfx)mtrace-tst-leaks2.out: $(objpfx)tst-leaks2.out - $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@; \ - $(evaluate-test) -+ -+$(objpfx)tst-resolv-qtypes: $(objpfx)libresolv.so $(shared-thread-library) -diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c -index 5f9e357..d16fa4b 100644 ---- a/resolv/nss_dns/dns-host.c -+++ b/resolv/nss_dns/dns-host.c -@@ -323,7 +323,7 @@ _nss_dns_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat, - - int olderr = errno; - enum nss_status status; -- int n = __libc_res_nsearch (&_res, name, C_IN, T_UNSPEC, -+ int n = __libc_res_nsearch (&_res, name, C_IN, T_QUERY_A_AND_AAAA, - host_buffer.buf->buf, 2048, &host_buffer.ptr, - &ans2p, &nans2p, &resplen2, &ans2p_malloced); - if (n >= 0) -diff --git a/resolv/res_mkquery.c b/resolv/res_mkquery.c -index 12f9730..d80b531 100644 ---- a/resolv/res_mkquery.c -+++ b/resolv/res_mkquery.c -@@ -103,6 +103,10 @@ res_nmkquery(res_state statp, - int n; - u_char *dnptrs[20], **dpp, **lastdnptr; - -+ if (class < 0 || class > 65535 -+ || type < 0 || type > 65535) -+ return -1; -+ - #ifdef DEBUG - if (statp->options & RES_DEBUG) - printf(";; res_nmkquery(%s, %s, %s, %s)\n", -diff --git a/resolv/res_query.c b/resolv/res_query.c -index 944d1a9..07dc6f6 100644 ---- a/resolv/res_query.c -+++ b/resolv/res_query.c -@@ -122,7 +122,7 @@ __libc_res_nquery(res_state statp, - int n, use_malloc = 0; - u_int oflags = statp->_flags; - -- size_t bufsize = (type == T_UNSPEC ? 2 : 1) * QUERYSIZE; -+ size_t bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * QUERYSIZE; - u_char *buf = alloca (bufsize); - u_char *query1 = buf; - int nquery1 = -1; -@@ -137,7 +137,7 @@ __libc_res_nquery(res_state statp, - printf(";; res_query(%s, %d, %d)\n", name, class, type); - #endif - -- if (type == T_UNSPEC) -+ if (type == T_QUERY_A_AND_AAAA) - { - n = res_nmkquery(statp, QUERY, name, class, T_A, NULL, 0, NULL, - query1, bufsize); -@@ -190,7 +190,7 @@ __libc_res_nquery(res_state statp, - if (__builtin_expect (n <= 0, 0) && !use_malloc) { - /* Retry just in case res_nmkquery failed because of too - short buffer. Shouldn't happen. */ -- bufsize = (type == T_UNSPEC ? 2 : 1) * MAXPACKET; -+ bufsize = (type == T_QUERY_A_AND_AAAA ? 2 : 1) * MAXPACKET; - buf = malloc (bufsize); - if (buf != NULL) { - query1 = buf; -diff --git a/resolv/tst-resolv-qtypes.c b/resolv/tst-resolv-qtypes.c -new file mode 100644 -index 0000000..b3e60c6 ---- /dev/null -+++ b/resolv/tst-resolv-qtypes.c -@@ -0,0 +1,185 @@ -+/* Exercise low-level query functions with different QTYPEs. -+ Copyright (C) 2016 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* If ture, the response function will send the actual response packet -+ over TCP instead of UDP. */ -+static volatile bool force_tcp; -+ -+/* Send back a fake resource record matching the QTYPE. */ -+static void -+response (const struct resolv_response_context *ctx, -+ struct resolv_response_builder *b, -+ const char *qname, uint16_t qclass, uint16_t qtype) -+{ -+ if (force_tcp && ctx->tcp) -+ { -+ resolv_response_init (b, (struct resolv_response_flags) { .tc = 1 }); -+ resolv_response_add_question (b, qname, qclass, qtype); -+ return; -+ } -+ -+ resolv_response_init (b, (struct resolv_response_flags) { }); -+ resolv_response_add_question (b, qname, qclass, qtype); -+ resolv_response_section (b, ns_s_an); -+ resolv_response_open_record (b, qname, qclass, qtype, 0); -+ resolv_response_add_data (b, &qtype, sizeof (qtype)); -+ resolv_response_close_record (b); -+} -+ -+static const const char *domain = "www.example.com"; -+ -+static int -+wrap_res_query (int type, unsigned char *answer, int answer_length) -+{ -+ return res_query (domain, C_IN, type, answer, answer_length); -+} -+ -+static int -+wrap_res_search (int type, unsigned char *answer, int answer_length) -+{ -+ return res_query (domain, C_IN, type, answer, answer_length); -+} -+ -+static int -+wrap_res_querydomain (int type, unsigned char *answer, int answer_length) -+{ -+ return res_querydomain ("www", "example.com", C_IN, type, -+ answer, answer_length); -+} -+ -+static int -+wrap_res_send (int type, unsigned char *answer, int answer_length) -+{ -+ unsigned char buf[512]; -+ int ret = res_mkquery (QUERY, domain, C_IN, type, -+ (const unsigned char *) "", 0, NULL, -+ buf, sizeof (buf)); -+ if (type < 0 || type >= 65536) -+ { -+ /* res_mkquery fails for out-of-range record types. */ -+ TEST_VERIFY_EXIT (ret == -1); -+ return -1; -+ } -+ TEST_VERIFY_EXIT (ret > 12); /* DNS header length. */ -+ return res_send (buf, ret, answer, answer_length); -+} -+ -+static int -+wrap_res_nquery (int type, unsigned char *answer, int answer_length) -+{ -+ return res_nquery (&_res, domain, C_IN, type, answer, answer_length); -+} -+ -+static int -+wrap_res_nsearch (int type, unsigned char *answer, int answer_length) -+{ -+ return res_nquery (&_res, domain, C_IN, type, answer, answer_length); -+} -+ -+static int -+wrap_res_nquerydomain (int type, unsigned char *answer, int answer_length) -+{ -+ return res_nquerydomain (&_res, "www", "example.com", C_IN, type, -+ answer, answer_length); -+} -+ -+static int -+wrap_res_nsend (int type, unsigned char *answer, int answer_length) -+{ -+ unsigned char buf[512]; -+ int ret = res_nmkquery (&_res, QUERY, domain, C_IN, type, -+ (const unsigned char *) "", 0, NULL, -+ buf, sizeof (buf)); -+ if (type < 0 || type >= 65536) -+ { -+ /* res_mkquery fails for out-of-range record types. */ -+ TEST_VERIFY_EXIT (ret == -1); -+ return -1; -+ } -+ TEST_VERIFY_EXIT (ret > 12); /* DNS header length. */ -+ return res_nsend (&_res, buf, ret, answer, answer_length); -+} -+ -+static void -+test_function (const char *fname, -+ int (*func) (int type, -+ unsigned char *answer, int answer_length)) -+{ -+ unsigned char buf[512]; -+ for (int tcp = 0; tcp < 2; ++tcp) -+ { -+ force_tcp = tcp; -+ for (unsigned int type = 1; type <= 65535; ++type) -+ { -+ if (test_verbose) -+ printf ("info: sending QTYPE %d with %s (tcp=%d)\n", -+ type, fname, tcp); -+ int ret = func (type, buf, sizeof (buf)); -+ if (ret != 47) -+ FAIL_EXIT1 ("%s tcp=%d qtype=%d return value %d", -+ fname,tcp, type, ret); -+ /* One question, one answer record. */ -+ TEST_VERIFY (memcmp (buf + 4, "\0\1\0\1\0\0\0\0", 8) == 0); -+ /* Question section. */ -+ static const char qname[] = "\3www\7example\3com"; -+ size_t qname_length = sizeof (qname); -+ TEST_VERIFY (memcmp (buf + 12, qname, qname_length) == 0); -+ /* RDATA part of answer. */ -+ uint16_t type16 = type; -+ TEST_VERIFY (memcmp (buf + ret - 2, &type16, sizeof (type16)) == 0); -+ } -+ } -+ -+ TEST_VERIFY (func (-1, buf, sizeof (buf) == -1)); -+ TEST_VERIFY (func (65536, buf, sizeof (buf) == -1)); -+} -+ -+static int -+do_test (void) -+{ -+ struct resolv_redirect_config config = -+ { -+ .response_callback = response, -+ }; -+ struct resolv_test *obj = resolv_test_start (config); -+ -+ test_function ("res_query", &wrap_res_query); -+ test_function ("res_search", &wrap_res_search); -+ test_function ("res_querydomain", &wrap_res_querydomain); -+ test_function ("res_send", &wrap_res_send); -+ -+ test_function ("res_nquery", &wrap_res_nquery); -+ test_function ("res_nsearch", &wrap_res_nsearch); -+ test_function ("res_nquerydomain", &wrap_res_nquerydomain); -+ test_function ("res_nsend", &wrap_res_nsend); -+ -+ resolv_test_end (obj); -+ return 0; -+} -+ -+#define TIMEOUT 300 -+#include --- -2.9.3 - diff --git a/gnu/packages/patches/glibc-CVE-2015-7547.patch b/gnu/packages/patches/glibc-CVE-2015-7547.patch deleted file mode 100644 index 12abeb76d4..0000000000 --- a/gnu/packages/patches/glibc-CVE-2015-7547.patch +++ /dev/null @@ -1,590 +0,0 @@ -From b995d95a5943785be3ab862b2d3276f3b4a22481 Mon Sep 17 00:00:00 2001 -From: Carlos O'Donell -Date: Tue, 16 Feb 2016 21:26:37 -0500 -Subject: [PATCH] CVE-2015-7547: getaddrinfo() stack-based buffer overflow (Bug - 18665). - -* A stack-based buffer overflow was found in libresolv when invoked from - libnss_dns, allowing specially crafted DNS responses to seize control - of execution flow in the DNS client. The buffer overflow occurs in - the functions send_dg (send datagram) and send_vc (send TCP) for the - NSS module libnss_dns.so.2 when calling getaddrinfo with AF_UNSPEC - family. The use of AF_UNSPEC triggers the low-level resolver code to - send out two parallel queries for A and AAAA. A mismanagement of the - buffers used for those queries could result in the response of a query - writing beyond the alloca allocated buffer created by - _nss_dns_gethostbyname4_r. Buffer management is simplified to remove - the overflow. Thanks to the Google Security Team and Red Hat for - reporting the security impact of this issue, and Robert Holiday of - Ciena for reporting the related bug 18665. (CVE-2015-7547) - -See also: -https://sourceware.org/ml/libc-alpha/2016-02/msg00416.html -https://sourceware.org/ml/libc-alpha/2016-02/msg00418.html - -(cherry picked from commit e9db92d3acfe1822d56d11abcea5bfc4c41cf6ca) ---- - ChangeLog | 15 +++ - NEWS | 14 +++ - resolv/nss_dns/dns-host.c | 111 ++++++++++++++++++- - resolv/res_query.c | 3 + - resolv/res_send.c | 264 ++++++++++++++++++++++++++++++++++------------ - 5 files changed, 338 insertions(+), 69 deletions(-) - -diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c -index 357ac04..a0fe9a8 100644 ---- a/resolv/nss_dns/dns-host.c -+++ b/resolv/nss_dns/dns-host.c -@@ -1031,7 +1031,10 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, - int h_namelen = 0; - - if (ancount == 0) -- return NSS_STATUS_NOTFOUND; -+ { -+ *h_errnop = HOST_NOT_FOUND; -+ return NSS_STATUS_NOTFOUND; -+ } - - while (ancount-- > 0 && cp < end_of_message && had_error == 0) - { -@@ -1208,7 +1211,14 @@ gaih_getanswer_slice (const querybuf *answer, int anslen, const char *qname, - /* Special case here: if the resolver sent a result but it only - contains a CNAME while we are looking for a T_A or T_AAAA record, - we fail with NOTFOUND instead of TRYAGAIN. */ -- return canon == NULL ? NSS_STATUS_TRYAGAIN : NSS_STATUS_NOTFOUND; -+ if (canon != NULL) -+ { -+ *h_errnop = HOST_NOT_FOUND; -+ return NSS_STATUS_NOTFOUND; -+ } -+ -+ *h_errnop = NETDB_INTERNAL; -+ return NSS_STATUS_TRYAGAIN; - } - - -@@ -1222,11 +1232,101 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2, - - enum nss_status status = NSS_STATUS_NOTFOUND; - -+ /* Combining the NSS status of two distinct queries requires some -+ compromise and attention to symmetry (A or AAAA queries can be -+ returned in any order). What follows is a breakdown of how this -+ code is expected to work and why. We discuss only SUCCESS, -+ TRYAGAIN, NOTFOUND and UNAVAIL, since they are the only returns -+ that apply (though RETURN and MERGE exist). We make a distinction -+ between TRYAGAIN (recoverable) and TRYAGAIN' (not-recoverable). -+ A recoverable TRYAGAIN is almost always due to buffer size issues -+ and returns ERANGE in errno and the caller is expected to retry -+ with a larger buffer. -+ -+ Lastly, you may be tempted to make significant changes to the -+ conditions in this code to bring about symmetry between responses. -+ Please don't change anything without due consideration for -+ expected application behaviour. Some of the synthesized responses -+ aren't very well thought out and sometimes appear to imply that -+ IPv4 responses are always answer 1, and IPv6 responses are always -+ answer 2, but that's not true (see the implementation of send_dg -+ and send_vc to see response can arrive in any order, particularly -+ for UDP). However, we expect it holds roughly enough of the time -+ that this code works, but certainly needs to be fixed to make this -+ a more robust implementation. -+ -+ ---------------------------------------------- -+ | Answer 1 Status / | Synthesized | Reason | -+ | Answer 2 Status | Status | | -+ |--------------------------------------------| -+ | SUCCESS/SUCCESS | SUCCESS | [1] | -+ | SUCCESS/TRYAGAIN | TRYAGAIN | [5] | -+ | SUCCESS/TRYAGAIN' | SUCCESS | [1] | -+ | SUCCESS/NOTFOUND | SUCCESS | [1] | -+ | SUCCESS/UNAVAIL | SUCCESS | [1] | -+ | TRYAGAIN/SUCCESS | TRYAGAIN | [2] | -+ | TRYAGAIN/TRYAGAIN | TRYAGAIN | [2] | -+ | TRYAGAIN/TRYAGAIN' | TRYAGAIN | [2] | -+ | TRYAGAIN/NOTFOUND | TRYAGAIN | [2] | -+ | TRYAGAIN/UNAVAIL | TRYAGAIN | [2] | -+ | TRYAGAIN'/SUCCESS | SUCCESS | [3] | -+ | TRYAGAIN'/TRYAGAIN | TRYAGAIN | [3] | -+ | TRYAGAIN'/TRYAGAIN' | TRYAGAIN' | [3] | -+ | TRYAGAIN'/NOTFOUND | TRYAGAIN' | [3] | -+ | TRYAGAIN'/UNAVAIL | UNAVAIL | [3] | -+ | NOTFOUND/SUCCESS | SUCCESS | [3] | -+ | NOTFOUND/TRYAGAIN | TRYAGAIN | [3] | -+ | NOTFOUND/TRYAGAIN' | TRYAGAIN' | [3] | -+ | NOTFOUND/NOTFOUND | NOTFOUND | [3] | -+ | NOTFOUND/UNAVAIL | UNAVAIL | [3] | -+ | UNAVAIL/SUCCESS | UNAVAIL | [4] | -+ | UNAVAIL/TRYAGAIN | UNAVAIL | [4] | -+ | UNAVAIL/TRYAGAIN' | UNAVAIL | [4] | -+ | UNAVAIL/NOTFOUND | UNAVAIL | [4] | -+ | UNAVAIL/UNAVAIL | UNAVAIL | [4] | -+ ---------------------------------------------- -+ -+ [1] If the first response is a success we return success. -+ This ignores the state of the second answer and in fact -+ incorrectly sets errno and h_errno to that of the second -+ answer. However because the response is a success we ignore -+ *errnop and *h_errnop (though that means you touched errno on -+ success). We are being conservative here and returning the -+ likely IPv4 response in the first answer as a success. -+ -+ [2] If the first response is a recoverable TRYAGAIN we return -+ that instead of looking at the second response. The -+ expectation here is that we have failed to get an IPv4 response -+ and should retry both queries. -+ -+ [3] If the first response was not a SUCCESS and the second -+ response is not NOTFOUND (had a SUCCESS, need to TRYAGAIN, -+ or failed entirely e.g. TRYAGAIN' and UNAVAIL) then use the -+ result from the second response, otherwise the first responses -+ status is used. Again we have some odd side-effects when the -+ second response is NOTFOUND because we overwrite *errnop and -+ *h_errnop that means that a first answer of NOTFOUND might see -+ its *errnop and *h_errnop values altered. Whether it matters -+ in practice that a first response NOTFOUND has the wrong -+ *errnop and *h_errnop is undecided. -+ -+ [4] If the first response is UNAVAIL we return that instead of -+ looking at the second response. The expectation here is that -+ it will have failed similarly e.g. configuration failure. -+ -+ [5] Testing this code is complicated by the fact that truncated -+ second response buffers might be returned as SUCCESS if the -+ first answer is a SUCCESS. To fix this we add symmetry to -+ TRYAGAIN with the second response. If the second response -+ is a recoverable error we now return TRYAGIN even if the first -+ response was SUCCESS. */ -+ - if (anslen1 > 0) - status = gaih_getanswer_slice(answer1, anslen1, qname, - &pat, &buffer, &buflen, - errnop, h_errnop, ttlp, - &first); -+ - if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND - || (status == NSS_STATUS_TRYAGAIN - /* We want to look at the second answer in case of an -@@ -1242,8 +1342,15 @@ gaih_getanswer (const querybuf *answer1, int anslen1, const querybuf *answer2, - &pat, &buffer, &buflen, - errnop, h_errnop, ttlp, - &first); -+ /* Use the second response status in some cases. */ - if (status != NSS_STATUS_SUCCESS && status2 != NSS_STATUS_NOTFOUND) - status = status2; -+ /* Do not return a truncated second response (unless it was -+ unavoidable e.g. unrecoverable TRYAGAIN). */ -+ if (status == NSS_STATUS_SUCCESS -+ && (status2 == NSS_STATUS_TRYAGAIN -+ && *errnop == ERANGE && *h_errnop != NO_RECOVERY)) -+ status = NSS_STATUS_TRYAGAIN; - } - - return status; -diff --git a/resolv/res_query.c b/resolv/res_query.c -index 4a9b3b3..95470a9 100644 ---- a/resolv/res_query.c -+++ b/resolv/res_query.c -@@ -396,6 +396,7 @@ __libc_res_nsearch(res_state statp, - { - free (*answerp2); - *answerp2 = NULL; -+ *nanswerp2 = 0; - *answerp2_malloced = 0; - } - } -@@ -447,6 +448,7 @@ __libc_res_nsearch(res_state statp, - { - free (*answerp2); - *answerp2 = NULL; -+ *nanswerp2 = 0; - *answerp2_malloced = 0; - } - -@@ -521,6 +523,7 @@ __libc_res_nsearch(res_state statp, - { - free (*answerp2); - *answerp2 = NULL; -+ *nanswerp2 = 0; - *answerp2_malloced = 0; - } - if (saved_herrno != -1) -diff --git a/resolv/res_send.c b/resolv/res_send.c -index 5e53cc2..6511bb1 100644 ---- a/resolv/res_send.c -+++ b/resolv/res_send.c -@@ -1,3 +1,20 @@ -+/* Copyright (C) 2016 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, see -+ . */ -+ - /* - * Copyright (c) 1985, 1989, 1993 - * The Regents of the University of California. All rights reserved. -@@ -363,6 +380,8 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen, - #ifdef USE_HOOKS - if (__glibc_unlikely (statp->qhook || statp->rhook)) { - if (anssiz < MAXPACKET && ansp) { -+ /* Always allocate MAXPACKET, callers expect -+ this specific size. */ - u_char *buf = malloc (MAXPACKET); - if (buf == NULL) - return (-1); -@@ -638,6 +657,77 @@ get_nsaddr (res_state statp, int n) - return (struct sockaddr *) (void *) &statp->nsaddr_list[n]; - } - -+/* The send_vc function is responsible for sending a DNS query over TCP -+ to the nameserver numbered NS from the res_state STATP i.e. -+ EXT(statp).nssocks[ns]. The function supports sending both IPv4 and -+ IPv6 queries at the same serially on the same socket. -+ -+ Please note that for TCP there is no way to disable sending both -+ queries, unlike UDP, which honours RES_SNGLKUP and RES_SNGLKUPREOP -+ and sends the queries serially and waits for the result after each -+ sent query. This implemetnation should be corrected to honour these -+ options. -+ -+ Please also note that for TCP we send both queries over the same -+ socket one after another. This technically violates best practice -+ since the server is allowed to read the first query, respond, and -+ then close the socket (to service another client). If the server -+ does this, then the remaining second query in the socket data buffer -+ will cause the server to send the client an RST which will arrive -+ asynchronously and the client's OS will likely tear down the socket -+ receive buffer resulting in a potentially short read and lost -+ response data. This will force the client to retry the query again, -+ and this process may repeat until all servers and connection resets -+ are exhausted and then the query will fail. It's not known if this -+ happens with any frequency in real DNS server implementations. This -+ implementation should be corrected to use two sockets by default for -+ parallel queries. -+ -+ The query stored in BUF of BUFLEN length is sent first followed by -+ the query stored in BUF2 of BUFLEN2 length. Queries are sent -+ serially on the same socket. -+ -+ Answers to the query are stored firstly in *ANSP up to a max of -+ *ANSSIZP bytes. If more than *ANSSIZP bytes are needed and ANSCP -+ is non-NULL (to indicate that modifying the answer buffer is allowed) -+ then malloc is used to allocate a new response buffer and ANSCP and -+ ANSP will both point to the new buffer. If more than *ANSSIZP bytes -+ are needed but ANSCP is NULL, then as much of the response as -+ possible is read into the buffer, but the results will be truncated. -+ When truncation happens because of a small answer buffer the DNS -+ packets header field TC will bet set to 1, indicating a truncated -+ message and the rest of the socket data will be read and discarded. -+ -+ Answers to the query are stored secondly in *ANSP2 up to a max of -+ *ANSSIZP2 bytes, with the actual response length stored in -+ *RESPLEN2. If more than *ANSSIZP bytes are needed and ANSP2 -+ is non-NULL (required for a second query) then malloc is used to -+ allocate a new response buffer, *ANSSIZP2 is set to the new buffer -+ size and *ANSP2_MALLOCED is set to 1. -+ -+ The ANSP2_MALLOCED argument will eventually be removed as the -+ change in buffer pointer can be used to detect the buffer has -+ changed and that the caller should use free on the new buffer. -+ -+ Note that the answers may arrive in any order from the server and -+ therefore the first and second answer buffers may not correspond to -+ the first and second queries. -+ -+ It is not supported to call this function with a non-NULL ANSP2 -+ but a NULL ANSCP. Put another way, you can call send_vc with a -+ single unmodifiable buffer or two modifiable buffers, but no other -+ combination is supported. -+ -+ It is the caller's responsibility to free the malloc allocated -+ buffers by detecting that the pointers have changed from their -+ original values i.e. *ANSCP or *ANSP2 has changed. -+ -+ If errors are encountered then *TERRNO is set to an appropriate -+ errno value and a zero result is returned for a recoverable error, -+ and a less-than zero result is returned for a non-recoverable error. -+ -+ If no errors are encountered then *TERRNO is left unmodified and -+ a the length of the first response in bytes is returned. */ - static int - send_vc(res_state statp, - const u_char *buf, int buflen, const u_char *buf2, int buflen2, -@@ -647,11 +737,7 @@ send_vc(res_state statp, - { - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; -- u_char *ans = *ansp; -- int orig_anssizp = *anssizp; -- // XXX REMOVE -- // int anssiz = *anssizp; -- HEADER *anhp = (HEADER *) ans; -+ HEADER *anhp = (HEADER *) *ansp; - struct sockaddr *nsap = get_nsaddr (statp, ns); - int truncating, connreset, n; - /* On some architectures compiler might emit a warning indicating -@@ -743,6 +829,8 @@ send_vc(res_state statp, - * Receive length & response - */ - int recvresp1 = 0; -+ /* Skip the second response if there is no second query. -+ To do that we mark the second response as received. */ - int recvresp2 = buf2 == NULL; - uint16_t rlen16; - read_len: -@@ -779,40 +867,14 @@ send_vc(res_state statp, - u_char **thisansp; - int *thisresplenp; - if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) { -+ /* We have not received any responses -+ yet or we only have one response to -+ receive. */ - thisanssizp = anssizp; - thisansp = anscp ?: ansp; - assert (anscp != NULL || ansp2 == NULL); - thisresplenp = &resplen; - } else { -- if (*anssizp != MAXPACKET) { -- /* No buffer allocated for the first -- reply. We can try to use the rest -- of the user-provided buffer. */ --#if __GNUC_PREREQ (4, 7) -- DIAG_PUSH_NEEDS_COMMENT; -- DIAG_IGNORE_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); --#endif --#if _STRING_ARCH_unaligned -- *anssizp2 = orig_anssizp - resplen; -- *ansp2 = *ansp + resplen; --#else -- int aligned_resplen -- = ((resplen + __alignof__ (HEADER) - 1) -- & ~(__alignof__ (HEADER) - 1)); -- *anssizp2 = orig_anssizp - aligned_resplen; -- *ansp2 = *ansp + aligned_resplen; --#endif --#if __GNUC_PREREQ (4, 7) -- DIAG_POP_NEEDS_COMMENT; --#endif -- } else { -- /* The first reply did not fit into the -- user-provided buffer. Maybe the second -- answer will. */ -- *anssizp2 = orig_anssizp; -- *ansp2 = *ansp; -- } -- - thisanssizp = anssizp2; - thisansp = ansp2; - thisresplenp = resplen2; -@@ -820,10 +882,14 @@ send_vc(res_state statp, - anhp = (HEADER *) *thisansp; - - *thisresplenp = rlen; -- if (rlen > *thisanssizp) { -- /* Yes, we test ANSCP here. If we have two buffers -- both will be allocatable. */ -- if (__glibc_likely (anscp != NULL)) { -+ /* Is the answer buffer too small? */ -+ if (*thisanssizp < rlen) { -+ /* If the current buffer is not the the static -+ user-supplied buffer then we can reallocate -+ it. */ -+ if (thisansp != NULL && thisansp != ansp) { -+ /* Always allocate MAXPACKET, callers expect -+ this specific size. */ - u_char *newp = malloc (MAXPACKET); - if (newp == NULL) { - *terrno = ENOMEM; -@@ -835,6 +901,9 @@ send_vc(res_state statp, - if (thisansp == ansp2) - *ansp2_malloced = 1; - anhp = (HEADER *) newp; -+ /* A uint16_t can't be larger than MAXPACKET -+ thus it's safe to allocate MAXPACKET but -+ read RLEN bytes instead. */ - len = rlen; - } else { - Dprint(statp->options & RES_DEBUG, -@@ -997,6 +1066,66 @@ reopen (res_state statp, int *terrno, int ns) - return 1; - } - -+/* The send_dg function is responsible for sending a DNS query over UDP -+ to the nameserver numbered NS from the res_state STATP i.e. -+ EXT(statp).nssocks[ns]. The function supports IPv4 and IPv6 queries -+ along with the ability to send the query in parallel for both stacks -+ (default) or serially (RES_SINGLKUP). It also supports serial lookup -+ with a close and reopen of the socket used to talk to the server -+ (RES_SNGLKUPREOP) to work around broken name servers. -+ -+ The query stored in BUF of BUFLEN length is sent first followed by -+ the query stored in BUF2 of BUFLEN2 length. Queries are sent -+ in parallel (default) or serially (RES_SINGLKUP or RES_SNGLKUPREOP). -+ -+ Answers to the query are stored firstly in *ANSP up to a max of -+ *ANSSIZP bytes. If more than *ANSSIZP bytes are needed and ANSCP -+ is non-NULL (to indicate that modifying the answer buffer is allowed) -+ then malloc is used to allocate a new response buffer and ANSCP and -+ ANSP will both point to the new buffer. If more than *ANSSIZP bytes -+ are needed but ANSCP is NULL, then as much of the response as -+ possible is read into the buffer, but the results will be truncated. -+ When truncation happens because of a small answer buffer the DNS -+ packets header field TC will bet set to 1, indicating a truncated -+ message, while the rest of the UDP packet is discarded. -+ -+ Answers to the query are stored secondly in *ANSP2 up to a max of -+ *ANSSIZP2 bytes, with the actual response length stored in -+ *RESPLEN2. If more than *ANSSIZP bytes are needed and ANSP2 -+ is non-NULL (required for a second query) then malloc is used to -+ allocate a new response buffer, *ANSSIZP2 is set to the new buffer -+ size and *ANSP2_MALLOCED is set to 1. -+ -+ The ANSP2_MALLOCED argument will eventually be removed as the -+ change in buffer pointer can be used to detect the buffer has -+ changed and that the caller should use free on the new buffer. -+ -+ Note that the answers may arrive in any order from the server and -+ therefore the first and second answer buffers may not correspond to -+ the first and second queries. -+ -+ It is not supported to call this function with a non-NULL ANSP2 -+ but a NULL ANSCP. Put another way, you can call send_vc with a -+ single unmodifiable buffer or two modifiable buffers, but no other -+ combination is supported. -+ -+ It is the caller's responsibility to free the malloc allocated -+ buffers by detecting that the pointers have changed from their -+ original values i.e. *ANSCP or *ANSP2 has changed. -+ -+ If an answer is truncated because of UDP datagram DNS limits then -+ *V_CIRCUIT is set to 1 and the return value non-zero to indicate to -+ the caller to retry with TCP. The value *GOTSOMEWHERE is set to 1 -+ if any progress was made reading a response from the nameserver and -+ is used by the caller to distinguish between ECONNREFUSED and -+ ETIMEDOUT (the latter if *GOTSOMEWHERE is 1). -+ -+ If errors are encountered then *TERRNO is set to an appropriate -+ errno value and a zero result is returned for a recoverable error, -+ and a less-than zero result is returned for a non-recoverable error. -+ -+ If no errors are encountered then *TERRNO is left unmodified and -+ a the length of the first response in bytes is returned. */ - static int - send_dg(res_state statp, - const u_char *buf, int buflen, const u_char *buf2, int buflen2, -@@ -1006,8 +1135,6 @@ send_dg(res_state statp, - { - const HEADER *hp = (HEADER *) buf; - const HEADER *hp2 = (HEADER *) buf2; -- u_char *ans = *ansp; -- int orig_anssizp = *anssizp; - struct timespec now, timeout, finish; - struct pollfd pfd[1]; - int ptimeout; -@@ -1040,6 +1167,8 @@ send_dg(res_state statp, - int need_recompute = 0; - int nwritten = 0; - int recvresp1 = 0; -+ /* Skip the second response if there is no second query. -+ To do that we mark the second response as received. */ - int recvresp2 = buf2 == NULL; - pfd[0].fd = EXT(statp).nssocks[ns]; - pfd[0].events = POLLOUT; -@@ -1203,55 +1332,56 @@ send_dg(res_state statp, - int *thisresplenp; - - if ((recvresp1 | recvresp2) == 0 || buf2 == NULL) { -+ /* We have not received any responses -+ yet or we only have one response to -+ receive. */ - thisanssizp = anssizp; - thisansp = anscp ?: ansp; - assert (anscp != NULL || ansp2 == NULL); - thisresplenp = &resplen; - } else { -- if (*anssizp != MAXPACKET) { -- /* No buffer allocated for the first -- reply. We can try to use the rest -- of the user-provided buffer. */ --#if _STRING_ARCH_unaligned -- *anssizp2 = orig_anssizp - resplen; -- *ansp2 = *ansp + resplen; --#else -- int aligned_resplen -- = ((resplen + __alignof__ (HEADER) - 1) -- & ~(__alignof__ (HEADER) - 1)); -- *anssizp2 = orig_anssizp - aligned_resplen; -- *ansp2 = *ansp + aligned_resplen; --#endif -- } else { -- /* The first reply did not fit into the -- user-provided buffer. Maybe the second -- answer will. */ -- *anssizp2 = orig_anssizp; -- *ansp2 = *ansp; -- } -- - thisanssizp = anssizp2; - thisansp = ansp2; - thisresplenp = resplen2; - } - - if (*thisanssizp < MAXPACKET -- /* Yes, we test ANSCP here. If we have two buffers -- both will be allocatable. */ -- && anscp -+ /* If the current buffer is not the the static -+ user-supplied buffer then we can reallocate -+ it. */ -+ && (thisansp != NULL && thisansp != ansp) - #ifdef FIONREAD -+ /* Is the size too small? */ - && (ioctl (pfd[0].fd, FIONREAD, thisresplenp) < 0 - || *thisanssizp < *thisresplenp) - #endif - ) { -+ /* Always allocate MAXPACKET, callers expect -+ this specific size. */ - u_char *newp = malloc (MAXPACKET); - if (newp != NULL) { -- *anssizp = MAXPACKET; -- *thisansp = ans = newp; -+ *thisanssizp = MAXPACKET; -+ *thisansp = newp; - if (thisansp == ansp2) - *ansp2_malloced = 1; - } - } -+ /* We could end up with truncation if anscp was NULL -+ (not allowed to change caller's buffer) and the -+ response buffer size is too small. This isn't a -+ reliable way to detect truncation because the ioctl -+ may be an inaccurate report of the UDP message size. -+ Therefore we use this only to issue debug output. -+ To do truncation accurately with UDP we need -+ MSG_TRUNC which is only available on Linux. We -+ can abstract out the Linux-specific feature in the -+ future to detect truncation. */ -+ if (__glibc_unlikely (*thisanssizp < *thisresplenp)) { -+ Dprint(statp->options & RES_DEBUG, -+ (stdout, ";; response may be truncated (UDP)\n") -+ ); -+ } -+ - HEADER *anhp = (HEADER *) *thisansp; - socklen_t fromlen = sizeof(struct sockaddr_in6); - assert (sizeof(from) <= fromlen); --- -2.9.3 - diff --git a/gnu/packages/patches/glibc-CVE-2016-3075.patch b/gnu/packages/patches/glibc-CVE-2016-3075.patch deleted file mode 100644 index d16722806e..0000000000 --- a/gnu/packages/patches/glibc-CVE-2016-3075.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 146b58d11fddbef15b888906e3be4f33900c416f Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Tue, 29 Mar 2016 12:57:56 +0200 -Subject: [PATCH] CVE-2016-3075: Stack overflow in _nss_dns_getnetbyname_r [BZ - #19879] - -The defensive copy is not needed because the name may not alias the -output buffer. - -(cherry picked from commit 317b199b4aff8cfa27f2302ab404d2bb5032b9a4) -(cherry picked from commit 883dceebc8f11921a9890211a4e202e5be17562f) ---- - ChangeLog | 7 +++++++ - NEWS | 10 ++++++++-- - resolv/nss_dns/dns-network.c | 5 +---- - 3 files changed, 16 insertions(+), 6 deletions(-) - -diff --git a/resolv/nss_dns/dns-network.c b/resolv/nss_dns/dns-network.c -index 2eb2f67..8f301a7 100644 ---- a/resolv/nss_dns/dns-network.c -+++ b/resolv/nss_dns/dns-network.c -@@ -118,17 +118,14 @@ _nss_dns_getnetbyname_r (const char *name, struct netent *result, - } net_buffer; - querybuf *orig_net_buffer; - int anslen; -- char *qbuf; - enum nss_status status; - - if (__res_maybe_init (&_res, 0) == -1) - return NSS_STATUS_UNAVAIL; - -- qbuf = strdupa (name); -- - net_buffer.buf = orig_net_buffer = (querybuf *) alloca (1024); - -- anslen = __libc_res_nsearch (&_res, qbuf, C_IN, T_PTR, net_buffer.buf->buf, -+ anslen = __libc_res_nsearch (&_res, name, C_IN, T_PTR, net_buffer.buf->buf, - 1024, &net_buffer.ptr, NULL, NULL, NULL, NULL); - if (anslen < 0) - { --- -2.9.3 - diff --git a/gnu/packages/patches/glibc-CVE-2016-3706.patch b/gnu/packages/patches/glibc-CVE-2016-3706.patch deleted file mode 100644 index 617242df24..0000000000 --- a/gnu/packages/patches/glibc-CVE-2016-3706.patch +++ /dev/null @@ -1,188 +0,0 @@ -From 1a8a7c12950a0026a3c406a7cb1608f96aa1460e Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Fri, 29 Apr 2016 10:35:34 +0200 -Subject: [PATCH] CVE-2016-3706: getaddrinfo: stack overflow in hostent - conversion [BZ #20010] - -When converting a struct hostent response to struct gaih_addrtuple, the -gethosts macro (which is called from gaih_inet) used alloca, without -malloc fallback for large responses. This commit changes this code to -use calloc unconditionally. - -This commit also consolidated a second hostent-to-gaih_addrtuple -conversion loop (in gaih_inet) to use the new conversion function. - -(cherry picked from commit 4ab2ab03d4351914ee53248dc5aef4a8c88ff8b9) ---- - ChangeLog | 10 ++++ - sysdeps/posix/getaddrinfo.c | 130 +++++++++++++++++++++++--------------------- - 2 files changed, 79 insertions(+), 61 deletions(-) - -diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c -index 1ef3f20..fed2d3b 100644 ---- a/sysdeps/posix/getaddrinfo.c -+++ b/sysdeps/posix/getaddrinfo.c -@@ -168,9 +168,58 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, - return 0; - } - -+/* Convert struct hostent to a list of struct gaih_addrtuple objects. -+ h_name is not copied, and the struct hostent object must not be -+ deallocated prematurely. *RESULT must be NULL or a pointer to an -+ object allocated using malloc, which is freed. */ -+static bool -+convert_hostent_to_gaih_addrtuple (const struct addrinfo *req, -+ int family, -+ struct hostent *h, -+ struct gaih_addrtuple **result) -+{ -+ free (*result); -+ *result = NULL; -+ -+ /* Count the number of addresses in h->h_addr_list. */ -+ size_t count = 0; -+ for (char **p = h->h_addr_list; *p != NULL; ++p) -+ ++count; -+ -+ /* Report no data if no addresses are available, or if the incoming -+ address size is larger than what we can store. */ -+ if (count == 0 || h->h_length > sizeof (((struct gaih_addrtuple) {}).addr)) -+ return true; -+ -+ struct gaih_addrtuple *array = calloc (count, sizeof (*array)); -+ if (array == NULL) -+ return false; -+ -+ for (size_t i = 0; i < count; ++i) -+ { -+ if (family == AF_INET && req->ai_family == AF_INET6) -+ { -+ /* Perform address mapping. */ -+ array[i].family = AF_INET6; -+ memcpy(array[i].addr + 3, h->h_addr_list[i], sizeof (uint32_t)); -+ array[i].addr[2] = htonl (0xffff); -+ } -+ else -+ { -+ array[i].family = family; -+ memcpy (array[i].addr, h->h_addr_list[i], h->h_length); -+ } -+ array[i].next = array + i + 1; -+ } -+ array[0].name = h->h_name; -+ array[count - 1].next = NULL; -+ -+ *result = array; -+ return true; -+} -+ - #define gethosts(_family, _type) \ - { \ -- int i; \ - int herrno; \ - struct hostent th; \ - struct hostent *h; \ -@@ -219,36 +268,23 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, - } \ - else if (h != NULL) \ - { \ -- for (i = 0; h->h_addr_list[i]; i++) \ -+ /* Make sure that addrmem can be freed. */ \ -+ if (!malloc_addrmem) \ -+ addrmem = NULL; \ -+ if (!convert_hostent_to_gaih_addrtuple (req, _family,h, &addrmem)) \ - { \ -- if (*pat == NULL) \ -- { \ -- *pat = __alloca (sizeof (struct gaih_addrtuple)); \ -- (*pat)->scopeid = 0; \ -- } \ -- uint32_t *addr = (*pat)->addr; \ -- (*pat)->next = NULL; \ -- (*pat)->name = i == 0 ? strdupa (h->h_name) : NULL; \ -- if (_family == AF_INET && req->ai_family == AF_INET6) \ -- { \ -- (*pat)->family = AF_INET6; \ -- addr[3] = *(uint32_t *) h->h_addr_list[i]; \ -- addr[2] = htonl (0xffff); \ -- addr[1] = 0; \ -- addr[0] = 0; \ -- } \ -- else \ -- { \ -- (*pat)->family = _family; \ -- memcpy (addr, h->h_addr_list[i], sizeof(_type)); \ -- } \ -- pat = &((*pat)->next); \ -+ _res.options |= old_res_options & RES_USE_INET6; \ -+ result = -EAI_SYSTEM; \ -+ goto free_and_return; \ - } \ -+ *pat = addrmem; \ -+ /* The conversion uses malloc unconditionally. */ \ -+ malloc_addrmem = true; \ - \ - if (localcanon != NULL && canon == NULL) \ - canon = strdupa (localcanon); \ - \ -- if (_family == AF_INET6 && i > 0) \ -+ if (_family == AF_INET6 && *pat != NULL) \ - got_ipv6 = true; \ - } \ - } -@@ -612,44 +648,16 @@ gaih_inet (const char *name, const struct gaih_service *service, - { - if (h != NULL) - { -- int i; -- /* We found data, count the number of addresses. */ -- for (i = 0; h->h_addr_list[i]; ++i) -- ; -- if (i > 0 && *pat != NULL) -- --i; -- -- if (__libc_use_alloca (alloca_used -- + i * sizeof (struct gaih_addrtuple))) -- addrmem = alloca_account (i * sizeof (struct gaih_addrtuple), -- alloca_used); -- else -- { -- addrmem = malloc (i -- * sizeof (struct gaih_addrtuple)); -- if (addrmem == NULL) -- { -- result = -EAI_MEMORY; -- goto free_and_return; -- } -- malloc_addrmem = true; -- } -- -- /* Now convert it into the list. */ -- struct gaih_addrtuple *addrfree = addrmem; -- for (i = 0; h->h_addr_list[i]; ++i) -+ /* We found data, convert it. */ -+ if (!convert_hostent_to_gaih_addrtuple -+ (req, AF_INET, h, &addrmem)) - { -- if (*pat == NULL) -- { -- *pat = addrfree++; -- (*pat)->scopeid = 0; -- } -- (*pat)->next = NULL; -- (*pat)->family = AF_INET; -- memcpy ((*pat)->addr, h->h_addr_list[i], -- h->h_length); -- pat = &((*pat)->next); -+ result = -EAI_MEMORY; -+ goto free_and_return; - } -+ *pat = addrmem; -+ /* The conversion uses malloc unconditionally. */ -+ malloc_addrmem = true; - } - } - else --- -2.9.3 - diff --git a/gnu/packages/patches/glibc-CVE-2016-4429.patch b/gnu/packages/patches/glibc-CVE-2016-4429.patch deleted file mode 100644 index 5eebd10543..0000000000 --- a/gnu/packages/patches/glibc-CVE-2016-4429.patch +++ /dev/null @@ -1,58 +0,0 @@ -From bdce95930e1d9a7d013d1ba78740243491262879 Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Mon, 23 May 2016 20:18:34 +0200 -Subject: [PATCH] CVE-2016-4429: sunrpc: Do not use alloca in clntudp_call [BZ - #20112] - -The call is technically in a loop, and under certain circumstances -(which are quite difficult to reproduce in a test case), alloca -can be invoked repeatedly during a single call to clntudp_call. -As a result, the available stack space can be exhausted (even -though individual alloca sizes are bounded implicitly by what -can fit into a UDP packet, as a side effect of the earlier -successful send operation). - -(cherry picked from commit bc779a1a5b3035133024b21e2f339fe4219fb11c) ---- - ChangeLog | 7 +++++++ - NEWS | 4 ++++ - sunrpc/clnt_udp.c | 10 +++++++++- - 3 files changed, 20 insertions(+), 1 deletion(-) - -diff --git a/sunrpc/clnt_udp.c b/sunrpc/clnt_udp.c -index a6cf5f1..4d9acb1 100644 ---- a/sunrpc/clnt_udp.c -+++ b/sunrpc/clnt_udp.c -@@ -388,9 +388,15 @@ send_again: - struct sock_extended_err *e; - struct sockaddr_in err_addr; - struct iovec iov; -- char *cbuf = (char *) alloca (outlen + 256); -+ char *cbuf = malloc (outlen + 256); - int ret; - -+ if (cbuf == NULL) -+ { -+ cu->cu_error.re_errno = errno; -+ return (cu->cu_error.re_status = RPC_CANTRECV); -+ } -+ - iov.iov_base = cbuf + 256; - iov.iov_len = outlen; - msg.msg_name = (void *) &err_addr; -@@ -415,10 +421,12 @@ send_again: - cmsg = CMSG_NXTHDR (&msg, cmsg)) - if (cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_RECVERR) - { -+ free (cbuf); - e = (struct sock_extended_err *) CMSG_DATA(cmsg); - cu->cu_error.re_errno = e->ee_errno; - return (cu->cu_error.re_status = RPC_CANTRECV); - } -+ free (cbuf); - } - #endif - do --- -2.9.3 - diff --git a/gnu/packages/patches/glibc-CVE-2017-1000366-pt1.patch b/gnu/packages/patches/glibc-CVE-2017-1000366-pt1.patch deleted file mode 100644 index 71e80968be..0000000000 --- a/gnu/packages/patches/glibc-CVE-2017-1000366-pt1.patch +++ /dev/null @@ -1,36 +0,0 @@ -From f6110a8fee2ca36f8e2d2abecf3cba9fa7b8ea7d Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Mon, 19 Jun 2017 17:09:55 +0200 -Subject: [PATCH] CVE-2017-1000366: Ignore LD_LIBRARY_PATH for AT_SECURE=1 - programs [BZ #21624] - -LD_LIBRARY_PATH can only be used to reorder system search paths, which -is not useful functionality. - -This makes an exploitable unbounded alloca in _dl_init_paths unreachable -for AT_SECURE=1 programs. - -patch from: -https://sourceware.org/git/?p=glibc.git;a=commit;h=f6110a8fee2ca36f8e2d2abecf3cba9fa7b8ea7d ---- - ChangeLog | 7 +++++++ - elf/rtld.c | 3 ++- - 2 files changed, 9 insertions(+), 1 deletion(-) - -diff --git a/elf/rtld.c b/elf/rtld.c -index 2446a87..2269dbe 100644 ---- a/elf/rtld.c -+++ b/elf/rtld.c -@@ -2422,7 +2422,8 @@ process_envvars (enum mode *modep) - - case 12: - /* The library search path. */ -- if (memcmp (envline, "LIBRARY_PATH", 12) == 0) -+ if (!__libc_enable_secure -+ && memcmp (envline, "LIBRARY_PATH", 12) == 0) - { - library_path = &envline[13]; - break; --- -2.9.3 - diff --git a/gnu/packages/patches/glibc-CVE-2017-1000366-pt2.patch b/gnu/packages/patches/glibc-CVE-2017-1000366-pt2.patch deleted file mode 100644 index 4b859c4bfd..0000000000 --- a/gnu/packages/patches/glibc-CVE-2017-1000366-pt2.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 6d0ba622891bed9d8394eef1935add53003b12e8 Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Mon, 19 Jun 2017 22:31:04 +0200 -Subject: [PATCH] ld.so: Reject overly long LD_PRELOAD path elements - -patch from: -https://sourceware.org/git/?p=glibc.git;a=patch;h=6d0ba622891bed9d8394eef1935add53003b12e8 - ---- - ChangeLog | 7 ++++++ - elf/rtld.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++------------ - 2 files changed, 73 insertions(+), 16 deletions(-) - -diff --git a/elf/rtld.c b/elf/rtld.c -index 2269dbe..86ae20c 100644 ---- a/elf/rtld.c -+++ b/elf/rtld.c -@@ -99,6 +99,35 @@ uintptr_t __pointer_chk_guard_local - strong_alias (__pointer_chk_guard_local, __pointer_chk_guard) - #endif - -+/* Length limits for names and paths, to protect the dynamic linker, -+ particularly when __libc_enable_secure is active. */ -+#ifdef NAME_MAX -+# define SECURE_NAME_LIMIT NAME_MAX -+#else -+# define SECURE_NAME_LIMIT 255 -+#endif -+#ifdef PATH_MAX -+# define SECURE_PATH_LIMIT PATH_MAX -+#else -+# define SECURE_PATH_LIMIT 1024 -+#endif -+ -+/* Check that AT_SECURE=0, or that the passed name does not contain -+ directories and is not overly long. Reject empty names -+ unconditionally. */ -+static bool -+dso_name_valid_for_suid (const char *p) -+{ -+ if (__glibc_unlikely (__libc_enable_secure)) -+ { -+ /* Ignore pathnames with directories for AT_SECURE=1 -+ programs, and also skip overlong names. */ -+ size_t len = strlen (p); -+ if (len >= SECURE_NAME_LIMIT || memchr (p, '/', len) != NULL) -+ return false; -+ } -+ return *p != '\0'; -+} - - /* List of auditing DSOs. */ - static struct audit_list -@@ -718,6 +747,42 @@ static const char *preloadlist attribute_relro; - /* Nonzero if information about versions has to be printed. */ - static int version_info attribute_relro; - -+/* The LD_PRELOAD environment variable gives list of libraries -+ separated by white space or colons that are loaded before the -+ executable's dependencies and prepended to the global scope list. -+ (If the binary is running setuid all elements containing a '/' are -+ ignored since it is insecure.) Return the number of preloads -+ performed. */ -+unsigned int -+handle_ld_preload (const char *preloadlist, struct link_map *main_map) -+{ -+ unsigned int npreloads = 0; -+ const char *p = preloadlist; -+ char fname[SECURE_PATH_LIMIT]; -+ -+ while (*p != '\0') -+ { -+ /* Split preload list at space/colon. */ -+ size_t len = strcspn (p, " :"); -+ if (len > 0 && len < sizeof (fname)) -+ { -+ memcpy (fname, p, len); -+ fname[len] = '\0'; -+ } -+ else -+ fname[0] = '\0'; -+ -+ /* Skip over the substring and the following delimiter. */ -+ p += len; -+ if (*p != '\0') -+ ++p; -+ -+ if (dso_name_valid_for_suid (fname)) -+ npreloads += do_preload (fname, main_map, "LD_PRELOAD"); -+ } -+ return npreloads; -+} -+ - static void - dl_main (const ElfW(Phdr) *phdr, - ElfW(Word) phnum, -@@ -1464,23 +1529,8 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n", - - if (__glibc_unlikely (preloadlist != NULL)) - { -- /* The LD_PRELOAD environment variable gives list of libraries -- separated by white space or colons that are loaded before the -- executable's dependencies and prepended to the global scope -- list. If the binary is running setuid all elements -- containing a '/' are ignored since it is insecure. */ -- char *list = strdupa (preloadlist); -- char *p; -- - HP_TIMING_NOW (start); -- -- /* Prevent optimizing strsep. Speed is not important here. */ -- while ((p = (strsep) (&list, " :")) != NULL) -- if (p[0] != '\0' -- && (__builtin_expect (! __libc_enable_secure, 1) -- || strchr (p, '/') == NULL)) -- npreloads += do_preload (p, main_map, "LD_PRELOAD"); -- -+ npreloads += handle_ld_preload (preloadlist, main_map); - HP_TIMING_NOW (stop); - HP_TIMING_DIFF (diff, start, stop); - HP_TIMING_ACCUM_NT (load_time, diff); --- -2.9.3 - diff --git a/gnu/packages/patches/glibc-CVE-2017-1000366-pt3.patch b/gnu/packages/patches/glibc-CVE-2017-1000366-pt3.patch deleted file mode 100644 index 3d8f6d2bf8..0000000000 --- a/gnu/packages/patches/glibc-CVE-2017-1000366-pt3.patch +++ /dev/null @@ -1,206 +0,0 @@ -From 81b82fb966ffbd94353f793ad17116c6088dedd9 Mon Sep 17 00:00:00 2001 -From: Florian Weimer -Date: Mon, 19 Jun 2017 22:32:12 +0200 -Subject: [PATCH] ld.so: Reject overly long LD_AUDIT path elements - -Also only process the last LD_AUDIT entry. - -patch from: -https://sourceware.org/git/?p=glibc.git;a=commit;h=81b82fb966ffbd94353f793ad17116c6088dedd9 - ---- - ChangeLog | 11 +++++++ - elf/rtld.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------- - 2 files changed, 106 insertions(+), 15 deletions(-) - -diff --git a/elf/rtld.c b/elf/rtld.c -index 86ae20c..65647fb 100644 ---- a/elf/rtld.c -+++ b/elf/rtld.c -@@ -129,13 +129,91 @@ dso_name_valid_for_suid (const char *p) - return *p != '\0'; - } - --/* List of auditing DSOs. */ -+/* LD_AUDIT variable contents. Must be processed before the -+ audit_list below. */ -+const char *audit_list_string; -+ -+/* Cyclic list of auditing DSOs. audit_list->next is the first -+ element. */ - static struct audit_list - { - const char *name; - struct audit_list *next; - } *audit_list; - -+/* Iterator for audit_list_string followed by audit_list. */ -+struct audit_list_iter -+{ -+ /* Tail of audit_list_string still needing processing, or NULL. */ -+ const char *audit_list_tail; -+ -+ /* The list element returned in the previous iteration. NULL before -+ the first element. */ -+ struct audit_list *previous; -+ -+ /* Scratch buffer for returning a name which is part of -+ audit_list_string. */ -+ char fname[SECURE_NAME_LIMIT]; -+}; -+ -+/* Initialize an audit list iterator. */ -+static void -+audit_list_iter_init (struct audit_list_iter *iter) -+{ -+ iter->audit_list_tail = audit_list_string; -+ iter->previous = NULL; -+} -+ -+/* Iterate through both audit_list_string and audit_list. */ -+static const char * -+audit_list_iter_next (struct audit_list_iter *iter) -+{ -+ if (iter->audit_list_tail != NULL) -+ { -+ /* First iterate over audit_list_string. */ -+ while (*iter->audit_list_tail != '\0') -+ { -+ /* Split audit list at colon. */ -+ size_t len = strcspn (iter->audit_list_tail, ":"); -+ if (len > 0 && len < sizeof (iter->fname)) -+ { -+ memcpy (iter->fname, iter->audit_list_tail, len); -+ iter->fname[len] = '\0'; -+ } -+ else -+ /* Do not return this name to the caller. */ -+ iter->fname[0] = '\0'; -+ -+ /* Skip over the substring and the following delimiter. */ -+ iter->audit_list_tail += len; -+ if (*iter->audit_list_tail == ':') -+ ++iter->audit_list_tail; -+ -+ /* If the name is valid, return it. */ -+ if (dso_name_valid_for_suid (iter->fname)) -+ return iter->fname; -+ /* Otherwise, wrap around and try the next name. */ -+ } -+ /* Fall through to the procesing of audit_list. */ -+ } -+ -+ if (iter->previous == NULL) -+ { -+ if (audit_list == NULL) -+ /* No pre-parsed audit list. */ -+ return NULL; -+ /* Start of audit list. The first list element is at -+ audit_list->next (cyclic list). */ -+ iter->previous = audit_list->next; -+ return iter->previous->name; -+ } -+ if (iter->previous == audit_list) -+ /* Cyclic list wrap-around. */ -+ return NULL; -+ iter->previous = iter->previous->next; -+ return iter->previous->name; -+} -+ - #ifndef HAVE_INLINED_SYSCALLS - /* Set nonzero during loading and initialization of executable and - libraries, cleared before the executable's entry point runs. This -@@ -1305,11 +1383,13 @@ of this helper program; chances are you did not intend to run this program.\n\ - GL(dl_rtld_map).l_tls_modid = _dl_next_tls_modid (); - - /* If we have auditing DSOs to load, do it now. */ -- if (__glibc_unlikely (audit_list != NULL)) -+ bool need_security_init = true; -+ if (__glibc_unlikely (audit_list != NULL) -+ || __glibc_unlikely (audit_list_string != NULL)) - { -- /* Iterate over all entries in the list. The order is important. */ - struct audit_ifaces *last_audit = NULL; -- struct audit_list *al = audit_list->next; -+ struct audit_list_iter al_iter; -+ audit_list_iter_init (&al_iter); - - /* Since we start using the auditing DSOs right away we need to - initialize the data structures now. */ -@@ -1320,9 +1400,14 @@ of this helper program; chances are you did not intend to run this program.\n\ - use different values (especially the pointer guard) and will - fail later on. */ - security_init (); -+ need_security_init = false; - -- do -+ while (true) - { -+ const char *name = audit_list_iter_next (&al_iter); -+ if (name == NULL) -+ break; -+ - int tls_idx = GL(dl_tls_max_dtv_idx); - - /* Now it is time to determine the layout of the static TLS -@@ -1331,7 +1416,7 @@ of this helper program; chances are you did not intend to run this program.\n\ - no DF_STATIC_TLS bit is set. The reason is that we know - glibc will use the static model. */ - struct dlmopen_args dlmargs; -- dlmargs.fname = al->name; -+ dlmargs.fname = name; - dlmargs.map = NULL; - - const char *objname; -@@ -1344,7 +1429,7 @@ of this helper program; chances are you did not intend to run this program.\n\ - not_loaded: - _dl_error_printf ("\ - ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n", -- al->name, err_str); -+ name, err_str); - if (malloced) - free ((char *) err_str); - } -@@ -1448,10 +1533,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n", - goto not_loaded; - } - } -- -- al = al->next; - } -- while (al != audit_list->next); - - /* If we have any auditing modules, announce that we already - have two objects loaded. */ -@@ -1715,7 +1797,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n", - if (tcbp == NULL) - tcbp = init_tls (); - -- if (__glibc_likely (audit_list == NULL)) -+ if (__glibc_likely (need_security_init)) - /* Initialize security features. But only if we have not done it - earlier. */ - security_init (); -@@ -2346,9 +2428,7 @@ process_dl_audit (char *str) - char *p; - - while ((p = (strsep) (&str, ":")) != NULL) -- if (p[0] != '\0' -- && (__builtin_expect (! __libc_enable_secure, 1) -- || strchr (p, '/') == NULL)) -+ if (dso_name_valid_for_suid (p)) - { - /* This is using the local malloc, not the system malloc. The - memory can never be freed. */ -@@ -2412,7 +2492,7 @@ process_envvars (enum mode *modep) - break; - } - if (memcmp (envline, "AUDIT", 5) == 0) -- process_dl_audit (&envline[6]); -+ audit_list_string = &envline[6]; - break; - - case 7: --- -2.9.3 - diff --git a/gnu/packages/patches/glibc-o-largefile.patch b/gnu/packages/patches/glibc-o-largefile.patch deleted file mode 100644 index 2b0ae8c8bb..0000000000 --- a/gnu/packages/patches/glibc-o-largefile.patch +++ /dev/null @@ -1,25 +0,0 @@ -This fixes -whereby, on 32-bit platforms, libc 2.22 would fail to pass O_LARGEFILE -to 'openat'. This was caught by 'tests/sparse03.at' in the tar -test suite. - -commit eb32b0d40308166c4d8f6330cc2958cb1e545075 -Author: Andreas Schwab -Date: Mon Aug 10 14:12:47 2015 +0200 - - Readd O_LARGEFILE flag for openat64 (bug 18781) - ---- a/sysdeps/unix/sysv/linux/openat.c -+++ b/sysdeps/unix/sysv/linux/openat.c -@@ -68,6 +68,11 @@ __OPENAT (int fd, const char *file, int oflag, ...) - va_end (arg); - } - -+ /* We have to add the O_LARGEFILE flag for openat64. */ -+#ifdef MORE_OFLAGS -+ oflag |= MORE_OFLAGS; -+#endif -+ - return SYSCALL_CANCEL (openat, fd, file, oflag, mode); - } - libc_hidden_def (__OPENAT) diff --git a/gnu/packages/patches/glibc-vectorized-strcspn-guards.patch b/gnu/packages/patches/glibc-vectorized-strcspn-guards.patch deleted file mode 100644 index 3d6c7749d4..0000000000 --- a/gnu/packages/patches/glibc-vectorized-strcspn-guards.patch +++ /dev/null @@ -1,23 +0,0 @@ -Copied from Debian. - -2017-06-14 Florian Weimer - - * sysdeps/i386/i686/multiarch/strcspn-c.c: Add IS_IN (libc) guard. - * sysdeps/i386/i686/multiarch/varshift.c: Likewise. - ---- a/sysdeps/i386/i686/multiarch/strcspn-c.c -+++ b/sysdeps/i386/i686/multiarch/strcspn-c.c -@@ -1,2 +1,4 @@ --#define __strcspn_sse2 __strcspn_ia32 --#include -+#if IS_IN (libc) -+# define __strcspn_sse2 __strcspn_ia32 -+# include -+#endif ---- a/sysdeps/i386/i686/multiarch/varshift.c -+++ b/sysdeps/i386/i686/multiarch/varshift.c -@@ -1 +1,3 @@ --#include -+#if IS_IN (libc) -+# include -+#endif -- cgit v1.2.3 From c64f0eea880efa4953cce93f293b2935b45b9721 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 27 Jul 2020 03:40:33 +0200 Subject: gnu: python-jedi: Update to 0.17.2. * gnu/packages/python-xyz.scm (python-jedi): Update to 0.17.2. [source, arguments]: Remove upstreamed patching. * gnu/packages/patches/python-jedi-sort-project-test.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - .../patches/python-jedi-sort-project-test.patch | 18 ------------------ gnu/packages/python-xyz.scm | 14 ++------------ 3 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 gnu/packages/patches/python-jedi-sort-project-test.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index ef6533bd8d..e574697f32 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1454,7 +1454,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-pep8-stdlib-tokenize-compat.patch \ %D%/packages/patches/python-pyfakefs-remove-bad-test.patch \ %D%/packages/patches/python-flint-includes.patch \ - %D%/packages/patches/python-jedi-sort-project-test.patch \ %D%/packages/patches/python-libxml2-utf8.patch \ %D%/packages/patches/python-memcached-syntax-warnings.patch \ %D%/packages/patches/python-mox3-python3.6-compat.patch \ diff --git a/gnu/packages/patches/python-jedi-sort-project-test.patch b/gnu/packages/patches/python-jedi-sort-project-test.patch deleted file mode 100644 index b2d602dfe6..0000000000 --- a/gnu/packages/patches/python-jedi-sort-project-test.patch +++ /dev/null @@ -1,18 +0,0 @@ -Sort the result of file system traversal to avoid test failure on different -file systems. - -Taken from upstream: -https://github.com/davidhalter/jedi/commit/7ff76bb7d0d94514e17cd1647f4ffaf533dd55f5 - -diff --git a/test/test_api/test_project.py b/test/test_api/test_project.py ---- a/test/test_api/test_project.py -+++ b/test/test_api/test_project.py -@@ -135,7 +135,7 @@ def test_search(string, full_names, kwargs, skip_pre_python36): - defs = project.complete_search(string, **kwargs) - else: - defs = project.search(string, **kwargs) -- assert [('stub:' if d.is_stub() else '') + d.full_name for d in defs] == full_names -+ assert sorted([('stub:' if d.is_stub() else '') + d.full_name for d in defs]) == full_names - - - @pytest.mark.parametrize( diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 42bb160a75..3aebff078b 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -12607,27 +12607,17 @@ characters, mouse support, and auto suggestions.") (define-public python-jedi (package (name "python-jedi") - (version "0.17.0") + (version "0.17.2") (source (origin (method url-fetch) (uri (pypi-uri "jedi" version)) - (patches (search-patches "python-jedi-sort-project-test.patch")) (sha256 - (base32 - "0c1h9x3a9klvk2g288wl328x8xgzw7136k6vs9hkd56b85vcjh6z")))) + (base32 "080xyf97ifabdz7jp8clg00b8zv5g33fva1fb2xf80q6fndpvvc6")))) (build-system python-build-system) (arguments `(#:phases (modify-phases %standard-phases - (add-before 'check 'adjust-test-for-python-3.8 - (lambda _ - ;; Mimic upstream commit e7feeef64 to allow for extra output lines - ;; in TestSetupReadline on Python 3.8. Remove for jedi > 0.17.0. - (substitute* "test/test_utils.py" - (("assert len\\(difference\\) < 20") - "assert len(difference) < 22")) - #t)) (replace 'check (lambda _ (setenv "HOME" "/tmp") -- cgit v1.2.3 From 2bd84c50ff7a8dafe83b6aa89cd0f01d5282c621 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sun, 26 Jul 2020 23:55:01 -0400 Subject: gnu: plotutils: Fix build on non-x86_64 architectures. * gnu/packages/patches/plotutils-spline-test.patch: Add patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/plotutils.scm (plotutils)[patches]: Apply it. --- gnu/local.mk | 1 + gnu/packages/patches/plotutils-spline-test.patch | 34 ++++++++++++++++++++++++ gnu/packages/plotutils.scm | 7 ++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/plotutils-spline-test.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index e574697f32..8274e158d0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1408,6 +1408,7 @@ dist_patch_DATA = \ %D%/packages/patches/plink-endian-detection.patch \ %D%/packages/patches/plib-CVE-2011-4620.patch \ %D%/packages/patches/plib-CVE-2012-4552.patch \ + %D%/packages/patches/plotutils-spline-test.patch \ %D%/packages/patches/podofo-cmake-3.12.patch \ %D%/packages/patches/portaudio-audacity-compat.patch \ %D%/packages/patches/portmidi-modular-build.patch \ diff --git a/gnu/packages/patches/plotutils-spline-test.patch b/gnu/packages/patches/plotutils-spline-test.patch new file mode 100644 index 0000000000..2f9feb96cf --- /dev/null +++ b/gnu/packages/patches/plotutils-spline-test.patch @@ -0,0 +1,34 @@ +Description: Work around i386 testsuite error +Author: Andreas Metzler +Origin: vendor +Bug: http://lists.gnu.org/archive/html/bug-plotutils/2017-02/msg00001.html +Bug-Debian: https://bugs.debian.org/856134 +Forwarded: http://lists.gnu.org/archive/html/bug-plotutils/2017-02/msg00002.html +Last-Update: 2017-02-25 + +--- a/test/spline.test ++++ b/test/spline.test +@@ -3,12 +3,21 @@ + echo 0 1 0.5 0.75 -0.25 0 | ../spline/spline -a -T 1 -n 120 \ + --precision 5 -p >spline.out + ++# Work around testsuite error ++# http://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00000.html ++# + # work around line end problems in installations with DJGPP under DOS +-tr -d '\015' < spline.out > spline.dos ++tr -d '\015' < spline.out \ ++ | head -n 120 | tail -n 119 \ ++ > spline.dos + +-if cmp -s $SRCDIR/spline.xout spline.dos ++# cannot patch spline.xout, it is used as input for graph.test. ++head -n 120 $SRCDIR/spline.xout | tail -n 119 > spline.xout.4comp ++ ++if cmp -s spline.xout.4comp spline.dos + then retval=0; + else retval=1; + fi; + ++rm -f spline.xout.4comp + exit $retval diff --git a/gnu/packages/plotutils.scm b/gnu/packages/plotutils.scm index 8ddc8ebc74..1e182fbb51 100644 --- a/gnu/packages/plotutils.scm +++ b/gnu/packages/plotutils.scm @@ -73,7 +73,12 @@ (substitute* "libplot/z_write.c" (("png_ptr->jmpbuf") "png_jmpbuf (png_ptr)")) - #t)))) + #t)) + (patches + ;; The test suite fails on some architectures such as i686 (see: + ;; https://lists.gnu.org/archive/html/bug-plotutils/2016-04/msg00002.html). + ;; The following Debian patch works around it. + (search-patches "plotutils-spline-test.patch")))) (build-system gnu-build-system) (arguments `(#:configure-flags (list "--enable-libplotter"))) -- cgit v1.2.3 From 076fd4e791e517c29cf2740d2fa8974a5edfd21d Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 27 Jul 2020 23:53:25 -0400 Subject: gnu: lib2geom: Fix more tests. There were still two tests failing on aarch64-linux: 1. rotated-rect-test, 2. ellipse-test. The first one was removed along with the RotatedRect class in latest upstream, while the second one is yet numerical accuracy related. It gets fixed by updating the already existing 'lib2geom-fix-tests' patch. * gnu/packages/graphics.scm (lib2geom): Bump revision to "2", and update commit hash to the latest one available. * gnu/packages/patches/lib2geom-fix-tests.patch: Update patch. --- gnu/packages/graphics.scm | 6 ++-- gnu/packages/patches/lib2geom-fix-tests.patch | 40 ++++++++++++++++++++------- 2 files changed, 33 insertions(+), 13 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index 2d0e3c1867..d5139b1f04 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -389,8 +389,8 @@ exception-handling library.") (define-public lib2geom ;; Use the latest master commit, as the 1.0 release suffer build problems. - (let ((revision "1") - (commit "42e119d94934a9514c61571cfb6b4af503ece082")) + (let ((revision "2") + (commit "f98256d2a923955af74b8cff3d456f0df1ee4b59")) (package (name "lib2geom") (version (git-version "1.0" revision commit)) @@ -402,7 +402,7 @@ exception-handling library.") (file-name (git-file-name name version)) (sha256 (base32 - "195rs0kdbs8w62irha1nwy83bccz04wglmk578qrj1mky7fc4rjv")) + "0w6ijaai8i80d0f35c0shgdspqlsdhw3cvz106k1gm7bmnz1wzpq")) (patches ;; Patches submitted to upstream (see: ;; https://gitlab.com/inkscape/lib2geom/merge_requests/17, diff --git a/gnu/packages/patches/lib2geom-fix-tests.patch b/gnu/packages/patches/lib2geom-fix-tests.patch index 9118658e49..47e8f6e2ec 100644 --- a/gnu/packages/patches/lib2geom-fix-tests.patch +++ b/gnu/packages/patches/lib2geom-fix-tests.patch @@ -1,10 +1,10 @@ -From 488edbf84e918e0353e7a8f438abbf6eeca3767e Mon Sep 17 00:00:00 2001 +From 3e858cc87f2f8b7dc514a8ad7709c1f47f1f4cde Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Wed, 17 Jun 2020 23:20:53 -0400 Subject: [PATCH] tests: Fix tests on non-x86_64 platforms. On platform other than x86_64 such as aarch64-linux or i686-linux, -some double comparison would fail. +some double comparisons would fail. See . @@ -14,6 +14,7 @@ EXPECT_near. (Portion): Replace EXPECT_EQ by EXPECT_near. * tests/ellipse-test.cpp (BezierIntersection): Lower error tolerance from 6e-13 to 6e-12. +(LineIntersection): Replace EXPECT_DOUBLE_EQ by EXPECT_NEAR. * tests/line-test.cpp (Reflection): Replace EXPECT_FLOAT_EQ BY EXPECT_near. (Coefficients): Skip test. @@ -21,13 +22,13 @@ EXPECT_near. EXPECT_DOUBLE_EQ. --- tests/bezier-test.cpp | 31 +++++++++++++++++-------------- - tests/ellipse-test.cpp | 2 +- + tests/ellipse-test.cpp | 11 ++++++----- tests/line-test.cpp | 11 +++++++---- tests/parallelogram-test.cpp | 8 ++++---- - 4 files changed, 29 insertions(+), 23 deletions(-) + 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/tests/bezier-test.cpp b/tests/bezier-test.cpp -index 4054a65..46209f4 100644 +index 4054a654..46209f40 100644 --- a/tests/bezier-test.cpp +++ b/tests/bezier-test.cpp @@ -152,11 +152,13 @@ TEST_F(BezierTest, Casteljau) { @@ -104,10 +105,29 @@ index 4054a65..46209f4 100644 } } diff --git a/tests/ellipse-test.cpp b/tests/ellipse-test.cpp -index 561c285..d6e65d8 100644 +index 561c285a..8e4de12c 100644 --- a/tests/ellipse-test.cpp +++ b/tests/ellipse-test.cpp -@@ -199,7 +199,7 @@ TEST(EllipseTest, BezierIntersection) { +@@ -158,13 +158,14 @@ TEST(EllipseTest, LineIntersection) { + std::vector xs = e.intersect(l); + + ASSERT_EQ(xs.size(), 2ul); +- EXPECT_FLOAT_EQ(xs[0].point()[X], 0); +- EXPECT_FLOAT_EQ(xs[0].point()[Y], -2); +- EXPECT_FLOAT_EQ(xs[1].point()[X], 9./5); +- EXPECT_FLOAT_EQ(xs[1].point()[Y], 8./5); + + // due to numeric imprecision when evaluating Ellipse, + // the points may deviate by around 2e-16 ++ EXPECT_NEAR(xs[0].point()[X], 0, 1e-15); ++ EXPECT_NEAR(xs[0].point()[Y], -2, 1e-15); ++ EXPECT_NEAR(xs[1].point()[X], 9./5, 1e-15); ++ EXPECT_NEAR(xs[1].point()[Y], 8./5, 1e-15); ++ + EXPECT_intersections_valid(e, l, xs, 1e-15); + } + +@@ -199,7 +200,7 @@ TEST(EllipseTest, BezierIntersection) { std::vector xs = e.intersect(b); EXPECT_EQ(xs.size(), 2ul); @@ -117,7 +137,7 @@ index 561c285..d6e65d8 100644 TEST(EllipseTest, Coefficients) { diff --git a/tests/line-test.cpp b/tests/line-test.cpp -index 99546dd..2399130 100644 +index 99546ddc..23991300 100644 --- a/tests/line-test.cpp +++ b/tests/line-test.cpp @@ -91,10 +91,12 @@ TEST(LineTest, Reflection) { @@ -146,7 +166,7 @@ index 99546dd..2399130 100644 lines.push_back(Line(Point(1e9,1e9), Point(1,1))); //the case below will never work without normalizing the line diff --git a/tests/parallelogram-test.cpp b/tests/parallelogram-test.cpp -index 8109ead..70ccea1 100644 +index 8109eadd..70ccea13 100644 --- a/tests/parallelogram-test.cpp +++ b/tests/parallelogram-test.cpp @@ -106,13 +106,13 @@ TEST(ParallelogramTest, area) @@ -168,5 +188,5 @@ index 8109ead..70ccea1 100644 class ParallelogramTest -- -2.26.2 +2.27.0 -- cgit v1.2.3 From 6a14917a16d3f629727960a9b620aa5455d963c3 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 27 Jul 2020 16:09:16 -0400 Subject: gnu: icecat: Update to 68.11.0-guix0-preview1 [security-fixes]. Includes fixes for CVE-2020-6463, CVE-2020-6514, CVE-2020-15652, and CVE-2020-15659. * gnu/packages/gnuzilla.scm (%icecat-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. * gnu/packages/patches/icecat-makeicecat.patch: Adapt to new version. --- gnu/packages/gnuzilla.scm | 12 ++++++------ gnu/packages/patches/icecat-makeicecat.patch | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index a525f70618..8923836437 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -556,8 +556,8 @@ from forcing GEXP-PROMISE." #:system system #:guile-for-build guile))) -(define %icecat-version "68.10.0-guix0-preview1") -(define %icecat-build-id "20200630000000") ;must be of the form YYYYMMDDhhmmss +(define %icecat-version "68.11.0-guix0-preview1") +(define %icecat-build-id "20200728000000") ;must be of the form YYYYMMDDhhmmss ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat' @@ -579,11 +579,11 @@ from forcing GEXP-PROMISE." "firefox-" upstream-firefox-version ".source.tar.xz")) (sha256 (base32 - "0azdinwqjfv2q37gqpxmfvzsk86pvsi6cjaq1310zs26gric5j1f")))) + "0q11dmfz59a11xgwy5sdc6x89xvb8lkm51lr8yvqb9qvmz5gghci")))) - (upstream-icecat-base-version "68.10.0") ; maybe older than base-version + (upstream-icecat-base-version "68.11.0") ; maybe older than base-version ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version)) - (gnuzilla-commit "76dced64ce0e72fe3030dc2f7b22cda8e36b165e") + (gnuzilla-commit "ac907e0c0f5b8896da34d31594b168e60983bec8") (gnuzilla-source (origin (method git-fetch) @@ -595,7 +595,7 @@ from forcing GEXP-PROMISE." (string-take gnuzilla-commit 8))) (sha256 (base32 - "0xcg6h0da63qyv7h575xjrbkzqqcjhwjd45x9h9qmpxiaibi9g3d")))) + "1n2sdf48s5xwcaf69v7yqvas069ficqnfk6nf0kqvd87vryb7182")))) (makeicecat-patch (local-file (search-patch "icecat-makeicecat.patch"))) diff --git a/gnu/packages/patches/icecat-makeicecat.patch b/gnu/packages/patches/icecat-makeicecat.patch index cff0b7ad45..521166b0fc 100644 --- a/gnu/packages/patches/icecat-makeicecat.patch +++ b/gnu/packages/patches/icecat-makeicecat.patch @@ -25,7 +25,7 @@ index 8be2362..48716f2 100755 -wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc -gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 -gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc --echo -n 2ec8c2627e46e80fc208584966a2ded7a0a9ff76b55ffccec0623b89b98ded2b firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +-echo -n 91c1f7caaf1ba785b74799865227456bf784ba614d17cf5f0f41a5f25d6d2160 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - - -echo Extracting Firefox tarball -tar -xf firefox-${FFVERSION}esr.source.tar.xz @@ -37,7 +37,7 @@ index 8be2362..48716f2 100755 +# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc +# gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 +# gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc -+# echo -n 2ec8c2627e46e80fc208584966a2ded7a0a9ff76b55ffccec0623b89b98ded2b firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - ++# echo -n 91c1f7caaf1ba785b74799865227456bf784ba614d17cf5f0f41a5f25d6d2160 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +# +# echo Extracting Firefox tarball +# tar -xf firefox-${FFVERSION}esr.source.tar.xz -- cgit v1.2.3 From e402ccd00308d2db6ff86d4bd180c25c8dd0ce87 Mon Sep 17 00:00:00 2001 From: Michael Rohleder Date: Mon, 27 Jul 2020 04:07:50 +0200 Subject: gnu: libextractor: Update to 1.10. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/gnunet.scm (libextractor): Update to 1.10. [arguments]: Add 'fix-exiv2-tests' phase. [inputs]: Add GIFLIB, remove TIDY-HTML. * gnu/packages/patches/libextractor-exiv2.patch: Remove. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 - gnu/packages/gnunet.scm | 23 +++-- gnu/packages/patches/libextractor-exiv2.patch | 124 -------------------------- 3 files changed, 14 insertions(+), 134 deletions(-) delete mode 100644 gnu/packages/patches/libextractor-exiv2.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 8274e158d0..812761b992 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1197,7 +1197,6 @@ dist_patch_DATA = \ %D%/packages/patches/libbonobo-activation-test-race.patch \ %D%/packages/patches/libcanberra-sound-theme-freedesktop.patch \ %D%/packages/patches/libdrm-realpath-virtio.patch \ - %D%/packages/patches/libextractor-exiv2.patch \ %D%/packages/patches/libgeotiff-adapt-test-script-for-proj-6.2.patch \ %D%/packages/patches/libgit2-mtime-0.patch \ %D%/packages/patches/libgnome-encoding.patch \ diff --git a/gnu/packages/gnunet.scm b/gnu/packages/gnunet.scm index 979dadbe2e..467e51db5f 100644 --- a/gnu/packages/gnunet.scm +++ b/gnu/packages/gnunet.scm @@ -10,6 +10,7 @@ ;;; Copyright © 2018 Alex Vong ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Tanguy Le Carrour +;;; Copyright © 2020 Michael Rohleder ;;; ;;; This file is part of GNU Guix. ;;; @@ -73,24 +74,22 @@ (define-public libextractor (package (name "libextractor") - (version "1.9") + (version "1.10") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/libextractor/libextractor-" version ".tar.gz")) (sha256 (base32 - "1zz2zvikvfibxnk1va3kgzs7djsmiqy7bmk8y01vbsf54ryjb3zh")) - (patches (search-patches "libextractor-exiv2.patch")))) + "0mr38g7kfn3p050hd3hckbcz2yd3za6dwl1c26x2kjf7vnsi3vcy")))) (build-system gnu-build-system) ;; WARNING: Checks require /dev/shm to be in the build chroot, especially ;; not to be a symbolic link to /run/shm. ;; FIXME: ;; The following dependencies are all optional, but should be ;; available for maximum coverage: - ;; * libmagic (file) ;; * librpm (rpm) ; investigate failure - ;; * libgif (giflib) ; investigate failure + ;; * libtidy-html (tidy-html) ; investigate failure (inputs `(("exiv2" ,exiv2) ("bzip2" ,bzip2) @@ -98,6 +97,7 @@ ("ffmpeg" ,ffmpeg) ("file" ,file) ;libmagic, for the MIME plug-in ("glib" ,glib) + ("giflib" ,giflib) ("gstreamer" ,gstreamer) ("gst-plugins-base" ,gst-plugins-base) ("gtk+" ,gtk+) @@ -108,7 +108,6 @@ ("libmpeg2" ,libmpeg2) ("libmp4v2" ,libmp4v2) ("libsmf" ,libsmf) - ("tidy-html" ,tidy-html) ("libogg" ,libogg) ("libtiff" ,libtiff) ("libvorbis" ,libvorbis) @@ -120,12 +119,18 @@ (arguments `(#:configure-flags (list (string-append "--with-ltdl=" - (assoc-ref %build-inputs "libltdl")) - (string-append "--with-tidy=" - (assoc-ref %build-inputs "tidy-html"))) + (assoc-ref %build-inputs "libltdl"))) #:parallel-tests? #f #:phases (modify-phases %standard-phases + (add-after 'configure 'fix-exiv2-tests + ;; exiv2>=0.27.3 rounds geolocation + ;; https://github.com/Exiv2/exiv2/pull/1107/commits/db1be4ae8e1077949fcb6a960e93069d6a41b395#diff-f3f55183ccbe956c720c86e61f708d9f + (lambda _ + (substitute* "src/plugins/test_exiv2.c" + (("17.585\\\\\" ") "18\\\"") + (("21.713\\\\\" ") "22\\\"")) + #t)) (add-after 'install 'move-static-libraries (lambda* (#:key outputs #:allow-other-keys) ;; Move static libraries to the "static" output. diff --git a/gnu/packages/patches/libextractor-exiv2.patch b/gnu/packages/patches/libextractor-exiv2.patch deleted file mode 100644 index b92fef3ca1..0000000000 --- a/gnu/packages/patches/libextractor-exiv2.patch +++ /dev/null @@ -1,124 +0,0 @@ -This patch allows us to build libextractor against exiv2 0.27.x. -Adapted from this upstream commit: - - commit 1ecee9a47717e36cb8a3925d011d1a6de11d631c - Author: Christian Grothoff - Date: Mon Jul 29 17:58:18 2019 +0200 - - importing patch from Gentoo/AS to address exiv2 build issue (#5820) - -diff --git a/src/plugins/exiv2_extractor.cc b/src/plugins/exiv2_extractor.cc -index 8741d40..ef402a8 100644 ---- a/src/plugins/exiv2_extractor.cc -+++ b/src/plugins/exiv2_extractor.cc -@@ -27,10 +27,7 @@ - #include - #include - #include --#include --#include --#include --#include -+#include - - /** - * Enable debugging to get error messages. -@@ -180,7 +177,7 @@ public: - * - * @return -1 on error - */ --#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0) -+#if EXIV2_TEST_VERSION(0,26,0) - virtual size_t size (void) const; - #else - virtual long int size (void) const; -@@ -316,7 +313,11 @@ ExtractorIO::getb () - const unsigned char *r; - - if (1 != ec->read (ec->cls, &data, 1)) -+#if EXIV2_TEST_VERSION(0,27,0) -+ throw Exiv2::BasicError (Exiv2::kerDecodeLangAltQualifierFailed); -+#else - throw Exiv2::BasicError (42 /* error code */); -+#endif - r = (const unsigned char *) data; - return *r; - } -@@ -371,7 +372,11 @@ ExtractorIO::putb (Exiv2::byte data) - void - ExtractorIO::transfer (Exiv2::BasicIo& src) - { -+#if EXIV2_TEST_VERSION(0,27,0) -+ throw Exiv2::BasicError (Exiv2::kerDecodeLangAltQualifierFailed); -+#else - throw Exiv2::BasicError (42 /* error code */); -+#endif - } - - -@@ -416,7 +421,11 @@ ExtractorIO::seek (long offset, - Exiv2::byte * - ExtractorIO::mmap (bool isWritable) - { -+#if EXIV2_TEST_VERSION(0,27,0) -+ throw Exiv2::BasicError (Exiv2::kerDecodeLangAltQualifierFailed); -+#else - throw Exiv2::BasicError (42 /* error code */); -+#endif - } - - -@@ -449,7 +458,7 @@ ExtractorIO::tell (void) const - * - * @return -1 on error - */ --#if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0) -+#if EXIV2_TEST_VERSION(0,26,0) - size_t - #else - long int -@@ -504,7 +513,11 @@ ExtractorIO::eof () const - std::string - ExtractorIO::path () const - { -+#if EXIV2_TEST_VERSION(0,27,0) -+ throw Exiv2::BasicError (Exiv2::kerDecodeLangAltQualifierFailed); -+#else - throw Exiv2::BasicError (42 /* error code */); -+#endif - } - - -@@ -517,7 +530,11 @@ ExtractorIO::path () const - std::wstring - ExtractorIO::wpath () const - { -+#if EXIV2_TEST_VERSION(0,27,0) -+ throw Exiv2::BasicError (Exiv2::kerDecodeLangAltQualifierFailed); -+#else - throw Exiv2::BasicError (42 /* error code */); -+#endif - } - #endif - -@@ -531,7 +548,11 @@ Exiv2::BasicIo::AutoPtr - ExtractorIO::temporary () const - { - fprintf (stderr, "throwing temporary error\n"); -+#if EXIV2_TEST_VERSION(0,27,0) -+ throw Exiv2::BasicError (Exiv2::kerDecodeLangAltQualifierFailed); -+#else - throw Exiv2::BasicError (42 /* error code */); -+#endif - } - - -@@ -697,7 +718,7 @@ EXTRACTOR_exiv2_extract_method (struct EXTRACTOR_ExtractContext *ec) - { - try - { --#if EXIV2_MAKE_VERSION(0,23,0) <= EXIV2_VERSION -+#if !EXIV2_TEST_VERSION(0,24,0) - Exiv2::LogMsg::setLevel (Exiv2::LogMsg::mute); - #endif - std::auto_ptr eio(new ExtractorIO (ec)); -- cgit v1.2.3 From 7b7543376bd495c269536d04d97b381ad89da5c4 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 27 Jul 2020 15:44:13 +0200 Subject: gnu: Add rnp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/openpgp.scm (rnp): New variable. * gnu/packages/patches/rnp-add-version.cmake.patch: New file. * gnu/packages/patches/rnp-disable-ruby-rnp-tests.patch: New file. * gnu/packages/patches/rnp-unbundle-googletest.patch: New file. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 3 + gnu/packages/openpgp.scm | 94 +++++++++++- gnu/packages/patches/rnp-add-version.cmake.patch | 169 +++++++++++++++++++++ .../patches/rnp-disable-ruby-rnp-tests.patch | 26 ++++ gnu/packages/patches/rnp-unbundle-googletest.patch | 43 ++++++ 5 files changed, 334 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/rnp-add-version.cmake.patch create mode 100644 gnu/packages/patches/rnp-disable-ruby-rnp-tests.patch create mode 100644 gnu/packages/patches/rnp-unbundle-googletest.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 812761b992..83727b6e61 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1503,6 +1503,9 @@ dist_patch_DATA = \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-store-checksum-override.patch \ %D%/packages/patches/retroarch-disable-online-updater.patch \ + %D%/packages/patches/rnp-add-version.cmake.patch \ + %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \ + %D%/packages/patches/rnp-unbundle-googletest.patch \ %D%/packages/patches/ruby-rack-ignore-failing-test.patch \ %D%/packages/patches/ruby-rubocop-break-dependency-cycle.patch\ %D%/packages/patches/ruby-sanitize-system-libxml.patch \ diff --git a/gnu/packages/openpgp.scm b/gnu/packages/openpgp.scm index 94beab9929..a5b8f1b09d 100644 --- a/gnu/packages/openpgp.scm +++ b/gnu/packages/openpgp.scm @@ -19,11 +19,19 @@ (define-module (gnu packages openpgp) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages crypto) #:use-module (gnu packages gnupg) - #:use-module (gnu packages multiprecision)) + #:use-module (gnu packages multiprecision) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages web)) (define-public libtmcg (package @@ -92,3 +100,87 @@ implementation is in experimental state and should NOT be used in production environments.") (home-page "https://www.nongnu.org/dkgpg/") (license license:gpl2+))) + +(define-public rnp + ;; Packaging the currently released version requires a large number of + ;; patches. For now, we package a snapshot instead. + (let ((commit "203224f0b1505dba17837c03da603e5b98ab125a") + (revision "0") + (last-version "0.13.1") + (day-of-release "2020-07-21")) + (package + (name "rnp") + (version (git-version last-version revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/rnpgp/rnp") + (commit commit))) + (file-name + (string-append name "-" (string-take commit 7) "-checkout")) + (sha256 + (base32 + "1rnwhc9ys4v4mv584hmmrl0ycnqmsaigpffzm31qq337hz24zqya")) + (patches + (search-patches "rnp-unbundle-googletest.patch" + "rnp-disable-ruby-rnp-tests.patch" + "rnp-add-version.cmake.patch")))) + (build-system cmake-build-system) + (arguments `(#:configure-flags + '("-DBUILD_SHARED_LIBS=on" + "-DBUILD_TESTING=on") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fixes + (lambda* (#:key inputs #:allow-other-keys) + (copy-recursively (assoc-ref inputs "googletest-source") + "src/tests/googletest-src") + (substitute* "src/tests/support.cpp" + (("\"cp\"") (string-append "\"" (which "cp") "\""))) + ;; Produce a version stamp in the format the upstream + ;; project uses for unreleased revisions. + (with-output-to-file "version.txt" + (lambda _ + (display + (string-append ,last-version + "-" ,revision + "-g" ,(string-take commit 7))))) + #t)) + (replace 'check + (lambda _ + ;; Some OpenPGP certificates used by the tests expire. + ;; To work around that, set the time to roughly the + ;; release date. + (invoke "faketime" ,day-of-release "make" "test")))))) + (native-inputs + `(("gnupg" ,gnupg) ; for tests + ("googletest-source" ,(package-source googletest)) ; for tests + ("libfaketime" ,libfaketime) ; for tests + ("pkg-config" ,pkg-config) + ("python" ,python) + ("python2" ,python-2.7))) + (inputs `(("botan" ,botan) + ("bzip2" ,bzip2) + ("json-c" ,json-c) + ("zlib" ,zlib))) + (synopsis + "RFC4880-compliant OpenPGP library written in C++") + (description + "Set of OpenPGP (RFC4880) tools that works on Linux, *BSD and macOS as a +replacement of GnuPG. It is maintained by Ribose after being forked from +NetPGP, itself originally written for NetBSD. + +librnp is the library used by rnp for all OpenPGP functions, useful for +developers to build against. It is a “real” library, not a wrapper like GPGME +of GnuPG.") + (home-page "https://www.rnpgp.com/") + (license + ;; RNP contains code written by Ribose and code derived from netpgp. + (list + ;; Ribose's BSD 2-Clause License and NetBSD's BSD 2-Clause License + ;; (netpgp). + license:bsd-2 + ;; Nominet UK's Apache 2.0 Licence (netpgp). + license:asl2.0 + ;; Nominet UK's BSD 3-Clause License (netpgp). + license:bsd-3))))) diff --git a/gnu/packages/patches/rnp-add-version.cmake.patch b/gnu/packages/patches/rnp-add-version.cmake.patch new file mode 100644 index 0000000000..67e3b75457 --- /dev/null +++ b/gnu/packages/patches/rnp-add-version.cmake.patch @@ -0,0 +1,169 @@ +From b4326f4649ceb146d5cc74f8579b68d8dc8f51e6 Mon Sep 17 00:00:00 2001 +From: Justus Winter +Date: Mon, 27 Jul 2020 14:00:25 +0200 +Subject: [PATCH 3/3] Add external version.cmake. + +This file is maintained in an external repository. It is only +included in released versions. For building snapshots of RNP, a fixed +snapshot of version.cmake is downloaded on demand. To avoid this, +this patch explicitly provides the file. +--- + cmake/version.cmake | 146 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 146 insertions(+) + create mode 100644 cmake/version.cmake + +diff --git a/cmake/version.cmake b/cmake/version.cmake +new file mode 100644 +index 00000000..514027aa +--- /dev/null ++++ b/cmake/version.cmake +@@ -0,0 +1,146 @@ ++# Copyright (c) 2018 Ribose Inc. ++# All rights reserved. ++# ++# Redistribution and use in source and binary forms, with or without ++# modification, are permitted provided that the following conditions ++# are met: ++# 1. Redistributions of source code must retain the above copyright ++# notice, this list of conditions and the following disclaimer. ++# 2. Redistributions in binary form must reproduce the above copyright ++# notice, this list of conditions and the following disclaimer in the ++# documentation and/or other materials provided with the distribution. ++# ++# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED ++# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR ++# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS ++# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ++# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ++# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ++# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ++# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ++# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ++# POSSIBILITY OF SUCH DAMAGE. ++ ++# desired length of commit hash ++set(GIT_REV_LEN 7) ++ ++# call git, store output in var (can fail) ++macro(_git var) ++ execute_process( ++ COMMAND "${GIT_EXECUTABLE}" ${ARGN} ++ WORKING_DIRECTORY "${source_dir}" ++ RESULT_VARIABLE _git_ec ++ OUTPUT_VARIABLE ${var} ++ OUTPUT_STRIP_TRAILING_WHITESPACE ++ ERROR_QUIET ++ ) ++endmacro() ++ ++# call git, store output in var (can not fail) ++macro(git var) ++ _git(${var} ${ARGN}) ++ if (NOT _git_ec EQUAL 0) ++ string(REPLACE ";" " " args "${ARGN}") ++ message(FATAL_ERROR "Failed to execute: git ${args}") ++ endif() ++endmacro() ++ ++function(extract_version_info version var_prefix) ++ # extract the main components ++ # v1.9.0-3-g5b92266+1546836556 ++ # v1.9.0-3-g5b92266-dirty+1546836556 ++ string(REGEX MATCH "^v?([0-9]+\\.[0-9]+\\.[0-9]+)(-([0-9]+)-g([0-9a-f]+)(-dirty)?)?(\\+([0-9]+))?$" matches "${version}") ++ if (NOT matches) ++ message(FATAL_ERROR "Failed to extract version components.") ++ endif() ++ set(${var_prefix}_VERSION "${CMAKE_MATCH_1}" PARENT_SCOPE) # 1.9.0 ++ if (NOT CMAKE_MATCH_3) ++ set(CMAKE_MATCH_3 "0") ++ endif() ++ set(${var_prefix}_VERSION_NCOMMITS "${CMAKE_MATCH_3}" PARENT_SCOPE) # 3 ++ if (NOT CMAKE_MATCH_4) ++ set(CMAKE_MATCH_4 "0") ++ endif() ++ set(${var_prefix}_VERSION_GIT_REV "${CMAKE_MATCH_4}" PARENT_SCOPE) # 5b92266 ++ if (CMAKE_MATCH_5 STREQUAL "-dirty") ++ set(${var_prefix}_VERSION_IS_DIRTY TRUE PARENT_SCOPE) ++ else() ++ set(${var_prefix}_VERSION_IS_DIRTY FALSE PARENT_SCOPE) ++ endif() ++ # timestamp is optional, default to 0 ++ if (NOT CMAKE_MATCH_7) ++ set(CMAKE_MATCH_7 "0") ++ endif() ++ set(${var_prefix}_VERSION_COMMIT_TIMESTAMP "${CMAKE_MATCH_7}" PARENT_SCOPE) # 1546836556 ++endfunction() ++ ++function(determine_version source_dir var_prefix) ++ if (EXISTS "${source_dir}/.git") ++ # for GIT_EXECUTABLE ++ find_package(Git REQUIRED) ++ # get a description of the version, something like: ++ # v1.9.1-0-g38ffe82 (a tagged release) ++ # v1.9.1-0-g38ffe82-dirty (a tagged release with local modifications) ++ # v1.9.0-3-g5b92266 (post-release snapshot) ++ # v1.9.0-3-g5b92266-dirty (post-release snapshot with local modifications) ++ _git(version describe --abbrev=${GIT_REV_LEN} --match "v[0-9]*" --long --dirty) ++ if (NOT _git_ec EQUAL 0) ++ # no annotated tags, fake one ++ git(revision rev-parse --short=${GIT_REV_LEN} --verify HEAD) ++ set(version "v0.0.0-0-g${revision}") ++ # check if dirty (this won't detect untracked files, but should be ok) ++ _git(changes diff-index --quiet HEAD --) ++ if (NOT _git_ec EQUAL 0) ++ string(APPEND version "-dirty") ++ endif() ++ # append the commit timestamp of the most recent commit (only ++ # in non-release branches -- typically master) ++ git(commit_timestamp show -s --format=%ct) ++ string(APPEND version "+${commit_timestamp}") ++ endif() ++ else() ++ # same as above, but used for snapshots ++ file(STRINGS "${source_dir}/version.txt" version) ++ endif() ++ set(local_prefix "_determine_ver") ++ extract_version_info("${version}" "${local_prefix}") ++ foreach(suffix VERSION VERSION_NCOMMITS VERSION_GIT_REV VERSION_IS_DIRTY VERSION_COMMIT_TIMESTAMP) ++ if (NOT DEFINED ${local_prefix}_${suffix}) ++ message(FATAL_ERROR "Unable to determine version.") ++ endif() ++ set(${var_prefix}_${suffix} "${${local_prefix}_${suffix}}" PARENT_SCOPE) ++ message(STATUS "${var_prefix}_${suffix}: ${${local_prefix}_${suffix}}") ++ endforeach() ++ # Set VERSION_SUFFIX and VERSION_FULL. When making changes, be aware that ++ # this is used in packaging as well and will affect ordering. ++ # | state | version_full | ++ # |------------------------------------------------| ++ # | exact tag | 0.9.0 | ++ # | exact tag, dirty | 0.9.0+git20180604 | ++ # | after tag | 0.9.0+git20180604.1.085039f | ++ # | no tag | 0.0.0+git20180604.2ee02af | ++ string(TIMESTAMP date "%Y%m%d" UTC) ++ set(version_suffix "") ++ if ((NOT ${local_prefix}_VERSION_NCOMMITS EQUAL 0) OR (${local_prefix}_VERSION STREQUAL "0.0.0")) ++ # 0.9.0+git20150604.4.289818b ++ string(APPEND version_suffix "+git${date}") ++ if (NOT ${local_prefix}_VERSION_NCOMMITS EQUAL 0) ++ string(APPEND version_suffix ".${${local_prefix}_VERSION_NCOMMITS}") ++ endif() ++ string(APPEND version_suffix ".${${local_prefix}_VERSION_GIT_REV}") ++ else() ++ if (${local_prefix}_VERSION_IS_DIRTY) ++ # 0.9.0+git20150604 ++ string(APPEND version_suffix "+git${date}") ++ endif() ++ endif() ++ set(version_full "${${local_prefix}_VERSION}${version_suffix}") ++ # set the results ++ set(${var_prefix}_VERSION_SUFFIX "${version_suffix}" PARENT_SCOPE) ++ set(${var_prefix}_VERSION_FULL "${version_full}" PARENT_SCOPE) ++ # for informational purposes ++ message(STATUS "${var_prefix}_VERSION_SUFFIX: ${version_suffix}") ++ message(STATUS "${var_prefix}_VERSION_FULL: ${version_full}") ++endfunction() ++ +-- +2.20.1 + diff --git a/gnu/packages/patches/rnp-disable-ruby-rnp-tests.patch b/gnu/packages/patches/rnp-disable-ruby-rnp-tests.patch new file mode 100644 index 0000000000..5a75b6f40f --- /dev/null +++ b/gnu/packages/patches/rnp-disable-ruby-rnp-tests.patch @@ -0,0 +1,26 @@ +From 40e53d639d86337cf58be3a2b9750b6c97a3c740 Mon Sep 17 00:00:00 2001 +From: Justus Winter +Date: Tue, 21 Jul 2020 16:10:21 +0200 +Subject: [PATCH 2/2] Disable ruby-rnp tests. + +Prevents cmake from cloning the ruby-rnp repository in order to run its tests. +--- + src/tests/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt +index d3c4fbe6..e7e1965e 100644 +--- a/src/tests/CMakeLists.txt ++++ b/src/tests/CMakeLists.txt +@@ -125,7 +125,7 @@ gtest_discover_tests(rnp_tests + + # ruby-rnp + # cruby does not currently play nice with ASaN et al. +-if (NOT ENABLE_SANITIZERS AND BUILD_SHARED_LIBS AND NOT WIN32) ++if (NOT ENABLE_SANITIZERS AND BUILD_SHARED_LIBS AND NOT WIN32 AND IGNORE) + include(ExternalProject) + set(_sourcedir "${CMAKE_BINARY_DIR}/ruby-rnp") + if (DEFINED ENV{RUBY_RNP_INSTALL}) +-- +2.20.1 + diff --git a/gnu/packages/patches/rnp-unbundle-googletest.patch b/gnu/packages/patches/rnp-unbundle-googletest.patch new file mode 100644 index 0000000000..b85bfd1f0e --- /dev/null +++ b/gnu/packages/patches/rnp-unbundle-googletest.patch @@ -0,0 +1,43 @@ +From 4b4697c8dd66bd2b1e4d6b831bbde46e27d62c46 Mon Sep 17 00:00:00 2001 +From: Justus Winter +Date: Tue, 21 Jul 2020 16:10:12 +0200 +Subject: [PATCH 1/2] Unbundle googletest. + +--- + src/tests/CMakeLists.txt | 2 +- + src/tests/gtest-CMakeLists.txt.in | 6 +++--- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt +index 0a841666..d3c4fbe6 100644 +--- a/src/tests/CMakeLists.txt ++++ b/src/tests/CMakeLists.txt +@@ -53,7 +53,7 @@ endif() + # maintain compiler/linker settings on Windows + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + # add to our build (provides gtest_main target) +-add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src ++add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest-src + ${CMAKE_CURRENT_BINARY_DIR}/googletest-build + EXCLUDE_FROM_ALL) + +diff --git a/src/tests/gtest-CMakeLists.txt.in b/src/tests/gtest-CMakeLists.txt.in +index a43e8e5d..3cc0ddd5 100644 +--- a/src/tests/gtest-CMakeLists.txt.in ++++ b/src/tests/gtest-CMakeLists.txt.in +@@ -4,9 +4,9 @@ project(googletest-download NONE) + + include(ExternalProject) + ExternalProject_Add(googletest +- GIT_REPOSITORY https://github.com/google/googletest.git +- GIT_TAG c43f710 +- SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" ++# GIT_REPOSITORY https://github.com/google/googletest.git ++# GIT_TAG c43f710 ++ SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/googletest-src" + BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build" + CONFIGURE_COMMAND "" + BUILD_COMMAND "" +-- +2.20.1 + -- cgit v1.2.3 From eb9f726d22751dd77984b106f2dbf1c0d336954b Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Wed, 29 Jul 2020 12:45:36 +0300 Subject: gnu: sphinxbase: Fix building. * gnu/packages/speech.scm (sphinxbase)[source]: Add patch. * gnu/packages/patches/sphinxbase-fix-doxygen.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/patches/sphinxbase-fix-doxygen.patch | 24 +++++++++++++++++++++++ gnu/packages/speech.scm | 4 +++- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/sphinxbase-fix-doxygen.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 83727b6e61..dc9ef7488e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1541,6 +1541,7 @@ dist_patch_DATA = \ %D%/packages/patches/slim-display.patch \ %D%/packages/patches/snappy-add-O2-flag-in-CmakeLists.txt.patch \ %D%/packages/patches/sooperlooper-build-with-wx-30.patch \ + %D%/packages/patches/sphinxbase-fix-doxygen.patch \ %D%/packages/patches/sssd-fix-samba.patch \ %D%/packages/patches/steghide-fixes.patch \ %D%/packages/patches/suitesparse-mongoose-cmake.patch \ diff --git a/gnu/packages/patches/sphinxbase-fix-doxygen.patch b/gnu/packages/patches/sphinxbase-fix-doxygen.patch new file mode 100644 index 0000000000..c8ebc52628 --- /dev/null +++ b/gnu/packages/patches/sphinxbase-fix-doxygen.patch @@ -0,0 +1,24 @@ +https://github.com/cmusphinx/sphinxbase/commit/6989c52a3fb9473fd61326e548440fff887525c2 + +commit 6989c52a3fb9473fd61326e548440fff887525c2 +Author: Michel Zou +Date: Thu Feb 6 07:02:06 2020 +0100 + + Fix doxy2swig.py IndexError: list index out of range + +diff --git a/doc/doxy2swig.py b/doc/doxy2swig.py +index 5589b0d..a01c4b1 100644 +--- a/doc/doxy2swig.py ++++ b/doc/doxy2swig.py +@@ -299,7 +299,10 @@ class Doxy2SWIG: + name = first['name'].firstChild.data + + for n in node.getElementsByTagName('param'): +- arg_type = n.getElementsByTagName('type')[0] ++ elts = n.getElementsByTagName('type') ++ if len(elts) == 0: ++ continue ++ arg_type = elts[0] + ref = self.get_specific_nodes(arg_type, ('ref')) + if 'ref' in ref: + type_name = ref['ref'].firstChild.data diff --git a/gnu/packages/speech.scm b/gnu/packages/speech.scm index c9c1eaa8d9..fc87a19b79 100644 --- a/gnu/packages/speech.scm +++ b/gnu/packages/speech.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2016 Kei Kebreau ;;; Copyright © 2019 Ricardo Wurmus ;;; Copyright © 2020 Nicolas Goaziou +;;; Copyright © 2020 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -497,7 +498,8 @@ control.") "sphinxbase/" version "/" "sphinxbase-" version ".tar.gz")) (sha256 - (base32 "0vr4k8pv5a8nvq9yja7kl13b5lh0f9vha8fc8znqnm8bwmcxnazp")))) + (base32 "0vr4k8pv5a8nvq9yja7kl13b5lh0f9vha8fc8znqnm8bwmcxnazp")) + (patches (search-patches "sphinxbase-fix-doxygen.patch")))) (build-system gnu-build-system) (arguments `(#:parallel-tests? #f)) ;tests fail otherwise -- cgit v1.2.3 From d4a044239b7af83e54d5c44dab3ea3299a946d9b Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 10 Jul 2020 11:15:58 +0200 Subject: gnu: Add nfs4-acl-tools. * gnu/packages/nfs.scm (nfs4-acl-tools): New variable. * gnu/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch: New file. * gnu/local.mk: Add it. Signed-off-by: Marius Bakke --- gnu/local.mk | 1 + gnu/packages/nfs.scm | 44 +++++++++++++ .../patches/nfs4-acl-tools-0.3.7-fixpaths.patch | 73 ++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 gnu/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index dc9ef7488e..73eabef66e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1320,6 +1320,7 @@ dist_patch_DATA = \ %D%/packages/patches/netsurf-system-utf8proc.patch \ %D%/packages/patches/netsurf-y2038-tests.patch \ %D%/packages/patches/netsurf-longer-test-timeout.patch \ + %D%/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch \ %D%/packages/patches/ngircd-handle-zombies.patch \ %D%/packages/patches/network-manager-plugin-path.patch \ %D%/packages/patches/nsis-env-passthru.patch \ diff --git a/gnu/packages/nfs.scm b/gnu/packages/nfs.scm index f3015ef79a..049de2c4b0 100644 --- a/gnu/packages/nfs.scm +++ b/gnu/packages/nfs.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2018 Efraim Flashner ;;; Copyright © 2020 Ricardo Wurmus ;;; Copyright © 2020 Tobias Geerinckx-Rice +;;; Copyright © 2020 Lars-Dominik Braun ;;; ;;; This file is part of GNU Guix. ;;; @@ -22,6 +23,8 @@ (define-module (gnu packages nfs) #:use-module (gnu packages) + #:use-module (gnu packages attr) + #:use-module (gnu packages autotools) #:use-module (gnu packages crypto) #:use-module (gnu packages linux) #:use-module (gnu packages libevent) @@ -35,6 +38,7 @@ #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module (guix download) + #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix utils) @@ -133,3 +137,43 @@ disk. It allows for fast, seamless sharing of files across a network.") ;; restrictive licence, and until advice to the contrary we must assume ;; that is what is intended. (license license:gpl2))) + +(define-public nfs4-acl-tools + (package + (name "nfs4-acl-tools") + (version "0.3.7") + (source (origin + (method git-fetch) + ;; tarballs are available here: + ;; http://linux-nfs.org/~bfields/nfs4-acl-tools/ + (uri (git-reference + (url "git://git.linux-nfs.org/projects/bfields/nfs4-acl-tools.git") + (commit (string-append name "-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0lq9xdaskxysggs918vs8x42xvmg9nj7lla21ni2scw5ljld3h1i")) + (patches (search-patches "nfs4-acl-tools-0.3.7-fixpaths.patch")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-bin-sh + (lambda _ + (substitute* "include/buildmacros" + (("/bin/sh") (which "sh"))) + #t))))) + (native-inputs + `(("automake" ,automake) + ("autoconf" ,autoconf) + ("libtool" ,libtool))) + (inputs + `(("attr" ,attr))) + (home-page "https://linux-nfs.org/wiki/index.php/Main_Page") + (synopsis "Commandline ACL utilities for the Linux NFSv4 client") + (description "This package provides the commandline utilities +@command{nfs4_getfacl} and @command{nfs4_setfacl}, which are similar to their +POSIX equivalents @command{getfacl} and @command{setfacl}. They fetch and +manipulate access control lists for files and directories on NFSv4 mounts.") + (license license:bsd-3))) diff --git a/gnu/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch b/gnu/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch new file mode 100644 index 0000000000..23cb586766 --- /dev/null +++ b/gnu/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch @@ -0,0 +1,73 @@ +Remove fixed search paths from autotools. + +--- a/m4/package_utilies.m4 1970-01-01 01:00:01.000000000 +0100 ++++ b/m4/package_utilies.m4 2020-07-07 12:41:48.871661042 +0200 +@@ -23,32 +23,32 @@ + AC_PACKAGE_NEED_UTILITY($1, "$cc", cc, [C compiler]) + + if test -z "$MAKE"; then +- AC_PATH_PROG(MAKE, gmake,, /usr/bin:/usr/freeware/bin) ++ AC_PATH_PROG(MAKE, gmake) + fi + if test -z "$MAKE"; then +- AC_PATH_PROG(MAKE, make,, /usr/bin) ++ AC_PATH_PROG(MAKE, make) + fi + make=$MAKE + AC_SUBST(make) + AC_PACKAGE_NEED_UTILITY($1, "$make", make, [GNU make]) + + if test -z "$LIBTOOL"; then +- AC_PATH_PROG(LIBTOOL, glibtool,, /usr/bin) ++ AC_PATH_PROG(LIBTOOL, glibtool) + fi + if test -z "$LIBTOOL"; then +- AC_PATH_PROG(LIBTOOL, libtool,, /usr/bin:/usr/local/bin:/usr/freeware/bin) ++ AC_PATH_PROG(LIBTOOL, libtool) + fi + libtool=$LIBTOOL + AC_SUBST(libtool) + AC_PACKAGE_NEED_UTILITY($1, "$libtool", libtool, [GNU libtool]) + + if test -z "$TAR"; then +- AC_PATH_PROG(TAR, tar,, /usr/freeware/bin:/bin:/usr/local/bin:/usr/bin) ++ AC_PATH_PROG(TAR, tar) + fi + tar=$TAR + AC_SUBST(tar) + if test -z "$ZIP"; then +- AC_PATH_PROG(ZIP, gzip,, /bin:/usr/local/bin:/usr/freeware/bin) ++ AC_PATH_PROG(ZIP, gzip) + fi + + zip=$ZIP +@@ -61,25 +61,25 @@ + AC_SUBST(makedepend) + + if test -z "$AWK"; then +- AC_PATH_PROG(AWK, awk,, /bin:/usr/bin) ++ AC_PATH_PROG(AWK, awk) + fi + awk=$AWK + AC_SUBST(awk) + + if test -z "$SED"; then +- AC_PATH_PROG(SED, sed,, /bin:/usr/bin) ++ AC_PATH_PROG(SED, sed) + fi + sed=$SED + AC_SUBST(sed) + + if test -z "$ECHO"; then +- AC_PATH_PROG(ECHO, echo,, /bin:/usr/bin) ++ AC_PATH_PROG(ECHO, echo) + fi + echo=$ECHO + AC_SUBST(echo) + + if test -z "$SORT"; then +- AC_PATH_PROG(SORT, sort,, /bin:/usr/bin) ++ AC_PATH_PROG(SORT, sort) + fi + sort=$SORT + AC_SUBST(sort) -- cgit v1.2.3 From 4da627a3ff87c475f27de5b89bb02cfe3b858de7 Mon Sep 17 00:00:00 2001 From: Tanguy Le Carrour Date: Mon, 27 Jul 2020 22:08:16 +0200 Subject: gnu: python-slugify: Update to 4.0.1. * gnu/packages/patches/python-slugify-depend-on-unidecode.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/python-web.scm (python-slugify): Update to 4.0.1. [source] Drop patch. Signed-off-by: Marius Bakke --- gnu/local.mk | 1 - .../python-slugify-depend-on-unidecode.patch | 22 ---------------------- gnu/packages/python-web.scm | 6 ++---- 3 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 gnu/packages/patches/python-slugify-depend-on-unidecode.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 73eabef66e..a2a1caa709 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1468,7 +1468,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \ %D%/packages/patches/python-robotframework-honor-source-date-epoch.patch \ %D%/packages/patches/python-shouldbe-0.1.2-cpy3.8.patch \ - %D%/packages/patches/python-slugify-depend-on-unidecode.patch \ %D%/packages/patches/python2-subprocess32-disable-input-test.patch \ %D%/packages/patches/python-tinycss2-flake8-compat.patch \ %D%/packages/patches/python-unittest2-python3-compat.patch \ diff --git a/gnu/packages/patches/python-slugify-depend-on-unidecode.patch b/gnu/packages/patches/python-slugify-depend-on-unidecode.patch deleted file mode 100644 index 5ac749c19d..0000000000 --- a/gnu/packages/patches/python-slugify-depend-on-unidecode.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/setup.py b/setup.py -index 4800173..6bdd77f 100755 ---- a/setup.py -+++ b/setup.py -@@ -14,8 +14,7 @@ url = 'https://github.com/un33k/python-slugify' - author = 'Val Neekman' - author_email = 'info@neekware.com' - license = 'MIT' --install_requires = ['text-unidecode>=1.3'] --extras_require = {'unidecode': ['Unidecode>=1.1.1']} -+install_requires = ['Unidecode'] - - classifiers = [ - 'Development Status :: 5 - Production/Stable', -@@ -67,7 +66,6 @@ setup( - author_email=author_email, - packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES), - install_requires=install_requires, -- extras_require=extras_require, - classifiers=classifiers, - entry_points={'console_scripts': ['slugify=slugify.slugify:main']}, - ) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 44fe95479f..d1dc907e35 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -3522,15 +3522,13 @@ Python.") (define-public python-slugify (package (name "python-slugify") - (version "3.0.4") + (version "4.0.1") (source (origin (method url-fetch) (uri (pypi-uri "python-slugify" version)) (sha256 - (base32 "0dv97yi5fq074q5qyqbin09pmi8ixg36caf5nkpw2bqkd8jh6pap")) - (patches - (search-patches "python-slugify-depend-on-unidecode.patch")))) + (base32 "0w22fapghmzk3xdasc4dn7h8sl58l08d1h5zbf72dh80drv1g9b9")))) (native-inputs `(("python-wheel" ,python-wheel))) (propagated-inputs -- cgit v1.2.3 From c55acb073248392b1387017378f36a1d378fa7c4 Mon Sep 17 00:00:00 2001 From: John Soo Date: Fri, 31 Jul 2020 12:52:38 +0200 Subject: gnu: Add bpftrace. * gnu/packages/linux.scm (bpftrace): New variable. * gnu/packages/patches/bpftrace-disable-bfd-disasm.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Mathieu Othacehe --- gnu/local.mk | 1 + gnu/packages/linux.scm | 45 ++++++++++++++++++++++ .../patches/bpftrace-disable-bfd-disasm.patch | 15 ++++++++ 3 files changed, 61 insertions(+) create mode 100644 gnu/packages/patches/bpftrace-disable-bfd-disasm.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index a2a1caa709..52c295b187 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -825,6 +825,7 @@ dist_patch_DATA = \ %D%/packages/patches/bitcoin-core-python-compat.patch \ %D%/packages/patches/blender-2.79-newer-ffmpeg.patch \ %D%/packages/patches/blender-2.79-python-3.7-fix.patch \ + %D%/packages/patches/bpftrace-disable-bfd-disasm.patch \ %D%/packages/patches/busybox-1.31.1-fix-build-with-glibc-2.31.patch \ %D%/packages/patches/byobu-writable-status.patch \ %D%/packages/patches/calibre-no-updates-dialog.patch \ diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index f98a5c8e6a..149a85b57b 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -7396,3 +7396,48 @@ extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1 and above.") (license license:asl2.0))) + +(define-public bpftrace + (package + (name "bpftrace") + (version "0.10.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/iovisor/bpftrace") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "023ardywbw5w8815j2ny9rrp2xlpxndqaa7v2njjm8109p7ilsdn")) + (patches (search-patches "bpftrace-disable-bfd-disasm.patch")))) + (build-system cmake-build-system) + (native-inputs + `(("bison" ,bison) + ("flex" ,flex))) + (inputs + `(("bcc" ,bcc) + ("clang-toolchain" ,clang-toolchain) + ("elfutils" ,elfutils) + ("libbpf" ,libbpf) + ("linux-libre-headers" ,linux-libre-headers))) + (arguments + `(#:tests? #f ;Tests require googletest sources. + #:configure-flags + '("-DBUILD_TESTING=OFF" + ;; FIXME: libbfd misses some link dependencies, when fixed, remove + ;; the associated patch. + "-DHAVE_BFD_DISASM=OFF"))) + (home-page "https://github.com/iovisor/bpftrace") + (synopsis "High-level tracing language for Linux eBPF") + (description + "bpftrace is a high-level tracing language for Linux enhanced Berkeley +Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses +LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for +interacting with the Linux BPF system, as well as existing Linux tracing +capabilities: kernel dynamic tracing (kprobes), user-level dynamic +tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk +and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was +created by Alastair Robertson.") + (license license:asl2.0))) diff --git a/gnu/packages/patches/bpftrace-disable-bfd-disasm.patch b/gnu/packages/patches/bpftrace-disable-bfd-disasm.patch new file mode 100644 index 0000000000..8565d8d851 --- /dev/null +++ b/gnu/packages/patches/bpftrace-disable-bfd-disasm.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e89a6a9..a594786 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -126,10 +126,6 @@ find_package(LibBpf) + find_package(LibBfd) + find_package(LibOpcodes) + +-if(${LIBBFD_FOUND} AND ${LIBOPCODES_FOUND}) +- set(HAVE_BFD_DISASM TRUE) +-endif() +- + include(CheckIncludeFile) + check_include_file("sys/sdt.h" HAVE_SYSTEMTAP_SYS_SDT_H) + -- cgit v1.2.3 From 96a655a77bb087397a9436391e472c36ff0a2ec2 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Fri, 31 Jul 2020 13:04:36 -0400 Subject: gnu: Add blender@2.79b. Restore blender@2.79b, the last version that does not require OpenGL 3, and therefore the last version to work on many older computers. Note that this commit relies on blender-2.79-newer-ffmpeg.patch and blender-2.79-python-3.7-fix.patch, which were left in the tree when blender@2.79b was previously removed in commit 1f14453eedfede4626a78321c66a009c9997bee4. * gnu/packages/patches/blender-2.79-gcc8.patch, gnu/packages/patches/blender-2.79-gcc9.patch, gnu/packages/patches/blender-2.79-oiio2.patch, gnu/packages/patches/blender-2.79-python-3.8-fix.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/graphics.scm (blender-2.79): New variable. --- gnu/local.mk | 4 + gnu/packages/graphics.scm | 96 +++++++ gnu/packages/patches/blender-2.79-gcc8.patch | 36 +++ gnu/packages/patches/blender-2.79-gcc9.patch | 53 ++++ gnu/packages/patches/blender-2.79-oiio2.patch | 284 +++++++++++++++++++++ .../patches/blender-2.79-python-3.8-fix.patch | 204 +++++++++++++++ 6 files changed, 677 insertions(+) create mode 100644 gnu/packages/patches/blender-2.79-gcc8.patch create mode 100644 gnu/packages/patches/blender-2.79-gcc9.patch create mode 100644 gnu/packages/patches/blender-2.79-oiio2.patch create mode 100644 gnu/packages/patches/blender-2.79-python-3.8-fix.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 52c295b187..181212c70b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -823,8 +823,12 @@ dist_patch_DATA = \ %D%/packages/patches/binutils-mingw-w64-timestamp.patch \ %D%/packages/patches/binutils-mingw-w64-deterministic.patch \ %D%/packages/patches/bitcoin-core-python-compat.patch \ + %D%/packages/patches/blender-2.79-gcc8.patch \ + %D%/packages/patches/blender-2.79-gcc9.patch \ %D%/packages/patches/blender-2.79-newer-ffmpeg.patch \ + %D%/packages/patches/blender-2.79-oiio2.patch \ %D%/packages/patches/blender-2.79-python-3.7-fix.patch \ + %D%/packages/patches/blender-2.79-python-3.8-fix.patch \ %D%/packages/patches/bpftrace-disable-bfd-disasm.patch \ %D%/packages/patches/busybox-1.31.1-fix-build-with-glibc-2.31.patch \ %D%/packages/patches/byobu-writable-status.patch \ diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index cc7e761955..cdb13c2619 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -295,6 +295,102 @@ compositing and motion tracking, even video editing and game creation. The application can be customized via its API for Python scripting.") (license license:gpl2+))) +(define-public blender-2.79 + (package + (name "blender") + (version "2.79b") + (source (origin + (method url-fetch) + (uri (string-append "https://download.blender.org/source/" + "blender-" version ".tar.gz")) + (sha256 + (base32 + "1g4kcdqmf67srzhi3hkdnr4z1ph4h9sza1pahz38mrj998q4r52c")) + (patches (search-patches "blender-2.79-newer-ffmpeg.patch" + "blender-2.79-oiio2.patch" + ;; The following patches may be + ;; needed when the default GCC is + ;; updated: + ;; "blender-2.79-gcc8.patch" + ;; "blender-2.79-gcc9.patch" + "blender-2.79-python-3.7-fix.patch" + "blender-2.79-python-3.8-fix.patch")))) + (build-system cmake-build-system) + (arguments + (let ((python-version (version-major+minor (package-version python)))) + `(;; Test files are very large and not included in the release tarball. + #:tests? #f + #:configure-flags + (list "-DWITH_CODEC_FFMPEG=ON" + "-DWITH_CODEC_SNDFILE=ON" + "-DWITH_CYCLES=ON" + "-DWITH_DOC_MANPAGE=ON" + "-DWITH_FFTW3=ON" + "-DWITH_GAMEENGINE=ON" + "-DWITH_IMAGE_OPENJPEG=ON" + "-DWITH_INPUT_NDOF=ON" + "-DWITH_INSTALL_PORTABLE=OFF" + "-DWITH_JACK=ON" + "-DWITH_MOD_OCEANSIM=ON" + "-DWITH_PLAYER=ON" + "-DWITH_PYTHON_INSTALL=OFF" + "-DWITH_PYTHON_INSTALL=OFF" + "-DWITH_SYSTEM_OPENJPEG=ON" + (string-append "-DPYTHON_LIBRARY=python" ,python-version) + (string-append "-DPYTHON_LIBPATH=" (assoc-ref %build-inputs "python") + "/lib") + (string-append "-DPYTHON_INCLUDE_DIR=" (assoc-ref %build-inputs "python") + "/include/python" ,python-version) + (string-append "-DPYTHON_VERSION=" ,python-version)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'fix-broken-import + (lambda _ + (substitute* "release/scripts/addons/io_scene_fbx/json2fbx.py" + (("import encode_bin") "from . import encode_bin")) + #t)) + (add-after 'set-paths 'add-ilmbase-include-path + (lambda* (#:key inputs #:allow-other-keys) + ;; OpenEXR propagates ilmbase, but its include files do not appear + ;; in the CPATH, so we need to add "$ilmbase/include/OpenEXR/" to + ;; the CPATH to satisfy the dependency on "half.h". + (setenv "CPATH" + (string-append (assoc-ref inputs "ilmbase") + "/include/OpenEXR" + ":" (or (getenv "CPATH") ""))) + #t)))))) + (inputs + `(("boost" ,boost) + ("jemalloc" ,jemalloc) + ("libx11" ,libx11) + ("openimageio" ,openimageio) + ("openexr" ,openexr) + ("ilmbase" ,ilmbase) + ("openjpeg" ,openjpeg) + ("libjpeg" ,libjpeg-turbo) + ("libpng" ,libpng) + ("libtiff" ,libtiff) + ("ffmpeg" ,ffmpeg) + ("fftw" ,fftw) + ("jack" ,jack-1) + ("libsndfile" ,libsndfile) + ("freetype" ,freetype) + ("glew" ,glew) + ("openal" ,openal) + ("python" ,python) + ("zlib" ,zlib))) + (home-page "https://blender.org/") + (synopsis "3D graphics creation suite") + (description + "Blender is a 3D graphics creation suite. It supports the entirety of +the 3D pipeline—modeling, rigging, animation, simulation, rendering, +compositing and motion tracking, even video editing and game creation. The +application can be customized via its API for Python scripting. + +NOTE: This older version of Blender is the last release that does not require +OpenGL 3. It is retained for use with older computers.") + (license license:gpl2+))) + (define-public assimp (package (name "assimp") diff --git a/gnu/packages/patches/blender-2.79-gcc8.patch b/gnu/packages/patches/blender-2.79-gcc8.patch new file mode 100644 index 0000000000..6a9186323b --- /dev/null +++ b/gnu/packages/patches/blender-2.79-gcc8.patch @@ -0,0 +1,36 @@ +diff --git a/intern/itasc/kdl/tree.hpp b/intern/itasc/kdl/tree.hpp +index c8a253fc901..bd35f82d185 100644 +--- a/intern/itasc/kdl/tree.hpp ++++ b/intern/itasc/kdl/tree.hpp +@@ -34,7 +34,7 @@ namespace KDL + //Forward declaration + class TreeElement; + // Eigen allocator is needed for alignment of Eigen data types +- typedef std::map, Eigen::aligned_allocator > > SegmentMap; ++ typedef std::map, Eigen::aligned_allocator > > SegmentMap; + + class TreeElement + { +diff --git a/intern/cycles/util/util_sseb.h b/intern/cycles/util/util_sseb.h +index 6e669701f3b..977976c3fc0 100644 +--- a/intern/cycles/util/util_sseb.h ++++ b/intern/cycles/util/util_sseb.h +@@ -22,6 +22,9 @@ CCL_NAMESPACE_BEGIN + + #ifdef __KERNEL_SSE2__ + ++struct ssei; ++struct ssef; ++ + /*! 4-wide SSE bool type. */ + struct sseb + { +@@ -116,7 +119,7 @@ __forceinline const sseb unpacklo( const sseb& a, const sseb& b ) { return _mm_u + __forceinline const sseb unpackhi( const sseb& a, const sseb& b ) { return _mm_unpackhi_ps(a, b); } + + template __forceinline const sseb shuffle( const sseb& a ) { +- return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)); ++ return _mm_castsi128_ps(_mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0))); + } + + template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a ) { diff --git a/gnu/packages/patches/blender-2.79-gcc9.patch b/gnu/packages/patches/blender-2.79-gcc9.patch new file mode 100644 index 0000000000..d538a02620 --- /dev/null +++ b/gnu/packages/patches/blender-2.79-gcc9.patch @@ -0,0 +1,53 @@ +commit e6d803fd4a383cecf8c643095f093a31c944b785 +Author: Robert-André Mauchin +Date: Wed Apr 3 01:36:52 2019 +0200 + + Fix for GCC9 new OpenMP data sharing + + GCC 9 started implementing the OpenMP 4.0 and later behavior. When not using + default clause or when using default(shared), this makes no difference, but + if using default(none), previously the choice was not specify the const + qualified variables on the construct at all, or specify in firstprivate + clause. In GCC 9 as well as for OpenMP 4.0 compliance, those variables need + to be specified on constructs in which they are used, either in shared or + in firstprivate clause. Specifying them in firstprivate clause is one way to + achieve compatibility with both older GCC versions and GCC 9, + another option is to drop the default(none) clause. + + This patch thus drops the default(none) clause. + + See https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing + + Signed-off-by: Robert-André Mauchin + +diff --git a/intern/elbeem/intern/solver_main.cpp b/intern/elbeem/intern/solver_main.cpp +index 68f7c04cd54..514087b6130 100644 +--- a/intern/elbeem/intern/solver_main.cpp ++++ b/intern/elbeem/intern/solver_main.cpp +@@ -381,7 +381,7 @@ LbmFsgrSolver::mainLoop(const int lev) + GRID_REGION_INIT(); + #if PARALLEL==1 + const int gDebugLevel = ::gDebugLevel; +-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ ++#pragma omp parallel num_threads(mNumOMPThreads) \ + reduction(+: \ + calcCurrentMass,calcCurrentVolume, \ + calcCellsFilled,calcCellsEmptied, \ +@@ -1126,7 +1126,7 @@ LbmFsgrSolver::preinitGrids() + GRID_REGION_INIT(); + #if PARALLEL==1 + const int gDebugLevel = ::gDebugLevel; +-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ ++#pragma omp parallel num_threads(mNumOMPThreads) \ + reduction(+: \ + calcCurrentMass,calcCurrentVolume, \ + calcCellsFilled,calcCellsEmptied, \ +@@ -1164,7 +1164,7 @@ LbmFsgrSolver::standingFluidPreinit() + GRID_REGION_INIT(); + #if PARALLEL==1 + const int gDebugLevel = ::gDebugLevel; +-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ ++#pragma omp parallel num_threads(mNumOMPThreads) \ + reduction(+: \ + calcCurrentMass,calcCurrentVolume, \ + calcCellsFilled,calcCellsEmptied, \ diff --git a/gnu/packages/patches/blender-2.79-oiio2.patch b/gnu/packages/patches/blender-2.79-oiio2.patch new file mode 100644 index 0000000000..1c3606a940 --- /dev/null +++ b/gnu/packages/patches/blender-2.79-oiio2.patch @@ -0,0 +1,284 @@ +From: Sergey Sharybin +Date: Fri, 28 Dec 2018 11:25:35 +0100 +Subject: adapt_build_against_OIIO2 + +--- + intern/cycles/blender/blender_python.cpp | 2 +- + intern/cycles/graph/node_xml.cpp | 2 +- + intern/cycles/render/buffers.cpp | 4 ++-- + intern/cycles/render/image.cpp | 15 ++++-------- + intern/cycles/render/image.h | 3 ++- + intern/cycles/util/util_unique_ptr.h | 28 ++++++++++++++++++++++ + .../blender/imbuf/intern/oiio/openimageio_api.cpp | 19 +++++++-------- + 7 files changed, 48 insertions(+), 25 deletions(-) + create mode 100644 intern/cycles/util/util_unique_ptr.h + +diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp +index 54973fd..bee6dd1 100644 +--- a/intern/cycles/blender/blender_python.cpp ++++ b/intern/cycles/blender/blender_python.cpp +@@ -493,7 +493,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args) + socket_type = "NodeSocketString"; + data_type = BL::NodeSocket::type_STRING; + if(param->validdefault) +- default_string = param->sdefault[0]; ++ default_string = param->sdefault[0].string(); + } + else + continue; +diff --git a/intern/cycles/graph/node_xml.cpp b/intern/cycles/graph/node_xml.cpp +index d26b3b2..2a24104 100644 +--- a/intern/cycles/graph/node_xml.cpp ++++ b/intern/cycles/graph/node_xml.cpp +@@ -250,7 +250,7 @@ void xml_read_node(XMLReader& reader, Node *node, xml_node xml_node) + } + } + +- if(node->name) ++ if(!node->name.empty()) + reader.node_map[node->name] = node; + } + +diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp +index cf402c3..f84a37a 100644 +--- a/intern/cycles/render/buffers.cpp ++++ b/intern/cycles/render/buffers.cpp +@@ -27,6 +27,7 @@ + #include "util/util_opengl.h" + #include "util/util_time.h" + #include "util/util_types.h" ++#include "util/util_unique_ptr.h" + + CCL_NAMESPACE_BEGIN + +@@ -453,7 +454,7 @@ void DisplayBuffer::write(Device *device, const string& filename) + device->pixels_copy_from(rgba, 0, w, h); + + /* write image */ +- ImageOutput *out = ImageOutput::create(filename); ++ unique_ptr out = unique_ptr(ImageOutput::create(filename)); + ImageSpec spec(w, h, 4, TypeDesc::UINT8); + int scanlinesize = w*4*sizeof(uchar); + +@@ -468,7 +469,6 @@ void DisplayBuffer::write(Device *device, const string& filename) + + out->close(); + +- delete out; + } + + device_memory& DisplayBuffer::rgba_data() +diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp +index 595eb46..a143b02 100644 +--- a/intern/cycles/render/image.cpp ++++ b/intern/cycles/render/image.cpp +@@ -23,6 +23,7 @@ + #include "util/util_path.h" + #include "util/util_progress.h" + #include "util/util_texture.h" ++#include "util/util_unique_ptr.h" + + #ifdef WITH_OSL + #include +@@ -148,7 +149,7 @@ ImageDataType ImageManager::get_image_metadata(const string& filename, + return IMAGE_DATA_TYPE_BYTE4; + } + +- ImageInput *in = ImageInput::create(filename); ++ unique_ptr in(ImageInput::create(filename)); + + if(in) { + ImageSpec spec; +@@ -194,7 +195,6 @@ ImageDataType ImageManager::get_image_metadata(const string& filename, + in->close(); + } + +- delete in; + } + + if(is_half) { +@@ -449,7 +449,7 @@ void ImageManager::tag_reload_image(const string& filename, + } + + bool ImageManager::file_load_image_generic(Image *img, +- ImageInput **in, ++ unique_ptr *in, + int &width, + int &height, + int &depth, +@@ -465,7 +465,7 @@ bool ImageManager::file_load_image_generic(Image *img, + } + + /* load image from file through OIIO */ +- *in = ImageInput::create(img->filename); ++ *in = unique_ptr(ImageInput::create(img->filename)); + + if(!*in) + return false; +@@ -477,8 +477,6 @@ bool ImageManager::file_load_image_generic(Image *img, + config.attribute("oiio:UnassociatedAlpha", 1); + + if(!(*in)->open(img->filename, spec, config)) { +- delete *in; +- *in = NULL; + return false; + } + +@@ -500,8 +498,6 @@ bool ImageManager::file_load_image_generic(Image *img, + if(!(components >= 1 && components <= 4)) { + if(*in) { + (*in)->close(); +- delete *in; +- *in = NULL; + } + + return false; +@@ -519,7 +515,7 @@ bool ImageManager::file_load_image(Image *img, + device_vector& tex_img) + { + const StorageType alpha_one = (FileFormat == TypeDesc::UINT8)? 255 : 1; +- ImageInput *in = NULL; ++ unique_ptr in = NULL; + int width, height, depth, components; + if(!file_load_image_generic(img, &in, width, height, depth, components)) { + return false; +@@ -575,7 +571,6 @@ bool ImageManager::file_load_image(Image *img, + } + cmyk = strcmp(in->format_name(), "jpeg") == 0 && components == 4; + in->close(); +- delete in; + } + else { + if(FileFormat == TypeDesc::FLOAT) { +diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h +index db7e28a..f4a14f4 100644 +--- a/intern/cycles/render/image.h ++++ b/intern/cycles/render/image.h +@@ -23,6 +23,7 @@ + #include "util/util_image.h" + #include "util/util_string.h" + #include "util/util_thread.h" ++#include "util/util_unique_ptr.h" + #include "util/util_vector.h" + + CCL_NAMESPACE_BEGIN +@@ -133,7 +134,7 @@ private: + bool pack_images; + + bool file_load_image_generic(Image *img, +- ImageInput **in, ++ unique_ptr *in, + int &width, + int &height, + int &depth, +diff --git a/intern/cycles/util/util_unique_ptr.h b/intern/cycles/util/util_unique_ptr.h +new file mode 100644 +index 0000000..1ceae73 +--- /dev/null ++++ b/intern/cycles/util/util_unique_ptr.h +@@ -0,0 +1,28 @@ ++/* ++ * Copyright 2011-2013 Blender Foundation ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef __UTIL_UNIQUE_PTR_H__ ++#define __UTIL_UNIQUE_PTR_H__ ++ ++#include ++ ++CCL_NAMESPACE_BEGIN ++ ++using std::unique_ptr; ++ ++CCL_NAMESPACE_END ++ ++#endif /* __UTIL_UNIQUE_PTR_H__ */ +diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp +index b123d50..7f2fac9 100644 +--- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp ++++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp +@@ -35,6 +35,11 @@ + #include "utfconv.h" + #endif + ++// NOTE: Keep first, BLI_path_util conflicts with OIIO's format. ++#include ++#include ++#include ++ + extern "C" + { + #include "MEM_guardedalloc.h" +@@ -48,12 +53,10 @@ extern "C" + #include "IMB_colormanagement_intern.h" + } + +-#include +-#include +- + OIIO_NAMESPACE_USING + + using std::string; ++using std::unique_ptr; + + typedef unsigned char uchar; + +@@ -197,7 +200,6 @@ int imb_save_photoshop(struct ImBuf *ibuf, const char * /*name*/, int flags) + + struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspace[IM_MAX_SPACE]) + { +- ImageInput *in = NULL; + struct ImBuf *ibuf = NULL; + int width, height, components; + bool is_float, is_alpha; +@@ -210,7 +212,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac + + colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE); + +- in = ImageInput::create(filename); ++ unique_ptr in(ImageInput::create(filename)); + if (!in) { + std::cerr << __func__ << ": ImageInput::create() failed:" << std::endl + << OIIO_NAMESPACE::geterror() << std::endl; +@@ -223,7 +225,6 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac + if (!in->open(filename, spec, config)) { + std::cerr << __func__ << ": ImageInput::open() failed:" << std::endl + << in->geterror() << std::endl; +- delete in; + return NULL; + } + +@@ -249,19 +250,17 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac + if (!(components >= 1 && components <= 4)) { + if (in) { + in->close(); +- delete in; + } + return NULL; + } + + if (is_float) +- ibuf = imb_oiio_load_image_float(in, width, height, components, flags, is_alpha); ++ ibuf = imb_oiio_load_image_float(in.get(), width, height, components, flags, is_alpha); + else +- ibuf = imb_oiio_load_image(in, width, height, components, flags, is_alpha); ++ ibuf = imb_oiio_load_image(in.get(), width, height, components, flags, is_alpha); + + if (in) { + in->close(); +- delete in; + } + + if (!ibuf) diff --git a/gnu/packages/patches/blender-2.79-python-3.8-fix.patch b/gnu/packages/patches/blender-2.79-python-3.8-fix.patch new file mode 100644 index 0000000000..18d25449ee --- /dev/null +++ b/gnu/packages/patches/blender-2.79-python-3.8-fix.patch @@ -0,0 +1,204 @@ +From 4b663ecf264020b1d7003a137ce84b06d7ec4ce6 Mon Sep 17 00:00:00 2001 +From: bartus +Date: Sat, 16 Nov 2019 20:29:30 +0100 +Subject: [PATCH] Add python 3.8 support. + +--- + source/blender/python/generic/py_capi_utils.c | 27 +++++++++++++++---- + 1 file changed, 22 insertions(+), 5 deletions(-) + +diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c +index 545e0506f84..a7eab70600b 100644 +--- a/source/blender/python/generic/py_capi_utils.c ++++ b/source/blender/python/generic/py_capi_utils.c +@@ -696,9 +696,16 @@ PyObject *PyC_UnicodeFromByte(const char *str) + ****************************************************************************/ + PyObject *PyC_DefaultNameSpace(const char *filename) + { ++ #if PY_VERSION_HEX >= 0x03080000 ++ PyObject *modules = PyImport_GetModuleDict(); ++ PyObject *builtins = PyEval_GetBuiltins(); ++ #else + PyInterpreterState *interp = PyThreadState_GET()->interp; ++ PyObject *modules = interp->modules; ++ PyObject *builtins = interp->builtins; ++ #endif + PyObject *mod_main = PyModule_New("__main__"); +- PyDict_SetItemString(interp->modules, "__main__", mod_main); ++ PyDict_SetItemString(modules, "__main__", mod_main); + Py_DECREF(mod_main); /* sys.modules owns now */ + PyModule_AddStringConstant(mod_main, "__name__", "__main__"); + if (filename) { +@@ -706,8 +713,8 @@ PyObject *PyC_DefaultNameSpace(const char *filename) + * note: this wont map to a real file when executing text-blocks and buttons. */ + PyModule_AddObject(mod_main, "__file__", PyC_UnicodeFromByte(filename)); + } +- PyModule_AddObject(mod_main, "__builtins__", interp->builtins); +- Py_INCREF(interp->builtins); /* AddObject steals a reference */ ++ PyModule_AddObject(mod_main, "__builtins__", builtins); ++ Py_INCREF(builtins); /* AddObject steals a reference */ + return PyModule_GetDict(mod_main); + } + +@@ -734,15 +741,25 @@ bool PyC_NameSpace_ImportArray(PyObject *py_dict, const char *imports[]) + /* restore MUST be called after this */ + void PyC_MainModule_Backup(PyObject **main_mod) + { ++ #if PY_VERSION_HEX >= 0x03080000 ++ PyObject *modules = PyImport_GetModuleDict(); ++ #else + PyInterpreterState *interp = PyThreadState_GET()->interp; +- *main_mod = PyDict_GetItemString(interp->modules, "__main__"); ++ PyObject *modules = interp->modules; ++ #endif ++ *main_mod = PyDict_GetItemString(modules, "__main__"); + Py_XINCREF(*main_mod); /* don't free */ + } + + void PyC_MainModule_Restore(PyObject *main_mod) + { ++ #if PY_VERSION_HEX >= 0x03080000 ++ PyObject *modules = PyImport_GetModuleDict(); ++ #else + PyInterpreterState *interp = PyThreadState_GET()->interp; +- PyDict_SetItemString(interp->modules, "__main__", main_mod); ++ PyObject *modules = interp->modules; ++ #endif ++ PyDict_SetItemString(modules, "__main__", main_mod); + Py_XDECREF(main_mod); + } + +-- +2.24.0 + +From 44f719b63238503ef8f933f55383c6d4798995cc Mon Sep 17 00:00:00 2001 +From: Campbell Barton +Date: Thu, 13 Sep 2018 17:06:07 +1000 +Subject: [PATCH] Cleanup: use PyImport_GetModuleDict + +Replace direct access using PyThreadState_GET +--- + source/blender/python/bmesh/bmesh_py_api.c | 2 +- + source/blender/python/generic/idprop_py_api.c | 2 +- + source/blender/python/intern/bpy_interface.c | 2 +- + source/blender/python/intern/gpu.c | 4 ++-- + source/blender/python/mathutils/mathutils.c | 2 +- + source/blender/python/mathutils/mathutils_noise.c | 5 +++-- + source/gameengine/Ketsji/KX_PythonInit.cpp | 2 +- + 7 files changed, 10 insertions(+), 9 deletions(-) + +diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c +index d5973baeadb..d7324eabb6c 100644 +--- a/source/blender/python/bmesh/bmesh_py_api.c ++++ b/source/blender/python/bmesh/bmesh_py_api.c +@@ -196,7 +196,7 @@ PyObject *BPyInit_bmesh(void) + { + PyObject *mod; + PyObject *submodule; +- PyObject *sys_modules = PyThreadState_GET()->interp->modules; ++ PyObject *sys_modules = PyImport_GetModuleDict(); + + BPy_BM_init_types(); + BPy_BM_init_types_select(); +diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c +index 4d4d5232800..8bed0f28cba 100644 +--- a/source/blender/python/generic/idprop_py_api.c ++++ b/source/blender/python/generic/idprop_py_api.c +@@ -1795,7 +1795,7 @@ PyObject *BPyInit_idprop(void) + { + PyObject *mod; + PyObject *submodule; +- PyObject *sys_modules = PyThreadState_GET()->interp->modules; ++ PyObject *sys_modules = PyImport_GetModuleDict(); + + mod = PyModule_Create(&IDProp_module_def); + +diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c +index 7ca087e4993..123c938b921 100644 +--- a/source/blender/python/intern/bpy_interface.c ++++ b/source/blender/python/intern/bpy_interface.c +@@ -537,7 +537,7 @@ static bool python_script_exec( + + if (py_dict) { + #ifdef PYMODULE_CLEAR_WORKAROUND +- PyModuleObject *mmod = (PyModuleObject *)PyDict_GetItemString(PyThreadState_GET()->interp->modules, "__main__"); ++ PyModuleObject *mmod = (PyModuleObject *)PyDict_GetItemString(PyImport_GetModuleDict(), "__main__"); + PyObject *dict_back = mmod->md_dict; + /* freeing the module will clear the namespace, + * gives problems running classes defined in this namespace being used later. */ +diff --git a/source/blender/python/intern/gpu.c b/source/blender/python/intern/gpu.c +index 43796dc9474..d902b6838f4 100644 +--- a/source/blender/python/intern/gpu.c ++++ b/source/blender/python/intern/gpu.c +@@ -326,7 +326,7 @@ PyObject *GPU_initPython(void) + { + PyObject *module; + PyObject *submodule; +- PyObject *sys_modules = PyThreadState_GET()->interp->modules; ++ PyObject *sys_modules = PyImport_GetModuleDict(); + + module = PyInit_gpu(); + +@@ -337,6 +337,6 @@ PyObject *GPU_initPython(void) + PyDict_SetItem(sys_modules, PyModule_GetNameObject(submodule), submodule); + Py_INCREF(submodule); + +- PyDict_SetItem(PyImport_GetModuleDict(), PyModule_GetNameObject(module), module); ++ PyDict_SetItem(sys_modules, PyModule_GetNameObject(module), module); + return module; + } +diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c +index a3a4e7f313b..f021d456b3a 100644 +--- a/source/blender/python/mathutils/mathutils.c ++++ b/source/blender/python/mathutils/mathutils.c +@@ -615,7 +615,7 @@ PyMODINIT_FUNC PyInit_mathutils(void) + { + PyObject *mod; + PyObject *submodule; +- PyObject *sys_modules = PyThreadState_GET()->interp->modules; ++ PyObject *sys_modules = PyImport_GetModuleDict(); + + if (PyType_Ready(&vector_Type) < 0) + return NULL; +diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c +index 839d1ffc588..834322c0aed 100644 +--- a/source/blender/python/mathutils/mathutils_noise.c ++++ b/source/blender/python/mathutils/mathutils_noise.c +@@ -845,6 +845,7 @@ static struct PyModuleDef M_Noise_module_def = { + /*----------------------------MODULE INIT-------------------------*/ + PyMODINIT_FUNC PyInit_mathutils_noise(void) + { ++ PyObject *sys_modules = PyImport_GetModuleDict(); + PyObject *submodule = PyModule_Create(&M_Noise_module_def); + PyObject *item_types, *item_metrics; + +@@ -852,11 +853,11 @@ PyMODINIT_FUNC PyInit_mathutils_noise(void) + setRndSeed(0); + + PyModule_AddObject(submodule, "types", (item_types = PyInit_mathutils_noise_types())); +- PyDict_SetItemString(PyThreadState_GET()->interp->modules, "noise.types", item_types); ++ PyDict_SetItemString(sys_modules, "noise.types", item_types); + Py_INCREF(item_types); + + PyModule_AddObject(submodule, "distance_metrics", (item_metrics = PyInit_mathutils_noise_metrics())); +- PyDict_SetItemString(PyThreadState_GET()->interp->modules, "noise.distance_metrics", item_metrics); ++ PyDict_SetItemString(sys_modules, "noise.distance_metrics", item_metrics); + Py_INCREF(item_metrics); + + return submodule; +diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp +index 251273cf7a8..9611a4ea49b 100644 +--- a/source/gameengine/Ketsji/KX_PythonInit.cpp ++++ b/source/gameengine/Ketsji/KX_PythonInit.cpp +@@ -2234,7 +2234,7 @@ PyMODINIT_FUNC initBGE(void) + { + PyObject *mod; + PyObject *submodule; +- PyObject *sys_modules = PyThreadState_GET()->interp->modules; ++ PyObject *sys_modules = PyImport_GetModuleDict(); + const char *mod_full; + + mod = PyModule_Create(&BGE_module_def); +-- +2.25.0 + -- cgit v1.2.3 From cf1d1f4f79ddf3a75b960ef52116221cc9732600 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 1 Aug 2020 03:16:40 -0400 Subject: gnu: xorg-server: Fix CVE-2020-14347 via graft. * gnu/packages/patches/xorg-server-CVE-2020-14347.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/xorg.scm (xorg-server/fixed): New variable. (xorg-server)[replacement]: New field. (xorg-server-wayland): Use package/inherit. --- gnu/local.mk | 1 + .../patches/xorg-server-CVE-2020-14347.patch | 33 ++++++++++++++++++++++ gnu/packages/xorg.scm | 14 +++++++-- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/xorg-server-CVE-2020-14347.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 181212c70b..b7c98aeef2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1650,6 +1650,7 @@ dist_patch_DATA = \ %D%/packages/patches/xf86-video-voodoo-pcitag.patch \ %D%/packages/patches/xfce4-panel-plugins.patch \ %D%/packages/patches/xfce4-settings-defaults.patch \ + %D%/packages/patches/xorg-server-CVE-2020-14347.patch \ %D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \ %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ %D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \ diff --git a/gnu/packages/patches/xorg-server-CVE-2020-14347.patch b/gnu/packages/patches/xorg-server-CVE-2020-14347.patch new file mode 100644 index 0000000000..c54b93d764 --- /dev/null +++ b/gnu/packages/patches/xorg-server-CVE-2020-14347.patch @@ -0,0 +1,33 @@ +From aac28e162e5108510065ad4c323affd6deffd816 Mon Sep 17 00:00:00 2001 +From: Matthieu Herrb +Date: Sat, 25 Jul 2020 19:33:23 +0200 +Subject: [PATCH] fix for ZDI-11426 + +Avoid leaking un-initalized memory to clients by zeroing the +whole pixmap on initial allocation. + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Matthieu Herrb +Reviewed-by: Alan Coopersmith +--- + dix/pixmap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dix/pixmap.c b/dix/pixmap.c +index 1186d7dbb..5a0146bbb 100644 +--- a/dix/pixmap.c ++++ b/dix/pixmap.c +@@ -116,7 +116,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) + if (pScreen->totalPixmapSize > ((size_t) - 1) - pixDataSize) + return NullPixmap; + +- pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); ++ pPixmap = calloc(1, pScreen->totalPixmapSize + pixDataSize); + if (!pPixmap) + return NullPixmap; + +-- +2.27.0 + diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index b58a5521ca..560e6b6a1c 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -5327,6 +5327,7 @@ over Xlib, including: (package (name "xorg-server") (version "1.20.8") + (replacement xorg-server/fixed) (source (origin (method url-fetch) @@ -5450,6 +5451,16 @@ communicates with the user via graphical controls such as buttons and draggable titlebars and borders.") (license license:x11))) +(define xorg-server/fixed ; Fixes CVE-2020-14347 + (package + (inherit xorg-server) + (source + (origin + (inherit (package-source xorg-server)) + (patches + (append (origin-patches (package-source xorg-server)) + (search-patches "xorg-server-CVE-2020-14347.patch"))))))) + ;; This package is intended to be used when building GTK+. ;; Note: It's currently marked as "hidden" to avoid having two non-eq? ;; packages with the same name and version. @@ -5468,8 +5479,7 @@ draggable titlebars and borders.") "18bfl04ihw1jr3h0fs522nnxxq5ixjay77y9dcymnkzk23q8cndx"))))))) (define-public xorg-server-xwayland - (package - (inherit xorg-server) + (package/inherit xorg-server (name "xorg-server-xwayland") (inputs `(("wayland" ,wayland) -- cgit v1.2.3 From 86f86cffd822afc012e308490e9931a66ce924aa Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Fri, 31 Jul 2020 23:33:23 -0500 Subject: gnu: Add Remake. * gnu/packages/debug.scm (remake): New variable. * gnu/packages/patches/remake-impure-dirs.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/debug.scm | 25 ++++++++++++++++++++++ gnu/packages/patches/remake-impure-dirs.patch | 30 +++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 gnu/packages/patches/remake-impure-dirs.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index b7c98aeef2..15ae30f30a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1507,6 +1507,7 @@ dist_patch_DATA = \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ %D%/packages/patches/rtags-separate-rct.patch \ %D%/packages/patches/racket-store-checksum-override.patch \ + %D%/packages/patches/remake-impure-dirs.patch \ %D%/packages/patches/retroarch-disable-online-updater.patch \ %D%/packages/patches/rnp-add-version.cmake.patch \ %D%/packages/patches/rnp-disable-ruby-rnp-tests.patch \ diff --git a/gnu/packages/debug.scm b/gnu/packages/debug.scm index 2a3e6edc31..2f58f8e972 100644 --- a/gnu/packages/debug.scm +++ b/gnu/packages/debug.scm @@ -536,6 +536,31 @@ the position of the variable and allows you to modify its value.") ;; by GPLv3 or later. (license (list license:lgpl3+ license:gpl3+)))) +(define-public remake + (package (inherit gnu-make) + (name "remake") + (version "4.3-1.5") + (source (origin + (method url-fetch) + (uri (let ((upstream-version + (match (string-split version #\-) + ((ver sub) (string-append ver "%2Bdbg-" sub))))) + (string-append "mirror://sourceforge/bashdb/" + "remake/" upstream-version "/" + "remake-" upstream-version ".tar.gz"))) + (file-name (string-append "remake-" version ".tar.gz")) + (sha256 + (base32 + "0xlx2485y0israv2pfghmv74lxcv9i5y65agy69mif76yc4vfvif")) + (patches (search-patches "remake-impure-dirs.patch")))) + (inputs + `(("readline" ,readline) + ,@(package-inputs gnu-make))) + (home-page "http://bashdb.sourceforge.net/remake/") + (description "Remake is an enhanced version of GNU Make that adds improved +error reporting, better tracing, profiling, and a debugger.") + (license license:gpl3+))) + (define-public rr (package (name "rr") diff --git a/gnu/packages/patches/remake-impure-dirs.patch b/gnu/packages/patches/remake-impure-dirs.patch new file mode 100644 index 0000000000..698ac7476c --- /dev/null +++ b/gnu/packages/patches/remake-impure-dirs.patch @@ -0,0 +1,30 @@ +Purity: don't look for library dependencies (of the form `-lfoo') in +/lib and /usr/lib. Likewise, when searching for included Makefiles, +don't look in /usr/include and friends. + +Borrowed from similar patch for GNU Make and adjusted for Remake. + +--- remake-4.3+dbg-1.5/src/read.c.orig 2020-03-14 17:06:16.000000000 -0500 ++++ remake-4.3+dbg-1.5/src/read.c 2020-07-31 22:34:03.862383862 -0500 +@@ -104,7 +104,7 @@ + # define INCLUDEDIR "." + #endif + INCLUDEDIR, +-#ifndef _AMIGA ++#if 0 + "/usr/gnu/include", + "/usr/local/include", + "/usr/include", +--- remake-4.3+dbg-1.5/src/remake.c.orig 2020-03-14 17:06:16.000000000 -0500 ++++ remake-4.3+dbg-1.5/src/remake.c 2020-07-31 22:34:26.798330508 -0500 +@@ -1665,8 +1665,10 @@ + { + static const char *dirs[] = + { ++#if 0 + "/lib", + "/usr/lib", ++#endif + #if defined(WINDOWS32) && !defined(LIBDIR) + /* + * This is completely up to the user at product install time. Just define -- cgit v1.2.3 From b654037403f0fdae63f200b57aee9a35a236907f Mon Sep 17 00:00:00 2001 From: Vinicius Monego Date: Sat, 1 Aug 2020 11:43:21 -0300 Subject: gnu: Add python-onnx. * gnu/packages/machine-learning.scm (python-onnx): New variable. * gnu/packages/patches/python-onnx-use-system-googletest.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Mathieu Othacehe --- gnu/local.mk | 1 + gnu/packages/machine-learning.scm | 43 +++++++++++++++++ .../python-onnx-use-system-googletest.patch | 54 ++++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 gnu/packages/patches/python-onnx-use-system-googletest.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 15ae30f30a..f1a6c6a0d0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1464,6 +1464,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-memcached-syntax-warnings.patch \ %D%/packages/patches/python-mox3-python3.6-compat.patch \ %D%/packages/patches/python-testtools.patch \ + %D%/packages/patches/python-onnx-use-system-googletest.patch \ %D%/packages/patches/python-packaging-test-arch.patch \ %D%/packages/patches/python2-parameterized-docstring-test.patch \ %D%/packages/patches/python-paste-remove-timing-test.patch \ diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 18a4ac9ef2..4ec3ed05c7 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -15,6 +15,7 @@ ;;; Copyright © 2019 Brett Gilio ;;; Copyright © 2020 Konrad Hinsen ;;; Copyright © 2020 Edouard Klein +;;; Copyright © 2020 Vinicius Monego ;;; ;;; This file is part of GNU Guix. ;;; @@ -53,6 +54,7 @@ #:use-module (gnu packages boost) #:use-module (gnu packages check) #:use-module (gnu packages compression) + #:use-module (gnu packages cmake) #:use-module (gnu packages cran) #:use-module (gnu packages databases) #:use-module (gnu packages dejagnu) @@ -70,6 +72,7 @@ #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-science) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) @@ -576,6 +579,46 @@ tools. This enables both rapid prototyping of data pipelines and extensibility in terms of new algorithms.") (license license:gpl3+))) +(define-public python-onnx + (package + (name "python-onnx") + (version "1.7.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "onnx" version)) + ;; ONNX will build googletest from a git checkout. Patch CMake + ;; to use googletest from Guix and enable tests by default. + (patches (search-patches "python-onnx-use-system-googletest.patch")) + (sha256 + (base32 "0j6rgfbhsw3a8id8pyg18y93k68lbjbj1kq6qia36h69f6pvlyjy")))) + (build-system python-build-system) + (native-inputs + `(("cmake" ,cmake) + ("googletest" ,googletest) + ("pybind11" ,pybind11) + ("python-coverage" ,python-coverage) + ("python-nbval" ,python-nbval) + ("python-pytest" ,python-pytest) + ("python-pytest-runner" ,python-pytest-runner))) + (inputs + `(("protobuf" ,protobuf))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("python-protobuf" ,python-protobuf) + ("python-six" ,python-six) + ("python-tabulate" ,python-tabulate) + ("python-typing-extensions" + ,python-typing-extensions))) + (home-page "https://onnx.ai/") + (synopsis "Open Neural Network Exchange") + (description + "Open Neural Network Exchange (ONNX) provides an open source format for +AI models, both deep learning and traditional ML. It defines an extensible +computation graph model, as well as definitions of built-in operators and +standard data types.") + (license license:expat))) + (define-public rxcpp (package (name "rxcpp") diff --git a/gnu/packages/patches/python-onnx-use-system-googletest.patch b/gnu/packages/patches/python-onnx-use-system-googletest.patch new file mode 100644 index 0000000000..33d2fa12de --- /dev/null +++ b/gnu/packages/patches/python-onnx-use-system-googletest.patch @@ -0,0 +1,54 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0aa9fda2..a573170c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,7 +22,7 @@ option(BUILD_ONNX_PYTHON "Build Python binaries" OFF) + option(ONNX_GEN_PB_TYPE_STUBS "Generate protobuf python type stubs" ON) + option(ONNX_WERROR "Build with Werror" OFF) + option(ONNX_COVERAGE "Build with coverage instrumentation" OFF) +-option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" OFF) ++option(ONNX_BUILD_TESTS "Build ONNX C++ APIs Tests" ON) + option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF) + option(ONNXIFI_ENABLE_EXT "Enable onnxifi extensions." OFF) + if(NOT DEFINED ONNX_ML) +@@ -82,8 +82,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + endif() + + if(ONNX_BUILD_TESTS) +- list(APPEND CMAKE_MODULE_PATH ${ONNX_ROOT}/cmake/external) +- include(googletest) ++ find_package(GTest REQUIRED) ++ if(NOT GTest_FOUND) ++ message(FATAL_ERROR "cannot find googletest") ++ endif() + endif() + + if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf)) +diff --git a/cmake/unittest.cmake b/cmake/unittest.cmake +index e29a93ff..ae146390 100644 +--- a/cmake/unittest.cmake ++++ b/cmake/unittest.cmake +@@ -6,8 +6,8 @@ include(${ONNX_ROOT}/cmake/Utils.cmake) + + find_package(Threads) + +-set(${UT_NAME}_libs ${googletest_STATIC_LIBRARIES}) +-set(${ONNXIFI_TEST_DRIVER}_libs ${googletest_STATIC_LIBRARIES}) ++set(${UT_NAME}_libs ${GTEST_LIBRARIES}) ++set(${ONNXIFI_TEST_DRIVER}_libs ${GTEST_LIBRARIES}) + + list(APPEND ${UT_NAME}_libs onnx) + list(APPEND ${UT_NAME}_libs onnx_proto) +@@ -31,10 +31,10 @@ function(AddTest) + list(REMOVE_DUPLICATES _UT_SOURCES) + + add_executable(${_UT_TARGET} ${_UT_SOURCES}) +- add_dependencies(${_UT_TARGET} onnx onnx_proto googletest) ++ add_dependencies(${_UT_TARGET} onnx onnx_proto) + + target_include_directories(${_UT_TARGET} +- PUBLIC ${googletest_INCLUDE_DIRS} ++ PUBLIC ${GTEST_INCLUDE_DIRS} + ${ONNX_INCLUDE_DIRS} + ${PROTOBUF_INCLUDE_DIRS} + ${ONNX_ROOT} -- cgit v1.2.3 From f574f859ee7343d894ecf7318fa53b7a73426775 Mon Sep 17 00:00:00 2001 From: Leo Prikler Date: Sun, 2 Aug 2020 20:46:58 +0200 Subject: gnu: emacs: Ignore empty XIM styles. As of libx11 version 1.6.10, xim may be NULL, which causes a segmentation fault in the execution of ARRAYELTS. As a cautionary measure, we short-circuit this logic. * gnu/packages/patches/emacs-ignore-empty-xim-styles.patch: New file. * gnu/packages/emacs.scm (emacs emacs-next)[patches]: Use it. * gnu/local.mk: Register it. Signed-off-by: Mathieu Othacehe --- gnu/local.mk | 1 + gnu/packages/emacs.scm | 2 ++ .../patches/emacs-ignore-empty-xim-styles.patch | 24 ++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 gnu/packages/patches/emacs-ignore-empty-xim-styles.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index f1a6c6a0d0..8be9bac67c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -917,6 +917,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-exec-path.patch \ %D%/packages/patches/emacs-exwm-fix-fullscreen-states.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ + %D%/packages/patches/emacs-ignore-empty-xim-styles.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ %D%/packages/patches/emacs-highlight-stages-add-gexp.patch \ %D%/packages/patches/emacs-hyperbole-toggle-messaging.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 8fe5750791..ad8d4b0606 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -85,6 +85,7 @@ "119ldpk7sgn9jlpyngv5y4z3i7bb8q3xp4p0qqi7i5nq39syd42d")) (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" + "emacs-ignore-empty-xim-styles.patch" "emacs-source-date-epoch.patch")) (modules '((guix build utils))) (snippet @@ -261,6 +262,7 @@ languages.") (file-name (git-file-name name version)) (patches (search-patches "emacs27-exec-path.patch" "emacs-fix-scheme-indent-function.patch" + "emacs-ignore-empty-xim-styles.patch" "emacs-source-date-epoch.patch")) (modules (origin-modules (package-source emacs))) ;; TODO: once the snippet for `emacs' is changed to not fail when diff --git a/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch new file mode 100644 index 0000000000..606d3ece6f --- /dev/null +++ b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch @@ -0,0 +1,24 @@ +Fix contributed upstream here: +https://debbugs.gnu.org/cgi/bugreport.cgi?bug=42694. + +Index: emacs-26.3/src/xfns.c +=================================================================== +--- emacs-26.3.orig/src/xfns.c ++++ emacs-26.3/src/xfns.c +@@ -2533,6 +2533,8 @@ xic_free_xfontset (struct frame *f) + static XIMStyle + best_xim_style (XIMStyles *xim) + { ++ if (xim == NULL) goto out; ++ + int i, j; + int nr_supported = ARRAYELTS (supported_xim_styles); + +@@ -2541,6 +2543,7 @@ best_xim_style (XIMStyles *xim) + if (supported_xim_styles[i] == xim->supported_styles[j]) + return supported_xim_styles[i]; + ++ out: + /* Return the default style. */ + return XIMPreeditNothing | XIMStatusNothing; + } -- cgit v1.2.3 From 839bb42f0cc80dbdbcd101fffadd47ead93409d2 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 3 Aug 2020 02:01:19 -0400 Subject: gnu: pjproject: Fix problem in pkg-config file. * gnu/packages/patches/pjproject-correct-the-cflags-field.patch: Add patch. * gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch: Likewise. * gnu/local.mk (dist_patch_DATA): Register the new patches. * gnu/packages/telephony.scm (pjproject): Use them. * gnu/packages/jami.scm (pjproject-jami): Remove a patch from pjproject-jami that is already applied against pjproject. --- gnu/local.mk | 2 + gnu/packages/jami.scm | 3 +- .../pjproject-correct-the-cflags-field.patch | 121 +++++++++++++++++++++ .../patches/pjproject-fix-pkg-config-ldflags.patch | 34 ++++++ gnu/packages/telephony.scm | 4 + 5 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/pjproject-correct-the-cflags-field.patch create mode 100644 gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 8be9bac67c..dee4862b93 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1410,6 +1410,8 @@ dist_patch_DATA = \ %D%/packages/patches/pingus-boost-headers.patch \ %D%/packages/patches/pingus-sdl-libs-config.patch \ %D%/packages/patches/pixman-CVE-2016-5296.patch \ + %D%/packages/patches/pjproject-correct-the-cflags-field.patch \ + %D%/packages/patches/pjproject-fix-pkg-config-ldflags.patch \ %D%/packages/patches/plink-1.07-unclobber-i.patch \ %D%/packages/patches/plink-endian-detection.patch \ %D%/packages/patches/plib-CVE-2011-4620.patch \ diff --git a/gnu/packages/jami.scm b/gnu/packages/jami.scm index 85a06026ed..6dbde4078b 100644 --- a/gnu/packages/jami.scm +++ b/gnu/packages/jami.scm @@ -171,7 +171,8 @@ "0007-pj_ice_sess" "0008-fix_ioqueue_ipv6_sendto" "0009-add-config-site" - "0010-fix-pkgconfig" + ;; Note: The base pjproject is already patched with + ;; "0010-fix-pkgconfig". "0011-fix-tcp-death-detection" "0012-fix-turn-shutdown-crash")) #t))) diff --git a/gnu/packages/patches/pjproject-correct-the-cflags-field.patch b/gnu/packages/patches/pjproject-correct-the-cflags-field.patch new file mode 100644 index 0000000000..8bc503580d --- /dev/null +++ b/gnu/packages/patches/pjproject-correct-the-cflags-field.patch @@ -0,0 +1,121 @@ +From 44f8f6c1c71bec6bf00269b075a2dc801ae6fd45 Mon Sep 17 00:00:00 2001 +From: Vladimir Stoiakin +Date: Thu, 23 Apr 2020 14:06:40 +0300 +Subject: [PATCH 1/2] libpjproject.pc: correct the field 'cflags' + +--- + Makefile | 6 ++---- + aconfigure | 4 ++++ + aconfigure.ac | 3 +++ + build.mak.in | 7 +++---- + libpjproject.pc.in | 4 ++-- + 5 files changed, 14 insertions(+), 10 deletions(-) + +diff --git a/Makefile b/Makefile +index ffaf638dd..3fd5cab40 100644 +--- a/Makefile ++++ b/Makefile +@@ -132,10 +132,8 @@ install: + sed -e "s!@INCLUDEDIR@!$(includedir)!" | \ + sed -e "s!@LIBDIR@!$(libdir)!" | \ + sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \ +- sed -e "s!@PJ_LDLIBS@!!" | \ +- sed -e "s!@PJ_LDXXLIBS@!$(PJ_LDXXLIBS)!" | \ +- sed -e "s!@PJ_INSTALL_CFLAGS@!!" | \ +- sed -e "s!@PJ_INSTALL_CXXFLAGS@!$(PJ_INSTALL_CXXFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc ++ sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \ ++ sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc + + uninstall: + $(RM) $(DESTDIR)$(libdir)/pkgconfig/libpjproject.pc +diff --git a/aconfigure b/aconfigure +index 2abbcf533..1ab932bda 100755 +--- a/aconfigure ++++ b/aconfigure +@@ -706,6 +706,7 @@ GREP + CPP + ac_cross_compile + ac_shlib_suffix ++ac_cflags + ac_build_mak_vars + ac_pjdir + CC_CFLAGS +@@ -3952,6 +3953,7 @@ if test "$CC_CFLAGS" = ""; then CC_CFLAGS="-Wall"; fi + + + ++ + case $host in + *mingw* | *cygw* | *win32* | *w32* ) + if pwd -W 2&> /dev/null; then +@@ -5138,8 +5140,10 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + if test "x$ac_cv_c_bigendian" = "xyes"; then + CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" ++ ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" + else + CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" ++ ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" + fi + + +diff --git a/aconfigure.ac b/aconfigure.ac +index 83d3559ed..b1d493c08 100644 +--- a/aconfigure.ac ++++ b/aconfigure.ac +@@ -71,6 +71,7 @@ AC_SUBST(CC_CFLAGS) + + AC_SUBST(ac_pjdir) + AC_SUBST(ac_build_mak_vars) ++AC_SUBST(ac_cflags) + + case $host in + *mingw* | *cygw* | *win32* | *w32* ) +@@ -144,8 +145,10 @@ AC_C_BIGENDIAN + + if test "x$ac_cv_c_bigendian" = "xyes"; then + CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" ++ ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0" + else + CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" ++ ac_cflags="$ac_cflags -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1" + fi + + dnl +diff --git a/build.mak.in b/build.mak.in +index abc0c4fa0..a9078bb25 100644 +--- a/build.mak.in ++++ b/build.mak.in +@@ -299,7 +299,7 @@ export APP_LDXXLIBS := $(PJSUA2_LIB_LDLIB) \ + -lstdc++ \ + $(APP_LDLIBS) + +-# Here are the variabels to use if application is using the library ++# Here are the variables to use if application is using the library + # from within the source distribution + export PJ_CC := $(APP_CC) + export PJ_CXX := $(APP_CXX) +@@ -317,6 +317,5 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES) + export PJ_INSTALL_DIR := @prefix@ + export PJ_INSTALL_INC_DIR := @includedir@ + export PJ_INSTALL_LIB_DIR := @libdir@ +-export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @CFLAGS@ +-export PJ_INSTALL_CXXFLAGS := @CXXFLAGS@ $(PJ_INSTALL_CFLAGS) +-export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDLIBS) ++export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@ ++export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS) +diff --git a/libpjproject.pc.in b/libpjproject.pc.in +index fa8d39114..30ea05c07 100644 +--- a/libpjproject.pc.in ++++ b/libpjproject.pc.in +@@ -9,5 +9,5 @@ Name: libpjproject + Description: Multimedia communication library + URL: http://www.pjsip.org + Version: @PJ_VERSION@ +-Libs: -L${libdir} @PJ_LDXXLIBS@ +-Cflags: -I${includedir} @PJ_INSTALL_CXXFLAGS@ ++Libs: @PJ_INSTALL_LDFLAGS@ ++Cflags: @PJ_INSTALL_CFLAGS@ +-- +2.27.0 + diff --git a/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch new file mode 100644 index 0000000000..a3f2852515 --- /dev/null +++ b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch @@ -0,0 +1,34 @@ +From 7a86f357ffa2339a67991e5f4f5610a218e80693 Mon Sep 17 00:00:00 2001 +From: Maxim Cournoyer +Date: Mon, 3 Aug 2020 17:43:19 -0400 +Subject: [PATCH 2/2] build.mak.in: Filter out 3rd party libraries from + PJ_INSTALL_LDFLAGS. + +This is done so users of the installed pjproject libraries do not get +directives (provided via pkg-config file of pjproject) to link against +pjproject's own library dependencies. + +* build.mak.in (THIRD_PARTY_LIBRARIES): New variable. +(PJ_INSTALL_LDFLAGS): Filter out THIRD_PARTY_LIBRARIES. +--- + build.mak.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/build.mak.in b/build.mak.in +index a9078bb25..86fd1ec30 100644 +--- a/build.mak.in ++++ b/build.mak.in +@@ -314,8 +314,9 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES) + + # And here are the variables to use if application is using the + # library from the install location (i.e. --prefix) ++THIRD_PARTY_LIBRARIES := $(APP_THIRD_PARTY_LIBS) $(APP_THIRD_PARTY_EXT) @LIBS@ + export PJ_INSTALL_DIR := @prefix@ + export PJ_INSTALL_INC_DIR := @includedir@ + export PJ_INSTALL_LIB_DIR := @libdir@ + export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@ +-export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS) ++export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(filter-out $(THIRD_PARTY_LIBRARIES),$(APP_LDXXLIBS)) +-- +2.27.0 + diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm index f5b484dc2b..cc31cd6a36 100644 --- a/gnu/packages/telephony.scm +++ b/gnu/packages/telephony.scm @@ -731,6 +731,10 @@ your calls and messages.") (base32 "1aklicpgwc88578k03i5d5cm5h8mfm7hmx8vfprchbmaa2p8f4z0")) (modules '((guix build utils))) + ;; The patches upstream status can be tracked at: + ;; https://github.com/pjsip/pjproject/pull/2501. + (patches (search-patches "pjproject-correct-the-cflags-field.patch" + "pjproject-fix-pkg-config-ldflags.patch")) (snippet '(begin ;; Remove bundled libraries. -- cgit v1.2.3 From e6062b6195c2d100f88bf8a82c45b7e9182ca088 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Tue, 4 Aug 2020 23:48:24 -0400 Subject: gnu: pjproject: Update the pkg-config patch. * gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch: Update patch. --- .../patches/pjproject-fix-pkg-config-ldflags.patch | 77 +++++++++++++++++----- 1 file changed, 61 insertions(+), 16 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch index a3f2852515..1199d82f1e 100644 --- a/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch +++ b/gnu/packages/patches/pjproject-fix-pkg-config-ldflags.patch @@ -1,34 +1,79 @@ -From 7a86f357ffa2339a67991e5f4f5610a218e80693 Mon Sep 17 00:00:00 2001 +From 9bcba7fb28055550961b134e517b695a8cd05b2a Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Mon, 3 Aug 2020 17:43:19 -0400 -Subject: [PATCH 2/2] build.mak.in: Filter out 3rd party libraries from - PJ_INSTALL_LDFLAGS. +Subject: [PATCH] libpjproject.pc: Move external libraries to Libs.private. -This is done so users of the installed pjproject libraries do not get +This is done so users of a shared pjproject library do not get link directives (provided via pkg-config file of pjproject) to link against pjproject's own library dependencies. -* build.mak.in (THIRD_PARTY_LIBRARIES): New variable. -(PJ_INSTALL_LDFLAGS): Filter out THIRD_PARTY_LIBRARIES. +Static linking with pjproject is preserved by moving the external +libraries link directives to the Libs.private field, which is +specifically intended for this purpose, via for example: + + $ pkg-config --static --libs libpjproject + +* build.mak.in (PJ_INSTALL_LDFLAGS_PRIVATE): New variable. +(PJ_INSTALL_LDFLAGS): Filter out PJ_INSTALL_LDFLAGS_PRIVATE entries. +* libpjproject.pc.in (Libs.private): New field. +* Makefile: Substitute PJ_INSTALL_LDFLAGS_PRIVATE as the value for the +Libs.private field. --- - build.mak.in | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) + Makefile | 5 +++-- + build.mak.in | 3 ++- + libpjproject.pc.in | 1 + + 3 files changed, 6 insertions(+), 3 deletions(-) +diff --git a/Makefile b/Makefile +index 3fd5cab40..d67badfa4 100644 +--- a/Makefile ++++ b/Makefile +@@ -54,14 +54,14 @@ doc: + exit 1; \ + fi; \ + done +- ++ + LIBS = pjlib/lib/libpj-$(TARGET_NAME).a \ + pjlib-util/lib/libpjlib-util-$(TARGET_NAME).a \ + pjnath/lib/libpjnath-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME).a \ + pjmedia/lib/libpjmedia-codec-$(TARGET_NAME).a \ +- pjsip/lib/libpjsip-$(TARGET_NAME).a \ ++ pjsip/lib/libpjsip-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-ua-$(TARGET_NAME).a \ + pjsip/lib/libpjsip-simple-$(TARGET_NAME).a \ + pjsip/lib/libpjsua-$(TARGET_NAME).a +@@ -133,6 +133,7 @@ install: + sed -e "s!@LIBDIR@!$(libdir)!" | \ + sed -e "s/@PJ_VERSION@/$(PJ_VERSION)/" | \ + sed -e "s!@PJ_INSTALL_LDFLAGS@!$(PJ_INSTALL_LDFLAGS)!" | \ ++ sed -e "s!@PJ_INSTALL_LDFLAGS_PRIVATE@!$(PJ_INSTALL_LDFLAGS_PRIVATE)!" | \ + sed -e "s!@PJ_INSTALL_CFLAGS@!$(PJ_INSTALL_CFLAGS)!" > $(DESTDIR)/$(libdir)/pkgconfig/libpjproject.pc + + uninstall: diff --git a/build.mak.in b/build.mak.in -index a9078bb25..86fd1ec30 100644 +index a9078bb25..1a18a8513 100644 --- a/build.mak.in +++ b/build.mak.in -@@ -314,8 +314,9 @@ export PJ_LIBXX_FILES := $(APP_LIBXX_FILES) - - # And here are the variables to use if application is using the - # library from the install location (i.e. --prefix) -+THIRD_PARTY_LIBRARIES := $(APP_THIRD_PARTY_LIBS) $(APP_THIRD_PARTY_EXT) @LIBS@ - export PJ_INSTALL_DIR := @prefix@ +@@ -318,4 +318,5 @@ export PJ_INSTALL_DIR := @prefix@ export PJ_INSTALL_INC_DIR := @includedir@ export PJ_INSTALL_LIB_DIR := @libdir@ export PJ_INSTALL_CFLAGS := -I$(PJ_INSTALL_INC_DIR) -DPJ_AUTOCONF=1 @ac_cflags@ -export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(APP_LDXXLIBS) -+export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(filter-out $(THIRD_PARTY_LIBRARIES),$(APP_LDXXLIBS)) ++export PJ_INSTALL_LDFLAGS_PRIVATE := $(APP_THIRD_PARTY_LIBS) $(APP_THIRD_PARTY_EXT) @LIBS@ ++export PJ_INSTALL_LDFLAGS := -L$(PJ_INSTALL_LIB_DIR) $(filter-out $(PJ_INSTALL_LDFLAGS_PRIVATE),$(APP_LDXXLIBS)) +diff --git a/libpjproject.pc.in b/libpjproject.pc.in +index 30ea05c07..4372d5016 100644 +--- a/libpjproject.pc.in ++++ b/libpjproject.pc.in +@@ -10,4 +10,5 @@ Description: Multimedia communication library + URL: http://www.pjsip.org + Version: @PJ_VERSION@ + Libs: @PJ_INSTALL_LDFLAGS@ ++Libs.private: @PJ_INSTALL_LDFLAGS_PRIVATE@ + Cflags: @PJ_INSTALL_CFLAGS@ -- 2.27.0 -- cgit v1.2.3 From 10b40489742bdaa0d193c00dff1446b11c081f6a Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 6 Aug 2020 09:43:40 +0300 Subject: gnu: json-c: Fix CVE-2020-12762. * gnu/packages/web.scm (json-c)[replacement]: New field. (json-c-0.13, json-c-0.12)[source]: Add patch. (json-c/fixed): New variable. * gnu/packages/patches/json-c-CVE-2020-12762.patch, gnu/packages/patches/json-c--0.13-CVE-2020-12762.patch, gnu/packages/patches/json-c--0.12-CVE-2020-12762.patch: New files. * gnu/local.mk (dist_patch_DATA): Register them. --- gnu/local.mk | 3 + .../patches/json-c-0.12-CVE-2020-12762.patch | 175 ++++++++++++++++ .../patches/json-c-0.13-CVE-2020-12762.patch | 230 +++++++++++++++++++++ gnu/packages/patches/json-c-CVE-2020-12762.patch | 193 +++++++++++++++++ gnu/packages/web.scm | 12 ++ 5 files changed, 613 insertions(+) create mode 100644 gnu/packages/patches/json-c-0.12-CVE-2020-12762.patch create mode 100644 gnu/packages/patches/json-c-0.13-CVE-2020-12762.patch create mode 100644 gnu/packages/patches/json-c-CVE-2020-12762.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index dee4862b93..2c426633bd 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1137,6 +1137,9 @@ dist_patch_DATA = \ %D%/packages/patches/iputils-libcap-compat.patch \ %D%/packages/patches/irrlicht-use-system-libs.patch \ %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ + %D%/packages/patches/json-c-CVE-2020-12762.patch \ + %D%/packages/patches/json-c-0.13-CVE-2020-12762.patch \ + %D%/packages/patches/json-c-0.12-CVE-2020-12762.patch \ %D%/packages/patches/jacal-fix-texinfo.patch \ %D%/packages/patches/jamvm-2.0.0-disable-branch-patching.patch \ %D%/packages/patches/jamvm-arm.patch \ diff --git a/gnu/packages/patches/json-c-0.12-CVE-2020-12762.patch b/gnu/packages/patches/json-c-0.12-CVE-2020-12762.patch new file mode 100644 index 0000000000..4c06d124ee --- /dev/null +++ b/gnu/packages/patches/json-c-0.12-CVE-2020-12762.patch @@ -0,0 +1,175 @@ +https://github.com/json-c/json-c/pull/611 +https://github.com/json-c/json-c/commit/74accb17cde1b88794b2b764cabaaf1f0858656c.patch + +From 74accb17cde1b88794b2b764cabaaf1f0858656c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Fri, 15 May 2020 20:38:40 +0200 +Subject: [PATCH] Fix CVE-2020-12762. + +This commit is a squashed and slightly modified backport +of the following commits on the master branch: + + * 77d935b + * d07b910 + * 519dfe1 + * a59d5ac +--- + linkhash.c | 12 +++++++++++- + printbuf.c | 18 +++++++++++++++++- + tests/test4.c | 31 ++++++++++++++++++++++++++++++- + tests/test4.expected | 1 + + 4 files changed, 59 insertions(+), 3 deletions(-) + +diff --git a/linkhash.c b/linkhash.c +index 8791a421e7..6543e171f9 100644 +--- a/linkhash.c ++++ b/linkhash.c +@@ -10,6 +10,7 @@ + * + */ + ++#include + #include + #include + #include +@@ -431,6 +432,8 @@ struct lh_table* lh_table_new(int size, const char *name, + int i; + struct lh_table *t; + ++ /* Allocate space for elements to avoid divisions by zero. */ ++ assert(size > 0); + t = (struct lh_table*)calloc(1, sizeof(struct lh_table)); + if(!t) lh_abort("lh_table_new: calloc failed\n"); + t->count = 0; +@@ -495,7 +498,14 @@ int lh_table_insert(struct lh_table *t, void *k, const void *v) + unsigned long h, n; + + t->inserts++; +- if(t->count >= t->size * LH_LOAD_FACTOR) lh_table_resize(t, t->size * 2); ++ if (t->count >= t->size * LH_LOAD_FACTOR) { ++ /* Avoid signed integer overflow with large tables. */ ++ int new_size = (t->size > INT_MAX / 2) ? INT_MAX : (t->size * 2); ++ if (t->size == INT_MAX) ++ return -1; ++ ++ lh_table_resize(t, new_size); ++ } + + h = t->hash_fn(k); + n = h % t->size; +diff --git a/printbuf.c b/printbuf.c +index 9d56522000..31dd86f87d 100644 +--- a/printbuf.c ++++ b/printbuf.c +@@ -15,6 +15,7 @@ + + #include "config.h" + ++#include + #include + #include + #include +@@ -63,7 +64,16 @@ static int printbuf_extend(struct printbuf *p, int min_size) + if (p->size >= min_size) + return 0; + +- new_size = json_max(p->size * 2, min_size + 8); ++ /* Prevent signed integer overflows with large buffers. */ ++ if (min_size > INT_MAX - 8) ++ return -1; ++ if (p->size > INT_MAX / 2) ++ new_size = min_size + 8; ++ else { ++ new_size = p->size * 2; ++ if (new_size < min_size + 8) ++ new_size = min_size + 8; ++ } + #ifdef PRINTBUF_DEBUG + MC_DEBUG("printbuf_memappend: realloc " + "bpos=%d min_size=%d old_size=%d new_size=%d\n", +@@ -78,6 +88,9 @@ static int printbuf_extend(struct printbuf *p, int min_size) + + int printbuf_memappend(struct printbuf *p, const char *buf, int size) + { ++ /* Prevent signed integer overflows with large buffers. */ ++ if (size > INT_MAX - p->bpos - 1) ++ return -1; + if (p->size <= p->bpos + size + 1) { + if (printbuf_extend(p, p->bpos + size + 1) < 0) + return -1; +@@ -94,6 +107,9 @@ int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len) + + if (offset == -1) + offset = pb->bpos; ++ /* Prevent signed integer overflows with large buffers. */ ++ if (len > INT_MAX - offset) ++ return -1; + size_needed = offset + len; + if (pb->size < size_needed) + { +diff --git a/tests/test4.c b/tests/test4.c +index 23e97dac1b..8b05848a13 100644 +--- a/tests/test4.c ++++ b/tests/test4.c +@@ -2,9 +2,11 @@ + * gcc -o utf8 utf8.c -I/home/y/include -L./.libs -ljson + */ + ++#include "config.h" ++#include + #include ++#include + #include +-#include "config.h" + + #include "json_inttypes.h" + #include "json_object.h" +@@ -24,6 +26,30 @@ void print_hex( const char* s) + printf("\n"); + } + ++static void test_lot_of_adds(void); ++static void test_lot_of_adds() ++{ ++ int ii; ++ char key[50]; ++ json_object *jobj = json_object_new_object(); ++ assert(jobj != NULL); ++ for (ii = 0; ii < 500; ii++) ++ { ++ snprintf(key, sizeof(key), "k%d", ii); ++ json_object *iobj = json_object_new_int(ii); ++ assert(iobj != NULL); ++ json_object_object_add(jobj, key, iobj); ++ if (json_object_object_get_ex(jobj, key, &iobj) == FALSE) ++ { ++ fprintf(stderr, "FAILED to add object #%d\n", ii); ++ abort(); ++ } ++ } ++ printf("%s\n", json_object_to_json_string(jobj)); ++ assert(json_object_object_length(jobj) == 500); ++ json_object_put(jobj); ++} ++ + int main() + { + const char *input = "\"\\ud840\\udd26,\\ud840\\udd27,\\ud800\\udd26,\\ud800\\udd27\""; +@@ -49,5 +75,8 @@ int main() + retval = 1; + } + json_object_put(parse_result); ++ ++ test_lot_of_adds(); ++ + return retval; + } +diff --git a/tests/test4.expected b/tests/test4.expected +index 68d4336d90..cb2744012b 100644 +--- a/tests/test4.expected ++++ b/tests/test4.expected +@@ -1,3 +1,4 @@ + input: "\ud840\udd26,\ud840\udd27,\ud800\udd26,\ud800\udd27" + JSON parse result is correct: 𠄦,𠄧,𐄦,𐄧 + PASS ++{ "k0": 0, "k1": 1, "k2": 2, "k3": 3, "k4": 4, "k5": 5, "k6": 6, "k7": 7, "k8": 8, "k9": 9, "k10": 10, "k11": 11, "k12": 12, "k13": 13, "k14": 14, "k15": 15, "k16": 16, "k17": 17, "k18": 18, "k19": 19, "k20": 20, "k21": 21, "k22": 22, "k23": 23, "k24": 24, "k25": 25, "k26": 26, "k27": 27, "k28": 28, "k29": 29, "k30": 30, "k31": 31, "k32": 32, "k33": 33, "k34": 34, "k35": 35, "k36": 36, "k37": 37, "k38": 38, "k39": 39, "k40": 40, "k41": 41, "k42": 42, "k43": 43, "k44": 44, "k45": 45, "k46": 46, "k47": 47, "k48": 48, "k49": 49, "k50": 50, "k51": 51, "k52": 52, "k53": 53, "k54": 54, "k55": 55, "k56": 56, "k57": 57, "k58": 58, "k59": 59, "k60": 60, "k61": 61, "k62": 62, "k63": 63, "k64": 64, "k65": 65, "k66": 66, "k67": 67, "k68": 68, "k69": 69, "k70": 70, "k71": 71, "k72": 72, "k73": 73, "k74": 74, "k75": 75, "k76": 76, "k77": 77, "k78": 78, "k79": 79, "k80": 80, "k81": 81, "k82": 82, "k83": 83, "k84": 84, "k85": 85, "k86": 86, "k87": 87, "k88": 88, "k89": 89, "k90": 90, "k91": 91, "k92": 92, "k93": 93, "k94": 94, "k95": 95, "k96": 96, "k97": 97, "k98": 98, "k99": 99, "k100": 100, "k101": 101, "k102": 102, "k103": 103, "k104": 104, "k105": 105, "k106": 106, "k107": 107, "k108": 108, "k109": 109, "k110": 110, "k111": 111, "k112": 112, "k113": 113, "k114": 114, "k115": 115, "k116": 116, "k117": 117, "k118": 118, "k119": 119, "k120": 120, "k121": 121, "k122": 122, "k123": 123, "k124": 124, "k125": 125, "k126": 126, "k127": 127, "k128": 128, "k129": 129, "k130": 130, "k131": 131, "k132": 132, "k133": 133, "k134": 134, "k135": 135, "k136": 136, "k137": 137, "k138": 138, "k139": 139, "k140": 140, "k141": 141, "k142": 142, "k143": 143, "k144": 144, "k145": 145, "k146": 146, "k147": 147, "k148": 148, "k149": 149, "k150": 150, "k151": 151, "k152": 152, "k153": 153, "k154": 154, "k155": 155, "k156": 156, "k157": 157, "k158": 158, "k159": 159, "k160": 160, "k161": 161, "k162": 162, "k163": 163, "k164": 164, "k165": 165, "k166": 166, "k167": 167, "k168": 168, "k169": 169, "k170": 170, "k171": 171, "k172": 172, "k173": 173, "k174": 174, "k175": 175, "k176": 176, "k177": 177, "k178": 178, "k179": 179, "k180": 180, "k181": 181, "k182": 182, "k183": 183, "k184": 184, "k185": 185, "k186": 186, "k187": 187, "k188": 188, "k189": 189, "k190": 190, "k191": 191, "k192": 192, "k193": 193, "k194": 194, "k195": 195, "k196": 196, "k197": 197, "k198": 198, "k199": 199, "k200": 200, "k201": 201, "k202": 202, "k203": 203, "k204": 204, "k205": 205, "k206": 206, "k207": 207, "k208": 208, "k209": 209, "k210": 210, "k211": 211, "k212": 212, "k213": 213, "k214": 214, "k215": 215, "k216": 216, "k217": 217, "k218": 218, "k219": 219, "k220": 220, "k221": 221, "k222": 222, "k223": 223, "k224": 224, "k225": 225, "k226": 226, "k227": 227, "k228": 228, "k229": 229, "k230": 230, "k231": 231, "k232": 232, "k233": 233, "k234": 234, "k235": 235, "k236": 236, "k237": 237, "k238": 238, "k239": 239, "k240": 240, "k241": 241, "k242": 242, "k243": 243, "k244": 244, "k245": 245, "k246": 246, "k247": 247, "k248": 248, "k249": 249, "k250": 250, "k251": 251, "k252": 252, "k253": 253, "k254": 254, "k255": 255, "k256": 256, "k257": 257, "k258": 258, "k259": 259, "k260": 260, "k261": 261, "k262": 262, "k263": 263, "k264": 264, "k265": 265, "k266": 266, "k267": 267, "k268": 268, "k269": 269, "k270": 270, "k271": 271, "k272": 272, "k273": 273, "k274": 274, "k275": 275, "k276": 276, "k277": 277, "k278": 278, "k279": 279, "k280": 280, "k281": 281, "k282": 282, "k283": 283, "k284": 284, "k285": 285, "k286": 286, "k287": 287, "k288": 288, "k289": 289, "k290": 290, "k291": 291, "k292": 292, "k293": 293, "k294": 294, "k295": 295, "k296": 296, "k297": 297, "k298": 298, "k299": 299, "k300": 300, "k301": 301, "k302": 302, "k303": 303, "k304": 304, "k305": 305, "k306": 306, "k307": 307, "k308": 308, "k309": 309, "k310": 310, "k311": 311, "k312": 312, "k313": 313, "k314": 314, "k315": 315, "k316": 316, "k317": 317, "k318": 318, "k319": 319, "k320": 320, "k321": 321, "k322": 322, "k323": 323, "k324": 324, "k325": 325, "k326": 326, "k327": 327, "k328": 328, "k329": 329, "k330": 330, "k331": 331, "k332": 332, "k333": 333, "k334": 334, "k335": 335, "k336": 336, "k337": 337, "k338": 338, "k339": 339, "k340": 340, "k341": 341, "k342": 342, "k343": 343, "k344": 344, "k345": 345, "k346": 346, "k347": 347, "k348": 348, "k349": 349, "k350": 350, "k351": 351, "k352": 352, "k353": 353, "k354": 354, "k355": 355, "k356": 356, "k357": 357, "k358": 358, "k359": 359, "k360": 360, "k361": 361, "k362": 362, "k363": 363, "k364": 364, "k365": 365, "k366": 366, "k367": 367, "k368": 368, "k369": 369, "k370": 370, "k371": 371, "k372": 372, "k373": 373, "k374": 374, "k375": 375, "k376": 376, "k377": 377, "k378": 378, "k379": 379, "k380": 380, "k381": 381, "k382": 382, "k383": 383, "k384": 384, "k385": 385, "k386": 386, "k387": 387, "k388": 388, "k389": 389, "k390": 390, "k391": 391, "k392": 392, "k393": 393, "k394": 394, "k395": 395, "k396": 396, "k397": 397, "k398": 398, "k399": 399, "k400": 400, "k401": 401, "k402": 402, "k403": 403, "k404": 404, "k405": 405, "k406": 406, "k407": 407, "k408": 408, "k409": 409, "k410": 410, "k411": 411, "k412": 412, "k413": 413, "k414": 414, "k415": 415, "k416": 416, "k417": 417, "k418": 418, "k419": 419, "k420": 420, "k421": 421, "k422": 422, "k423": 423, "k424": 424, "k425": 425, "k426": 426, "k427": 427, "k428": 428, "k429": 429, "k430": 430, "k431": 431, "k432": 432, "k433": 433, "k434": 434, "k435": 435, "k436": 436, "k437": 437, "k438": 438, "k439": 439, "k440": 440, "k441": 441, "k442": 442, "k443": 443, "k444": 444, "k445": 445, "k446": 446, "k447": 447, "k448": 448, "k449": 449, "k450": 450, "k451": 451, "k452": 452, "k453": 453, "k454": 454, "k455": 455, "k456": 456, "k457": 457, "k458": 458, "k459": 459, "k460": 460, "k461": 461, "k462": 462, "k463": 463, "k464": 464, "k465": 465, "k466": 466, "k467": 467, "k468": 468, "k469": 469, "k470": 470, "k471": 471, "k472": 472, "k473": 473, "k474": 474, "k475": 475, "k476": 476, "k477": 477, "k478": 478, "k479": 479, "k480": 480, "k481": 481, "k482": 482, "k483": 483, "k484": 484, "k485": 485, "k486": 486, "k487": 487, "k488": 488, "k489": 489, "k490": 490, "k491": 491, "k492": 492, "k493": 493, "k494": 494, "k495": 495, "k496": 496, "k497": 497, "k498": 498, "k499": 499 } diff --git a/gnu/packages/patches/json-c-0.13-CVE-2020-12762.patch b/gnu/packages/patches/json-c-0.13-CVE-2020-12762.patch new file mode 100644 index 0000000000..7a6743bcc0 --- /dev/null +++ b/gnu/packages/patches/json-c-0.13-CVE-2020-12762.patch @@ -0,0 +1,230 @@ +https://github.com/json-c/json-c/pull/607 +https://github.com/json-c/json-c/commit/865b5a65199973bb63dff8e47a2f57e04fec9736.patch + +From 865b5a65199973bb63dff8e47a2f57e04fec9736 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Thu, 14 May 2020 12:32:30 +0200 +Subject: [PATCH] Fix CVE-2020-12762. + +This commit is a squashed backport of the following commits +on the master branch: + + * 099016b7e8d70a6d5dd814e788bba08d33d48426 + * 77d935b7ae7871a1940cd827e850e6063044ec45 + * d07b91014986900a3a75f306d302e13e005e9d67 + * 519dfe1591d85432986f9762d41d1a883198c157 + * a59d5acfab4485d5133114df61785b1fc633e0c6 +--- + arraylist.c | 3 +++ + linkhash.c | 21 ++++++++++++++------- + printbuf.c | 38 ++++++++++++++++++++++++++------------ + tests/test4.c | 30 +++++++++++++++++++++++++++++- + tests/test4.expected | 1 + + 5 files changed, 73 insertions(+), 20 deletions(-) + +diff --git a/arraylist.c b/arraylist.c +index ddeb8d4eb4..e737052e32 100644 +--- a/arraylist.c ++++ b/arraylist.c +@@ -135,6 +135,9 @@ array_list_del_idx( struct array_list *arr, size_t idx, size_t count ) + { + size_t i, stop; + ++ /* Avoid overflow in calculation with large indices. */ ++ if (idx > SIZE_T_MAX - count) ++ return -1; + stop = idx + count; + if ( idx >= arr->length || stop > arr->length ) return -1; + for ( i = idx; i < stop; ++i ) { +diff --git a/linkhash.c b/linkhash.c +index 5497061a8a..6435a154ac 100644 +--- a/linkhash.c ++++ b/linkhash.c +@@ -12,12 +12,13 @@ + + #include "config.h" + +-#include +-#include +-#include ++#include ++#include + #include + #include +-#include ++#include ++#include ++#include + + #ifdef HAVE_ENDIAN_H + # include /* attempt to define endianness */ +@@ -28,8 +29,8 @@ + # include /* Get InterlockedCompareExchange */ + #endif + +-#include "random_seed.h" + #include "linkhash.h" ++#include "random_seed.h" + + /* hash functions */ + static unsigned long lh_char_hash(const void *k); +@@ -498,7 +499,9 @@ struct lh_table* lh_table_new(int size, + int i; + struct lh_table *t; + +- t = (struct lh_table*)calloc(1, sizeof(struct lh_table)); ++ /* Allocate space for elements to avoid divisions by zero. */ ++ assert(size > 0); ++ t = (struct lh_table *)calloc(1, sizeof(struct lh_table)); + if (!t) + return NULL; + +@@ -577,8 +580,12 @@ int lh_table_insert_w_hash(struct lh_table *t, const void *k, const void *v, con + unsigned long n; + + if (t->count >= t->size * LH_LOAD_FACTOR) +- if (lh_table_resize(t, t->size * 2) != 0) ++ { ++ /* Avoid signed integer overflow with large tables. */ ++ int new_size = (t->size > INT_MAX / 2) ? INT_MAX : (t->size * 2); ++ if (t->size == INT_MAX || lh_table_resize(t, new_size) != 0) + return -1; ++ } + + n = h % t->size; + +diff --git a/printbuf.c b/printbuf.c +index 6c77b5defd..6fc56de455 100644 +--- a/printbuf.c ++++ b/printbuf.c +@@ -15,6 +15,7 @@ + + #include "config.h" + ++#include + #include + #include + #include +@@ -64,10 +65,16 @@ static int printbuf_extend(struct printbuf *p, int min_size) + + if (p->size >= min_size) + return 0; +- +- new_size = p->size * 2; +- if (new_size < min_size + 8) +- new_size = min_size + 8; ++ /* Prevent signed integer overflows with large buffers. */ ++ if (min_size > INT_MAX - 8) ++ return -1; ++ if (p->size > INT_MAX / 2) ++ new_size = min_size + 8; ++ else { ++ new_size = p->size * 2; ++ if (new_size < min_size + 8) ++ new_size = min_size + 8; ++ } + #ifdef PRINTBUF_DEBUG + MC_DEBUG("printbuf_memappend: realloc " + "bpos=%d min_size=%d old_size=%d new_size=%d\n", +@@ -82,14 +89,18 @@ static int printbuf_extend(struct printbuf *p, int min_size) + + int printbuf_memappend(struct printbuf *p, const char *buf, int size) + { +- if (p->size <= p->bpos + size + 1) { +- if (printbuf_extend(p, p->bpos + size + 1) < 0) +- return -1; +- } +- memcpy(p->buf + p->bpos, buf, size); +- p->bpos += size; +- p->buf[p->bpos]= '\0'; +- return size; ++ /* Prevent signed integer overflows with large buffers. */ ++ if (size > INT_MAX - p->bpos - 1) ++ return -1; ++ if (p->size <= p->bpos + size + 1) ++ { ++ if (printbuf_extend(p, p->bpos + size + 1) < 0) ++ return -1; ++ } ++ memcpy(p->buf + p->bpos, buf, size); ++ p->bpos += size; ++ p->buf[p->bpos] = '\0'; ++ return size; + } + + int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len) +@@ -98,6 +109,9 @@ int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len) + + if (offset == -1) + offset = pb->bpos; ++ /* Prevent signed integer overflows with large buffers. */ ++ if (len > INT_MAX - offset) ++ return -1; + size_needed = offset + len; + if (pb->size < size_needed) + { +diff --git a/tests/test4.c b/tests/test4.c +index fc8b79dbf4..82d3f494de 100644 +--- a/tests/test4.c ++++ b/tests/test4.c +@@ -2,9 +2,11 @@ + * gcc -o utf8 utf8.c -I/home/y/include -L./.libs -ljson + */ + ++#include "config.h" ++#include + #include ++#include + #include +-#include "config.h" + + #include "json_inttypes.h" + #include "json_object.h" +@@ -24,6 +26,29 @@ void print_hex(const char* s) + putchar('\n'); + } + ++static void test_lot_of_adds(void); ++static void test_lot_of_adds() ++{ ++ int ii; ++ char key[50]; ++ json_object *jobj = json_object_new_object(); ++ assert(jobj != NULL); ++ for (ii = 0; ii < 500; ii++) ++ { ++ snprintf(key, sizeof(key), "k%d", ii); ++ json_object *iobj = json_object_new_int(ii); ++ assert(iobj != NULL); ++ if (json_object_object_add(jobj, key, iobj)) ++ { ++ fprintf(stderr, "FAILED to add object #%d\n", ii); ++ abort(); ++ } ++ } ++ printf("%s\n", json_object_to_json_string(jobj)); ++ assert(json_object_object_length(jobj) == 500); ++ json_object_put(jobj); ++} ++ + int main(void) + { + const char *input = "\"\\ud840\\udd26,\\ud840\\udd27,\\ud800\\udd26,\\ud800\\udd27\""; +@@ -49,5 +74,8 @@ int main(void) + retval = 1; + } + json_object_put(parse_result); ++ ++ test_lot_of_adds(); ++ + return retval; + } +diff --git a/tests/test4.expected b/tests/test4.expected +index 68d4336d90..cb2744012b 100644 +--- a/tests/test4.expected ++++ b/tests/test4.expected +@@ -1,3 +1,4 @@ + input: "\ud840\udd26,\ud840\udd27,\ud800\udd26,\ud800\udd27" + JSON parse result is correct: 𠄦,𠄧,𐄦,𐄧 + PASS ++{ "k0": 0, "k1": 1, "k2": 2, "k3": 3, "k4": 4, "k5": 5, "k6": 6, "k7": 7, "k8": 8, "k9": 9, "k10": 10, "k11": 11, "k12": 12, "k13": 13, "k14": 14, "k15": 15, "k16": 16, "k17": 17, "k18": 18, "k19": 19, "k20": 20, "k21": 21, "k22": 22, "k23": 23, "k24": 24, "k25": 25, "k26": 26, "k27": 27, "k28": 28, "k29": 29, "k30": 30, "k31": 31, "k32": 32, "k33": 33, "k34": 34, "k35": 35, "k36": 36, "k37": 37, "k38": 38, "k39": 39, "k40": 40, "k41": 41, "k42": 42, "k43": 43, "k44": 44, "k45": 45, "k46": 46, "k47": 47, "k48": 48, "k49": 49, "k50": 50, "k51": 51, "k52": 52, "k53": 53, "k54": 54, "k55": 55, "k56": 56, "k57": 57, "k58": 58, "k59": 59, "k60": 60, "k61": 61, "k62": 62, "k63": 63, "k64": 64, "k65": 65, "k66": 66, "k67": 67, "k68": 68, "k69": 69, "k70": 70, "k71": 71, "k72": 72, "k73": 73, "k74": 74, "k75": 75, "k76": 76, "k77": 77, "k78": 78, "k79": 79, "k80": 80, "k81": 81, "k82": 82, "k83": 83, "k84": 84, "k85": 85, "k86": 86, "k87": 87, "k88": 88, "k89": 89, "k90": 90, "k91": 91, "k92": 92, "k93": 93, "k94": 94, "k95": 95, "k96": 96, "k97": 97, "k98": 98, "k99": 99, "k100": 100, "k101": 101, "k102": 102, "k103": 103, "k104": 104, "k105": 105, "k106": 106, "k107": 107, "k108": 108, "k109": 109, "k110": 110, "k111": 111, "k112": 112, "k113": 113, "k114": 114, "k115": 115, "k116": 116, "k117": 117, "k118": 118, "k119": 119, "k120": 120, "k121": 121, "k122": 122, "k123": 123, "k124": 124, "k125": 125, "k126": 126, "k127": 127, "k128": 128, "k129": 129, "k130": 130, "k131": 131, "k132": 132, "k133": 133, "k134": 134, "k135": 135, "k136": 136, "k137": 137, "k138": 138, "k139": 139, "k140": 140, "k141": 141, "k142": 142, "k143": 143, "k144": 144, "k145": 145, "k146": 146, "k147": 147, "k148": 148, "k149": 149, "k150": 150, "k151": 151, "k152": 152, "k153": 153, "k154": 154, "k155": 155, "k156": 156, "k157": 157, "k158": 158, "k159": 159, "k160": 160, "k161": 161, "k162": 162, "k163": 163, "k164": 164, "k165": 165, "k166": 166, "k167": 167, "k168": 168, "k169": 169, "k170": 170, "k171": 171, "k172": 172, "k173": 173, "k174": 174, "k175": 175, "k176": 176, "k177": 177, "k178": 178, "k179": 179, "k180": 180, "k181": 181, "k182": 182, "k183": 183, "k184": 184, "k185": 185, "k186": 186, "k187": 187, "k188": 188, "k189": 189, "k190": 190, "k191": 191, "k192": 192, "k193": 193, "k194": 194, "k195": 195, "k196": 196, "k197": 197, "k198": 198, "k199": 199, "k200": 200, "k201": 201, "k202": 202, "k203": 203, "k204": 204, "k205": 205, "k206": 206, "k207": 207, "k208": 208, "k209": 209, "k210": 210, "k211": 211, "k212": 212, "k213": 213, "k214": 214, "k215": 215, "k216": 216, "k217": 217, "k218": 218, "k219": 219, "k220": 220, "k221": 221, "k222": 222, "k223": 223, "k224": 224, "k225": 225, "k226": 226, "k227": 227, "k228": 228, "k229": 229, "k230": 230, "k231": 231, "k232": 232, "k233": 233, "k234": 234, "k235": 235, "k236": 236, "k237": 237, "k238": 238, "k239": 239, "k240": 240, "k241": 241, "k242": 242, "k243": 243, "k244": 244, "k245": 245, "k246": 246, "k247": 247, "k248": 248, "k249": 249, "k250": 250, "k251": 251, "k252": 252, "k253": 253, "k254": 254, "k255": 255, "k256": 256, "k257": 257, "k258": 258, "k259": 259, "k260": 260, "k261": 261, "k262": 262, "k263": 263, "k264": 264, "k265": 265, "k266": 266, "k267": 267, "k268": 268, "k269": 269, "k270": 270, "k271": 271, "k272": 272, "k273": 273, "k274": 274, "k275": 275, "k276": 276, "k277": 277, "k278": 278, "k279": 279, "k280": 280, "k281": 281, "k282": 282, "k283": 283, "k284": 284, "k285": 285, "k286": 286, "k287": 287, "k288": 288, "k289": 289, "k290": 290, "k291": 291, "k292": 292, "k293": 293, "k294": 294, "k295": 295, "k296": 296, "k297": 297, "k298": 298, "k299": 299, "k300": 300, "k301": 301, "k302": 302, "k303": 303, "k304": 304, "k305": 305, "k306": 306, "k307": 307, "k308": 308, "k309": 309, "k310": 310, "k311": 311, "k312": 312, "k313": 313, "k314": 314, "k315": 315, "k316": 316, "k317": 317, "k318": 318, "k319": 319, "k320": 320, "k321": 321, "k322": 322, "k323": 323, "k324": 324, "k325": 325, "k326": 326, "k327": 327, "k328": 328, "k329": 329, "k330": 330, "k331": 331, "k332": 332, "k333": 333, "k334": 334, "k335": 335, "k336": 336, "k337": 337, "k338": 338, "k339": 339, "k340": 340, "k341": 341, "k342": 342, "k343": 343, "k344": 344, "k345": 345, "k346": 346, "k347": 347, "k348": 348, "k349": 349, "k350": 350, "k351": 351, "k352": 352, "k353": 353, "k354": 354, "k355": 355, "k356": 356, "k357": 357, "k358": 358, "k359": 359, "k360": 360, "k361": 361, "k362": 362, "k363": 363, "k364": 364, "k365": 365, "k366": 366, "k367": 367, "k368": 368, "k369": 369, "k370": 370, "k371": 371, "k372": 372, "k373": 373, "k374": 374, "k375": 375, "k376": 376, "k377": 377, "k378": 378, "k379": 379, "k380": 380, "k381": 381, "k382": 382, "k383": 383, "k384": 384, "k385": 385, "k386": 386, "k387": 387, "k388": 388, "k389": 389, "k390": 390, "k391": 391, "k392": 392, "k393": 393, "k394": 394, "k395": 395, "k396": 396, "k397": 397, "k398": 398, "k399": 399, "k400": 400, "k401": 401, "k402": 402, "k403": 403, "k404": 404, "k405": 405, "k406": 406, "k407": 407, "k408": 408, "k409": 409, "k410": 410, "k411": 411, "k412": 412, "k413": 413, "k414": 414, "k415": 415, "k416": 416, "k417": 417, "k418": 418, "k419": 419, "k420": 420, "k421": 421, "k422": 422, "k423": 423, "k424": 424, "k425": 425, "k426": 426, "k427": 427, "k428": 428, "k429": 429, "k430": 430, "k431": 431, "k432": 432, "k433": 433, "k434": 434, "k435": 435, "k436": 436, "k437": 437, "k438": 438, "k439": 439, "k440": 440, "k441": 441, "k442": 442, "k443": 443, "k444": 444, "k445": 445, "k446": 446, "k447": 447, "k448": 448, "k449": 449, "k450": 450, "k451": 451, "k452": 452, "k453": 453, "k454": 454, "k455": 455, "k456": 456, "k457": 457, "k458": 458, "k459": 459, "k460": 460, "k461": 461, "k462": 462, "k463": 463, "k464": 464, "k465": 465, "k466": 466, "k467": 467, "k468": 468, "k469": 469, "k470": 470, "k471": 471, "k472": 472, "k473": 473, "k474": 474, "k475": 475, "k476": 476, "k477": 477, "k478": 478, "k479": 479, "k480": 480, "k481": 481, "k482": 482, "k483": 483, "k484": 484, "k485": 485, "k486": 486, "k487": 487, "k488": 488, "k489": 489, "k490": 490, "k491": 491, "k492": 492, "k493": 493, "k494": 494, "k495": 495, "k496": 496, "k497": 497, "k498": 498, "k499": 499 } diff --git a/gnu/packages/patches/json-c-CVE-2020-12762.patch b/gnu/packages/patches/json-c-CVE-2020-12762.patch new file mode 100644 index 0000000000..80daa475e9 --- /dev/null +++ b/gnu/packages/patches/json-c-CVE-2020-12762.patch @@ -0,0 +1,193 @@ +https://github.com/json-c/json-c/pull/608 +https://github.com/json-c/json-c/commit/5d6fa331418d49f1bd488553fd1cfa9ab023fabb.patch + +From 5d6fa331418d49f1bd488553fd1cfa9ab023fabb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Thu, 14 May 2020 12:32:30 +0200 +Subject: [PATCH] Fix CVE-2020-12762. + +This commit is a squashed backport of the following commits +on the master branch: + + * 099016b7e8d70a6d5dd814e788bba08d33d48426 + * 77d935b7ae7871a1940cd827e850e6063044ec45 + * d07b91014986900a3a75f306d302e13e005e9d67 + * 519dfe1591d85432986f9762d41d1a883198c157 + * a59d5acfab4485d5133114df61785b1fc633e0c6 + * 26f080997d41cfdb17beab65e90c82217d0ac43b +--- + arraylist.c | 3 +++ + linkhash.c | 9 ++++++++- + printbuf.c | 18 ++++++++++++++++-- + tests/test4.c | 29 +++++++++++++++++++++++++++++ + tests/test4.expected | 1 + + 5 files changed, 57 insertions(+), 3 deletions(-) + +diff --git a/arraylist.c b/arraylist.c +index 12ad8af6d3..e5524aca75 100644 +--- a/arraylist.c ++++ b/arraylist.c +@@ -136,6 +136,9 @@ int array_list_del_idx(struct array_list *arr, size_t idx, size_t count) + { + size_t i, stop; + ++ /* Avoid overflow in calculation with large indices. */ ++ if (idx > SIZE_T_MAX - count) ++ return -1; + stop = idx + count; + if (idx >= arr->length || stop > arr->length) + return -1; +diff --git a/linkhash.c b/linkhash.c +index 7ea58c0abf..b021ef10b0 100644 +--- a/linkhash.c ++++ b/linkhash.c +@@ -12,6 +12,7 @@ + + #include "config.h" + ++#include + #include + #include + #include +@@ -499,6 +500,8 @@ struct lh_table *lh_table_new(int size, lh_entry_free_fn *free_fn, lh_hash_fn *h + int i; + struct lh_table *t; + ++ /* Allocate space for elements to avoid divisions by zero. */ ++ assert(size > 0); + t = (struct lh_table *)calloc(1, sizeof(struct lh_table)); + if (!t) + return NULL; +@@ -578,8 +581,12 @@ int lh_table_insert_w_hash(struct lh_table *t, const void *k, const void *v, con + unsigned long n; + + if (t->count >= t->size * LH_LOAD_FACTOR) +- if (lh_table_resize(t, t->size * 2) != 0) ++ { ++ /* Avoid signed integer overflow with large tables. */ ++ int new_size = (t->size > INT_MAX / 2) ? INT_MAX : (t->size * 2); ++ if (t->size == INT_MAX || lh_table_resize(t, new_size) != 0) + return -1; ++ } + + n = h % t->size; + +diff --git a/printbuf.c b/printbuf.c +index 976c12dde5..f9b15b1191 100644 +--- a/printbuf.c ++++ b/printbuf.c +@@ -15,6 +15,7 @@ + + #include "config.h" + ++#include + #include + #include + #include +@@ -66,9 +67,16 @@ static int printbuf_extend(struct printbuf *p, int min_size) + if (p->size >= min_size) + return 0; + +- new_size = p->size * 2; +- if (new_size < min_size + 8) ++ /* Prevent signed integer overflows with large buffers. */ ++ if (min_size > INT_MAX - 8) ++ return -1; ++ if (p->size > INT_MAX / 2) + new_size = min_size + 8; ++ else { ++ new_size = p->size * 2; ++ if (new_size < min_size + 8) ++ new_size = min_size + 8; ++ } + #ifdef PRINTBUF_DEBUG + MC_DEBUG("printbuf_memappend: realloc " + "bpos=%d min_size=%d old_size=%d new_size=%d\n", +@@ -83,6 +91,9 @@ static int printbuf_extend(struct printbuf *p, int min_size) + + int printbuf_memappend(struct printbuf *p, const char *buf, int size) + { ++ /* Prevent signed integer overflows with large buffers. */ ++ if (size > INT_MAX - p->bpos - 1) ++ return -1; + if (p->size <= p->bpos + size + 1) + { + if (printbuf_extend(p, p->bpos + size + 1) < 0) +@@ -100,6 +111,9 @@ int printbuf_memset(struct printbuf *pb, int offset, int charvalue, int len) + + if (offset == -1) + offset = pb->bpos; ++ /* Prevent signed integer overflows with large buffers. */ ++ if (len > INT_MAX - offset) ++ return -1; + size_needed = offset + len; + if (pb->size < size_needed) + { +diff --git a/tests/test4.c b/tests/test4.c +index bd964ec789..288cec1792 100644 +--- a/tests/test4.c ++++ b/tests/test4.c +@@ -3,12 +3,15 @@ + */ + + #include "config.h" ++#include + #include ++#include + #include + + #include "json_inttypes.h" + #include "json_object.h" + #include "json_tokener.h" ++#include "snprintf_compat.h" + + void print_hex(const char *s) + { +@@ -24,6 +27,29 @@ void print_hex(const char *s) + putchar('\n'); + } + ++static void test_lot_of_adds(void); ++static void test_lot_of_adds() ++{ ++ int ii; ++ char key[50]; ++ json_object *jobj = json_object_new_object(); ++ assert(jobj != NULL); ++ for (ii = 0; ii < 500; ii++) ++ { ++ snprintf(key, sizeof(key), "k%d", ii); ++ json_object *iobj = json_object_new_int(ii); ++ assert(iobj != NULL); ++ if (json_object_object_add(jobj, key, iobj)) ++ { ++ fprintf(stderr, "FAILED to add object #%d\n", ii); ++ abort(); ++ } ++ } ++ printf("%s\n", json_object_to_json_string(jobj)); ++ assert(json_object_object_length(jobj) == 500); ++ json_object_put(jobj); ++} ++ + int main(void) + { + const char *input = "\"\\ud840\\udd26,\\ud840\\udd27,\\ud800\\udd26,\\ud800\\udd27\""; +@@ -52,5 +78,8 @@ int main(void) + retval = 1; + } + json_object_put(parse_result); ++ ++ test_lot_of_adds(); ++ + return retval; + } +diff --git a/tests/test4.expected b/tests/test4.expected +index 68d4336d90..cb2744012b 100644 +--- a/tests/test4.expected ++++ b/tests/test4.expected +@@ -1,3 +1,4 @@ + input: "\ud840\udd26,\ud840\udd27,\ud800\udd26,\ud800\udd27" + JSON parse result is correct: 𠄦,𠄧,𐄦,𐄧 + PASS ++{ "k0": 0, "k1": 1, "k2": 2, "k3": 3, "k4": 4, "k5": 5, "k6": 6, "k7": 7, "k8": 8, "k9": 9, "k10": 10, "k11": 11, "k12": 12, "k13": 13, "k14": 14, "k15": 15, "k16": 16, "k17": 17, "k18": 18, "k19": 19, "k20": 20, "k21": 21, "k22": 22, "k23": 23, "k24": 24, "k25": 25, "k26": 26, "k27": 27, "k28": 28, "k29": 29, "k30": 30, "k31": 31, "k32": 32, "k33": 33, "k34": 34, "k35": 35, "k36": 36, "k37": 37, "k38": 38, "k39": 39, "k40": 40, "k41": 41, "k42": 42, "k43": 43, "k44": 44, "k45": 45, "k46": 46, "k47": 47, "k48": 48, "k49": 49, "k50": 50, "k51": 51, "k52": 52, "k53": 53, "k54": 54, "k55": 55, "k56": 56, "k57": 57, "k58": 58, "k59": 59, "k60": 60, "k61": 61, "k62": 62, "k63": 63, "k64": 64, "k65": 65, "k66": 66, "k67": 67, "k68": 68, "k69": 69, "k70": 70, "k71": 71, "k72": 72, "k73": 73, "k74": 74, "k75": 75, "k76": 76, "k77": 77, "k78": 78, "k79": 79, "k80": 80, "k81": 81, "k82": 82, "k83": 83, "k84": 84, "k85": 85, "k86": 86, "k87": 87, "k88": 88, "k89": 89, "k90": 90, "k91": 91, "k92": 92, "k93": 93, "k94": 94, "k95": 95, "k96": 96, "k97": 97, "k98": 98, "k99": 99, "k100": 100, "k101": 101, "k102": 102, "k103": 103, "k104": 104, "k105": 105, "k106": 106, "k107": 107, "k108": 108, "k109": 109, "k110": 110, "k111": 111, "k112": 112, "k113": 113, "k114": 114, "k115": 115, "k116": 116, "k117": 117, "k118": 118, "k119": 119, "k120": 120, "k121": 121, "k122": 122, "k123": 123, "k124": 124, "k125": 125, "k126": 126, "k127": 127, "k128": 128, "k129": 129, "k130": 130, "k131": 131, "k132": 132, "k133": 133, "k134": 134, "k135": 135, "k136": 136, "k137": 137, "k138": 138, "k139": 139, "k140": 140, "k141": 141, "k142": 142, "k143": 143, "k144": 144, "k145": 145, "k146": 146, "k147": 147, "k148": 148, "k149": 149, "k150": 150, "k151": 151, "k152": 152, "k153": 153, "k154": 154, "k155": 155, "k156": 156, "k157": 157, "k158": 158, "k159": 159, "k160": 160, "k161": 161, "k162": 162, "k163": 163, "k164": 164, "k165": 165, "k166": 166, "k167": 167, "k168": 168, "k169": 169, "k170": 170, "k171": 171, "k172": 172, "k173": 173, "k174": 174, "k175": 175, "k176": 176, "k177": 177, "k178": 178, "k179": 179, "k180": 180, "k181": 181, "k182": 182, "k183": 183, "k184": 184, "k185": 185, "k186": 186, "k187": 187, "k188": 188, "k189": 189, "k190": 190, "k191": 191, "k192": 192, "k193": 193, "k194": 194, "k195": 195, "k196": 196, "k197": 197, "k198": 198, "k199": 199, "k200": 200, "k201": 201, "k202": 202, "k203": 203, "k204": 204, "k205": 205, "k206": 206, "k207": 207, "k208": 208, "k209": 209, "k210": 210, "k211": 211, "k212": 212, "k213": 213, "k214": 214, "k215": 215, "k216": 216, "k217": 217, "k218": 218, "k219": 219, "k220": 220, "k221": 221, "k222": 222, "k223": 223, "k224": 224, "k225": 225, "k226": 226, "k227": 227, "k228": 228, "k229": 229, "k230": 230, "k231": 231, "k232": 232, "k233": 233, "k234": 234, "k235": 235, "k236": 236, "k237": 237, "k238": 238, "k239": 239, "k240": 240, "k241": 241, "k242": 242, "k243": 243, "k244": 244, "k245": 245, "k246": 246, "k247": 247, "k248": 248, "k249": 249, "k250": 250, "k251": 251, "k252": 252, "k253": 253, "k254": 254, "k255": 255, "k256": 256, "k257": 257, "k258": 258, "k259": 259, "k260": 260, "k261": 261, "k262": 262, "k263": 263, "k264": 264, "k265": 265, "k266": 266, "k267": 267, "k268": 268, "k269": 269, "k270": 270, "k271": 271, "k272": 272, "k273": 273, "k274": 274, "k275": 275, "k276": 276, "k277": 277, "k278": 278, "k279": 279, "k280": 280, "k281": 281, "k282": 282, "k283": 283, "k284": 284, "k285": 285, "k286": 286, "k287": 287, "k288": 288, "k289": 289, "k290": 290, "k291": 291, "k292": 292, "k293": 293, "k294": 294, "k295": 295, "k296": 296, "k297": 297, "k298": 298, "k299": 299, "k300": 300, "k301": 301, "k302": 302, "k303": 303, "k304": 304, "k305": 305, "k306": 306, "k307": 307, "k308": 308, "k309": 309, "k310": 310, "k311": 311, "k312": 312, "k313": 313, "k314": 314, "k315": 315, "k316": 316, "k317": 317, "k318": 318, "k319": 319, "k320": 320, "k321": 321, "k322": 322, "k323": 323, "k324": 324, "k325": 325, "k326": 326, "k327": 327, "k328": 328, "k329": 329, "k330": 330, "k331": 331, "k332": 332, "k333": 333, "k334": 334, "k335": 335, "k336": 336, "k337": 337, "k338": 338, "k339": 339, "k340": 340, "k341": 341, "k342": 342, "k343": 343, "k344": 344, "k345": 345, "k346": 346, "k347": 347, "k348": 348, "k349": 349, "k350": 350, "k351": 351, "k352": 352, "k353": 353, "k354": 354, "k355": 355, "k356": 356, "k357": 357, "k358": 358, "k359": 359, "k360": 360, "k361": 361, "k362": 362, "k363": 363, "k364": 364, "k365": 365, "k366": 366, "k367": 367, "k368": 368, "k369": 369, "k370": 370, "k371": 371, "k372": 372, "k373": 373, "k374": 374, "k375": 375, "k376": 376, "k377": 377, "k378": 378, "k379": 379, "k380": 380, "k381": 381, "k382": 382, "k383": 383, "k384": 384, "k385": 385, "k386": 386, "k387": 387, "k388": 388, "k389": 389, "k390": 390, "k391": 391, "k392": 392, "k393": 393, "k394": 394, "k395": 395, "k396": 396, "k397": 397, "k398": 398, "k399": 399, "k400": 400, "k401": 401, "k402": 402, "k403": 403, "k404": 404, "k405": 405, "k406": 406, "k407": 407, "k408": 408, "k409": 409, "k410": 410, "k411": 411, "k412": 412, "k413": 413, "k414": 414, "k415": 415, "k416": 416, "k417": 417, "k418": 418, "k419": 419, "k420": 420, "k421": 421, "k422": 422, "k423": 423, "k424": 424, "k425": 425, "k426": 426, "k427": 427, "k428": 428, "k429": 429, "k430": 430, "k431": 431, "k432": 432, "k433": 433, "k434": 434, "k435": 435, "k436": 436, "k437": 437, "k438": 438, "k439": 439, "k440": 440, "k441": 441, "k442": 442, "k443": 443, "k444": 444, "k445": 445, "k446": 446, "k447": 447, "k448": 448, "k449": 449, "k450": 450, "k451": 451, "k452": 452, "k453": 453, "k454": 454, "k455": 455, "k456": 456, "k457": 457, "k458": 458, "k459": 459, "k460": 460, "k461": 461, "k462": 462, "k463": 463, "k464": 464, "k465": 465, "k466": 466, "k467": 467, "k468": 468, "k469": 469, "k470": 470, "k471": 471, "k472": 472, "k473": 473, "k474": 474, "k475": 475, "k476": 476, "k477": 477, "k478": 478, "k479": 479, "k480": 480, "k481": 481, "k482": 482, "k483": 483, "k484": 484, "k485": 485, "k486": 486, "k487": 487, "k488": 488, "k489": 489, "k490": 490, "k491": 491, "k492": 492, "k493": 493, "k494": 494, "k495": 495, "k496": 496, "k497": 497, "k498": 498, "k499": 499 } diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index b9c3b7fc43..c846bef21c 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -770,6 +770,7 @@ data.") (define-public json-c (package + (replacement json-c/fixed) (name "json-c") (version "0.14") (source (origin @@ -790,6 +791,15 @@ parse JSON-formatted strings back into the C representation of JSON objects. It aims to conform to RFC 7159.") (license license:x11))) +(define json-c/fixed + (package + (inherit json-c) + (name "json-c") + (version "0.14") + (source (origin + (inherit (package-source json-c)) + (patches (search-patches "json-c-CVE-2020-12762.patch")))))) + ;; TODO: Remove these old versions when all dependents have been updated. (define-public json-c-0.13 (package @@ -802,6 +812,7 @@ It aims to conform to RFC 7159.") version ".tar.gz")) (sha256 (base32 "0ws8dz9nk8q2c0gbf66kg2r6mrkl7kamd3gpdv9zsyrz9n6n0zmq")) + (patches (search-patches "json-c-0.13-CVE-2020-12762.patch")) (modules '((guix build utils))) (snippet '(begin @@ -824,6 +835,7 @@ It aims to conform to RFC 7159.") version ".tar.gz")) (sha256 (base32 "08qibrq29a5v7g23wi5icy6l4fbfw90h9ccps6vq0bcklx8n84ra")) + (patches (search-patches "json-c-0.12-CVE-2020-12762.patch")) (modules '((guix build utils))) (snippet '(begin -- cgit v1.2.3 From d6fcc67de59ab5406348bf4fc206c9be82858f06 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 8 Aug 2020 23:51:08 -0400 Subject: gnu: lib2geom: Update to commit 17e0d21f. * gnu/packages/patches/lib2geom-enable-assertions.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Unregister it. * gnu/packages/graphics.scm (lib2geom): Update to commit 17e0d21f0afc8489656f9184bff7ad024a42394a, and remove obsolete patch. --- gnu/local.mk | 1 - gnu/packages/graphics.scm | 12 +++----- .../patches/lib2geom-enable-assertions.patch | 36 ---------------------- 3 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 gnu/packages/patches/lib2geom-enable-assertions.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 2c426633bd..ee9ed21c2c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1195,7 +1195,6 @@ dist_patch_DATA = \ %D%/packages/patches/ldc-disable-phobos-tests.patch \ %D%/packages/patches/leela-zero-gtest.patch \ %D%/packages/patches/less-hurd-path-max.patch \ - %D%/packages/patches/lib2geom-enable-assertions.patch \ %D%/packages/patches/lib2geom-fix-tests.patch \ %D%/packages/patches/liba52-enable-pic.patch \ %D%/packages/patches/liba52-link-with-libm.patch \ diff --git a/gnu/packages/graphics.scm b/gnu/packages/graphics.scm index cdb13c2619..91ac62e903 100644 --- a/gnu/packages/graphics.scm +++ b/gnu/packages/graphics.scm @@ -486,8 +486,8 @@ exception-handling library.") (define-public lib2geom ;; Use the latest master commit, as the 1.0 release suffer build problems. - (let ((revision "2") - (commit "f98256d2a923955af74b8cff3d456f0df1ee4b59")) + (let ((revision "3") + (commit "17e0d21f0afc8489656f9184bff7ad024a42394a")) (package (name "lib2geom") (version (git-version "1.0" revision commit)) @@ -499,13 +499,11 @@ exception-handling library.") (file-name (git-file-name name version)) (sha256 (base32 - "0w6ijaai8i80d0f35c0shgdspqlsdhw3cvz106k1gm7bmnz1wzpq")) + "0waskrmdrrdjw8pr5cvlkrxywgf376viggpc2jzdqxxpy2k78fpr")) (patches - ;; Patches submitted to upstream (see: - ;; https://gitlab.com/inkscape/lib2geom/merge_requests/17, + ;; Patch submitted to upstream (see: ;; https://gitlab.com/inkscape/lib2geom/-/merge_requests/32). - (search-patches "lib2geom-enable-assertions.patch" - "lib2geom-fix-tests.patch")) + (search-patches "lib2geom-fix-tests.patch")) (modules '((guix build utils))) (snippet '(begin diff --git a/gnu/packages/patches/lib2geom-enable-assertions.patch b/gnu/packages/patches/lib2geom-enable-assertions.patch deleted file mode 100644 index 8feb44acbf..0000000000 --- a/gnu/packages/patches/lib2geom-enable-assertions.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4aa78f52232682b353eb15c219171e466987bac7 Mon Sep 17 00:00:00 2001 -From: Maxim Cournoyer -Date: Thu, 16 Jan 2020 00:19:29 -0500 -Subject: [PATCH] build: Enable assertions for the RelWithDebugInfo build type. - -This fixes issue #5 (see: -https://gitlab.com/inkscape/lib2geom/issues/5). - -* CMakeLists.txt: Remove the "-DNDEBUG" CXX flag from the default -configuration for the RelWithDebugInfo build type. ---- - CMakeLists.txt | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index bfeb8f03..a663a1b0 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -19,6 +19,14 @@ enable_testing() - - include(CheckCXXSourceCompiles) - -+# Enable assertions for the RelWithDebugInfo build type. This is -+# useful as some tests make use of it (see: -+# https://gitlab.com/inkscape/lib2geom/issues/5). -+if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") -+ string(REPLACE "-DNDEBUG" "" -+ CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") -+endif() -+ - # Find dependencies - find_package(Boost 1.40 REQUIRED) - find_package(DoubleConversion REQUIRED) --- -2.24.1 - -- cgit v1.2.3 From 007000ac38d2fdda08739ca74876d0b14240341b Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 9 Aug 2020 21:07:20 +0200 Subject: gnu: python-alembic: Update to 1.4.2. * gnu/packages/databases.scm (python-alembic): Update to 1.4.2. [source]: Remove patch. * gnu/packages/patches/python-alembic-exceptions-cause.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/databases.scm | 6 +- .../patches/python-alembic-exceptions-cause.patch | 69 ---------------------- 3 files changed, 2 insertions(+), 74 deletions(-) delete mode 100644 gnu/packages/patches/python-alembic-exceptions-cause.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index faf9888073..357ec3b7f2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1453,7 +1453,6 @@ dist_patch_DATA = \ %D%/packages/patches/python-CVE-2018-14647.patch \ %D%/packages/patches/python-aiohttp-3.6.2-no-warning-fail.patch \ %D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \ - %D%/packages/patches/python-alembic-exceptions-cause.patch \ %D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \ %D%/packages/patches/python-axolotl-AES-fix.patch \ %D%/packages/patches/python-cairocffi-dlopen-path.patch \ diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index db8b74db06..6c1d95c126 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -2703,15 +2703,13 @@ You might also want to install the following optional dependencies: (define-public python-alembic (package (name "python-alembic") - (version "1.4.1") + (version "1.4.2") (source (origin (method url-fetch) (uri (pypi-uri "alembic" version)) - (patches (search-patches "python-alembic-exceptions-cause.patch")) (sha256 - (base32 - "0a4hzn76csgbf1px4f5vfm256byvjrqkgi9869nkcjrwjn35c6kr")))) + (base32 "1gsdrzx9h7wfva200qvvsc9sn4w79mk2vs0bbnzjhxi1jw2b0nh3")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases diff --git a/gnu/packages/patches/python-alembic-exceptions-cause.patch b/gnu/packages/patches/python-alembic-exceptions-cause.patch deleted file mode 100644 index b9844e5ad0..0000000000 --- a/gnu/packages/patches/python-alembic-exceptions-cause.patch +++ /dev/null @@ -1,69 +0,0 @@ -Fix a test failure with newer versions of SQLalchemy due to missing -"causes" for some exceptions. - -diff --git a/alembic/operations/ops.py b/alembic/operations/ops.py -index 5ec2762..7129472 100644 ---- a/alembic/operations/ops.py -+++ b/alembic/operations/ops.py -@@ -108,6 +108,7 @@ def from_constraint(cls, constraint): - "primary_key_constraint": "primary", - "check_constraint": "check", - "column_check_constraint": "check", -+ "table_or_column_check_constraint": "check", - } - - constraint_table = sqla_compat._table_for_constraint(constraint) -@@ -707,6 +708,7 @@ def batch_create_foreign_key( - "create_check_constraint", "batch_create_check_constraint" - ) - @AddConstraintOp.register_add_constraint("check_constraint") -+@AddConstraintOp.register_add_constraint("table_or_column_check_constraint") - @AddConstraintOp.register_add_constraint("column_check_constraint") - class CreateCheckConstraintOp(AddConstraintOp): - """Represent a create check constraint operation.""" -diff --git a/alembic/testing/assertions.py b/alembic/testing/assertions.py -index 3dc08f0..a78e5e8 100644 ---- a/alembic/testing/assertions.py -+++ b/alembic/testing/assertions.py -@@ -2,10 +2,9 @@ - - import re - -+from sqlalchemy import util - from sqlalchemy.engine import default - from sqlalchemy.testing.assertions import _expect_warnings --from sqlalchemy.testing.assertions import assert_raises # noqa --from sqlalchemy.testing.assertions import assert_raises_message # noqa - from sqlalchemy.testing.assertions import eq_ # noqa - from sqlalchemy.testing.assertions import is_ # noqa - from sqlalchemy.testing.assertions import is_false # noqa -@@ -17,6 +16,29 @@ - from ..util.compat import py3k - - -+def assert_raises(except_cls, callable_, *args, **kw): -+ try: -+ callable_(*args, **kw) -+ success = False -+ except except_cls: -+ success = True -+ -+ # assert outside the block so it works for AssertionError too ! -+ assert success, "Callable did not raise an exception" -+ -+ -+def assert_raises_message(except_cls, msg, callable_, *args, **kwargs): -+ try: -+ callable_(*args, **kwargs) -+ assert False, "Callable did not raise an exception" -+ except except_cls as e: -+ assert re.search(msg, util.text_type(e), re.UNICODE), "%r !~ %s" % ( -+ msg, -+ e, -+ ) -+ print(util.text_type(e).encode("utf-8")) -+ -+ - def eq_ignore_whitespace(a, b, msg=None): - # sqlalchemy.testing.assertion has this function - # but not with the special "!U" detection part -- cgit v1.2.3 From 5f022a51c49087b8a09736338cbba2d75a586431 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 11 Aug 2020 17:47:50 +0200 Subject: gnu: clang-runtime-3.5: Fix build. * gnu/packages/patches/clang-runtime-3.5-libsanitizer-mode-field.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/llvm.scm (clang-runtime-3.5): Add patch. --- gnu/local.mk | 1 + gnu/packages/llvm.scm | 1 + ...clang-runtime-3.5-libsanitizer-mode-field.patch | 29 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 gnu/packages/patches/clang-runtime-3.5-libsanitizer-mode-field.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 357ec3b7f2..746f5c5779 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -855,6 +855,7 @@ dist_patch_DATA = \ %D%/packages/patches/clang-runtime-asan-build-fixes.patch \ %D%/packages/patches/clang-runtime-esan-build-fixes.patch \ %D%/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch \ + %D%/packages/patches/clang-runtime-3.5-libsanitizer-mode-field.patch \ %D%/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch \ %D%/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch \ %D%/packages/patches/classpath-aarch64-support.patch \ diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index af1fb6cf7f..15078a1168 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -781,6 +781,7 @@ components which highly leverage existing libraries in the larger LLVM Project." llvm-3.5 "1hsdnzzdr5kglz6fnv3lcsjs222zjsy14y8ax9dy6zqysanplbal" '("clang-runtime-asan-build-fixes.patch" + "clang-runtime-3.5-libsanitizer-mode-field.patch" "clang-3.5-libsanitizer-ustat-fix.patch")))) (package (inherit runtime) diff --git a/gnu/packages/patches/clang-runtime-3.5-libsanitizer-mode-field.patch b/gnu/packages/patches/clang-runtime-3.5-libsanitizer-mode-field.patch new file mode 100644 index 0000000000..9e9d57d265 --- /dev/null +++ b/gnu/packages/patches/clang-runtime-3.5-libsanitizer-mode-field.patch @@ -0,0 +1,29 @@ +Adjust libsanitizer to ABI change in glibc 2.31. + +Adapted to 3.x from this upstream commit: +https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce + +--- a/lib/sanitizer_common/saniniitizer_platform_limits_posix.h.orig 2020-08-11 16:01:32.494882282 +0200 # ++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h 2020-08-11 16:32:49.711383554 +0200 +@@ -176,8 +176,7 @@ + unsigned long __unused1; + unsigned long __unused2; + #else +- unsigned short mode; +- unsigned short __pad1; ++ unsigned int mode; + unsigned short __seq; + unsigned short __pad2; + #if defined(__x86_64__) && !defined(_LP64) +--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc 2020-08-11 16:01:07.926821829 +0200 ++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc.orig 2020-08-11 16:01:03.698811421 +0200 +@@ -1056,7 +1056,9 @@ + CHECK_SIZE_AND_OFFSET(ipc_perm, gid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); ++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) + CHECK_SIZE_AND_OFFSET(ipc_perm, mode); ++#endif + + CHECK_TYPE_SIZE(shmid_ds); + CHECK_SIZE_AND_OFFSET(shmid_ds, shm_perm); -- cgit v1.2.3 From 8677e8699a0a882efb579de385d020f3aebf0127 Mon Sep 17 00:00:00 2001 From: Jesse Gibbons Date: Mon, 10 Feb 2020 10:18:57 -0700 Subject: gnu: freedink-engine: Fix SDL hints. * gnu/packages/games.scm: freedink: [patches]: Add fix. * gnu/packages/patches/freedink-engine-fix-sdl-hints.patch: New file. * gnu/local.mk: Add it. Signed-off-by: Nicolas Goaziou --- gnu/local.mk | 1 + gnu/packages/games.scm | 1 + .../patches/freedink-engine-fix-sdl-hints.patch | 33 ++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 gnu/packages/patches/freedink-engine-fix-sdl-hints.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 746f5c5779..66ad65cb15 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -960,6 +960,7 @@ dist_patch_DATA = \ %D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \ %D%/packages/patches/foomatic-filters-CVE-2015-8560.patch \ %D%/packages/patches/fontconfig-hurd-path-max.patch \ + %D%/packages/patches/freedink-engine-fix-sdl-hints.patch \ %D%/packages/patches/freeimage-unbundle.patch \ %D%/packages/patches/fuse-overlapping-headers.patch \ %D%/packages/patches/ganeti-deterministic-manual.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index e8cb012fba..8e4aa0742b 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -2732,6 +2732,7 @@ interface or via an external visual interface such as GNU XBoard.") (method url-fetch) (uri (string-append "mirror://gnu/freedink/freedink-" version ".tar.gz")) + (patches (search-patches "freedink-engine-fix-sdl-hints.patch")) (sha256 (base32 "00hhk1bjdrc1np2qz44sa5n1mb62qzwxbvsnws3vpms6iyn3a2sy")))) diff --git a/gnu/packages/patches/freedink-engine-fix-sdl-hints.patch b/gnu/packages/patches/freedink-engine-fix-sdl-hints.patch new file mode 100644 index 0000000000..ce37ab4870 --- /dev/null +++ b/gnu/packages/patches/freedink-engine-fix-sdl-hints.patch @@ -0,0 +1,33 @@ +From 85f8dda6de28ef86e58f26c8aa863a26524f6ce0 Mon Sep 17 00:00:00 2001 +From: Jesse Gibbons +Date: Sun, 9 Feb 2020 21:46:26 -0700 +Subject: [PATCH] Fix mouse/touch event hints for SDL 2.0.10. + +This fixes the bug reported at +. + +It should remain backwards compatible with releases of SDL prior to 2.0.10. +--- + src/input.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/input.cpp b/src/input.cpp +index b5ae21e..153d349 100644 +--- a/src/input.cpp ++++ b/src/input.cpp +@@ -91,7 +91,12 @@ void input_init(void) + + // TODO: don't attempt to simulate mouse events from touch events - + // fake mouse events often are de-centered ++#ifdef SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH + SDL_SetHint(SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH, "0"); ++#elif defined SDL_HINT_MOUSE_TOUCH_EVENTS && defined SDL_HINT_TOUCH_MOUSE_EVENTS ++ SDL_SetHint(SDL_HINT_MOUSE_TOUCH_EVENTS, "0"); ++ SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0"); ++#endif + + /* Touch devices */ + { +-- +2.25.0 + -- cgit v1.2.3 From 8bf704262d672ae0735f0685bfd1c9ddcb1d8484 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Thu, 13 Aug 2020 15:26:45 +0200 Subject: gnu: opencv: Fix build with Jasper 2.0.19. * gnu/packages/image-processing.scm (opencv)[source]: Add patch. * gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/image-processing.scm | 4 ++- .../opencv-fix-build-of-grfmt_jpeg2000.cpp.patch | 39 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 66ad65cb15..27dcf965ca 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1356,6 +1356,7 @@ dist_patch_DATA = \ %D%/packages/patches/ola-readdir-r.patch \ %D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch \ %D%/packages/patches/opencascade-oce-glibc-2.26.patch \ + %D%/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch \ %D%/packages/patches/opencv-rgbd-aarch64-test-fix.patch \ %D%/packages/patches/opendht-fix-jami.patch \ %D%/packages/patches/openfoam-4.1-cleanup.patch \ diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index e62c5c7cdb..52e0311943 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -4,7 +4,7 @@ ;;; Copyright © 2014 Ludovic Courtès ;;; Copyright © 2014 Mark H Weaver ;;; Copyright © 2016 Eric Bavier -;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice +;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice ;;; Copyright © 2018 Björn Höfling ;;; Copyright © 2018 Lprndn ;;; Copyright © 2019 Efraim Flashner @@ -251,6 +251,8 @@ integrates with various databases on GUI toolkits such as Qt and Tk.") (sha256 (base32 "06bc61r8myym4s8im10brdjfg4wxkrvsbhhl7vr1msdan2xddzi3")) + (patches + (search-patches "opencv-fix-build-of-grfmt_jpeg2000.cpp.patch")) (modules '((guix build utils))) (snippet '(begin diff --git a/gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch b/gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch new file mode 100644 index 0000000000..8deb60296a --- /dev/null +++ b/gnu/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch @@ -0,0 +1,39 @@ +From: Tobias Geerinckx-Rice +Date: Thu, 13 Aug 2020 15:21:30 +0200 +Subject: [PATCH] gnu: opencv: Fix build with Jasper 2.0.19. + +Taken verbatim from upstream: . + +From f66fc199a20882c546fa31142e9c0f5a8b3cf983 Mon Sep 17 00:00:00 2001 +From: Florian Jung +Date: Wed, 29 Jul 2020 18:51:55 +0200 +Subject: [PATCH] Fix build of grfmt_jpeg2000.cpp + +libjasper has recently changed `jas_matrix_get` from a macro to an inline function +(389951d071 in https://github.com/jasper-software/jasper), causing the build to fail. +--- + modules/imgcodecs/src/grfmt_jpeg2000.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/modules/imgcodecs/src/grfmt_jpeg2000.cpp b/modules/imgcodecs/src/grfmt_jpeg2000.cpp +index fe69f80c86f..0f4d28d6f4d 100644 +--- a/modules/imgcodecs/src/grfmt_jpeg2000.cpp ++++ b/modules/imgcodecs/src/grfmt_jpeg2000.cpp +@@ -377,7 +377,7 @@ bool Jpeg2KDecoder::readComponent8u( uchar *data, void *_buffer, + + for( y = 0; y < yend - ystart; ) + { +- jas_seqent_t* pix_row = &jas_matrix_get( buffer, y / ystep, 0 ); ++ jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 ); + uchar* dst = data + (y - yoffset) * step - xoffset; + + if( xstep == 1 ) +@@ -443,7 +443,7 @@ bool Jpeg2KDecoder::readComponent16u( unsigned short *data, void *_buffer, + + for( y = 0; y < yend - ystart; ) + { +- jas_seqent_t* pix_row = &jas_matrix_get( buffer, y / ystep, 0 ); ++ jas_seqent_t* pix_row = jas_matrix_getref( buffer, y / ystep, 0 ); + ushort* dst = data + (y - yoffset) * step - xoffset; + + if( xstep == 1 ) -- cgit v1.2.3 From 95b90decd3303d691b5c3d305f7cef0c7e60182d Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Sat, 15 Aug 2020 13:17:55 -0400 Subject: gnu: gvfs: Fix build with libplist 2.2.0. * gnu/packages/gnome.scm (gvfs)[source]: Add patch. * gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/gnome.scm | 5 +++- .../gvfs-add-support-for-libplist-2.2.patch | 34 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 27dcf965ca..71b964e465 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1101,6 +1101,7 @@ dist_patch_DATA = \ %D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \ %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \ %D%/packages/patches/gtksourceview-2-add-default-directory.patch \ + %D%/packages/patches/gvfs-add-support-for-libplist-2.2.patch \ %D%/packages/patches/gzdoom-search-in-installed-share.patch \ %D%/packages/patches/gzdoom-find-system-libgme.patch \ %D%/packages/patches/hdf4-architectures.patch \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index dffcd697d7..18cb196e22 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -5343,7 +5343,10 @@ part of udev-extras, then udev, then systemd. It's now a project on its own.") "gvfs-" version ".tar.xz")) (sha256 (base32 - "1cfnzamr4mvgpf6yhm28lh9cafy9z6842s8jpbqnfizfxybg8ylj")))) + "1cfnzamr4mvgpf6yhm28lh9cafy9z6842s8jpbqnfizfxybg8ylj")) + ;; This patch may be removed when upgrading to version 1.46.x. + (patches + (search-patches "gvfs-add-support-for-libplist-2.2.patch")))) (build-system meson-build-system) (arguments '(#:glib-or-gtk? #t diff --git a/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch b/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch new file mode 100644 index 0000000000..250eef2c8b --- /dev/null +++ b/gnu/packages/patches/gvfs-add-support-for-libplist-2.2.patch @@ -0,0 +1,34 @@ +Source: https://gitlab.gnome.org/GNOME/gvfs/-/commit/13551f3f40d41f1357126ac5a26d0fa012cd8123 + +Note: This change should be incorporated into stable version 1.46.x of gvfs. + +From 13551f3f40d41f1357126ac5a26d0fa012cd8123 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 16 Jun 2020 13:28:35 +0200 +Subject: [PATCH] afc: Add support for libplist-2.2 + +Which changed name from libplist to libplist-2.0 to embed its API +version number in the library name. +--- + meson.build | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 1750f65ca..187bfd55f 100644 +--- a/meson.build ++++ b/meson.build +@@ -357,7 +357,10 @@ config_h.set('HAVE_LOGIND', enable_logind) + enable_afc = get_option('afc') + if enable_afc + libimobiledevice_dep = dependency('libimobiledevice-1.0', version: '>= 1.2') +- libplist_dep = dependency('libplist', version: '>= 0.15') ++ libplist_dep = dependency('libplist-2.0', required: false) ++ if not libplist_dep.found() ++ libplist_dep = dependency('libplist', version: '>= 0.15') ++ endif + endif + + # *** Check if we should build with GOA volume monitor *** +-- +GitLab + -- cgit v1.2.3 From e0945a02a41afe31d99e3920aa9f7e2239df7bb7 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 13 Aug 2020 19:49:03 +0300 Subject: gnu: Add dbxfs. * gnu/packages/file-systems.scm (dbxfs): New variable. * gnu/packages/patches/dbxfs-remove-sentry-sdk.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/file-systems.scm | 30 ++++++++++ gnu/packages/patches/dbxfs-remove-sentry-sdk.patch | 64 ++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 gnu/packages/patches/dbxfs-remove-sentry-sdk.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 71b964e465..87bd7094bf 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -887,6 +887,7 @@ dist_patch_DATA = \ %D%/packages/patches/dbus-CVE-2020-12049.patch \ %D%/packages/patches/dbus-c++-gcc-compat.patch \ %D%/packages/patches/dbus-c++-threading-mutex.patch \ + %D%/packages/patches/dbxfs-remove-sentry-sdk.patch \ %D%/packages/patches/dconf-meson-0.52.patch \ %D%/packages/patches/debops-constants-for-external-program-names.patch \ %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \ diff --git a/gnu/packages/file-systems.scm b/gnu/packages/file-systems.scm index 7d06e3e899..b8612ac3b2 100644 --- a/gnu/packages/file-systems.scm +++ b/gnu/packages/file-systems.scm @@ -889,3 +889,33 @@ compatible directories.") (description "This package provides a Python SDK for integrating with the Dropbox API v2.") (license license:expat))) + +(define-public dbxfs + (package + (name "dbxfs") + (version "1.0.43") + (source + (origin + (method url-fetch) + (uri (pypi-uri "dbxfs" version)) + (sha256 + (base32 + "1f9sy2ax215dxiwszrrcadffjdsmrlxm4kwrbiap9dhxvzm226ks")) + (patches (search-patches "dbxfs-remove-sentry-sdk.patch")))) + (build-system python-build-system) + (arguments + '(#:tests? #f)) ; tests requires safefs + (propagated-inputs + `(("python-appdirs" ,python-appdirs) + ("python-block-tracing" ,python-block-tracing) + ("python-dropbox" ,python-dropbox) + ("python-keyring" ,python-keyring) + ("python-keyrings.alt" ,python-keyrings.alt) + ("python-privy" ,python-privy) + ("python-userspacefs" ,python-userspacefs))) + (home-page "https://github.com/rianhunter/dbxfs") + (synopsis "User-space file system for Dropbox") + (description + "@code{dbxfs} allows you to mount your Dropbox folder as if it were a +local filesystem using FUSE.") + (license license:gpl3+))) diff --git a/gnu/packages/patches/dbxfs-remove-sentry-sdk.patch b/gnu/packages/patches/dbxfs-remove-sentry-sdk.patch new file mode 100644 index 0000000000..7079fa8c3c --- /dev/null +++ b/gnu/packages/patches/dbxfs-remove-sentry-sdk.patch @@ -0,0 +1,64 @@ +sentry-sdk provides a link to sentry.io, a service which monitors applications deployed in the wild. +Defaults to true. Best to just remove the option. + +--- + dbxfs/main.py | 16 ---------------- + setup.py | 1 - + 2 files changed, 17 deletions(-) + +diff --git a/dbxfs/main.py b/dbxfs/main.py +index 5a6cea1..5d00818 100755 +--- a/dbxfs/main.py ++++ b/dbxfs/main.py +@@ -40,8 +40,6 @@ import userspacefs + import keyring + from keyring.errors import KeyringError + +-import sentry_sdk +- + from block_tracing import block_tracing, BLOCK_TRACING_INHERITS + + from dbxfs.dbxfs import FileSystem as DropboxFileSystem +@@ -299,12 +297,6 @@ def _main(argv=None): + config['keyring_user'] = keyring_user + save_config = True + +- if not config.get("asked_send_error_reports", False): +- if yes_no_input("Would you like to help us improve %s by providing anonymous error reports?" % (APP_NAME,), default_yes=True): +- config['send_error_reports'] = True +- config['asked_send_error_reports'] = True +- save_config = True +- + if save_access_token and yes_no_input("Do you want \"%s\" to be the default mount point?" % (mount_point,), default_yes=True): + config['mount_point'] = mount_point + save_config = True +@@ -315,14 +307,6 @@ def _main(argv=None): + + log.info("Starting %s...", APP_NAME) + +- if config.get('send_error_reports', False): +- try: +- sentry_sdk.init("https://b4b13ebd300849bd92260507a594e618@sentry.io/1293235", +- release='%s@%s' % (APP_NAME, version), +- with_locals=False) +- except Exception: +- log.warning("Failed to initialize sentry", exc_info=True) +- + if cache_folder is None: + cache_folder = os.path.join(appdirs.user_cache_dir(APP_NAME), "file_cache") + try: +diff --git a/setup.py b/setup.py +index 89e25c6..f940d47 100644 +--- a/setup.py ++++ b/setup.py +@@ -43,7 +43,6 @@ setup( + "privy>=6.0,<7", + "keyring>=15.1.0", + "keyrings.alt>=3.1,<4", +- "sentry_sdk>=0.3,<1", + ], + extras_require={ + 'safefs': ["safefs"], +-- +2.28.0 + -- cgit v1.2.3 From 784e7d7ae9840b4d38379e587dd181a9490cd101 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Sun, 16 Aug 2020 12:08:37 +0200 Subject: gnu: ola: Build with libmicrohttpd 0.9.71. * gnu/packages/lighting.scm (ola)[source]: Update to 0.10.7-0.5d88293. [source]: Use GIT-FETCH & GIT-FILE-NAME. Remove patch. [native-inputs]: Add autoconf, automake, and libtool. * gnu/packages/patches/ola-readdir-r.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/lighting.scm | 88 ++++++++++++++++++-------------- gnu/packages/patches/ola-readdir-r.patch | 62 ---------------------- 3 files changed, 49 insertions(+), 102 deletions(-) delete mode 100644 gnu/packages/patches/ola-readdir-r.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 87bd7094bf..db0f73d881 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1355,7 +1355,6 @@ dist_patch_DATA = \ %D%/packages/patches/ocaml-dose3-dont-make-printconf.patch \ %D%/packages/patches/ocaml-dose3-Install-mli-cmx-etc.patch \ %D%/packages/patches/omake-fix-non-determinism.patch \ - %D%/packages/patches/ola-readdir-r.patch \ %D%/packages/patches/openbabel-fix-crash-on-nwchem-output.patch \ %D%/packages/patches/opencascade-oce-glibc-2.26.patch \ %D%/packages/patches/opencv-fix-build-of-grfmt_jpeg2000.cpp.patch \ diff --git a/gnu/packages/lighting.scm b/gnu/packages/lighting.scm index 18110420de..027c08b4e9 100644 --- a/gnu/packages/lighting.scm +++ b/gnu/packages/lighting.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 John J. Foerch -;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice +;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice ;;; ;;; This file is part of GNU Guix. ;;; @@ -19,10 +19,11 @@ (define-module (gnu packages lighting) #:use-module (guix build-system gnu) - #:use-module (guix download) + #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (gnu packages) + #:use-module (gnu packages autotools) #:use-module (gnu packages bison) #:use-module (gnu packages check) #:use-module (gnu packages compression) @@ -35,46 +36,55 @@ #:use-module (gnu packages protobuf)) (define-public ola - (package - (name "ola") - (version "0.10.7") - (source (origin - (method url-fetch) - (uri (string-append - "https://github.com/OpenLightingProject/ola/releases/download/" - version "/ola-" version ".tar.gz")) - (patches (search-patches "ola-readdir-r.patch")) - (sha256 - (base32 - "181imc9qkjm2m1iwrb5ixsckx893nc6qwjfzacsjlqp0jlnj8rca")))) - (build-system gnu-build-system) - (native-inputs - `(("bison" ,bison) - ("cppunit" ,cppunit) - ("flex" ,flex) - ("pkg-config" ,pkg-config))) - (inputs - `(("libftdi" ,libftdi) - ("libmicrohttpd" ,libmicrohttpd) - ("libusb" ,libusb) - ("libuuid" ,util-linux "lib") - ("zlib" ,zlib))) - (propagated-inputs - ;; Ola 0.10.5 only supports protobuf 2.x, and building it with 3.x breaks. - ;; XXX Remove protobuf-2 when it is no longer needed. - `(("protobuf" ,protobuf-2))) ;; for pkg-config --libs libola - (arguments - `(;; G++ >= 4.8 macro expansion tracking requires lots of memory, causing - ;; build to fail on low memory systems. We disable that with the - ;; following configure flags. - #:configure-flags (list "CXXFLAGS=-ftrack-macro-expansion=0"))) - (synopsis "Framework for controlling entertainment lighting equipment") - (description "The Open Lighting Architecture is a framework for lighting + ;; Use a commit that allows building with libmicrohttpd 0.9.71. + ;; https://github.com/OpenLightingProject/ola/pull/1651 + (let ((commit "5d882936436240b312b3836afd199587beaca840") + (revision "0")) + (package + (name "ola") + (version (git-version "0.10.7" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/OpenLightingProject/ola") + (commit commit))) + (sha256 + (base32 "1bhl3gvmvmnyrygfj13cibf2xirm285m8abjkaxq22hrqbsvab2m")) + (file-name (git-file-name name version)))) + (build-system gnu-build-system) + (native-inputs + `(("bison" ,bison) + ("cppunit" ,cppunit) + ("flex" ,flex) + ("pkg-config" ,pkg-config) + + ;; For git repository bootstrapping. + ("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool))) + (inputs + `(("libftdi" ,libftdi) + ("libmicrohttpd" ,libmicrohttpd) + ("libusb" ,libusb) + ("libuuid" ,util-linux "lib") + ("zlib" ,zlib))) + (propagated-inputs + ;; Ola 0.10.5 only supports protobuf 2.x, and building it with 3.x breaks. + ;; XXX Remove protobuf-2 when it is no longer needed. + `(("protobuf" ,protobuf-2))) ;; for pkg-config --libs libola + (arguments + `( ;; G++ >= 4.8 macro expansion tracking requires lots of memory, causing + ;; build to fail on low memory systems. We disable that with the + ;; following configure flags. + #:configure-flags (list "CXXFLAGS=-ftrack-macro-expansion=0"))) + (synopsis "Framework for controlling entertainment lighting equipment") + (description "The Open Lighting Architecture is a framework for lighting control information. It supports a range of protocols and over a dozen USB devices. It can run as a standalone service, which is useful for converting signals between protocols, or alternatively using the OLA API, it can be used as the backend for lighting control software. OLA runs on many different platforms including ARM, which makes it a perfect fit for low cost Ethernet to DMX gateways.") - (home-page "https://www.openlighting.org/ola") - (license license:lgpl2.1+))) + (home-page "https://www.openlighting.org/ola") + (license license:lgpl2.1+)))) diff --git a/gnu/packages/patches/ola-readdir-r.patch b/gnu/packages/patches/ola-readdir-r.patch deleted file mode 100644 index b4bd98137e..0000000000 --- a/gnu/packages/patches/ola-readdir-r.patch +++ /dev/null @@ -1,62 +0,0 @@ -Fix build failure caused by use of the deprecated readdir_r(3) while -building with -Werror=deprecated-declarations - -Patch copied from upstream source repository: -https://github.com/daveol/ola/commit/9d8575ff38f76df698ea8889e07a3dee8f21bd68 - -From 9d8575ff38f76df698ea8889e07a3dee8f21bd68 Mon Sep 17 00:00:00 2001 -From: Dave Olsthoorn -Date: Wed, 2 Mar 2016 11:22:17 +0100 -Subject: [PATCH] Use readdir instead of readdir_r - -This replacec the use of readdir_r with readdir since readdir seems to -be both dangarous and deprecated in newer versions of glibc. - -This fixes #1055 ---- - common/file/Util.cpp | 17 ++++++++--------- - 1 file changed, 8 insertions(+), 9 deletions(-) - -diff --git a/common/file/Util.cpp b/common/file/Util.cpp -index e2261fd..0ffddd3 100644 ---- a/common/file/Util.cpp -+++ b/common/file/Util.cpp -@@ -128,30 +128,29 @@ bool FindMatchingFiles(const string &directory, - FindClose(h_find); - #else - DIR *dp; -- struct dirent dir_ent; -- struct dirent *dir_ent_p; -+ struct dirent *dir_ent; - if ((dp = opendir(directory.data())) == NULL) { - OLA_WARN << "Could not open " << directory << ":" << strerror(errno); - return false; - } - -- if (readdir_r(dp, &dir_ent, &dir_ent_p)) { -- OLA_WARN << "readdir_r(" << directory << "): " << strerror(errno); -+ if ((dir_ent = readdir(dp)) == NULL) { -+ OLA_WARN << "readdir(" << directory << "): " << strerror(errno); - closedir(dp); - return false; - } - -- while (dir_ent_p != NULL) { -+ while (dir_ent != NULL) { - vector::const_iterator iter; - for (iter = prefixes.begin(); iter != prefixes.end(); ++iter) { -- if (!strncmp(dir_ent_p->d_name, iter->data(), iter->size())) { -+ if (!strncmp(dir_ent->d_name, iter->data(), iter->size())) { - std::ostringstream str; -- str << directory << PATH_SEPARATOR << dir_ent_p->d_name; -+ str << directory << PATH_SEPARATOR << dir_ent->d_name; - files->push_back(str.str()); - } - } -- if (readdir_r(dp, &dir_ent, &dir_ent_p)) { -- OLA_WARN << "readdir_r(" << directory << "): " << strerror(errno); -+ if ((dir_ent = readdir(dp)) == NULL) { -+ OLA_WARN << "readdir(" << directory << "): " << strerror(errno); - closedir(dp); - return false; - } -- cgit v1.2.3 From bc549a276cd9c10202427d220d87f50eb3784d42 Mon Sep 17 00:00:00 2001 From: Leo Prikler Date: Sat, 15 Aug 2020 01:03:53 -0400 Subject: gnu: webkitgtk: Expose all font locations to the bubblewrap sandbox. Fixes and . The webkitgtk library relied on by Epiphany and others uses bubblewrap to sandbox its process. This sandbox was only exposing fonts relative to XDG_DATA_HOME. Extend it so that it honors font locations specified via XDG_DATA_DIRS as well, which is what Guix uses. * gnu/packages/patches/webkitgtk-bind-all-fonts.patch: Add patch. * gnu/local.mk: Register it. * gnu/packages/webkit.scm (webkitgtk)[source]: Use it. Signed-off-by: Maxim Cournoyer --- gnu/local.mk | 1 + .../patches/webkitgtk-bind-all-fonts.patch | 26 ++++++++++++++++++++++ gnu/packages/webkit.scm | 3 ++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/webkitgtk-bind-all-fonts.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index db0f73d881..cc820c23db 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1639,6 +1639,7 @@ dist_patch_DATA = \ %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch \ %D%/packages/patches/weasyprint-library-paths.patch \ %D%/packages/patches/webkitgtk-share-store.patch \ + %D%/packages/patches/webkitgtk-bind-all-fonts.patch \ %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch \ %D%/packages/patches/wicd-bitrate-none-fix.patch \ %D%/packages/patches/wicd-get-selected-profile-fix.patch \ diff --git a/gnu/packages/patches/webkitgtk-bind-all-fonts.patch b/gnu/packages/patches/webkitgtk-bind-all-fonts.patch new file mode 100644 index 0000000000..3fe9704727 --- /dev/null +++ b/gnu/packages/patches/webkitgtk-bind-all-fonts.patch @@ -0,0 +1,26 @@ +Add fonts from all XDG_DATA_DIRS, not just XDG_DATA_HOME. + +See . +Author: Leo Prikler +Index: webkitgtk-2.28.2/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp +=================================================================== +--- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp ++++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp +@@ -387,6 +387,7 @@ static void bindFonts(Vector& args) + const char* homeDir = g_get_home_dir(); + const char* dataDir = g_get_user_data_dir(); + const char* cacheDir = g_get_user_cache_dir(); ++ const char* const * dataDirs = g_get_system_data_dirs(); + + // Configs can include custom dirs but then we have to parse them... + GUniquePtr fontConfig(g_build_filename(configDir, "fontconfig", nullptr)); +@@ -403,6 +404,10 @@ static void bindFonts(Vector& args) + bindIfExists(args, fontHomeConfigDir.get()); + bindIfExists(args, fontData.get()); + bindIfExists(args, fontHomeData.get()); ++ for (auto dataDir = dataDirs; dataDir != nullptr && *dataDir != nullptr; dataDir++) { ++ GUniquePtr fontDataDir(g_build_filename(*dataDir, "fonts", nullptr)); ++ bindIfExists(args, fontDataDir.get()); ++ } + bindIfExists(args, "/var/cache/fontconfig"); // Used by Debian. + } diff --git a/gnu/packages/webkit.scm b/gnu/packages/webkit.scm index 5a517c3b87..80df8560d9 100644 --- a/gnu/packages/webkit.scm +++ b/gnu/packages/webkit.scm @@ -129,7 +129,8 @@ engine that uses Wayland for graphics output.") (sha256 (base32 "0r4lkk21pny2g4mmsw0ds14m5hhjys1l47gvy59dfgihr7l546c2")) - (patches (search-patches "webkitgtk-share-store.patch")))) + (patches (search-patches "webkitgtk-share-store.patch" + "webkitgtk-bind-all-fonts.patch")))) (build-system cmake-build-system) (outputs '("out" "doc")) (arguments -- cgit v1.2.3 From 0444187de484e2eaf8e1946d755907b2baec8533 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Fri, 3 Jul 2020 08:03:40 -0400 Subject: gnu: Add libquicktime. * gnu/packages/video.scm (libquicktime): New variable. * gnu/packages/patches/libquicktime-ffmpeg.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 1 + gnu/packages/patches/libquicktime-ffmpeg.patch | 1309 ++++++++++++++++++++++++ gnu/packages/video.scm | 40 + 3 files changed, 1350 insertions(+) create mode 100644 gnu/packages/patches/libquicktime-ffmpeg.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index cc820c23db..d61f272f3e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1229,6 +1229,7 @@ dist_patch_DATA = \ %D%/packages/patches/libmygpo-qt-fix-qt-5.11.patch \ %D%/packages/patches/libmygpo-qt-missing-qt5-modules.patch \ %D%/packages/patches/libqalculate-3.8.0-libcurl-ssl-fix.patch \ + %D%/packages/patches/libquicktime-ffmpeg.patch \ %D%/packages/patches/libsndfile-armhf-type-checks.patch \ %D%/packages/patches/libsndfile-CVE-2017-8361-8363-8365.patch \ %D%/packages/patches/libsndfile-CVE-2017-8362.patch \ diff --git a/gnu/packages/patches/libquicktime-ffmpeg.patch b/gnu/packages/patches/libquicktime-ffmpeg.patch new file mode 100644 index 0000000000..48c595fba9 --- /dev/null +++ b/gnu/packages/patches/libquicktime-ffmpeg.patch @@ -0,0 +1,1309 @@ +Submitted By: Ken Moffat +Date: 2018-05-12 +Initial Package Version: 1.2.4 +Upstream Status: Defunct +Origin: Gentoo +Description: Accumulated fixes up to and including building with ffmpeg-4 + +From gentoo, their libav-9.patch, ffmpeg2.patch, CVE-2016-2399.patch, +ffmpeg29.patch, ffmpeg4.patch, and seds to files lqt_ffmpeg.c, video.c, +audio.c in plugins/ffmpeg/ to change CODEC_ID to AV_CODEC_ID. + +Build-tested only. + +diff -Naur a/plugins/ffmpeg/audio.c b/plugins/ffmpeg/audio.c +--- a/plugins/ffmpeg/audio.c 2012-03-29 20:44:28.000000000 +0100 ++++ b/plugins/ffmpeg/audio.c 2018-05-11 23:15:21.057985300 +0100 +@@ -45,6 +45,11 @@ + #define ENCODE_AUDIO 1 + #endif + ++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE ++/* from libavcodec/avcodec.h dated Dec 23 2012 */ ++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio ++#endif ++ + /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */ + + /* MPEG Audio header parsing code */ +@@ -540,7 +545,7 @@ + + #if DECODE_AUDIO3 || DECODE_AUDIO4 + codec->pkt.data = codec->chunk_buffer; +- codec->pkt.size = packet_size + FF_INPUT_BUFFER_PADDING_SIZE; ++ codec->pkt.size = packet_size + AV_INPUT_BUFFER_PADDING_SIZE; + + #if DECODE_AUDIO4 + frame_bytes = avcodec_decode_audio4(codec->avctx, &f, +@@ -578,7 +583,7 @@ + (codec->sample_buffer_end - codec->sample_buffer_start)], + &bytes_decoded, + codec->chunk_buffer, +- packet_size + FF_INPUT_BUFFER_PADDING_SIZE); ++ packet_size + AV_INPUT_BUFFER_PADDING_SIZE); + if(frame_bytes < 0) + { + lqt_log(file, LQT_LOG_ERROR, LOG_DOMAIN, "avcodec_decode_audio2 error"); +@@ -626,7 +631,7 @@ + { + /* If the codec is mp3, make sure to decode the very last frame */ + +- if((codec->avctx->codec_id == CODEC_ID_MP3) && ++ if((codec->avctx->codec_id == AV_CODEC_ID_MP3) && + (codec->bytes_in_chunk_buffer >= 4)) + { + if(!mpa_decode_header(&mph, codec->chunk_buffer, (const mpa_header*)0)) +@@ -640,13 +645,13 @@ + return 0; + } + +- if(codec->chunk_buffer_alloc < mph.frame_bytes + FF_INPUT_BUFFER_PADDING_SIZE) ++ if(codec->chunk_buffer_alloc < mph.frame_bytes + AV_INPUT_BUFFER_PADDING_SIZE) + { +- codec->chunk_buffer_alloc = mph.frame_bytes + FF_INPUT_BUFFER_PADDING_SIZE; ++ codec->chunk_buffer_alloc = mph.frame_bytes + AV_INPUT_BUFFER_PADDING_SIZE; + codec->chunk_buffer = realloc(codec->chunk_buffer, codec->chunk_buffer_alloc); + } + memset(codec->chunk_buffer + codec->bytes_in_chunk_buffer, 0, +- mph.frame_bytes - codec->bytes_in_chunk_buffer + FF_INPUT_BUFFER_PADDING_SIZE); ++ mph.frame_bytes - codec->bytes_in_chunk_buffer + AV_INPUT_BUFFER_PADDING_SIZE); + num_samples = mph.samples_per_frame; + codec->bytes_in_chunk_buffer = mph.frame_bytes; + } +@@ -690,12 +695,12 @@ + { + + +- /* BIG NOTE: We pass extra FF_INPUT_BUFFER_PADDING_SIZE for the buffer size ++ /* BIG NOTE: We pass extra AV_INPUT_BUFFER_PADDING_SIZE for the buffer size + because we know, that lqt_read_audio_chunk allocates 16 extra bytes for us */ + + /* Some really broken mp3 files have the header bytes split across 2 chunks */ + +- if(codec->avctx->codec_id == CODEC_ID_MP3) ++ if(codec->avctx->codec_id == AV_CODEC_ID_MP3) + { + if(codec->bytes_in_chunk_buffer < 4) + { +@@ -756,7 +761,7 @@ + + #if DECODE_AUDIO3 || DECODE_AUDIO4 + codec->pkt.data = &codec->chunk_buffer[bytes_used]; +- codec->pkt.size = codec->bytes_in_chunk_buffer + FF_INPUT_BUFFER_PADDING_SIZE; ++ codec->pkt.size = codec->bytes_in_chunk_buffer + AV_INPUT_BUFFER_PADDING_SIZE; + + #if DECODE_AUDIO4 + +@@ -793,7 +798,7 @@ + (codec->sample_buffer_end - codec->sample_buffer_start)], + &bytes_decoded, + &codec->chunk_buffer[bytes_used], +- codec->bytes_in_chunk_buffer + FF_INPUT_BUFFER_PADDING_SIZE); ++ codec->bytes_in_chunk_buffer + AV_INPUT_BUFFER_PADDING_SIZE); + #endif + if(frame_bytes < 0) + { +@@ -806,7 +811,7 @@ + + if(bytes_decoded < 0) + { +- if(codec->avctx->codec_id == CODEC_ID_MP3) ++ if(codec->avctx->codec_id == AV_CODEC_ID_MP3) + { + /* For mp3, bytes_decoded < 0 means, that the frame should be muted */ + memset(&codec->sample_buffer[track_map->channels * (codec->sample_buffer_end - +@@ -833,7 +838,7 @@ + } + } + +- /* This happens because ffmpeg adds FF_INPUT_BUFFER_PADDING_SIZE to the bytes returned */ ++ /* This happens because ffmpeg adds AV_INPUT_BUFFER_PADDING_SIZE to the bytes returned */ + + if(codec->bytes_in_chunk_buffer < 0) + codec->bytes_in_chunk_buffer = 0; +@@ -866,8 +871,8 @@ + quicktime_audio_map_t *track_map = &file->atracks[track]; + quicktime_ffmpeg_audio_codec_t *codec = track_map->codec->priv; + +- if((codec->decoder->id == CODEC_ID_MP2) || +- (codec->decoder->id == CODEC_ID_MP3)) ++ if((codec->decoder->id == AV_CODEC_ID_MP2) || ++ (codec->decoder->id == AV_CODEC_ID_MP3)) + { + mpa_header h; + uint32_t header; +@@ -909,7 +914,7 @@ + else + track_map->ci.bitrate = h.bitrate; + } +- else if(codec->decoder->id == CODEC_ID_AC3) ++ else if(codec->decoder->id == AV_CODEC_ID_AC3) + { + a52_header h; + uint8_t * ptr; +@@ -986,7 +991,7 @@ + #endif + /* Some codecs need extra stuff */ + +- if(codec->decoder->id == CODEC_ID_ALAC) ++ if(codec->decoder->id == AV_CODEC_ID_ALAC) + { + header = quicktime_wave_get_user_atom(track_map->track, "alac", &header_len); + if(header) +@@ -995,7 +1000,7 @@ + codec->avctx->extradata_size = header_len; + } + } +- if(codec->decoder->id == CODEC_ID_QDM2) ++ if(codec->decoder->id == AV_CODEC_ID_QDM2) + { + header = quicktime_wave_get_user_atom(track_map->track, "QDCA", &header_len); + if(header) +@@ -1261,7 +1266,7 @@ + pkt.data = codec->chunk_buffer; + pkt.size = codec->chunk_buffer_alloc; + +- avcodec_get_frame_defaults(&f); ++ av_frame_unref(&f); + f.nb_samples = codec->avctx->frame_size; + + avcodec_fill_audio_frame(&f, channels, codec->avctx->sample_fmt, +@@ -1495,9 +1500,9 @@ + codec_base->decode_audio = lqt_ffmpeg_decode_audio; + codec_base->set_parameter = set_parameter; + +- if((decoder->id == CODEC_ID_MP3) || (decoder->id == CODEC_ID_MP2)) ++ if((decoder->id == AV_CODEC_ID_MP3) || (decoder->id == AV_CODEC_ID_MP2)) + codec_base->read_packet = read_packet_mpa; +- else if(decoder->id == CODEC_ID_AC3) ++ else if(decoder->id == AV_CODEC_ID_AC3) + { + codec_base->write_packet = write_packet_ac3; + codec_base->read_packet = read_packet_ac3; +diff -Naur a/plugins/ffmpeg/ffmpeg.h b/plugins/ffmpeg/ffmpeg.h +--- a/plugins/ffmpeg/ffmpeg.h 2012-02-15 19:48:30.000000000 +0000 ++++ b/plugins/ffmpeg/ffmpeg.h 2018-05-11 23:10:24.204992468 +0100 +@@ -27,6 +27,7 @@ + + #include + #include AVCODEC_HEADER ++#include + + void quicktime_init_video_codec_ffmpeg(quicktime_codec_t * codec, + quicktime_video_map_t *vtrack, +diff -Naur a/plugins/ffmpeg/lqt_ffmpeg.c b/plugins/ffmpeg/lqt_ffmpeg.c +--- a/plugins/ffmpeg/lqt_ffmpeg.c 2012-02-15 19:48:30.000000000 +0000 ++++ b/plugins/ffmpeg/lqt_ffmpeg.c 2018-05-11 23:15:07.583985628 +0100 +@@ -386,7 +386,7 @@ + struct CODECIDMAP codecidmap_v[] = + { + { +- .id = CODEC_ID_MPEG1VIDEO, ++ .id = AV_CODEC_ID_MPEG1VIDEO, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -397,7 +397,7 @@ + .wav_ids = { LQT_WAV_ID_NONE } + }, + { +- .id = CODEC_ID_MPEG4, ++ .id = AV_CODEC_ID_MPEG4, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -415,7 +415,7 @@ + .compression_id = LQT_COMPRESSION_MPEG4_ASP, + }, + { +- .id = CODEC_ID_MSMPEG4V1, ++ .id = AV_CODEC_ID_MSMPEG4V1, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -426,7 +426,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_MSMPEG4V2, ++ .id = AV_CODEC_ID_MSMPEG4V2, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -437,7 +437,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_MSMPEG4V3, ++ .id = AV_CODEC_ID_MSMPEG4V3, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -453,7 +453,7 @@ + .do_encode = 1, + }, + { +- .id = CODEC_ID_MSMPEG4V3, ++ .id = AV_CODEC_ID_MSMPEG4V3, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -468,7 +468,7 @@ + }, + #if 0 + { +- .id = CODEC_ID_WMV1, ++ .id = AV_CODEC_ID_WMV1, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -481,7 +481,7 @@ + }, + #endif + { +- .id = CODEC_ID_H263, ++ .id = AV_CODEC_ID_H263, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -493,7 +493,7 @@ + .compatibility_flags = LQT_FILE_QT_OLD | LQT_FILE_QT | LQT_FILE_MP4 | LQT_FILE_3GP, + }, + { +- .id = CODEC_ID_H263, ++ .id = AV_CODEC_ID_H263, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -508,7 +508,7 @@ + .do_encode = 1, + }, + { +- .id = CODEC_ID_H264, ++ .id = AV_CODEC_ID_H264, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -519,7 +519,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_H263P, ++ .id = AV_CODEC_ID_H263P, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -533,7 +533,7 @@ + .do_encode = 1, + }, + { +- .id = CODEC_ID_H263I, ++ .id = AV_CODEC_ID_H263I, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -544,7 +544,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_SVQ1, ++ .id = AV_CODEC_ID_SVQ1, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -555,7 +555,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_SVQ3, ++ .id = AV_CODEC_ID_SVQ3, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -566,7 +566,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_MJPEG, ++ .id = AV_CODEC_ID_MJPEG, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -580,7 +580,7 @@ + .do_encode = 1, + }, + { +- .id = CODEC_ID_MJPEGB, ++ .id = AV_CODEC_ID_MJPEGB, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -594,7 +594,7 @@ + }, + #if LIBAVCODEC_BUILD >= 3346688 + { +- .id = CODEC_ID_TARGA, ++ .id = AV_CODEC_ID_TARGA, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -606,7 +606,7 @@ + #endif + #if LIBAVCODEC_BUILD >= 3347456 + { +- .id = CODEC_ID_TIFF, ++ .id = AV_CODEC_ID_TIFF, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -617,7 +617,7 @@ + }, + #endif + { +- .id = CODEC_ID_8BPS, ++ .id = AV_CODEC_ID_8BPS, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -627,7 +627,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_INDEO3, ++ .id = AV_CODEC_ID_INDEO3, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -638,7 +638,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_RPZA, ++ .id = AV_CODEC_ID_RPZA, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -648,7 +648,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_SMC, ++ .id = AV_CODEC_ID_SMC, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -658,7 +658,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_CINEPAK, ++ .id = AV_CODEC_ID_CINEPAK, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -669,7 +669,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_CYUV, ++ .id = AV_CODEC_ID_CYUV, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -680,7 +680,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_QTRLE, ++ .id = AV_CODEC_ID_QTRLE, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -693,7 +693,7 @@ + .encoding_colormodels = (int[]){ BC_RGB888, BC_RGBA8888, LQT_COLORMODEL_NONE }, + }, + { +- .id = CODEC_ID_MSRLE, ++ .id = AV_CODEC_ID_MSRLE, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -703,7 +703,7 @@ + .wav_ids = { LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_DVVIDEO, ++ .id = AV_CODEC_ID_DVVIDEO, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -719,7 +719,7 @@ + .image_sizes = image_sizes_dv, + }, + { +- .id = CODEC_ID_DVVIDEO, ++ .id = AV_CODEC_ID_DVVIDEO, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -735,7 +735,7 @@ + .image_sizes = image_sizes_dv, + }, + { +- .id = CODEC_ID_DVVIDEO, ++ .id = AV_CODEC_ID_DVVIDEO, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -751,7 +751,7 @@ + }, + /* DVCPRO HD (decoding only for now) */ + { +- .id = CODEC_ID_DVVIDEO, ++ .id = AV_CODEC_ID_DVVIDEO, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -772,7 +772,7 @@ + // .do_encode = 1 + }, + { +- .id = CODEC_ID_FFVHUFF, ++ .id = AV_CODEC_ID_FFVHUFF, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -785,7 +785,7 @@ + .do_encode = 1 + }, + { +- .id = CODEC_ID_FFV1, ++ .id = AV_CODEC_ID_FFV1, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -801,7 +801,7 @@ + }, + #if LIBAVCODEC_BUILD >= 3352576 + { +- .id = CODEC_ID_DNXHD, ++ .id = AV_CODEC_ID_DNXHD, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -817,7 +817,7 @@ + }, + #endif + { +- .id = CODEC_ID_MPEG2VIDEO, ++ .id = AV_CODEC_ID_MPEG2VIDEO, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -839,7 +839,7 @@ + struct CODECIDMAP codecidmap_a[] = + { + { +- .id = CODEC_ID_MP3, ++ .id = AV_CODEC_ID_MP3, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -851,7 +851,7 @@ + .wav_ids = { 0x50, 0x55, LQT_WAV_ID_NONE }, + }, + { +- .id = CODEC_ID_MP2, ++ .id = AV_CODEC_ID_MP2, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -866,7 +866,7 @@ + .compression_id = LQT_COMPRESSION_MP2, + }, + { +- .id = CODEC_ID_AC3, ++ .id = AV_CODEC_ID_AC3, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -881,7 +881,7 @@ + .compression_id = LQT_COMPRESSION_AC3, + }, + { +- .id = CODEC_ID_QDM2, ++ .id = AV_CODEC_ID_QDM2, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -896,7 +896,7 @@ + #if 1 + /* Doesn't work as long as audio chunks are not split into VBR "Samples" */ + { +- .id = CODEC_ID_ALAC, ++ .id = AV_CODEC_ID_ALAC, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -909,7 +909,7 @@ + #if 1 + /* Sounds ugly */ + { +- .id = CODEC_ID_ADPCM_MS, ++ .id = AV_CODEC_ID_ADPCM_MS, + .index = -1, + .encoder = NULL, + .decoder = NULL, +@@ -922,7 +922,7 @@ + #if 1 + /* Sounds ugly */ + { +- .id = CODEC_ID_ADPCM_IMA_WAV, ++ .id = AV_CODEC_ID_ADPCM_IMA_WAV, + .index = -1, + .encoder = NULL, + .decoder = NULL, +diff -Naur a/plugins/ffmpeg/params.c b/plugins/ffmpeg/params.c +--- a/plugins/ffmpeg/params.c 2012-03-07 14:10:41.000000000 +0000 ++++ b/plugins/ffmpeg/params.c 2018-05-11 23:11:59.803990160 +0100 +@@ -101,6 +101,17 @@ + } \ + } + ++#define PARAM_DICT_INT(name, dict_name) \ ++ { \ ++ if(!strcasecmp(name, key)) \ ++ { \ ++ char buf[128]; \ ++ snprintf(buf, sizeof(buf), "%d", *(int*)value); \ ++ av_dict_set(options, dict_name, buf, 0); \ ++ found = 1; \ ++ } \ ++ } ++ + #define PARAM_DICT_FLAG(name, dict_name) \ + { \ + if(!strcasecmp(name, key)) \ +@@ -113,16 +124,6 @@ + } + + +-enum_t me_method[] = +- { +- { "Zero", ME_ZERO }, +- { "Phods", ME_PHODS }, +- { "Log", ME_LOG }, +- { "X1", ME_X1 }, +- { "Epzs", ME_EPZS }, +- { "Full", ME_FULL } +- }; +- + enum_t prediction_method[] = + { + { "Left", FF_PRED_LEFT }, +@@ -152,15 +153,6 @@ + { "Rate distoration", FF_MB_DECISION_RD } + }; + +-enum_t coder_type[] = +- { +- { "VLC", FF_CODER_TYPE_VLC }, +- { "Arithmetic", FF_CODER_TYPE_AC }, +- { "Raw", FF_CODER_TYPE_RAW }, +- { "RLE", FF_CODER_TYPE_RLE }, +- { "Deflate", FF_CODER_TYPE_DEFLATE }, +- }; +- + #define PARAM_ENUM(name, var, arr) \ + if(!strcasecmp(key, name)) \ + { \ +@@ -192,7 +184,7 @@ + PARAM_INT_SCALE("ff_bit_rate_audio",bit_rate,1000); + PARAM_INT_SCALE("ff_bit_rate_video",bit_rate,1000); + PARAM_INT_SCALE("ff_bit_rate_tolerance",bit_rate_tolerance,1000); +- PARAM_ENUM("ff_me_method",me_method,me_method); ++ PARAM_DICT_INT("ff_me_method","motion-est"); + PARAM_INT("ff_gop_size",gop_size); + PARAM_FLOAT("ff_qcompress",qcompress); + PARAM_FLOAT("ff_qblur",qblur); +@@ -202,17 +194,23 @@ + PARAM_INT("ff_max_b_frames",max_b_frames); + PARAM_FLOAT("ff_b_quant_factor",b_quant_factor); + PARAM_INT("ff_b_frame_strategy",b_frame_strategy); ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold"); ++ PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold"); ++#else + PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold); + PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold); ++#endif ++ + PARAM_INT("ff_strict_std_compliance",strict_std_compliance); + PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset); + PARAM_INT("ff_rc_min_rate",rc_min_rate); + PARAM_INT("ff_rc_max_rate",rc_max_rate); + PARAM_INT_SCALE("ff_rc_buffer_size",rc_buffer_size,1000); +- PARAM_FLOAT("ff_rc_buffer_aggressivity",rc_buffer_aggressivity); + PARAM_FLOAT("ff_i_quant_factor",i_quant_factor); + PARAM_QP2LAMBDA("ff_i_quant_offset",i_quant_offset); +- PARAM_FLOAT("ff_rc_initial_cplx",rc_initial_cplx); ++ PARAM_DICT_INT("ff_rc_initial_cplx","rc_init_cplx"); + PARAM_FLOAT("ff_lumi_masking",lumi_masking); + PARAM_FLOAT("ff_temporal_cplx_masking",temporal_cplx_masking); + PARAM_FLOAT("ff_spatial_cplx_masking",spatial_cplx_masking); +@@ -237,58 +235,68 @@ + PARAM_INT("ff_me_range",me_range); + PARAM_ENUM("ff_mb_decision",mb_decision,mb_decision); + PARAM_INT("ff_scenechange_threshold",scenechange_threshold); +- PARAM_QP2LAMBDA("ff_lmin", lmin); +- PARAM_QP2LAMBDA("ff_lmax", lmax); ++ PARAM_DICT_INT("ff_lmin", "lmin"); ++ PARAM_DICT_INT("ff_lmax", "lmax"); + PARAM_INT("ff_noise_reduction",noise_reduction); + PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000); ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_INT("ff_inter_threshold","inter_threshold"); ++ PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping"); ++#else + PARAM_INT("ff_inter_threshold",inter_threshold); + PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping); ++#endif ++ + PARAM_INT("ff_thread_count",thread_count); +- PARAM_INT("ff_me_threshold",me_threshold); +- PARAM_INT("ff_mb_threshold",mb_threshold); + PARAM_INT("ff_nsse_weight",nsse_weight); +- PARAM_FLOAT("ff_border_masking",border_masking); ++ PARAM_DICT_INT("ff_border_masking","border_mask"); + PARAM_QP2LAMBDA("ff_mb_lmin", mb_lmin); + PARAM_QP2LAMBDA("ff_mb_lmax", mb_lmax); + PARAM_INT("ff_me_penalty_compensation",me_penalty_compensation); + PARAM_INT("ff_bidir_refine",bidir_refine); + PARAM_INT("ff_brd_scale",brd_scale); +- PARAM_INT("ff_scenechange_factor",scenechange_factor); +- PARAM_FLAG("ff_flag_qscale",CODEC_FLAG_QSCALE); +- PARAM_FLAG("ff_flag_4mv",CODEC_FLAG_4MV); +- PARAM_FLAG("ff_flag_qpel",CODEC_FLAG_QPEL); +- PARAM_FLAG("ff_flag_gmc",CODEC_FLAG_GMC); +- PARAM_FLAG("ff_flag_mv0",CODEC_FLAG_MV0); ++ PARAM_FLAG("ff_flag_qscale",AV_CODEC_FLAG_QSCALE); ++ PARAM_FLAG("ff_flag_4mv",AV_CODEC_FLAG_4MV); ++ PARAM_FLAG("ff_flag_qpel",AV_CODEC_FLAG_QPEL); ++ PARAM_DICT_FLAG("ff_flag_gmc","gmc"); ++ PARAM_DICT_FLAG("ff_flag_mv0","mpv_flags"); + // PARAM_FLAG("ff_flag_part",CODEC_FLAG_PART); // Unused +- PARAM_FLAG("ff_flag_gray",CODEC_FLAG_GRAY); +- PARAM_FLAG("ff_flag_emu_edge",CODEC_FLAG_EMU_EDGE); +- PARAM_FLAG("ff_flag_normalize_aqp",CODEC_FLAG_NORMALIZE_AQP); ++ PARAM_FLAG("ff_flag_gray",AV_CODEC_FLAG_GRAY); ++ PARAM_DICT_FLAG("ff_flag_normalize_aqp","naq"); + // PARAM_FLAG("ff_flag_alt_scan",CODEC_FLAG_ALT_SCAN); // Unused + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + PARAM_FLAG("ff_flag_trellis_quant",CODEC_FLAG_TRELLIS_QUANT); + #else + PARAM_INT("ff_trellis",trellis); + #endif +- PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT); +- PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED); ++ PARAM_FLAG("ff_flag_bitexact",AV_CODEC_FLAG_BITEXACT); ++ PARAM_FLAG("ff_flag_ac_pred",AV_CODEC_FLAG_AC_PRED); + // PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused +- PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD); +- PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD); ++ ++#if LIBAVCODEC_VERSION_MAJOR >= 55 ++ PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd"); ++ PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd"); ++ PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop"); ++#else ++ PARAM_FLAG("ff_flag_cbp_rd",AV_CODEC_FLAG_CBP_RD); ++ PARAM_FLAG("ff_flag_qp_rd",AV_CODEC_FLAG_QP_RD); ++ PARAM_FLAG2("ff_flag2_strict_gop",AV_CODEC_FLAG2_STRICT_GOP); ++#endif + + #if LIBAVCODEC_VERSION_MAJOR >= 54 + PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv"); + PARAM_DICT_FLAG("ff_flag_obmc","obmc"); + PARAM_DICT_FLAG("ff_flag_h263p_slice_struct","structured_slices"); + #else +- PARAM_FLAG("ff_flag_h263p_aiv",CODEC_FLAG_H263P_AIV); +- PARAM_FLAG("ff_flag_obmc",CODEC_FLAG_OBMC); +- PARAM_FLAG("ff_flag_h263p_slice_struct",CODEC_FLAG_H263P_SLICE_STRUCT); ++ PARAM_FLAG("ff_flag_h263p_aiv",AV_CODEC_FLAG_H263P_AIV); ++ PARAM_FLAG("ff_flag_obmc",AV_CODEC_FLAG_OBMC); ++ PARAM_FLAG("ff_flag_h263p_slice_struct",AV_CODEC_FLAG_H263P_SLICE_STRUCT); + #endif + +- PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER); +- PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP); +- PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST); +- PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP); +- PARAM_ENUM("ff_coder_type",coder_type,coder_type); ++ PARAM_FLAG("ff_flag_loop_filter",AV_CODEC_FLAG_LOOP_FILTER); ++ PARAM_FLAG("ff_flag_closed_gop",AV_CODEC_FLAG_CLOSED_GOP); ++ PARAM_FLAG2("ff_flag2_fast",AV_CODEC_FLAG2_FAST); ++ PARAM_DICT_INT("ff_coder_type","coder"); + + } +diff -Naur a/plugins/ffmpeg/params.h b/plugins/ffmpeg/params.h +--- a/plugins/ffmpeg/params.h 2011-05-11 16:13:39.000000000 +0100 ++++ b/plugins/ffmpeg/params.h 2018-05-11 23:11:59.803990160 +0100 +@@ -149,7 +149,7 @@ + .type = LQT_PARAMETER_INT, \ + .val_default = { .val_int = 0 }, \ + .val_min = { .val_int = 0 }, \ +- .val_max = { .val_int = FF_MAX_B_FRAMES }, \ ++ .val_max = { .val_int = 16 }, \ + .help_string = TRS("Maximum number of B-frames between non B-frames") \ + } + +diff -Naur a/plugins/ffmpeg/video.c b/plugins/ffmpeg/video.c +--- a/plugins/ffmpeg/video.c 2012-02-25 19:46:56.000000000 +0000 ++++ b/plugins/ffmpeg/video.c 2018-05-11 23:15:15.697985432 +0100 +@@ -37,10 +37,10 @@ + #endif + + +-#ifdef PIX_FMT_YUV422P10 +-#define PIX_FMT_YUV422P10_OR_DUMMY PIX_FMT_YUV422P10 ++#ifdef AV_PIX_FMT_YUV422P10 ++#define AV_PIX_FMT_YUV422P10_OR_DUMMY AV_PIX_FMT_YUV422P10 + #else +-#define PIX_FMT_YUV422P10_OR_DUMMY -1234 ++#define AV_PIX_FMT_YUV422P10_OR_DUMMY -1234 + #endif + + #if LIBAVCODEC_VERSION_INT >= ((54<<16)|(1<<8)|0) +@@ -90,9 +90,9 @@ + int imx_bitrate; + int imx_strip_vbi; + +- /* In some cases FFMpeg would report something like PIX_FMT_YUV422P, while +- we would like to treat it as PIX_FMT_YUVJ422P. It's only used for decoding */ +- enum PixelFormat reinterpret_pix_fmt; ++ /* In some cases FFMpeg would report something like AV_PIX_FMT_YUV422P, while ++ we would like to treat it as AV_PIX_FMT_YUVJ422P. It's only used for decoding */ ++ enum AVPixelFormat reinterpret_pix_fmt; + + int is_imx; + int y_offset; +@@ -137,42 +137,42 @@ + + static const struct + { +- enum PixelFormat ffmpeg_id; ++ enum AVPixelFormat ffmpeg_id; + int lqt_id; + int exact; + } + colormodels[] = + { +- { PIX_FMT_YUV420P, BC_YUV420P, 1 }, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples) ++ { AV_PIX_FMT_YUV420P, BC_YUV420P, 1 }, ///< Planar YUV 4:2:0 (1 Cr & Cb sample per 2x2 Y samples) + #if LIBAVUTIL_VERSION_INT < (50<<16) +- { PIX_FMT_YUV422, BC_YUV422, 1 }, ++ { AV_PIX_FMT_YUV422, BC_YUV422, 1 }, + #else +- { PIX_FMT_YUYV422, BC_YUV422, 1 }, ++ { AV_PIX_FMT_YUYV422, BC_YUV422, 1 }, + #endif +- { PIX_FMT_RGB24, BC_RGB888, 1 }, ///< Packed pixel, 3 bytes per pixel, RGBRGB... +- { PIX_FMT_BGR24, BC_BGR888, 1 }, ///< Packed pixel, 3 bytes per pixel, BGRBGR... +- { PIX_FMT_YUV422P, BC_YUV422P, 1 }, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) +- { PIX_FMT_YUV444P, BC_YUV444P, 1 }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples) +- { PIX_FMT_YUV411P, BC_YUV411P, 1 }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples) +- { PIX_FMT_YUV422P16, BC_YUV422P16, 1 }, ///< Planar 16 bit YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) +-#ifdef PIX_FMT_YUV422P10 +- { PIX_FMT_YUV422P10, BC_YUV422P10, 1 }, ///< 10 bit samples in uint16_t containers, planar 4:2:2 +-#endif +- { PIX_FMT_RGB565, BC_RGB565, 1 }, ///< always stored in cpu endianness +- { PIX_FMT_YUVJ420P, BC_YUVJ420P, 1 }, ///< Planar YUV 4:2:0 full scale (jpeg) +- { PIX_FMT_YUVJ422P, BC_YUVJ422P, 1 }, ///< Planar YUV 4:2:2 full scale (jpeg) +- { PIX_FMT_YUVJ444P, BC_YUVJ444P, 1 }, ///< Planar YUV 4:4:4 full scale (jpeg) ++ { AV_PIX_FMT_RGB24, BC_RGB888, 1 }, ///< Packed pixel, 3 bytes per pixel, RGBRGB... ++ { AV_PIX_FMT_BGR24, BC_BGR888, 1 }, ///< Packed pixel, 3 bytes per pixel, BGRBGR... ++ { AV_PIX_FMT_YUV422P, BC_YUV422P, 1 }, ///< Planar YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) ++ { AV_PIX_FMT_YUV444P, BC_YUV444P, 1 }, ///< Planar YUV 4:4:4 (1 Cr & Cb sample per 1x1 Y samples) ++ { AV_PIX_FMT_YUV411P, BC_YUV411P, 1 }, ///< Planar YUV 4:1:1 (1 Cr & Cb sample per 4x1 Y samples) ++ { AV_PIX_FMT_YUV422P16, BC_YUV422P16, 1 }, ///< Planar 16 bit YUV 4:2:2 (1 Cr & Cb sample per 2x1 Y samples) ++#ifdef AV_PIX_FMT_YUV422P10 ++ { AV_PIX_FMT_YUV422P10, BC_YUV422P10, 1 }, ///< 10 bit samples in uint16_t containers, planar 4:2:2 ++#endif ++ { AV_PIX_FMT_RGB565, BC_RGB565, 1 }, ///< always stored in cpu endianness ++ { AV_PIX_FMT_YUVJ420P, BC_YUVJ420P, 1 }, ///< Planar YUV 4:2:0 full scale (jpeg) ++ { AV_PIX_FMT_YUVJ422P, BC_YUVJ422P, 1 }, ///< Planar YUV 4:2:2 full scale (jpeg) ++ { AV_PIX_FMT_YUVJ444P, BC_YUVJ444P, 1 }, ///< Planar YUV 4:4:4 full scale (jpeg) + #if LIBAVUTIL_VERSION_INT < (50<<16) +- { PIX_FMT_RGBA32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA... ++ { AV_PIX_FMT_RGBA32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA... + #else +- { PIX_FMT_RGB32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA... ++ { AV_PIX_FMT_RGB32, BC_RGBA8888, 0 }, ///< Packed pixel, 4 bytes per pixel, BGRABGRA... + #endif +- { PIX_FMT_RGB555, BC_RGB888, 0 }, ///< always stored in cpu endianness, most significant bit to 1 +- { PIX_FMT_GRAY8, BC_RGB888, 0 }, +- { PIX_FMT_MONOWHITE, BC_RGB888, 0 }, ///< 0 is white +- { PIX_FMT_MONOBLACK, BC_RGB888, 0 }, ///< 0 is black +- { PIX_FMT_PAL8, BC_RGB888, 0 }, ///< 8 bit with RGBA palette +- { PIX_FMT_YUV410P, BC_YUV420P, 0 }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples) ++ { AV_PIX_FMT_RGB555, BC_RGB888, 0 }, ///< always stored in cpu endianness, most significant bit to 1 ++ { AV_PIX_FMT_GRAY8, BC_RGB888, 0 }, ++ { AV_PIX_FMT_MONOWHITE, BC_RGB888, 0 }, ///< 0 is white ++ { AV_PIX_FMT_MONOBLACK, BC_RGB888, 0 }, ///< 0 is black ++ { AV_PIX_FMT_PAL8, BC_RGB888, 0 }, ///< 8 bit with RGBA palette ++ { AV_PIX_FMT_YUV410P, BC_YUV420P, 0 }, ///< Planar YUV 4:1:0 (1 Cr & Cb sample per 4x4 Y samples) + }; + + static const struct +@@ -343,16 +343,16 @@ + if (!codec->pix_fmts) + return 0; + +- for (i = 0; codec->pix_fmts[i] != PIX_FMT_NONE; ++i) ++ for (i = 0; codec->pix_fmts[i] != AV_PIX_FMT_NONE; ++i) + { +- if (codec->pix_fmts[i] == PIX_FMT_YUV422P10_OR_DUMMY) ++ if (codec->pix_fmts[i] == AV_PIX_FMT_YUV422P10_OR_DUMMY) + return 1; + } + + return 0; + } + +-static enum PixelFormat lqt_ffmpeg_get_ffmpeg_colormodel(int id) ++static enum AVPixelFormat lqt_ffmpeg_get_ffmpeg_colormodel(int id) + { + int i; + +@@ -361,10 +361,10 @@ + if(colormodels[i].lqt_id == id) + return colormodels[i].ffmpeg_id; + } +- return PIX_FMT_NB; ++ return AV_PIX_FMT_NB; + } + +-static int lqt_ffmpeg_get_lqt_colormodel(enum PixelFormat id, int * exact) ++static int lqt_ffmpeg_get_lqt_colormodel(enum AVPixelFormat id, int * exact) + { + int i; + +@@ -400,26 +400,26 @@ + codec->reinterpret_pix_fmt = codec->avctx->pix_fmt; + + /* First we try codec-specific colormodel matching. */ +- if(codec->decoder->id == CODEC_ID_DNXHD) ++ if(codec->decoder->id == AV_CODEC_ID_DNXHD) + { +- /* FFMpeg supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10 for DNxHD, which +- we sometimes interpret as PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10. */ +- if (codec->avctx->pix_fmt == PIX_FMT_YUV422P || codec->avctx->pix_fmt == PIX_FMT_YUV422P10_OR_DUMMY) ++ /* FFMpeg supports AV_PIX_FMT_YUV422P and AV_PIX_FMT_YUV422P10 for DNxHD, which ++ we sometimes interpret as AV_PIX_FMT_YUVJ422P and AV_PIX_FMT_YUVJ422P10. */ ++ if (codec->avctx->pix_fmt == AV_PIX_FMT_YUV422P || codec->avctx->pix_fmt == AV_PIX_FMT_YUV422P10_OR_DUMMY) + { +- int p10 = (codec->avctx->pix_fmt == PIX_FMT_YUV422P10_OR_DUMMY); ++ int p10 = (codec->avctx->pix_fmt == AV_PIX_FMT_YUV422P10_OR_DUMMY); + *exact = 1; + if (lqt_ffmpeg_get_avid_yuv_range(vtrack->track) == AVID_FULL_YUV_RANGE) + { + vtrack->stream_cmodel = p10 ? BC_YUVJ422P10 : BC_YUVJ422P; +- codec->reinterpret_pix_fmt = p10 ? PIX_FMT_YUV422P10_OR_DUMMY : PIX_FMT_YUVJ422P; +- // Note: reinterpret_pix_fmt should really be PIX_FMT_YUVJ422P10, except ++ codec->reinterpret_pix_fmt = p10 ? AV_PIX_FMT_YUV422P10_OR_DUMMY : AV_PIX_FMT_YUVJ422P; ++ // Note: reinterpret_pix_fmt should really be AV_PIX_FMT_YUVJ422P10, except + // there is no such colormodel in FFMpeg. Fortunately, it's not a problem + // in this case, as reinterpret_pix_fmt is only used when *exact == 0. + } + else + { + vtrack->stream_cmodel = p10 ? BC_YUV422P10 : BC_YUV422P; +- codec->reinterpret_pix_fmt = p10 ? PIX_FMT_YUV422P10_OR_DUMMY : PIX_FMT_YUV422P; ++ codec->reinterpret_pix_fmt = p10 ? AV_PIX_FMT_YUV422P10_OR_DUMMY : AV_PIX_FMT_YUV422P; + } + return; + } +@@ -438,16 +438,16 @@ + quicktime_ffmpeg_video_codec_t *codec = vtrack->codec->priv; + codec->avctx->pix_fmt = lqt_ffmpeg_get_ffmpeg_colormodel(vtrack->stream_cmodel); + +- if (codec->encoder->id == CODEC_ID_DNXHD) ++ if (codec->encoder->id == AV_CODEC_ID_DNXHD) + { +- /* FFMpeg's DNxHD encoder only supports PIX_FMT_YUV422P and PIX_FMT_YUV422P10 +- and doesn't know anything about PIX_FMT_YUVJ422P and PIX_FMT_YUVJ422P10 ++ /* FFMpeg's DNxHD encoder only supports AV_PIX_FMT_YUV422P and AV_PIX_FMT_YUV422P10 ++ and doesn't know anything about AV_PIX_FMT_YUVJ422P and AV_PIX_FMT_YUVJ422P10 + (in fact, the latter doesn't even exist) */ +- codec->avctx->pix_fmt = PIX_FMT_YUV422P; ++ codec->avctx->pix_fmt = AV_PIX_FMT_YUV422P; + if (vtrack->stream_cmodel == BC_YUV422P10 || vtrack->stream_cmodel == BC_YUVJ422P10) + { + if (lqt_tenbit_dnxhd_supported(codec->encoder)) +- codec->avctx->pix_fmt = PIX_FMT_YUV422P10_OR_DUMMY; ++ codec->avctx->pix_fmt = AV_PIX_FMT_YUV422P10_OR_DUMMY; + } + } + } +@@ -458,7 +458,7 @@ + /* From avcodec.h: */ + + /* +- * PIX_FMT_RGBA32 is handled in an endian-specific manner. A RGBA ++ * AV_PIX_FMT_RGBA32 is handled in an endian-specific manner. A RGBA + * color is put together as: + * (A << 24) | (R << 16) | (G << 8) | B + * This is stored as BGRA on little endian CPU architectures and ARGB on +@@ -530,7 +530,7 @@ + */ + + static void convert_image_decode(quicktime_ffmpeg_video_codec_t *codec, +- AVFrame * in_frame, enum PixelFormat in_format, ++ AVFrame * in_frame, enum AVPixelFormat in_format, + unsigned char ** out_frame, int out_format, + int width, int height, int row_span, int row_span_uv) + { +@@ -547,9 +547,9 @@ + * RGBA format like in ffmpeg?? + */ + #if LIBAVUTIL_VERSION_INT < (50<<16) +- if((in_format == PIX_FMT_RGBA32) && (out_format == BC_RGBA8888)) ++ if((in_format == AV_PIX_FMT_RGBA32) && (out_format == BC_RGBA8888)) + #else +- if((in_format == PIX_FMT_RGB32) && (out_format == BC_RGBA8888)) ++ if((in_format == AV_PIX_FMT_RGB32) && (out_format == BC_RGBA8888)) + #endif + { + convert_image_decode_rgba(in_frame, out_frame, width, height, codec->y_offset); +@@ -728,13 +728,13 @@ + + /* Set extradata: It's done differently for each codec */ + +- if(codec->decoder->id == CODEC_ID_SVQ3) ++ if(codec->decoder->id == AV_CODEC_ID_SVQ3) + { + extradata = trak->mdia.minf.stbl.stsd.table[0].table_raw + 4; + extradata_size = trak->mdia.minf.stbl.stsd.table[0].table_raw_size - 4; + + } +- else if(codec->decoder->id == CODEC_ID_H264) ++ else if(codec->decoder->id == AV_CODEC_ID_H264) + { + user_atom = quicktime_stsd_get_user_atom(trak, "avcC", &user_atom_len); + +@@ -753,7 +753,7 @@ + } + + } +- else if(codec->decoder->id == CODEC_ID_MPEG4) ++ else if(codec->decoder->id == AV_CODEC_ID_MPEG4) + { + if(trak->mdia.minf.stbl.stsd.table[0].has_esds) + { +@@ -781,7 +781,7 @@ + if(extradata) + { + codec->extradata = +- calloc(1, extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); ++ calloc(1, extradata_size + AV_INPUT_BUFFER_PADDING_SIZE); + memcpy(codec->extradata, extradata, extradata_size); + codec->avctx->extradata_size = extradata_size; + codec->avctx->extradata = codec->extradata; +@@ -829,7 +829,7 @@ + if(avcodec_open2(codec->avctx, codec->decoder, NULL) != 0) + return -1; + #endif +- codec->frame = avcodec_alloc_frame(); ++ codec->frame = av_frame_alloc(); + vtrack->stream_cmodel = LQT_COLORMODEL_NONE; + codec->initialized = 1; + } +@@ -929,10 +929,10 @@ + #ifdef HAVE_LIBSWSCALE + + #if LIBAVUTIL_VERSION_INT < (50<<16) +- if(!((codec->avctx->pix_fmt == PIX_FMT_RGBA32) && ++ if(!((codec->avctx->pix_fmt == AV_PIX_FMT_RGBA32) && + (vtrack->stream_cmodel == BC_RGBA8888))) + #else +- if(!((codec->avctx->pix_fmt == PIX_FMT_RGB32) && ++ if(!((codec->avctx->pix_fmt == AV_PIX_FMT_RGB32) && + (vtrack->stream_cmodel == BC_RGBA8888))) + #endif + { +@@ -947,15 +947,15 @@ + } + #endif + } +- if(codec->decoder->id == CODEC_ID_DVVIDEO) ++ if(codec->decoder->id == AV_CODEC_ID_DVVIDEO) + { + if(vtrack->stream_cmodel == BC_YUV420P) + vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_DVPAL; + vtrack->interlace_mode = LQT_INTERLACE_BOTTOM_FIRST; + vtrack->ci.id = LQT_COMPRESSION_DV; + } +- else if((codec->decoder->id == CODEC_ID_MPEG4) || +- (codec->decoder->id == CODEC_ID_H264)) ++ else if((codec->decoder->id == AV_CODEC_ID_MPEG4) || ++ (codec->decoder->id == AV_CODEC_ID_H264)) + { + if(vtrack->stream_cmodel == BC_YUV420P) + vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_MPEG2; +@@ -1140,8 +1140,8 @@ + codec->avctx->qmin = 1; + codec->avctx->qmax = 3; + codec->avctx->rtp_payload_size = 1; // ?? +- codec->avctx->rc_buffer_aggressivity = 0.25; +- codec->avctx->flags |= CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_LOW_DELAY; ++ av_dict_set(&codec->options, "rc_buf_aggressivity", "0.25", 0); ++ codec->avctx->flags |= AV_CODEC_FLAG_INTERLACED_DCT|AV_CODEC_FLAG_LOW_DELAY; + + #if (LIBAVCODEC_VERSION_MAJOR < 54) + codec->avctx->flags2 |= CODEC_FLAG2_INTRA_VLC|CODEC_FLAG2_NON_LINEAR_QUANT; +@@ -1299,13 +1299,13 @@ + { + if(vtrack->stream_cmodel == BC_YUV420P) + { +- if(codec->encoder->id == CODEC_ID_MPEG4) ++ if(codec->encoder->id == AV_CODEC_ID_MPEG4) + { + vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_MPEG2; + /* enable interlaced encoding */ + vtrack->interlace_mode = LQT_INTERLACE_NONE; + } +- else if(codec->encoder->id == CODEC_ID_DVVIDEO) ++ else if(codec->encoder->id == AV_CODEC_ID_DVVIDEO) + { + vtrack->chroma_placement = LQT_CHROMA_PLACEMENT_DVPAL; + } +@@ -1318,7 +1318,7 @@ + + if(!codec->initialized) + { +- codec->frame = avcodec_alloc_frame(); ++ codec->frame = av_frame_alloc(); + + /* time_base is 1/framerate for constant framerate */ + +@@ -1328,7 +1328,7 @@ + // codec->avctx->time_base.den = 1; + // codec->avctx->time_base.num = lqt_video_time_scale(file, track); + +- if(codec->avctx->flags & CODEC_FLAG_QSCALE) ++ if(codec->avctx->flags & AV_CODEC_FLAG_QSCALE) + codec->avctx->global_quality = codec->qscale; + + codec->avctx->width = width; +@@ -1340,11 +1340,11 @@ + codec->avctx->sample_aspect_ratio.num = pixel_width; + codec->avctx->sample_aspect_ratio.den = pixel_height; + /* Use global headers for mp4v */ +- if(codec->encoder->id == CODEC_ID_MPEG4) ++ if(codec->encoder->id == AV_CODEC_ID_MPEG4) + { + if(!(file->file_type & (LQT_FILE_AVI|LQT_FILE_AVI_ODML))) + { +- codec->avctx->flags |= CODEC_FLAG_GLOBAL_HEADER; ++ codec->avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + codec->write_global_header = 1; + } + +@@ -1360,16 +1360,16 @@ + { + lqt_log(file, LQT_LOG_INFO, LOG_DOMAIN, "Enabling interlaced encoding"); + codec->avctx->flags |= +- (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME|CODEC_FLAG_ALT_SCAN); ++ (AV_CODEC_FLAG_INTERLACED_DCT|AV_CODEC_FLAG_INTERLACED_ME|AV_CODEC_FLAG_ALT_SCAN); + } + #endif + } +- else if((codec->encoder->id == CODEC_ID_MSMPEG4V3) && (trak->strl) && ++ else if((codec->encoder->id == AV_CODEC_ID_MSMPEG4V3) && (trak->strl) && + !strncmp(trak->strl->strf.bh.biCompression, "DIV3", 4)) + { + strncpy(trak->strl->strh.fccHandler, "div3", 4); + } +- else if((codec->encoder->id == CODEC_ID_H263) && ++ else if((codec->encoder->id == AV_CODEC_ID_H263) && + (file->file_type & (LQT_FILE_MP4|LQT_FILE_3GP))) + { + uint8_t d263_data[] = +@@ -1383,34 +1383,34 @@ + strncpy(trak->mdia.minf.stbl.stsd.table[0].format, + "s263", 4); + } +- else if(codec->encoder->id == CODEC_ID_FFVHUFF) ++ else if(codec->encoder->id == AV_CODEC_ID_FFVHUFF) + { + if(!(file->file_type & (LQT_FILE_AVI|LQT_FILE_AVI_ODML))) + { +- codec->avctx->flags |= CODEC_FLAG_GLOBAL_HEADER; ++ codec->avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; + codec->write_global_header = 1; + } + } +- else if(codec->encoder->id == CODEC_ID_QTRLE) ++ else if(codec->encoder->id == AV_CODEC_ID_QTRLE) + { + if(vtrack->stream_cmodel == BC_RGBA8888) + { + /* Libquicktime doesn't natively support a color model equivalent +- to PIX_FMT_ARGB, which is required for QTRLE with alpha channel. ++ to AV_PIX_FMT_ARGB, which is required for QTRLE with alpha channel. + So, we use BC_RGBA8888 and do ad hoc conversion below. */ +- codec->avctx->pix_fmt = PIX_FMT_ARGB; ++ codec->avctx->pix_fmt = AV_PIX_FMT_ARGB; + vtrack->track->mdia.minf.stbl.stsd.table[0].depth = 32; + } + } +- else if(codec->encoder->id == CODEC_ID_DVVIDEO) ++ else if(codec->encoder->id == AV_CODEC_ID_DVVIDEO) + { + set_dv_fourcc(width, height, vtrack->stream_cmodel, trak); + } +- else if(codec->encoder->id == CODEC_ID_DNXHD) ++ else if(codec->encoder->id == AV_CODEC_ID_DNXHD) + { + if(vtrack->interlace_mode != LQT_INTERLACE_NONE) + { +- codec->avctx->flags |= CODEC_FLAG_INTERLACED_DCT; ++ codec->avctx->flags |= AV_CODEC_FLAG_INTERLACED_DCT; + } + } + else if(codec->is_imx) +@@ -1422,7 +1422,7 @@ + if(codec->pass == 1) + { + codec->stats_file = fopen(codec->stats_filename, "w"); +- codec->avctx->flags |= CODEC_FLAG_PASS1; ++ codec->avctx->flags |= AV_CODEC_FLAG_PASS1; + } + else if(codec->pass == codec->total_passes) + { +@@ -1438,7 +1438,7 @@ + fclose(codec->stats_file); + codec->stats_file = (FILE*)0; + +- codec->avctx->flags |= CODEC_FLAG_PASS2; ++ codec->avctx->flags |= AV_CODEC_FLAG_PASS2; + } + } + /* Open codec */ +@@ -1467,7 +1467,7 @@ + } + // codec->lqt_colormodel = ffmepg_2_lqt(codec->com.ffcodec_enc); + +- if(codec->y_offset != 0 || codec->avctx->pix_fmt == PIX_FMT_ARGB) ++ if(codec->y_offset != 0 || codec->avctx->pix_fmt == AV_PIX_FMT_ARGB) + { + if(!codec->tmp_rows) + { +@@ -1492,7 +1492,7 @@ + vtrack->stream_cmodel, + 0, 0, 0, codec->y_offset); + } +- else if(codec->avctx->pix_fmt == PIX_FMT_ARGB) ++ else if(codec->avctx->pix_fmt == AV_PIX_FMT_ARGB) + { + convert_rgba_to_argb(row_pointers[0], vtrack->stream_row_span, + codec->tmp_rows[0], codec->tmp_row_span, +@@ -1516,7 +1516,7 @@ + } + + codec->frame->pts = vtrack->timestamp; +- if(codec->avctx->flags & CODEC_FLAG_QSCALE) ++ if(codec->avctx->flags & AV_CODEC_FLAG_QSCALE) + codec->frame->quality = codec->qscale; + #ifdef DO_INTERLACE + if(vtrack->interlace_mode != LQT_INTERLACE_NONE) +@@ -1558,12 +1558,12 @@ + + #endif + +- if(!was_initialized && codec->encoder->id == CODEC_ID_DNXHD) ++ if(!was_initialized && codec->encoder->id == AV_CODEC_ID_DNXHD) + setup_avid_atoms(file, vtrack, codec->buffer, bytes_encoded); + + if(bytes_encoded) + { +- if (pts == AV_NOPTS_VALUE || (codec->encoder->id == CODEC_ID_DNXHD && pts == 0)) ++ if (pts == AV_NOPTS_VALUE || (codec->encoder->id == AV_CODEC_ID_DNXHD && pts == 0)) + { + /* Some codecs don't bother generating presentation timestamps. + FFMpeg's DNxHD encoder doesn't even bother to set it to AV_NOPTS_VALUE. */ +@@ -1590,17 +1590,16 @@ + + if(codec->write_global_header && !codec->global_header_written) + { +- if(codec->encoder->id == CODEC_ID_FFVHUFF) ++ if(codec->encoder->id == AV_CODEC_ID_FFVHUFF) + { + quicktime_user_atoms_add_atom(&trak->mdia.minf.stbl.stsd.table[0].user_atoms, + "glbl", + codec->avctx->extradata, codec->avctx->extradata_size ); + } +- else if(codec->encoder->id == CODEC_ID_MPEG4) ++ else if(codec->encoder->id == AV_CODEC_ID_MPEG4) + { + int advanced = 0; +- if(codec->avctx->max_b_frames || +- (codec->avctx->flags & (CODEC_FLAG_QPEL|CODEC_FLAG_GMC))) ++ if(codec->avctx->max_b_frames) + advanced = 1; + + setup_header_mpeg4(file, track, codec->avctx->extradata, +@@ -1903,18 +1902,18 @@ + codec_base->encode_video = lqt_ffmpeg_encode_video; + codec_base->set_pass = set_pass_ffmpeg; + +- if(encoder->id == CODEC_ID_MPEG4) ++ if(encoder->id == AV_CODEC_ID_MPEG4) + { + codec_base->writes_compressed = writes_compressed_mpeg4; + codec_base->init_compressed = init_compressed_mpeg4; + codec_base->write_packet = write_packet_mpeg4; + } +- else if(encoder->id == CODEC_ID_MPEG2VIDEO) ++ else if(encoder->id == AV_CODEC_ID_MPEG2VIDEO) + { + codec_base->writes_compressed = writes_compressed_imx; + codec_base->init_compressed = init_compressed_imx; + } +- else if(encoder->id == CODEC_ID_DVVIDEO) ++ else if(encoder->id == AV_CODEC_ID_DVVIDEO) + { + codec_base->init_compressed = init_compressed_dv; + } +@@ -1922,7 +1921,7 @@ + } + if(decoder) + { +- if(decoder->id == CODEC_ID_H264) ++ if(decoder->id == AV_CODEC_ID_H264) + codec_base->read_packet = read_packet_h264; + codec_base->decode_video = lqt_ffmpeg_decode_video; + } +diff -Naur a/src/util.c b/src/util.c +--- a/src/util.c 2011-01-07 14:40:47.000000000 +0000 ++++ b/src/util.c 2018-05-11 23:11:04.367991499 +0100 +@@ -340,9 +340,14 @@ + + void quicktime_read_pascal(quicktime_t *file, char *data) + { +- char len = quicktime_read_char(file); +- quicktime_read_data(file, (uint8_t*)data, len); +- data[(int)len] = 0; ++ int len = quicktime_read_char(file); ++ if ((len > 0) && (len < 256)) { ++ /* data[] is expected to be 256 bytes long */ ++ quicktime_read_data(file, (uint8_t*)data, len); ++ data[len] = 0; ++ } else { ++ data[0] = 0; ++ } + } + + void quicktime_write_pascal(quicktime_t *file, char *data) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 1133321ffc..331a5a3210 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -221,6 +221,46 @@ as a joint effort between the BBC and Fluendo.") license:expat license:mpl1.1)))) +(define-public libquicktime + (package + (name "libquicktime") + (version "1.2.4") + (source + (origin + (method url-fetch) + (uri + (string-append "https://sourceforge.net/projects/" name "/files/" + name "/" version "/" name "-" version ".tar.gz")) + (sha256 + (base32 "0s3kshzl3zfjw3phzv73r91fkr9z8q8kc3dhsys4f4xk6ff3alqw")) + (patches + (search-patches "libquicktime-ffmpeg.patch")))) + (build-system gnu-build-system) + (native-inputs + `(("gettext" ,gettext-minimal) + ("doxygen" ,doxygen) + ("pkg-config" ,pkg-config))) + (inputs + `(("alsa" ,alsa-lib) + ("ffmpeg" ,ffmpeg) + ("gtk+-2" ,gtk+-2) + ("lame" ,lame) + ("libdv" ,libdv) + ("libjpeg" ,libjpeg-turbo) + ("libpng" ,libpng) + ("libvorbis" ,libvorbis) + ("opengl" ,mesa) + ("schroedinger" ,schroedinger) + ("x11" ,libx11) + ("x264" ,libx264) + ("xaw" ,libxaw) + ("xv" ,libxv))) + (synopsis "Quick Time Library") + (description "The goal of this project is to enhance the quicktime4linux +library.") + (home-page "http://libquicktime.sourceforge.net/") + (license license:lgpl2.1+))) + (define-public libmms (package (name "libmms") -- cgit v1.2.3 From 38375ce952902931f626ce6440368dee1ff4f68c Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Fri, 3 Jul 2020 09:16:01 -0400 Subject: gnu: Add libofa. * gnu/packages/audio.scm (libofa): New variable. * gnu/packages/patches/libofa-ftbfs-1.diff: New file. * gnu/packages/patches/libofa-curl.diff: New file. * gnu/packages/patches/libofa-ftbfs-2.diff: New file. * gnu/local.mk (dist_patch_DATA): Add them. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 3 +++ gnu/packages/audio.scm | 32 +++++++++++++++++++++++ gnu/packages/patches/libofa-curl.diff | 15 +++++++++++ gnu/packages/patches/libofa-ftbfs-1.diff | 45 ++++++++++++++++++++++++++++++++ gnu/packages/patches/libofa-ftbfs-2.diff | 27 +++++++++++++++++++ 5 files changed, 122 insertions(+) create mode 100644 gnu/packages/patches/libofa-curl.diff create mode 100644 gnu/packages/patches/libofa-ftbfs-1.diff create mode 100644 gnu/packages/patches/libofa-ftbfs-2.diff (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d61f272f3e..2a2ac2fa62 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1216,6 +1216,9 @@ dist_patch_DATA = \ %D%/packages/patches/libgnomeui-utf8.patch \ %D%/packages/patches/libjxr-fix-function-signature.patch \ %D%/packages/patches/libjxr-fix-typos.patch \ + %D%/packages/patches/libofa-ftbfs-1.diff \ + %D%/packages/patches/libofa-curl.diff \ + %D%/packages/patches/libofa-ftbfs-2.diff \ %D%/packages/patches/libotr-test-auth-fix.patch \ %D%/packages/patches/libksieve-Fix-missing-link-libraries.patch \ %D%/packages/patches/libmad-armv7-thumb-pt1.patch \ diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index d2ffa54e83..f3e94e8eb0 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -128,6 +128,38 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26)) +(define-public libofa + (package + (name "libofa") + (version "0.9.3") + (source + (origin + (method url-fetch) + (uri + (string-append "https://storage.googleapis.com/" + "google-code-archive-downloads/v2/code.google.com/" + "musicip-libofa/" name "-" version ".tar.gz")) + (sha256 + (base32 "184ham039l7lwhfgg0xr2vch2xnw1lwh7sid432mh879adhlc5h2")) + (patches + (search-patches + "libofa-ftbfs-1.diff" + "libofa-curl.diff" + "libofa-ftbfs-2.diff")))) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs + `(("curl" ,curl) + ("expat" ,expat))) + (propagated-inputs + `(("fftw" ,fftw))) + (synopsis "Open Fingerprint Architecture") + (description "LibOFA is an audio fingerprint library, created and provided +by MusicIP.") + (home-page "https://code.google.com/archive/p/musicip-libofa/") + (license license:gpl2+))) + (define-public faac (package (name "faac") diff --git a/gnu/packages/patches/libofa-curl.diff b/gnu/packages/patches/libofa-curl.diff new file mode 100644 index 0000000000..6b1e824fad --- /dev/null +++ b/gnu/packages/patches/libofa-curl.diff @@ -0,0 +1,15 @@ +Description: Fix FTBFS due to unexisting and useless include. (Closes: #637896) +Author: Regis Boudin +Last-Update: 2011-10-03 +Index: libofa-0.9.3/examples/protocol.cpp +=================================================================== +--- libofa-0.9.3.orig/examples/protocol.cpp ++++ libofa-0.9.3/examples/protocol.cpp +@@ -13,7 +13,6 @@ + #include + #include + #include +-#include + #include + + using namespace std; diff --git a/gnu/packages/patches/libofa-ftbfs-1.diff b/gnu/packages/patches/libofa-ftbfs-1.diff new file mode 100644 index 0000000000..4aa712320c --- /dev/null +++ b/gnu/packages/patches/libofa-ftbfs-1.diff @@ -0,0 +1,45 @@ +Description: fix FTBFS with GCC 4.3. (Closes: #417355) +Author: Martin Michlmayr +Last-Update: 2007-04-02 + +Description: add a missing include. (Closes: #441557) +Author: Brian M. Carlson +Last-Update: 2007-12-29 + +Index: libofa-0.9.3/lib/signal_op.cpp +=================================================================== +--- libofa-0.9.3.orig/lib/signal_op.cpp ++++ libofa-0.9.3/lib/signal_op.cpp +@@ -12,6 +12,7 @@ + // DATE CREATED: 1/12/06 + + ++#include + #include + #include "signal_op.h" + #include "AFLIB/aflibConverter.h" +Index: libofa-0.9.3/examples/example.cpp +=================================================================== +--- libofa-0.9.3.orig/examples/example.cpp ++++ libofa-0.9.3/examples/example.cpp +@@ -8,6 +8,8 @@ + -------------------------------------------------------------------*/ + + #include "protocol.h" ++#include ++#include + + AudioData* loadWaveFile(char *file); + AudioData* loadDataUsingLAME(char *file); +Index: libofa-0.9.3/examples/protocol.cpp +=================================================================== +--- libofa-0.9.3.orig/examples/protocol.cpp ++++ libofa-0.9.3/examples/protocol.cpp +@@ -8,6 +8,7 @@ + -------------------------------------------------------------------*/ + #include + #include ++#include + #include + #include + #include diff --git a/gnu/packages/patches/libofa-ftbfs-2.diff b/gnu/packages/patches/libofa-ftbfs-2.diff new file mode 100644 index 0000000000..ad61573578 --- /dev/null +++ b/gnu/packages/patches/libofa-ftbfs-2.diff @@ -0,0 +1,27 @@ +Description: ftbfs with GCC-4.7. (Closes: #667250) +Author: Matthias Klose +Last-Update: 2012-04-17 +Index: libofa-0.9.3/examples/uselame.cpp +=================================================================== +--- libofa-0.9.3.orig/examples/uselame.cpp ++++ libofa-0.9.3/examples/uselame.cpp +@@ -11,6 +11,7 @@ + #include "windows.h" + #else + #include ++#include + #endif + + AudioData *loadWaveFile(char *file); +Index: libofa-0.9.3/examples/wavefile.cpp +=================================================================== +--- libofa-0.9.3.orig/examples/wavefile.cpp ++++ libofa-0.9.3/examples/wavefile.cpp +@@ -11,6 +11,7 @@ + #include "io.h" + #endif + #include ++#include + + static bool readBytes(int fd, unsigned char *buf, int size) { + int ct = 0; -- cgit v1.2.3 From 08d048a06bf94b7b043b4ae0ef01b67c0241cb01 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Mon, 6 Jul 2020 00:45:47 -0400 Subject: gnu: Add opensles. * gnu/packages/audio.scm (opensles): New variable. * gnu/packages/patches/opensles-add-license-file.patch: New file. * gnu/local.mk (opensles-add-license-file.patch): New reference. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 1 + gnu/packages/audio.scm | 62 ++++++++++++++++++++++ .../patches/opensles-add-license-file.patch | 45 ++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 gnu/packages/patches/opensles-add-license-file.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 2a2ac2fa62..f7dcc8ab40 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1371,6 +1371,7 @@ dist_patch_DATA = \ %D%/packages/patches/openssh-hurd.patch \ %D%/packages/patches/openresolv-restartcmd-guix.patch \ %D%/packages/patches/openscad-parser-boost-1.72.patch \ + %D%/packages/patches/opensles-add-license-file.patch \ %D%/packages/patches/openssl-runpath.patch \ %D%/packages/patches/openssl-1.1-c-rehash-in.patch \ %D%/packages/patches/openssl-c-rehash-in.patch \ diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index 5516a5437e..2fe0678f46 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -129,6 +129,68 @@ #:use-module (srfi srfi-1) #:use-module (srfi srfi-26)) +(define-public opensles + (package + (name "opensles") + (version "1.1.0") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/KhronosGroup/OpenSL-ES-Registry.git") + (commit "ea5104bf37bf525c25e6ae2386586048179d0fda"))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0j5bm7h3ahz66f23i9abwc0y10agfkpksnj6y078x2nichq66h4f")) + (patches + (search-patches "opensles-add-license-file.patch")))) + (build-system copy-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'install 'clean + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (mkdir-p (string-append out "/etc")) + (mkdir-p (string-append out "/include")) + (mkdir-p (string-append out "/share")) + (rename-file + (string-append out "/api/1.1/OpenSLES_IID.c") + (string-append out "/etc/OpenSLES_IID.c")) + (rename-file + (string-append out "/api/1.1/OpenSLES.h") + (string-append out "/include/OpenSLES.h")) + (rename-file + (string-append out "/api/1.1/OpenSLES_Platform.h") + (string-append out "/include/OpenSLES_Platform.h")) + (rename-file + (string-append out "/api/1.1/README.txt") + (string-append out "/share/README.txt")) + (rename-file + (string-append out "/LICENSE.txt") + (string-append out "/share/LICENSE.txt")) + (for-each delete-file-recursively + (list + (string-append out "/api") + (string-append out "/specs"))) + (for-each delete-file + (list + (string-append out "/CODE_OF_CONDUCT.md") + (string-append out "/index.php") + (string-append out "/README.md")))) + #t))))) + (synopsis "Embedded Audio Acceleration") + (description "OpenSLES is a royalty-free, cross-platform, +hardware-accelerated audio API tuned for embedded systems. It provides a +standardized, high-performance, low-latency method to access audio +functionality for developers of native applications on embedded mobile +multimedia devices, enabling straightforward cross-platform deployment of +hardware and software audio capabilities, reducing implementation effort, and +promoting the market for advanced audio.") + (home-page "https://www.khronos.org/opensles/") + (license (license:non-copyleft "file:///LICENSE.txt")))) + (define-public wildmidi (package (name "wildmidi") diff --git a/gnu/packages/patches/opensles-add-license-file.patch b/gnu/packages/patches/opensles-add-license-file.patch new file mode 100644 index 0000000000..c638b3886a --- /dev/null +++ b/gnu/packages/patches/opensles-add-license-file.patch @@ -0,0 +1,45 @@ +From 3a78134a35b448d9d4136ffbc55175be7fab6644 Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +Date: Mon, 6 Jul 2020 00:34:20 -0400 +Subject: [PATCH] [PATCH]: Add license file. + +--- + LICENSE.txt | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + create mode 100644 LICENSE.txt + +diff --git a/LICENSE.txt b/LICENSE.txt +new file mode 100644 +index 0000000..0fce823 +--- /dev/null ++++ b/LICENSE.txt +@@ -0,0 +1,25 @@ ++/* ++ * Copyright (c) 2007-2011 The Khronos Group Inc. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a copy of ++ * this software and /or associated documentation files (the "Materials "), to ++ * deal in the Materials without restriction, including without limitation the ++ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Materials, and to permit persons to whom the Materials are ++ * furnished to do so, subject to ++ * the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included ++ * in all copies or substantial portions of the Materials. ++ * ++ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ * OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE ++ * MATERIALS. ++ * ++ * OpenSLES_IID.c - OpenSL ES version 1.1 ++ * ++ */ +\ No newline at end of file +-- +2.26.2 + -- cgit v1.2.3 From 8fd769ddc93215ab16712669e39214510eed8364 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Sun, 19 Jul 2020 06:54:46 -0400 Subject: gnu: Add dee. * gnu/packages/gnome.scm (dee): New variable. * gnu/packages/patches/dee-vapi.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 1 + gnu/packages/gnome.scm | 82 +++++++++++++++++++++++++++++++++++++ gnu/packages/patches/dee-vapi.patch | 15 +++++++ 3 files changed, 98 insertions(+) create mode 100644 gnu/packages/patches/dee-vapi.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index f7dcc8ab40..221a49e985 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -891,6 +891,7 @@ dist_patch_DATA = \ %D%/packages/patches/dconf-meson-0.52.patch \ %D%/packages/patches/debops-constants-for-external-program-names.patch \ %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \ + %D%/packages/patches/dee-vapi.patch \ %D%/packages/patches/desmume-gcc6-fixes.patch \ %D%/packages/patches/desmume-gcc7-fixes.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index bcc9c937e7..bca042266d 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -296,6 +296,88 @@ of writing test cases for asynchronous interactions.") (home-page "https://launchpad.net/gtx") (license license:lgpl2.1+))) +(define-public dee + (package + (name "dee") + (version "1.2.7") + (source + (origin + (method url-fetch) + (uri + (string-append "https://launchpad.net/dee/1.0/" + version "/+download/dee-" version ".tar.gz")) + (sha256 + (base32 "12mzffk0lyd566y46x57jlvb9af152b4dqpasr40zal4wrn37w0v")) + (patches + (search-patches "dee-vapi.patch")))) + (build-system glib-or-gtk-build-system) + (outputs '("out" "doc")) + (arguments + `(#:configure-flags + (list + "--disable-maintainer-flags" + (string-append "--with-pygi-overrides-dir=" + (assoc-ref %outputs "out") + "/lib/python" + ,(version-major+minor + (package-version python)) + "/site-packages/gi/overrides") + (string-append "--with-html-dir=" + (assoc-ref %outputs "doc") + "/share/gtk-doc/html")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "doc/reference/dee-1.0" + (substitute* "dee-1.0-docs.sgml" + (("http://www.oasis-open.org/docbook/xml/4.3/") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/")))) + #t)) + (add-after 'patch-docbook-xml 'disable-failing-tests + (lambda _ + (substitute* "tests/test-icu.c" + (("g_test_add \\(DOMAIN\"/Default/AsciiFolder\", Fixture, 0,") + "") + (("setup, test_ascii_folder, teardown\\);") + "")) + #t)) + (add-before 'check 'pre-check + (lambda _ + ;; Tests require a running dbus-daemon. + (system "dbus-daemon &") + ;; For missing '/etc/machine-id'. + (setenv "DBUS_FATAL_WARNINGS" "0") + #t))))) + (native-inputs + `(("dbus" ,dbus) + ("dbus-test-runner" ,dbus-test-runner) + ("docbook-xml" ,docbook-xml-4.3) + ("gobject-introspection" ,gobject-introspection) + ("gtk-doc" ,gtk-doc) + ;; Would only be required by configure flag "--enable-extended-tests". + ;("gtx" ,gtx) + ("pkg-config" ,pkg-config) + ("pygobject" ,python-pygobject) + ("python" ,python-wrapper) + ("vala" ,vala))) + (inputs + `(("icu" ,icu4c))) + (propagated-inputs + `(("glib" ,glib))) + (synopsis "Model to synchronize multiple instances over DBus") + (description "Dee is a library that uses DBus to provide objects allowing +you to create Model-View-Controller type programs across DBus. It also consists +of utility objects which extend DBus allowing for peer-to-peer discoverability +of known objects without needing a central registrar.") + (home-page "https://launchpad.net/dee") + (license + ;; Dual-licensed + (list + license:lgpl3+ + license:gpl3+)))) + (define-public libcloudproviders (package (name "libcloudproviders") diff --git a/gnu/packages/patches/dee-vapi.patch b/gnu/packages/patches/dee-vapi.patch new file mode 100644 index 0000000000..3a9353a521 --- /dev/null +++ b/gnu/packages/patches/dee-vapi.patch @@ -0,0 +1,15 @@ +Index: dee-1.2.7+17.10.20170616/vapi/Dee-1.0.metadata +=================================================================== +--- dee-1.2.7+17.10.20170616.orig/vapi/Dee-1.0.metadata ++++ dee-1.2.7+17.10.20170616/vapi/Dee-1.0.metadata +@@ -2,7 +2,9 @@ GListResultSet skip + GListResultSetClass skip + + FilterModel +- .filter unowned ++ .filter skip // unsupported type for construct property ++Index ++ .reader skip // unsupported type for construct property + Model + .append skip=false + .build_named_row skip -- cgit v1.2.3 From 77d7bbf4bdf75cbbc40c4ac6634b4a3e886a6362 Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Sat, 25 Jul 2020 09:01:19 -0400 Subject: gnu: Add seed. * gnu/packages/gnome.scm (seed): New variable. * gnu/packages/patches/seed-webkit.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 1 + gnu/packages/gnome.scm | 80 ++++++++++++++++++++++++++++++++++ gnu/packages/patches/seed-webkit.patch | 49 +++++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 gnu/packages/patches/seed-webkit.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 221a49e985..348db63188 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1551,6 +1551,7 @@ dist_patch_DATA = \ %D%/packages/patches/screen-hurd-path-max.patch \ %D%/packages/patches/scribus-1.5.5-poppler-0.86-build-fix.patch \ %D%/packages/patches/sdl-libx11-1.6.patch \ + %D%/packages/patches/seed-webkit.patch \ %D%/packages/patches/seq24-rename-mutex.patch \ %D%/packages/patches/sharutils-CVE-2018-1000097.patch \ %D%/packages/patches/shadow-hurd-pctrl.patch \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 563b259940..2abb73a175 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -292,6 +292,86 @@ bindings.") (home-page "https://wiki.gnome.org/Projects/Seed") (license license:gpl3+))) +(define-public seed + (package + (name "seed") + (version "3.8.1") + (source + (origin + (method url-fetch) + (uri + (string-append "mirror://gnome/sources/" name "/" + (version-major+minor version) "/" + name "-" version ".tar.xz")) + (sha256 + (base32 "0cmcxaggcdcy13j27gy8id2qsf2p2sl4bz2mwb9zhv3gzavlvjw0")) + (patches + (search-patches "seed-webkit.patch")))) + (build-system glib-or-gtk-build-system) + (outputs '("out" "doc")) + (arguments + `(#:configure-flags + (list + "--disable-static" + "--enable-xorg-module" + (string-append "--with-html-dir=" + (assoc-ref %outputs "doc") + "/share/gtk-doc/html") + "--with-webkit=4.0") + #:phases + (modify-phases %standard-phases + ;; The seed-webkit.patch patches configure.ac. + ;; So the source files need to be re-bootstrapped. + (add-after 'unpack 'trigger-bootstrap + (lambda _ + (for-each delete-file + (list + "configure" + "Makefile.in")) + #t)) + (add-before 'build 'patch-docbook-xml + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion "doc" + (substitute* '("reference/seed-docs.sgml" "modules/book.xml") + (("http://www.oasis-open.org/docbook/xml/4.1.2/") + (string-append (assoc-ref inputs "docbook-xml") + "/xml/dtd/docbook/")))) + #t))))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("docbook-xml" ,docbook-xml-4.1.2) + ("gettext" ,gettext-minimal) + ("gobject-introspection" ,gobject-introspection) + ("gtk-doc" ,gtk-doc) + ("intltool" ,intltool) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config))) + (inputs + `(("cairo" ,cairo) + ("dbus" ,dbus) + ("dbus-glib" ,dbus-glib) + ("gnome-js-common" ,gnome-js-common) + ("gtk+" ,gtk+) + ("gtk+-2" ,gtk+-2) + ("libffi" ,libffi) + ("libxml2" ,libxml2) + ("mpfr" ,mpfr) + ("readline" ,readline) + ("sqlite" ,sqlite) + ("xscrnsaver" ,libxscrnsaver))) + (propagated-inputs + `(("glib" ,glib) + ("webkit" ,webkitgtk))) + (synopsis "GObject JavaScriptCore bridge") + (description "Seed is a library and interpreter, dynamically bridging +(through GObjectIntrospection) the WebKit JavaScriptCore engine, with the +GNOME platform. It serves as something which enables you to write standalone +applications in JavaScript, or easily enable your application to be extensible +in JavaScript.") + (home-page "https://wiki.gnome.org/Projects/Seed") + (license license:lgpl2.0+))) + (define-public libdmapsharing (package (name "libdmapsharing") diff --git a/gnu/packages/patches/seed-webkit.patch b/gnu/packages/patches/seed-webkit.patch new file mode 100644 index 0000000000..55f15af12f --- /dev/null +++ b/gnu/packages/patches/seed-webkit.patch @@ -0,0 +1,49 @@ +From 6d512b5c4d774a9853b51dae464a10cea7e3423a Mon Sep 17 00:00:00 2001 +From: Peter Rustler +Date: Mon, 7 Dec 2015 11:40:05 +0000 +Subject: [PATCH] Add support for new webkit version 4.0 to build system + +Add new configure value for option --with-webkit. +Now you can add 4.0 as value to --with-webkit. +Default is still 3.0. + +https://bugzilla.gnome.org/show_bug.cgi?id=759171 +--- + configure.ac | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 2313c093..3d5d4823 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -77,12 +77,12 @@ dnl ==============================WebKit======================================= + m4_define([webkit_default], [3.0]) + + AC_ARG_WITH([webkit], +- [AC_HELP_STRING([--with-webkit=@<:@3.0/1.0@:>@], ++ [AC_HELP_STRING([--with-webkit=@<:@4.0/3.0/1.0@:>@], + [Select the Webkit backend, default=3.0])], + [], + [with_webkit=webkit_default]) + +-dnl=== support both 1.0 and 3.0 (default 3.0) == ++dnl=== support all 1.0, 3.0 and 4.0 (default 3.0) == + AS_CASE([$with_webkit], + [3.0], [ + WEBKIT_PC=webkitgtk-3.0 +@@ -90,6 +90,12 @@ AS_CASE([$with_webkit], + AC_CHECK_LIB(webkitgtk-3.0, JSContextGroupCreate,, + AC_CHECK_LIB(javascriptcoregtk-3.0, JSContextGroupCreate,WEBKIT_PC=javascriptcoregtk-3.0)) + ], ++ [4.0], [ ++ WEBKIT_PC=webkitgtk-4.0 ++ SEED_GTK_VERSION=-gtk4 ++ AC_CHECK_LIB(webkitgtk-4.0, JSContextGroupCreate,, ++ AC_CHECK_LIB(javascriptcoregtk-4.0, JSContextGroupCreate,WEBKIT_PC=javascriptcoregtk-4.0)) ++ ], + [1.0], [ + AC_CHECK_LIB(webkitgtk-1.0, JSContextGroupCreate,WEBKIT_PC=webkitgtk-1.0, + AC_CHECK_LIB(javascriptcoregtk-1.0, JSContextGroupCreate,WEBKIT_PC=javascriptcoregtk-1.0, +-- +GitLab + -- cgit v1.2.3 From 6a7256fc808e60ae671c1fdbac63961052a2cf1a Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Wed, 29 Jul 2020 12:50:18 -0400 Subject: gnu: Add ldns. * gnu/packages/dns.scm (ldns): New variable. * gnu/packages/patches/ldns-drill-examples.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 1 + gnu/packages/dns.scm | 87 ++++++++++++++++++++++++++ gnu/packages/patches/ldns-drill-examples.patch | 85 +++++++++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 gnu/packages/patches/ldns-drill-examples.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 348db63188..7e2f1003bb 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1199,6 +1199,7 @@ dist_patch_DATA = \ %D%/packages/patches/lcms-CVE-2018-16435.patch \ %D%/packages/patches/ldc-bootstrap-disable-tests.patch \ %D%/packages/patches/ldc-disable-phobos-tests.patch \ + %D%/packages/patches/ldns-drill-examples.patch \ %D%/packages/patches/leela-zero-gtest.patch \ %D%/packages/patches/less-hurd-path-max.patch \ %D%/packages/patches/lib2geom-fix-tests.patch \ diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm index 3c69fd9858..4639df96ed 100644 --- a/gnu/packages/dns.scm +++ b/gnu/packages/dns.scm @@ -38,6 +38,7 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages base) #:use-module (gnu packages bash) + #:use-module (gnu packages certs) #:use-module (gnu packages check) #:use-module (gnu packages databases) #:use-module (gnu packages documentation) @@ -62,6 +63,7 @@ #:use-module (gnu packages protobuf) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages shells) #:use-module (gnu packages sphinx) #:use-module (gnu packages swig) #:use-module (gnu packages tls) @@ -77,6 +79,91 @@ #:use-module (guix build-system meson) #:use-module (guix build-system trivial)) +(define-public ldns + (package + (name "ldns") + (version "1.7.1") + (source + (origin + (method url-fetch) + (uri + (string-append "https://www.nlnetlabs.nl/downloads/" + name "/" name "-" version ".tar.gz")) + (sha256 + (base32 "0ac242n7996fswq1a3nlh1bbbhrsdwsq4mx7xq8ffq6aplb4rj4a")) + (patches + (search-patches + ;; To create make-flag vairables, + ;; for splitting installation of drill and examples. + "ldns-drill-examples.patch")))) + (build-system gnu-build-system) + (outputs '("out" "drill" "examples" "pyldns")) + (arguments + `( ;; Tests require Tpkg. + ;; https://tpkg.github.io/ + #:tests? #f + #:configure-flags + (list + "--disable-static" + "--enable-gost-anyway" + "--enable-rrtype-ninfo" + "--enable-rrtype-rkey" + "--enable-rrtype-ta" + "--enable-rrtype-avc" + "--enable-rrtype-doa" + "--enable-rrtype-amtrelay" + "--with-drill" + "--with-examples" + "--with-pyldns" + ;; Perl module DNS::LDNS not available. + ;; https://github.com/erikoest/DNS-LDNS.git + ;; "--with-p5-dns-ldns" + (string-append "--with-ssl=" + (assoc-ref %build-inputs "openssl")) + (string-append "--with-ca-path=" + (assoc-ref %build-inputs "nss-certs") + "/etc/ssl/certs")) + #:make-flags + (list + (string-append "drillbindir=" + (assoc-ref %outputs "drill") + "/bin") + (string-append "drillmandir=" + (assoc-ref %outputs "drill") + "/share/man") + (string-append "examplesbindir=" + (assoc-ref %outputs "examples") + "/bin") + (string-append "examplesmandir=" + (assoc-ref %outputs "examples") + "/share/man") + (string-append "python_site=" + (assoc-ref %outputs "pyldns") + "/lib/python" + ,(version-major+minor + (package-version python)) + "/site-packages")))) + (native-inputs + `(("doxygen" ,doxygen) + ("ksh" ,oksh) + ("perl" ,perl) + ("perl-devel-checklib" ,perl-devel-checklib) + ("pkg-config" ,pkg-config) + ("python" ,python-wrapper) + ("swig" ,swig))) + (inputs + `(("libpcap" ,libpcap) + ("nss-certs" ,nss-certs) + ("openssl" ,openssl))) + (synopsis "DNS library that facilitates DNS tool programming") + (description "LDNS aims to simplify DNS programming, it supports recent +RFCs like the DNSSEC documents, and allows developers to easily create +software conforming to current RFCs, and experimental software for current +Internet Drafts. A secondary benefit of using ldns is speed; ldns is written in +C it should be a lot faster than Perl.") + (home-page "https://nlnetlabs.nl/projects/ldns/about/") + (license license:bsd-3))) + (define-public dnsmasq (package (name "dnsmasq") diff --git a/gnu/packages/patches/ldns-drill-examples.patch b/gnu/packages/patches/ldns-drill-examples.patch new file mode 100644 index 0000000000..f85e14cebe --- /dev/null +++ b/gnu/packages/patches/ldns-drill-examples.patch @@ -0,0 +1,85 @@ +From 68916cd7ffb49ece9126d13ef984595595a156c4 Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +Date: Wed, 29 Jul 2020 12:32:48 -0400 +Subject: [PATCH] [PATCH]: Split installation of drill and examples. + +--- + Makefile.in | 38 +++++++++++++++++++++----------------- + 1 file changed, 21 insertions(+), 17 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 442067de..9d2d5f4d 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -14,6 +14,10 @@ libdir = @libdir@ + includedir = @includedir@ + sysconfdir = @sysconfdir@ + doxygen = @doxygen@ ++drillbindir = @drillbindir@ ++drillmandir = @drillmandir@ ++examplesbindir = @examplesbindir@ ++examplesmandir = @examplesmandir@ + pywrapdir = $(srcdir)/contrib/python + pyldnsxwrapdir = $(srcdir)/contrib/ldnsx + p5_dns_ldns_dir = $(srcdir)/contrib/DNS-LDNS +@@ -154,16 +158,16 @@ drill/drill.1: $(srcdir)/drill/drill.1.in + $(edit) $(srcdir)/drill/drill.1.in > drill/drill.1 + + install-drill: drill/drill drill/drill.1 +- $(INSTALL) -m 755 -d $(DESTDIR)$(bindir) +- $(INSTALL) -m 755 -d $(DESTDIR)$(mandir) +- $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 +- $(LIBTOOL) --mode=install cp drill/drill $(DESTDIR)$(bindir) +- $(INSTALL) -m 644 drill/drill.1 $(DESTDIR)$(mandir)/man1/drill.1 ++ $(INSTALL) -m 755 -d $(drillbindir) ++ $(INSTALL) -m 755 -d $(drillmandir) ++ $(INSTALL) -m 755 -d $(drillmandir)/man1 ++ $(LIBTOOL) --mode=install cp drill/drill $(drillbindir) ++ $(INSTALL) -m 644 drill/drill.1 $(drillmandir)/man1/drill.1 + + uninstall-drill: +- rm -f $(DESTDIR)$(bindir)/drill $(DESTDIR)$(mandir)/man1/drill.1 +- test ! -d $(DESTDIR)$(mandir) || rmdir -p $(DESTDIR)$(mandir)/man1 || :; +- test ! -d $(DESTDIR)$(bindir) || rmdir -p $(DESTDIR)$(bindir) || : ; ++ rm -f $(drillbindir)/drill $(drillmandir)/man1/drill.1 ++ test ! -d $(drillmandir) || rmdir -p $(drillmandir)/man1 || :; ++ test ! -d $(drillbindir) || rmdir -p $(drillbindir) || : ; + + clean-drill: + $(LIBTOOL) --mode clean rm -f $(DRILL_LOBJS) drill/drill drill/drill.1 +@@ -202,23 +206,23 @@ examples/ldns-verify-zone.1: $(srcdir)/examples/ldns-verify-zone.1.in + $(edit) $(srcdir)/examples/ldns-verify-zone.1.in > examples/ldns-verify-zone.1 + + install-examples: $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) examples/ldns-dane.1 examples/ldns-verify-zone.1 +- $(INSTALL) -m 755 -d $(DESTDIR)$(bindir) +- $(INSTALL) -m 755 -d $(DESTDIR)$(mandir) +- $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 ++ $(INSTALL) -m 755 -d $(examplesbindir) ++ $(INSTALL) -m 755 -d $(examplesmandir) ++ $(INSTALL) -m 755 -d $(examplesmandir)/man1 + for p in $(EXAMPLE_PROGS) $(TESTNS) $(LDNS_DPA) $(LDNS_DANE) $(EX_SSL_PROGS) ; do \ +- $(LIBTOOL) --mode=install cp $$p $(DESTDIR)$(bindir) ; \ ++ $(LIBTOOL) --mode=install cp $$p $(examplesbindir) ; \ + if test -f $$p.1 ; \ +- then $(INSTALL) -m 644 $$p.1 $(DESTDIR)$(mandir)/man1 ; \ +- else $(INSTALL) -m 644 $(srcdir)/$$p.1 $(DESTDIR)$(mandir)/man1 ; \ ++ then $(INSTALL) -m 644 $$p.1 $(examplesmandir)/man1 ; \ ++ else $(INSTALL) -m 644 $(srcdir)/$$p.1 $(examplesmandir)/man1 ; \ + fi ; \ + done + + uninstall-examples: + for p in $(EX_PROGS_BASENM) ; do \ +- rm -f $(DESTDIR)$(bindir)/$$p $(DESTDIR)$(mandir)/man1/$$p.1 ;\ ++ rm -f $(examplesbindir)/$$p $(examplesmandir)/man1/$$p.1 ;\ + done +- test ! -d $(DESTDIR)$(mandir) || rmdir -p $(DESTDIR)$(mandir)/man1 || :; +- test ! -d $(DESTDIR)$(bindir) || rmdir -p $(DESTDIR)$(bindir) || : ; ++ test ! -d $(examplesmandir) || rmdir -p $(examplesmandir)/man1 || :; ++ test ! -d $(examplesbindir) || rmdir -p $(examplesbindir) || : ; + + clean-examples: + $(LIBTOOL) --mode clean rm -f $(EXAMPLE_PROGS) +-- +2.27.0 + -- cgit v1.2.3 From 8205fe4493678cc38a95e2db8d8fcbca03b7173f Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Fri, 7 Aug 2020 17:08:33 -0400 Subject: gnu: Add liblouisutdml. * gnu/packages/language.scm (liblouisutdml): New variable. * gnu/packages/patches/liblouisutdml-fix-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 1 + gnu/packages/language.scm | 52 +++++++++++++++++++++- gnu/packages/patches/liblouisutdml-fix-tests.patch | 33 ++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/liblouisutdml-fix-tests.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 7e2f1003bb..2174393f76 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1218,6 +1218,7 @@ dist_patch_DATA = \ %D%/packages/patches/libgnomeui-utf8.patch \ %D%/packages/patches/libjxr-fix-function-signature.patch \ %D%/packages/patches/libjxr-fix-typos.patch \ + %D%/packages/patches/liblouisutdml-fix-tests.patch \ %D%/packages/patches/libofa-ftbfs-1.diff \ %D%/packages/patches/libofa-curl.diff \ %D%/packages/patches/libofa-ftbfs-2.diff \ diff --git a/gnu/packages/language.scm b/gnu/packages/language.scm index 771df61497..4959f96a19 100644 --- a/gnu/packages/language.scm +++ b/gnu/packages/language.scm @@ -25,6 +25,7 @@ #:use-module (gnu packages autotools) #:use-module (gnu packages glib) #:use-module (gnu packages gtk) + #:use-module (gnu packages java) #:use-module (gnu packages llvm) #:use-module (gnu packages man) #:use-module (gnu packages ocr) @@ -35,6 +36,7 @@ #:use-module (gnu packages swig) #:use-module (gnu packages texinfo) #:use-module (gnu packages web) + #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (guix packages) #:use-module (guix build-system gnu) @@ -42,7 +44,7 @@ #:use-module (guix build-system python) #:use-module ((guix licenses) #:select - (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ perl-license zpl2.1)) + (bsd-3 gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+ perl-license zpl2.1)) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils)) @@ -105,6 +107,54 @@ Marburg.") ;; Tools gpl3+)))) +(define-public liblouisutdml + (package + (name "liblouisutdml") + (version "2.8.0") + (source + (origin + (method git-fetch) + (uri + (git-reference + (url "https://github.com/liblouis/liblouisutdml.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "11xxky3crjm8bidfljzpqaz1m1i1m1yskmdpavf9b4jpf87nzjj2")) + (patches + (search-patches "liblouisutdml-fix-tests.patch")))) + (build-system gnu-build-system) + (outputs '("out" "bin" "doc")) + (arguments + `(#:configure-flags + (list + "--disable-static"))) + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("help2man" ,help2man) + ("jdk" ,icedtea "jdk") + ("libtool" ,libtool) + ("makeinfo" ,texinfo) + ("pkg-config" ,pkg-config))) + (inputs + `(("libxml2" ,libxml2))) + (propagated-inputs + `(("liblouis" ,liblouis) + ("liblouis:bin" ,liblouis "bin"))) + (synopsis "Braille transcription services") + (description "Liblouisutdml is a library providing complete braille +transcription services for xml, html and text documents. It translates into +appropriate braille codes and formats according to its style sheet and the +specifications in the document.") + (home-page "http://liblouis.org/") + (license + (list + ;; Library + lgpl3+ + ;; Tools + gpl3+)))) + (define-public libstemmer (package (name "libstemmer") diff --git a/gnu/packages/patches/liblouisutdml-fix-tests.patch b/gnu/packages/patches/liblouisutdml-fix-tests.patch new file mode 100644 index 0000000000..08d3db2c21 --- /dev/null +++ b/gnu/packages/patches/liblouisutdml-fix-tests.patch @@ -0,0 +1,33 @@ +From 52d44cdbc307d4e2ffc3ebe674745eb9d43ec337 Mon Sep 17 00:00:00 2001 +From: Christian Egli +Date: Mon, 10 Aug 2020 16:08:17 +0200 +Subject: [PATCH] Some math over and under tests now actually pass + +with the newest liblouis +--- + tests/Makefile.am | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/tests/Makefile.am b/tests/Makefile.am +index 157b005..932a5d0 100644 +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -321,10 +321,6 @@ XFAIL_TESTS += \ + mathml_nemeth/mover_06.test \ + mathml_nemeth/mover_07.test \ + mathml_nemeth/mover_08.test \ +- mathml_nemeth/mover_09.test \ +- mathml_nemeth/mover_10.test \ +- mathml_nemeth/mover_11.test \ +- mathml_nemeth/mover_12.test \ + mathml_nemeth/mover_13.test \ + mathml_nemeth/mover_14.test \ + mathml_nemeth/mover_15.test \ +@@ -332,7 +328,6 @@ XFAIL_TESTS += \ + mathml_nemeth/munder_01.test \ + mathml_nemeth/munder_02.test \ + mathml_nemeth/munder_03.test \ +- mathml_nemeth/munder_04.test \ + mathml_nemeth/munder_05.test \ + mathml_nemeth/munder_06.test \ + mathml_nemeth/munder_07.test \ -- cgit v1.2.3 From ce49fdc62ba6eab483e2e38be13c869c01edf18e Mon Sep 17 00:00:00 2001 From: Raghav Gururajan Date: Fri, 3 Jul 2020 11:22:08 -0400 Subject: gnu: Add transcode. * gnu/packages/video.scm (transcode): New variable. * gnu/packages/patches/transcode-ffmpeg.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 1 + gnu/packages/patches/transcode-ffmpeg.patch | 1408 +++++++++++++++++++++++++++ gnu/packages/video.scm | 101 ++ 3 files changed, 1510 insertions(+) create mode 100644 gnu/packages/patches/transcode-ffmpeg.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 2174393f76..d7f28c7a18 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1605,6 +1605,7 @@ dist_patch_DATA = \ %D%/packages/patches/tipp10-fix-compiling.patch \ %D%/packages/patches/tipp10-remove-license-code.patch \ %D%/packages/patches/tk-find-library.patch \ + %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ %D%/packages/patches/ttfautohint-source-date-epoch.patch \ %D%/packages/patches/tomb-fix-errors-on-open.patch \ diff --git a/gnu/packages/patches/transcode-ffmpeg.patch b/gnu/packages/patches/transcode-ffmpeg.patch new file mode 100644 index 0000000000..c547cbad2b --- /dev/null +++ b/gnu/packages/patches/transcode-ffmpeg.patch @@ -0,0 +1,1408 @@ +Submitted By: Ken Moffat +Date: 2018-05-14 +Initial Package Version: 1.1.7 +Upstream Status: Defunct +Origin: From gentoo. +Description: Accumulated fixes to build with ffmpeg-4.0 (but only +with the limited functionality we had before). + +diff -Naur a/encode/encode_lavc.c b/encode/encode_lavc.c +--- a/encode/encode_lavc.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/encode/encode_lavc.c 2018-05-14 01:58:58.346408791 +0100 +@@ -74,6 +74,16 @@ + int lmin; + int lmax; + int me_method; ++ int luma_elim_threshold; ++ int chroma_elim_threshold; ++ int quantizer_noise_shaping; ++ int inter_quant_bias; ++ int intra_quant_bias; ++ int scenechange_factor; ++ int rc_strategy; ++ float rc_initial_cplx; ++ float rc_qsquish; ++ float border_masking; + + /* same as above for flags */ + struct { +@@ -114,6 +124,7 @@ + + AVFrame ff_venc_frame; + AVCodecContext ff_vcontext; ++ AVDictionary * ff_opts; + + AVCodec *ff_vcodec; + +@@ -164,6 +175,7 @@ + TC_CODEC_ERROR + }; + ++#if LIBAVCODEC_VERSION_MAJOR < 55 + static const enum CodecID tc_lavc_internal_codecs[] = { + CODEC_ID_MPEG1VIDEO, CODEC_ID_MPEG2VIDEO, CODEC_ID_MPEG4, + CODEC_ID_H263I, CODEC_ID_H263P, +@@ -176,6 +188,20 @@ + CODEC_ID_MSMPEG4V2, CODEC_ID_MSMPEG4V3, + CODEC_ID_NONE + }; ++#else ++static const enum AVCodecID tc_lavc_internal_codecs[] = { ++ AV_CODEC_ID_MPEG1VIDEO, AV_CODEC_ID_MPEG2VIDEO, AV_CODEC_ID_MPEG4, ++ AV_CODEC_ID_H263I, AV_CODEC_ID_H263P, ++ AV_CODEC_ID_H264, ++ AV_CODEC_ID_WMV1, AV_CODEC_ID_WMV2, ++ AV_CODEC_ID_RV10, ++ AV_CODEC_ID_HUFFYUV, AV_CODEC_ID_FFV1, ++ AV_CODEC_ID_DVVIDEO, ++ AV_CODEC_ID_MJPEG, AV_CODEC_ID_LJPEG, ++ AV_CODEC_ID_MSMPEG4V2, AV_CODEC_ID_MSMPEG4V3, ++ AV_CODEC_ID_NONE ++}; ++#endif + + static const TCFormatID tc_lavc_formats[] = { TC_FORMAT_ERROR }; + +@@ -214,7 +240,7 @@ + vframe_list_t *vframe) + { + avpicture_fill((AVPicture *)&pd->ff_venc_frame, vframe->video_buf, +- PIX_FMT_YUV420P, ++ AV_PIX_FMT_YUV420P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + } + +@@ -228,7 +254,7 @@ + IMG_YUV_DEFAULT, + pd->ff_vcontext.width, pd->ff_vcontext.height); + avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf, +- PIX_FMT_YUV422P, ++ AV_PIX_FMT_YUV422P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + ac_imgconvert(src, IMG_YUV_DEFAULT, + pd->ff_venc_frame.data, IMG_YUV422P, +@@ -244,7 +270,7 @@ + IMG_YUV422P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf, +- PIX_FMT_YUV420P, ++ AV_PIX_FMT_YUV420P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + ac_imgconvert(src, IMG_YUV422P, + pd->ff_venc_frame.data, IMG_YUV420P, +@@ -266,7 +292,7 @@ + vframe_list_t *vframe) + { + avpicture_fill((AVPicture *)&pd->ff_venc_frame, pd->vframe_buf->video_buf, +- PIX_FMT_YUV420P, ++ AV_PIX_FMT_YUV420P, + pd->ff_vcontext.width, pd->ff_vcontext.height); + ac_imgconvert(&vframe->video_buf, IMG_RGB_DEFAULT, + pd->ff_venc_frame.data, IMG_YUV420P, +@@ -596,15 +622,15 @@ + } else { + pd->tc_pix_fmt = TC_CODEC_YUV420P; + pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) +- ? PIX_FMT_YUVJ420P +- : PIX_FMT_YUV420P; ++ ? AV_PIX_FMT_YUVJ420P ++ : AV_PIX_FMT_YUV420P; + pd->pre_encode_video = pre_encode_video_yuv420p; + } + break; + case CODEC_YUV422: + pd->tc_pix_fmt = TC_CODEC_YUV422P; + pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) +- ? PIX_FMT_YUVJ422P ++ ? AV_PIX_FMT_YUVJ422P + : PIX_FMT_YUV422P; + if (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) { + pd->pre_encode_video = pre_encode_video_yuv422p_huffyuv; +@@ -617,8 +643,8 @@ + pd->ff_vcontext.pix_fmt = (TC_VCODEC_ID(pd) == TC_CODEC_HUFFYUV) + ? PIX_FMT_YUV422P + : (TC_VCODEC_ID(pd) == TC_CODEC_MJPEG) +- ? PIX_FMT_YUVJ420P +- : PIX_FMT_YUV420P; ++ ? AV_PIX_FMT_YUVJ420P ++ : AV_PIX_FMT_YUV420P; + pd->pre_encode_video = pre_encode_video_rgb24; + break; + default: +@@ -665,7 +691,7 @@ + switch (vob->divxmultipass) { + case 1: + CAN_DO_MULTIPASS(multipass_flag); +- pd->ff_vcontext.flags |= CODEC_FLAG_PASS1; ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS1; + pd->stats_file = fopen(vob->divxlogfile, "w"); + if (pd->stats_file == NULL) { + tc_log_error(MOD_NAME, "could not create 2pass log file" +@@ -675,7 +701,7 @@ + break; + case 2: + CAN_DO_MULTIPASS(multipass_flag); +- pd->ff_vcontext.flags |= CODEC_FLAG_PASS2; ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_PASS2; + pd->stats_file = fopen(vob->divxlogfile, "r"); + if (pd->stats_file == NULL){ + tc_log_error(MOD_NAME, "could not open 2pass log file \"%s\"" +@@ -704,7 +730,7 @@ + break; + case 3: + /* fixed qscale :p */ +- pd->ff_vcontext.flags |= CODEC_FLAG_QSCALE; ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_QSCALE; + pd->ff_venc_frame.quality = vob->divxbitrate; + break; + } +@@ -937,7 +963,11 @@ + static void tc_lavc_config_defaults(TCLavcPrivateData *pd) + { + /* first of all reinitialize lavc data */ ++#if LIBAVCODEC_VERSION_MAJOR < 55 + avcodec_get_context_defaults(&pd->ff_vcontext); ++#else ++ avcodec_get_context_defaults3(&pd->ff_vcontext, NULL); ++#endif + + pd->confdata.thread_count = 1; + +@@ -947,7 +977,7 @@ + pd->confdata.rc_buffer_size = 0; + pd->confdata.lmin = 2; + pd->confdata.lmax = 31; +- pd->confdata.me_method = ME_EPZS; ++ pd->confdata.me_method = 0; + + memset(&pd->confdata.flags, 0, sizeof(pd->confdata.flags)); + pd->confdata.turbo_setup = 0; +@@ -962,12 +992,12 @@ + pd->ff_vcontext.me_range = 0; + pd->ff_vcontext.mb_decision = 0; + pd->ff_vcontext.scenechange_threshold = 0; +- pd->ff_vcontext.scenechange_factor = 1; ++ pd->confdata.scenechange_factor = 1; + pd->ff_vcontext.b_frame_strategy = 0; + pd->ff_vcontext.b_sensitivity = 40; + pd->ff_vcontext.brd_scale = 0; + pd->ff_vcontext.bidir_refine = 0; +- pd->ff_vcontext.rc_strategy = 2; ++ pd->confdata.rc_strategy = 2; + pd->ff_vcontext.b_quant_factor = 1.25; + pd->ff_vcontext.i_quant_factor = 0.8; + pd->ff_vcontext.b_quant_offset = 1.25; +@@ -975,10 +1005,10 @@ + pd->ff_vcontext.qblur = 0.5; + pd->ff_vcontext.qcompress = 0.5; + pd->ff_vcontext.mpeg_quant = 0; +- pd->ff_vcontext.rc_initial_cplx = 0.0; +- pd->ff_vcontext.rc_qsquish = 1.0; +- pd->ff_vcontext.luma_elim_threshold = 0; +- pd->ff_vcontext.chroma_elim_threshold = 0; ++ pd->confdata.rc_initial_cplx = 0.0; ++ pd->confdata.rc_qsquish = 1.0; ++ pd->confdata.luma_elim_threshold = 0; ++ pd->confdata.chroma_elim_threshold = 0; + pd->ff_vcontext.strict_std_compliance = 0; + pd->ff_vcontext.dct_algo = FF_DCT_AUTO; + pd->ff_vcontext.idct_algo = FF_IDCT_AUTO; +@@ -987,7 +1017,7 @@ + pd->ff_vcontext.temporal_cplx_masking = 0.0; + pd->ff_vcontext.spatial_cplx_masking = 0.0; + pd->ff_vcontext.p_masking = 0.0; +- pd->ff_vcontext.border_masking = 0.0; ++ pd->confdata.border_masking = 0.0; + pd->ff_vcontext.me_pre_cmp = 0; + pd->ff_vcontext.me_cmp = 0; + pd->ff_vcontext.me_sub_cmp = 0; +@@ -999,10 +1029,8 @@ + pd->ff_vcontext.pre_me = 1; + pd->ff_vcontext.me_subpel_quality = 8; + pd->ff_vcontext.refs = 1; +- pd->ff_vcontext.intra_quant_bias = FF_DEFAULT_QUANT_BIAS; +- pd->ff_vcontext.inter_quant_bias = FF_DEFAULT_QUANT_BIAS; + pd->ff_vcontext.noise_reduction = 0; +- pd->ff_vcontext.quantizer_noise_shaping = 0; ++ pd->confdata.quantizer_noise_shaping = 0; + pd->ff_vcontext.flags = 0; + } + +@@ -1023,27 +1051,22 @@ + */ + static void tc_lavc_dispatch_settings(TCLavcPrivateData *pd) + { ++ char buf[1024]; + /* some translation... */ + pd->ff_vcontext.bit_rate_tolerance = pd->confdata.vrate_tolerance * 1000; + pd->ff_vcontext.rc_min_rate = pd->confdata.rc_min_rate * 1000; + pd->ff_vcontext.rc_max_rate = pd->confdata.rc_max_rate * 1000; + pd->ff_vcontext.rc_buffer_size = pd->confdata.rc_buffer_size * 1024; +- pd->ff_vcontext.lmin = (int)(FF_QP2LAMBDA * pd->confdata.lmin + 0.5); +- pd->ff_vcontext.lmax = (int)(FF_QP2LAMBDA * pd->confdata.lmax + 0.5); +- pd->ff_vcontext.me_method = ME_ZERO + pd->confdata.me_method; ++ snprintf(buf, sizeof(buf), "%i", (int)(FF_QP2LAMBDA * pd->confdata.lmin + 0.5)); ++ av_dict_set(&(pd->ff_opts), "lmin", buf, 0); ++ snprintf(buf, sizeof(buf), "%i", (int)(FF_QP2LAMBDA * pd->confdata.lmax + 0.5)); ++ av_dict_set(&(pd->ff_opts), "lmax", buf, 0); + + pd->ff_vcontext.flags = 0; +- SET_FLAG(pd, mv0); +- SET_FLAG(pd, cbp); + SET_FLAG(pd, qpel); +- SET_FLAG(pd, alt); +- SET_FLAG(pd, vdpart); +- SET_FLAG(pd, naq); + SET_FLAG(pd, ilme); + SET_FLAG(pd, ildct); + SET_FLAG(pd, aic); +- SET_FLAG(pd, aiv); +- SET_FLAG(pd, umv); + SET_FLAG(pd, psnr); + SET_FLAG(pd, trell); + SET_FLAG(pd, gray); +@@ -1061,9 +1084,49 @@ + } + if (pd->interlacing.active) { + /* enforce interlacing */ +- pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_DCT; +- pd->ff_vcontext.flags |= CODEC_FLAG_INTERLACED_ME; ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_INTERLACED_DCT; ++ pd->ff_vcontext.flags |= AV_CODEC_FLAG_INTERLACED_ME; ++ } ++ if (pd->confdata.flags.alt) { ++ av_dict_set(&(pd->ff_opts), "alternate_scan", "1", 0); + } ++ if (pd->confdata.flags.vdpart) { ++ av_dict_set(&(pd->ff_opts), "data_partitioning", "1", 0); ++ } ++ if (pd->confdata.flags.umv) { ++ av_dict_set(&(pd->ff_opts), "umv", "1", 0); ++ } ++ if (pd->confdata.flags.aiv) { ++ av_dict_set(&(pd->ff_opts), "aiv", "1", 0); ++ } ++ if (pd->confdata.flags.cbp) { ++ av_dict_set(&(pd->ff_opts), "mpv_flags", "+cbp_rd", 0); ++ } ++ if (pd->confdata.flags.mv0) { ++ av_dict_set(&(pd->ff_opts), "mpv_flags", "+mv0", 0); ++ } ++ if (pd->confdata.flags.naq) { ++ av_dict_set(&(pd->ff_opts), "mpv_flags", "+naq", 0); ++ } ++ ++#define set_dict_opt(val, opt) \ ++ snprintf(buf, sizeof(buf), "%i", pd->confdata.val);\ ++ av_dict_set(&(pd->ff_opts), opt, buf, 0) ++#define set_dict_float_opt(val, opt) \ ++ snprintf(buf, sizeof(buf), "%f", pd->confdata.val);\ ++ av_dict_set(&(pd->ff_opts), opt, buf, 0) ++ ++ set_dict_opt(luma_elim_threshold, "luma_elim_threshold"); ++ set_dict_opt(chroma_elim_threshold, "chroma_elim_threshold"); ++ set_dict_opt(quantizer_noise_shaping, "quantizer_noise_shaping"); ++ set_dict_opt(inter_quant_bias, "pbias"); ++ set_dict_opt(intra_quant_bias, "ibias"); ++ set_dict_opt(me_method, "me_method"); ++ set_dict_opt(scenechange_factor, "sc_factor"); ++ set_dict_opt(rc_strategy, "rc_strategy"); ++ set_dict_float_opt(rc_initial_cplx, "rc_init_cplx"); ++ set_dict_float_opt(rc_qsquish, "qsquish"); ++ set_dict_float_opt(border_masking, "border_mask"); + } + + #undef SET_FLAG +@@ -1121,12 +1184,12 @@ + { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 }, + { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 }, + { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 }, +- { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES }, ++ { "vmax_b_frames", PCTX(max_b_frames), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX }, + { "vme", PAUX(me_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16, }, + { "me_range", PCTX(me_range), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000 }, + { "mbd", PCTX(mb_decision), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 }, + { "sc_threshold", PCTX(scenechange_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000 }, +- { "sc_factor", PCTX(scenechange_factor), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16 }, ++ { "sc_factor", PAUX(scenechange_factor), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16 }, + { "vb_strategy", PCTX(b_frame_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 }, + { "b_sensitivity", PCTX(b_sensitivity), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 100 }, + { "brd_scale", PCTX(brd_scale), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 }, +@@ -1137,7 +1200,7 @@ + { "vrc_maxrate", PAUX(rc_max_rate), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000 }, + { "vrc_minrate", PAUX(rc_min_rate), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 24000000 }, + { "vrc_buf_size", PAUX(rc_buffer_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000 }, +- { "vrc_strategy", PCTX(rc_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2 }, ++ { "vrc_strategy", PAUX(rc_strategy), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2 }, + { "vb_qfactor", PCTX(b_quant_factor), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0 }, + { "vi_qfactor", PCTX(i_quant_factor), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0 }, + { "vb_qoffset", PCTX(b_quant_offset), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0 }, +@@ -1147,11 +1210,11 @@ + { "mpeg_quant", PCTX(mpeg_quant), TCCONF_TYPE_FLAG, 0, 0, 1 }, + // { "vrc_eq", }, // not yet supported + { "vrc_override", rc_override_buf, TCCONF_TYPE_STRING, 0, 0, 0 }, +- { "vrc_init_cplx", PCTX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 }, ++ { "vrc_init_cplx", PAUX(rc_initial_cplx), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 9999999.0 }, + // { "vrc_init_occupancy", }, // not yet supported +- { "vqsquish", PCTX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 }, +- { "vlelim", PCTX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, +- { "vcelim", PCTX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, ++ { "vqsquish", PAUX(rc_qsquish), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 99.0 }, ++ { "vlelim", PAUX(luma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, ++ { "vcelim", PAUX(chroma_elim_threshold), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, + { "vstrict", PCTX(strict_std_compliance), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99 }, + { "vpsize", PCTX(rtp_payload_size), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000 }, + { "dct", PCTX(dct_algo), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10 }, +@@ -1161,7 +1224,7 @@ + { "tcplx_mask", PCTX(temporal_cplx_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, + { "scplx_mask", PCTX(spatial_cplx_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, + { "p_mask", PCTX(p_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, +- { "border_mask", PCTX(border_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, ++ { "border_mask", PAUX(border_masking), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0 }, + { "pred", PCTX(prediction_method), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 4 }, + { "precmp", PCTX(me_pre_cmp), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000 }, + { "cmp", PCTX(me_cmp), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000 }, +@@ -1174,37 +1237,37 @@ + { "pre_me", PCTX(pre_me), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, + { "subq", PCTX(me_subpel_quality), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8 }, + { "refs", PCTX(refs), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 8 }, +- { "ibias", PCTX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, +- { "pbias", PCTX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, ++ { "ibias", PAUX(intra_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, ++ { "pbias", PAUX(inter_quant_bias), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512 }, + { "nr", PCTX(noise_reduction), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000}, +- { "qns", PCTX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 }, ++ { "qns", PAUX(quantizer_noise_shaping), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 3 }, + { "inter_matrix_file", inter_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 }, + { "intra_matrix_file", intra_matrix_file, TCCONF_TYPE_STRING, 0, 0, 0 }, + +- { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0 }, +- { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD }, +- { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL }, +- { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN }, +- { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME }, +- { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_DCT }, +- { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_NORMALIZE_AQP }, +- { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART }, ++ { "mv0", PAUX(flags.mv0), TCCONF_TYPE_FLAG, 0, 0, 1 }, ++ { "cbp", PAUX(flags.cbp), TCCONF_TYPE_FLAG, 0, 0, 1 }, ++ { "qpel", PAUX(flags.qpel), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_QPEL }, ++ { "alt", PAUX(flags.alt), TCCONF_TYPE_FLAG, 0, 0, 1 }, ++ { "ilme", PAUX(flags.ilme), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME }, ++ { "ildct", PAUX(flags.ildct), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_DCT }, ++ { "naq", PAUX(flags.naq), TCCONF_TYPE_FLAG, 0, 0, 1 }, ++ { "vdpart", PAUX(flags.vdpart), TCCONF_TYPE_FLAG, 0, 0, 1 }, + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC }, + #else +- { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED }, ++ { "aic", PAUX(flags.aic), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_AC_PRED }, + #endif +- { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIV }, +- { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV }, +- { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR }, ++ { "aiv", PAUX(flags.aiv), TCCONF_TYPE_FLAG, 0, 0, 1 }, ++ { "umv", PAUX(flags.umv), TCCONF_TYPE_FLAG, 0, 0, 1 }, ++ { "psnr", PAUX(flags.psnr), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_PSNR }, + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + { "trell", PAUX(flags.trell), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT }, + #else + { "trell", PCTX(trellis), TCCONF_TYPE_FLAG, 0, 0, 1 }, + #endif +- { "gray", PAUX(flags.gray), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GRAY }, +- { "v4mv", PAUX(flags.v4mv), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV }, +- { "closedgop", PAUX(flags.closedgop), TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP }, ++ { "gray", PAUX(flags.gray), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_GRAY }, ++ { "v4mv", PAUX(flags.v4mv), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_4MV }, ++ { "closedgop", PAUX(flags.closedgop), TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP }, + + // { "turbo", PAUX(turbo_setup), TCCONF_TYPE_FLAG, 0, 0, 1 }, // not yet supported + /* End of the config file */ +@@ -1345,6 +1408,8 @@ + + pd = self->userdata; + ++ pd->ff_opts = NULL; ++ + pd->flush_flag = vob->encoder_flush; + + /* FIXME: move into core? */ +@@ -1387,7 +1452,7 @@ + pd->confdata.thread_count, + (pd->confdata.thread_count > 1) ?"s" :""); + } +- avcodec_thread_init(&pd->ff_vcontext, pd->confdata.thread_count); ++ pd->ff_vcontext.thread_count = pd->confdata.thread_count; + + pd->ff_vcodec = avcodec_find_encoder(FF_VCODEC_ID(pd)); + if (pd->ff_vcodec == NULL) { +@@ -1397,11 +1462,11 @@ + } + + TC_LOCK_LIBAVCODEC; +- ret = avcodec_open(&pd->ff_vcontext, pd->ff_vcodec); ++ ret = avcodec_open2(&pd->ff_vcontext, pd->ff_vcodec, &(pd->ff_opts)); + TC_UNLOCK_LIBAVCODEC; + + if (ret < 0) { +- tc_log_error(MOD_NAME, "avcodec_open() failed"); ++ tc_log_error(MOD_NAME, "avcodec_open2() failed"); + goto failed; + } + /* finally, pass up the extradata, if any */ +diff -Naur a/export/aud_aux.c b/export/aud_aux.c +--- a/export/aud_aux.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/export/aud_aux.c 2018-05-14 01:58:58.346408791 +0100 +@@ -326,10 +326,18 @@ + + switch (o_codec) { + case 0x50: ++#if LIBAVCODEC_VERSION_MAJOR < 55 + codeid = CODEC_ID_MP2; ++#else ++ codeid = AV_CODEC_ID_MP2; ++#endif + break; + case 0x2000: ++#if LIBAVCODEC_VERSION_MAJOR < 55 + codeid = CODEC_ID_AC3; ++#else ++ codeid = AV_CODEC_ID_AC3; ++#endif + break; + default: + tc_warn("cannot init ffmpeg with %x", o_codec); +@@ -346,7 +354,7 @@ + + //-- set parameters (bitrate, channels and sample-rate) -- + //-------------------------------------------------------- +- avcodec_get_context_defaults(&mpa_ctx); ++ avcodec_get_context_defaults3(&mpa_ctx, mpa_codec); + #if LIBAVCODEC_VERSION_MAJOR < 53 + mpa_ctx.codec_type = CODEC_TYPE_AUDIO; + #else +@@ -359,11 +367,16 @@ + //-- open codec -- + //---------------- + TC_LOCK_LIBAVCODEC; +- ret = avcodec_open(&mpa_ctx, mpa_codec); ++ ret = avcodec_open2(&mpa_ctx, mpa_codec, NULL); + TC_UNLOCK_LIBAVCODEC; + if (ret < 0) { + tc_warn("tc_audio_init_ffmpeg: could not open %s codec !", +- (codeid == CODEC_ID_MP2) ?"mpa" :"ac3"); ++#if LIBAVCODEC_VERSION_MAJOR < 55 ++ (codeid == CODEC_ID_MP2) ++#else ++ (codeid == AV_CODEC_ID_MP2) ++#endif ++ ?"mpa" :"ac3"); + return(TC_EXPORT_ERROR); + } + +diff -Naur a/export/export_ffmpeg.c b/export/export_ffmpeg.c +--- a/export/export_ffmpeg.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/export/export_ffmpeg.c 2018-05-14 01:58:58.346408791 +0100 +@@ -122,6 +122,7 @@ + static AVFrame *lavc_convert_frame = NULL; + + static AVCodec *lavc_venc_codec = NULL; ++static AVDictionary *lavc_venc_opts = NULL; + static AVFrame *lavc_venc_frame = NULL; + static AVCodecContext *lavc_venc_context; + static avi_t *avifile = NULL; +@@ -180,7 +181,7 @@ + + + /* START: COPIED FROM ffmpeg-0.5_p22846(ffmpeg.c, cmdutils.c) */ +-#include ++#include + #include + #include + +@@ -321,7 +322,7 @@ + } + + if(!f){ +- fprintf(stderr, "File for preset '%s' not found\n", arg); ++ tc_log_error(MOD_NAME, "File for preset '%s' not found", arg); + av_exit(1); + } + +@@ -470,7 +471,6 @@ + } + + TC_LOCK_LIBAVCODEC; +- avcodec_init(); + avcodec_register_all(); + TC_UNLOCK_LIBAVCODEC; + +@@ -486,11 +486,11 @@ + codec->name, codec->fourCC, codec->comments); + } + +- lavc_venc_context = avcodec_alloc_context(); ++ lavc_venc_context = avcodec_alloc_context3(lavc_venc_codec); + lavc_venc_frame = avcodec_alloc_frame(); + + lavc_convert_frame= avcodec_alloc_frame(); +- size = avpicture_get_size(PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height); ++ size = avpicture_get_size(AV_PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height); + enc_buffer = tc_malloc(size); + + if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) { +@@ -634,7 +634,7 @@ + lavc_param_rc_max_rate = 2516; + lavc_param_rc_buffer_size = 224 * 8; + lavc_param_rc_buffer_aggressivity = 99; +- lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET; ++ lavc_param_scan_offset = 1; + + break; + +@@ -674,7 +674,7 @@ + + lavc_param_rc_buffer_size = 224 * 8; + lavc_param_rc_buffer_aggressivity = 99; +- lavc_param_scan_offset = CODEC_FLAG_SVCD_SCAN_OFFSET; ++ lavc_param_scan_offset = 1; + + break; + +@@ -828,18 +828,35 @@ + + lavc_venc_context->bit_rate = vob->divxbitrate * 1000; + lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000; +- lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5); +- lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5); + lavc_venc_context->max_qdiff = lavc_param_vqdiff; + lavc_venc_context->qcompress = lavc_param_vqcompress; + lavc_venc_context->qblur = lavc_param_vqblur; + lavc_venc_context->max_b_frames = lavc_param_vmax_b_frames; + lavc_venc_context->b_quant_factor = lavc_param_vb_qfactor; +- lavc_venc_context->rc_strategy = lavc_param_vrc_strategy; + lavc_venc_context->b_frame_strategy = lavc_param_vb_strategy; + lavc_venc_context->b_quant_offset = lavc_param_vb_qoffset; +- lavc_venc_context->luma_elim_threshold= lavc_param_luma_elim_threshold; +- lavc_venc_context->chroma_elim_threshold= lavc_param_chroma_elim_threshold; ++ ++ char buf[1024]; ++#define set_dict_opt(val, opt) \ ++ snprintf(buf, sizeof(buf), "%i", val); \ ++ av_dict_set(&lavc_venc_opts, opt, buf, 0) ++#define set_dict_float_opt(val, opt) \ ++ snprintf(buf, sizeof(buf), "%f", val); \ ++ av_dict_set(&lavc_venc_opts, opt, buf, 0) ++ set_dict_opt(lavc_param_luma_elim_threshold, "luma_elim_threshold"); ++ set_dict_opt(lavc_param_chroma_elim_threshold, "chroma_elim_threshold"); ++ set_dict_opt((int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5), "lmin"); ++ set_dict_opt((int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5), "lmax"); ++ set_dict_opt(lavc_param_vrc_strategy, "rc_strategy"); ++ set_dict_float_opt(lavc_param_rc_qsquish, "qsquish"); ++ set_dict_float_opt(lavc_param_rc_qmod_amp, "rc_qmod_amp"); ++ set_dict_opt(lavc_param_rc_qmod_freq, "rc_qmod_freq"); ++ set_dict_opt(lavc_param_rc_eq, "rc_eq"); ++ set_dict_opt(lavc_param_vme, "me_method"); ++ set_dict_opt(lavc_param_ibias, "ibias"); ++ set_dict_opt(lavc_param_pbias, "pbias"); ++ set_dict_float_opt(lavc_param_rc_buffer_aggressivity, "rc_buf_aggressivity"); ++ set_dict_float_opt(lavc_param_rc_initial_cplx, "rc_init_cplx"); + lavc_venc_context->rtp_payload_size = lavc_param_packet_size; + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + if (lavc_param_packet_size) +@@ -848,15 +865,9 @@ + lavc_venc_context->strict_std_compliance= lavc_param_strict; + lavc_venc_context->i_quant_factor = lavc_param_vi_qfactor; + lavc_venc_context->i_quant_offset = lavc_param_vi_qoffset; +- lavc_venc_context->rc_qsquish = lavc_param_rc_qsquish; +- lavc_venc_context->rc_qmod_amp = lavc_param_rc_qmod_amp; +- lavc_venc_context->rc_qmod_freq = lavc_param_rc_qmod_freq; +- lavc_venc_context->rc_eq = lavc_param_rc_eq; + lavc_venc_context->rc_max_rate = lavc_param_rc_max_rate * 1000; + lavc_venc_context->rc_min_rate = lavc_param_rc_min_rate * 1000; + lavc_venc_context->rc_buffer_size = lavc_param_rc_buffer_size * 1024; +- lavc_venc_context->rc_buffer_aggressivity= lavc_param_rc_buffer_aggressivity; +- lavc_venc_context->rc_initial_cplx = lavc_param_rc_initial_cplx; + lavc_venc_context->debug = lavc_param_debug; + lavc_venc_context->last_predictor_count= lavc_param_last_pred; + lavc_venc_context->pre_me = lavc_param_pre_me; +@@ -864,13 +875,11 @@ + lavc_venc_context->pre_dia_size = lavc_param_pre_dia_size; + lavc_venc_context->me_subpel_quality = lavc_param_me_subpel_quality; + lavc_venc_context->me_range = lavc_param_me_range; +- lavc_venc_context->intra_quant_bias = lavc_param_ibias; +- lavc_venc_context->inter_quant_bias = lavc_param_pbias; + lavc_venc_context->coder_type = lavc_param_coder; + lavc_venc_context->context_model = lavc_param_context; + lavc_venc_context->scenechange_threshold= lavc_param_sc_threshold; + lavc_venc_context->noise_reduction = lavc_param_noise_reduction; +- lavc_venc_context->inter_threshold = lavc_param_inter_threshold; ++ set_dict_opt(lavc_param_inter_threshold, "inter_threshold"); + lavc_venc_context->intra_dc_precision = lavc_param_intra_dc_precision; + lavc_venc_context->skip_top = lavc_param_skip_top; + lavc_venc_context->skip_bottom = lavc_param_skip_bottom; +@@ -887,7 +896,7 @@ + lavc_venc_context->thread_count); + } + +- avcodec_thread_init(lavc_venc_context, lavc_param_threads); ++ lavc_venc_context->thread_count = lavc_param_threads; + + if (lavc_param_intra_matrix) { + char *tmp; +@@ -1065,15 +1074,14 @@ + lavc_venc_context->flags |= lavc_param_closedgop; + lavc_venc_context->flags |= lavc_param_trunc; + lavc_venc_context->flags |= lavc_param_aic; +- lavc_venc_context->flags |= lavc_param_umv; + lavc_venc_context->flags |= lavc_param_v4mv; +- lavc_venc_context->flags |= lavc_param_data_partitioning; +- lavc_venc_context->flags |= lavc_param_cbp; ++ if(lavc_param_cbp) ++ av_dict_set(&lavc_venc_opts, "mpv_flags", "+cbp_rd", 0); + lavc_venc_context->flags |= lavc_param_mv0; +- lavc_venc_context->flags |= lavc_param_qp_rd; +- lavc_venc_context->flags |= lavc_param_scan_offset; +- lavc_venc_context->flags |= lavc_param_ss; +- lavc_venc_context->flags |= lavc_param_alt; ++ if(lavc_param_qp_rd) ++ av_dict_set(&lavc_venc_opts, "mpv_flags", "+qp_rd", 0); ++ if (lavc_param_normalize_aqp) ++ av_dict_set(&lavc_venc_opts, "mpv_flags", "+naq", 0); + lavc_venc_context->flags |= lavc_param_ilme; + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + lavc_venc_context->flags |= lavc_param_trell; +@@ -1082,9 +1090,7 @@ + #endif + + if (lavc_param_gray) +- lavc_venc_context->flags |= CODEC_FLAG_GRAY; +- if (lavc_param_normalize_aqp) +- lavc_venc_context->flags |= CODEC_FLAG_NORMALIZE_AQP; ++ lavc_venc_context->flags |= AV_CODEC_FLAG_GRAY; + + switch(vob->encode_fields) { + case TC_ENCODE_FIELDS_TOP_FIRST: +@@ -1102,9 +1108,9 @@ + } + + lavc_venc_context->flags |= interlacing_active ? +- CODEC_FLAG_INTERLACED_DCT : 0; ++ AV_CODEC_FLAG_INTERLACED_DCT : 0; + lavc_venc_context->flags |= interlacing_active ? +- CODEC_FLAG_INTERLACED_ME : 0; ++ AV_CODEC_FLAG_INTERLACED_ME : 0; + + lavc_venc_context->flags |= lavc_param_psnr; + do_psnr = lavc_param_psnr; +@@ -1112,7 +1118,7 @@ + lavc_venc_context->prediction_method = lavc_param_prediction_method; + + if(is_huffyuv) +- lavc_venc_context->pix_fmt = PIX_FMT_YUV422P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P; + else + { + switch(pix_fmt) +@@ -1121,18 +1127,18 @@ + case CODEC_RGB: + { + if(is_mjpeg) +- lavc_venc_context->pix_fmt = PIX_FMT_YUVJ420P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ420P; + else +- lavc_venc_context->pix_fmt = PIX_FMT_YUV420P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV420P; + break; + } + + case CODEC_YUV422: + { + if(is_mjpeg) +- lavc_venc_context->pix_fmt = PIX_FMT_YUVJ422P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ422P; + else +- lavc_venc_context->pix_fmt = PIX_FMT_YUV422P; ++ lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P; + break; + } + +@@ -1151,7 +1157,7 @@ + "encoding."); + return TC_EXPORT_ERROR; + } +- lavc_venc_context->flags |= CODEC_FLAG_PASS1; ++ lavc_venc_context->flags |= AV_CODEC_FLAG_PASS1; + stats_file = fopen(vob->divxlogfile, "w"); + if (stats_file == NULL){ + tc_log_warn(MOD_NAME, "Could not create 2pass log file \"%s\".", +@@ -1165,7 +1171,7 @@ + "encoding."); + return TC_EXPORT_ERROR; + } +- lavc_venc_context->flags |= CODEC_FLAG_PASS2; ++ lavc_venc_context->flags |= AV_CODEC_FLAG_PASS2; + stats_file= fopen(vob->divxlogfile, "r"); + if (stats_file==NULL){ + tc_log_warn(MOD_NAME, "Could not open 2pass log file \"%s\" for " +@@ -1196,18 +1202,16 @@ + break; + case 3: + /* fixed qscale :p */ +- lavc_venc_context->flags |= CODEC_FLAG_QSCALE; ++ lavc_venc_context->flags |= AV_CODEC_FLAG_QSCALE; + lavc_venc_frame->quality = vob->divxbitrate; + break; + } + +- lavc_venc_context->me_method = ME_ZERO + lavc_param_vme; +- + + /* FIXME: transcode itself contains "broken ffmpeg default settings", thus we need to override them! */ +- if (lavc_param_video_preset) { ++ if (lavc_param_video_preset && strcmp(lavc_param_video_preset, "none")) { + avcodec_opts[AVMEDIA_TYPE_VIDEO] = lavc_venc_context; +- video_codec_name = ffmpeg_codec_name(codec->name); ++ video_codec_name = av_strdup(ffmpeg_codec_name(codec->name)); + + const char *preset_start = lavc_param_video_preset; + while (preset_start) { +@@ -1225,6 +1229,8 @@ + if (opt_preset("vpre", preset_name) != 0) { + tc_log_warn(MOD_NAME, "Parsing ffmpeg preset '%s' failed", preset_name); + } ++ av_free(video_codec_name); ++ video_codec_name = NULL; + if (verbose) { + int i; + tc_log_info(MOD_NAME, "After parsing preset '%s', %i options are overridden:", preset_name, opt_name_count); +@@ -1241,20 +1247,39 @@ + } + } + ++ if (lavc_param_scan_offset) { ++ av_dict_set(&lavc_venc_opts, "scan_offset", "1", 0); ++ } ++ ++ if (lavc_param_ss) { ++ av_dict_set(&lavc_venc_opts, "structured_slices", "1", 0); ++ } ++ ++ if (lavc_param_alt) { ++ av_dict_set(&lavc_venc_opts, "alternate_scan", "1", 0); ++ } ++ ++ if (lavc_param_umv) { ++ av_dict_set(&lavc_venc_opts, "umv", "1", 0); ++ } ++ ++ if (lavc_param_data_partitioning) { ++ av_dict_set(&lavc_venc_opts, "vdpart", "1", 0); ++ } + + //-- open codec -- + //---------------- + TC_LOCK_LIBAVCODEC; +- ret = avcodec_open(lavc_venc_context, lavc_venc_codec); ++ ret = avcodec_open2(lavc_venc_context, lavc_venc_codec, &lavc_venc_opts); + TC_UNLOCK_LIBAVCODEC; + if (ret < 0) { + tc_log_warn(MOD_NAME, "could not open FFMPEG codec"); + return TC_EXPORT_ERROR; + } + +- if (lavc_venc_context->codec->encode == NULL) { ++ if (av_codec_is_encoder(lavc_venc_context->codec) == 0) { + tc_log_warn(MOD_NAME, "could not open FFMPEG codec " +- "(lavc_venc_context->codec->encode == NULL)"); ++ "(av_codec_is_encoder(lavc_venc_context->codec) == 0)"); + return TC_EXPORT_ERROR; + } + +@@ -1598,7 +1623,7 @@ + YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT, + lavc_venc_context->width, lavc_venc_context->height); + avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, +- PIX_FMT_YUV422P, lavc_venc_context->width, ++ AV_PIX_FMT_YUV422P, lavc_venc_context->width, + lavc_venc_context->height); + /* FIXME: can't use tcv_convert (see decode_lavc.c) */ + ac_imgconvert(src, IMG_YUV_DEFAULT, +@@ -1628,7 +1653,7 @@ + lavc_venc_context->width, + lavc_venc_context->height); + avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, +- PIX_FMT_YUV420P, lavc_venc_context->width, ++ AV_PIX_FMT_YUV420P, lavc_venc_context->width, + lavc_venc_context->height); + ac_imgconvert(src, IMG_YUV422P, + lavc_venc_frame->data, IMG_YUV420P, +@@ -1639,7 +1664,7 @@ + + case CODEC_RGB: + avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, +- PIX_FMT_YUV420P, lavc_venc_context->width, ++ AV_PIX_FMT_YUV420P, lavc_venc_context->width, + lavc_venc_context->height); + ac_imgconvert(¶m->buffer, IMG_RGB_DEFAULT, + lavc_venc_frame->data, IMG_YUV420P, +diff -Naur a/export/ffmpeg_cfg.c b/export/ffmpeg_cfg.c +--- a/export/ffmpeg_cfg.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/export/ffmpeg_cfg.c 2018-05-14 01:58:58.346408791 +0100 +@@ -95,8 +95,8 @@ + int lavc_param_pre_me= 1; + int lavc_param_me_subpel_quality= 8; + int lavc_param_me_range=0; +-int lavc_param_ibias=FF_DEFAULT_QUANT_BIAS; +-int lavc_param_pbias=FF_DEFAULT_QUANT_BIAS; ++int lavc_param_ibias=0; ++int lavc_param_pbias=0; + int lavc_param_coder=0; + int lavc_param_context=0; + char *lavc_param_intra_matrix = NULL; +@@ -126,7 +126,7 @@ + //int lavc_param_atag = 0; + //int lavc_param_abitrate = 224; + +-char *lavc_param_video_preset = "medium"; ++char *lavc_param_video_preset = "none"; + char *lavc_param_ffmpeg_datadir = "/usr/share/ffmpeg"; + + TCConfigEntry lavcopts_conf[]={ +@@ -138,7 +138,7 @@ + {"vratetol", &lavc_param_vrate_tolerance, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 4, 24000000}, + {"vhq", &lavc_param_mb_decision, TCCONF_TYPE_FLAG, 0, 0, 1}, + {"mbd", &lavc_param_mb_decision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 9}, +- {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_4MV}, ++ {"v4mv", &lavc_param_v4mv, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_4MV}, + {"vme", &lavc_param_vme, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 5}, + // {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, + // {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31}, +@@ -151,7 +151,7 @@ + {"vqcomp", &lavc_param_vqcompress, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0}, + {"vqblur", &lavc_param_vqblur, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 1.0}, + {"vb_qfactor", &lavc_param_vb_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0}, +- {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, FF_MAX_B_FRAMES}, ++ {"vmax_b_frames", &lavc_param_vmax_b_frames, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, INT_MAX}, + // {"vpass", &lavc_param_vpass, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2}, + {"vrc_strategy", &lavc_param_vrc_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2}, + {"vb_strategy", &lavc_param_vb_strategy, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10}, +@@ -160,9 +160,9 @@ + {"vcelim", &lavc_param_chroma_elim_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99}, + {"vpsize", &lavc_param_packet_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000}, + {"vstrict", &lavc_param_strict, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -99, 99}, +- {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART}, ++ {"vdpart", &lavc_param_data_partitioning, TCCONF_TYPE_FLAG, 0, 0, 1}, + // {"keyint", &lavc_param_keyint, TCCONF_TYPE_INT, 0, 0, 0}, +- {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PART}, ++ {"gray", &lavc_param_gray, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_GRAY}, + {"mpeg_quant", &lavc_param_mpeg_quant, TCCONF_TYPE_FLAG, 0, 0, 1}, + {"vi_qfactor", &lavc_param_vi_qfactor, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, -31.0, 31.0}, + {"vi_qoffset", &lavc_param_vi_qoffset, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.0, 31.0}, +@@ -188,7 +188,7 @@ + {"pred", &lavc_param_prediction_method, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 20}, + {"format", &lavc_param_format, TCCONF_TYPE_STRING, 0, 0, 0}, + {"debug", &lavc_param_debug, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 100000000}, +- {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_PSNR}, ++ {"psnr", &lavc_param_psnr, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_PSNR}, + {"precmp", &lavc_param_me_pre_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, + {"cmp", &lavc_param_me_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, + {"subcmp", &lavc_param_me_sub_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, +@@ -196,9 +196,9 @@ + {"ildctcmp", &lavc_param_ildct_cmp, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 2000}, + {"predia", &lavc_param_pre_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000}, + {"dia", &lavc_param_dia_size, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -2000, 2000}, +- {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QPEL}, ++ {"qpel", &lavc_param_qpel, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_QPEL}, + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) +- {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRELLIS_QUANT}, ++ {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_TRELLIS_QUANT}, + #else + {"trell", &lavc_param_trell, TCCONF_TYPE_FLAG, 0, 0, 1}, + #endif +@@ -207,32 +207,32 @@ + {"subq", &lavc_param_me_subpel_quality, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 8}, + {"me_range", &lavc_param_me_range, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16000}, + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) +- {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_AIC}, ++ {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_H263P_AIC}, + #else +- {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_AC_PRED}, ++ {"aic", &lavc_param_aic, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_AC_PRED}, + #endif +- {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_UMV}, ++ {"umv", &lavc_param_umv, TCCONF_TYPE_FLAG, 0, 0, 1}, + {"ibias", &lavc_param_ibias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512}, + {"pbias", &lavc_param_pbias, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -512, 512}, + {"coder", &lavc_param_coder, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10}, + {"context", &lavc_param_context, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 10}, + {"intra_matrix", &lavc_param_intra_matrix, TCCONF_TYPE_STRING, 0, 0, 0}, + {"inter_matrix", &lavc_param_inter_matrix, TCCONF_TYPE_STRING, 0, 0, 0}, +- {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CBP_RD}, +- {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_MV0}, ++ {"cbp", &lavc_param_cbp, TCCONF_TYPE_FLAG, 0, 0, 1}, ++ {"mv0", &lavc_param_mv0, TCCONF_TYPE_FLAG, 0, 0, 1}, + {"nr", &lavc_param_noise_reduction, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000000}, +- {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_QP_RD}, ++ {"qprd", &lavc_param_qp_rd, TCCONF_TYPE_FLAG, 0, 0, 1}, + {"threads", &lavc_param_threads, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 16}, +- {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_H263P_SLICE_STRUCT}, +- {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_SVCD_SCAN_OFFSET}, +- {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_ALT_SCAN}, +- {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_INTERLACED_ME}, ++ {"ss", &lavc_param_ss, TCCONF_TYPE_FLAG, 0, 0, 1}, ++ {"svcd_sof", &lavc_param_scan_offset, TCCONF_TYPE_FLAG, 0, 0, 1}, ++ {"alt", &lavc_param_alt, TCCONF_TYPE_FLAG, 0, 0, 1}, ++ {"ilme", &lavc_param_ilme, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_INTERLACED_ME}, + {"inter_threshold", &lavc_param_inter_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000}, + {"sc_threshold", &lavc_param_sc_threshold, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1000000, 1000000}, + {"top", &lavc_param_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, -1, 1}, +- {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_GMC}, +- {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_TRUNCATED}, +- {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, CODEC_FLAG_CLOSED_GOP}, ++ {"gmc", &lavc_param_gmc, TCCONF_TYPE_FLAG, 0, 0, 1}, ++ {"trunc", &lavc_param_trunc, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_TRUNCATED}, ++ {"closedgop", &lavc_param_closedgop, TCCONF_TYPE_FLAG, 0, 0, AV_CODEC_FLAG_CLOSED_GOP}, + {"intra_dc_precision", &lavc_param_intra_dc_precision, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 16}, + {"skip_top", &lavc_param_skip_top, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000}, + {"skip_bottom", &lavc_param_skip_bottom, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 0, 1000}, +diff -Naur a/filter/filter_pp.c b/filter/filter_pp.c +--- a/filter/filter_pp.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/filter/filter_pp.c 2018-05-14 01:58:58.347408780 +0100 +@@ -38,8 +38,8 @@ + + /* FIXME: these use the filter ID as an index--the ID can grow + * arbitrarily large, so this needs to be fixed */ +-static pp_mode_t *mode[100]; +-static pp_context_t *context[100]; ++static pp_mode *mode[100]; ++static pp_context *context[100]; + static int width[100], height[100]; + static int pre[100]; + +diff -Naur a/filter/filter_resample.c b/filter/filter_resample.c +--- a/filter/filter_resample.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/filter/filter_resample.c 2018-05-14 01:58:58.347408780 +0100 +@@ -37,6 +37,7 @@ + #include "libtc/optstr.h" + #include "libtc/tcavcodec.h" + #include "libtc/tcmodule-plugin.h" ++#include + + + typedef struct { +@@ -45,7 +46,7 @@ + + int bytes_per_sample; + +- ReSampleContext *resample_ctx; ++ AVAudioResampleContext *resample_ctx; + } ResamplePrivateData; + + static const char resample_help[] = "" +diff -Naur a/filter/subtitler/load_font.c b/filter/subtitler/load_font.c +--- a/filter/subtitler/load_font.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/filter/subtitler/load_font.c 2018-05-14 01:58:58.347408780 +0100 +@@ -47,8 +47,8 @@ + // FreeType specific includes + #include + #include FT_FREETYPE_H ++#include FT_GLYPH_H + +-#include + + /** + * @file bswap.h +diff -Naur a/import/decode_lavc.c b/import/decode_lavc.c +--- a/import/decode_lavc.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/import/decode_lavc.c 2018-05-14 01:58:58.347408780 +0100 +@@ -57,6 +57,7 @@ + }; + + // fourCC to ID mapping taken from MPlayer's codecs.conf ++#if LIBAVCODEC_VERSION_MAJOR < 55 + static struct ffmpeg_codec ffmpeg_codecs[] = { + {CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41", + {"MP41", "DIV1", ""}}, +@@ -91,6 +92,42 @@ + {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video", + {"MPG2", ""}}, + {0, TC_CODEC_UNKNOWN, NULL, {""}}}; ++#else ++static struct ffmpeg_codec ffmpeg_codecs[] = { ++ {AV_CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41", ++ {"MP41", "DIV1", ""}}, ++ {AV_CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42", ++ {"MP42", "DIV2", ""}}, ++ {AV_CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4", ++ {"DIV3", "DIV5", "AP41", "MPG3", "MP43", ""}}, ++ {AV_CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4", ++ {"DIVX", "XVID", "MP4S", "M4S2", "MP4V", "UMP4", "DX50", ""}}, ++ {AV_CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg", ++ {"MJPG", "AVRN", "AVDJ", "JPEG", "MJPA", "JFIF", ""}}, ++ {AV_CODEC_ID_MPEG1VIDEO, TC_CODEC_MPEG1VIDEO, "mpeg1video", ++ {"MPG1", ""}}, ++ {AV_CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo", ++ {"DVSD", ""}}, ++ {AV_CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1", ++ {"WMV1", ""}}, ++ {AV_CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2", ++ {"WMV2", ""}}, ++ {AV_CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu", ++ {"HFYU", ""}}, ++ {AV_CODEC_ID_H263I, TC_CODEC_H263I, "h263i", ++ {"I263", ""}}, ++ {AV_CODEC_ID_H263P, TC_CODEC_H263P, "h263p", ++ {"H263", "U263", "VIV1", ""}}, ++ {AV_CODEC_ID_RV10, TC_CODEC_RV10, "rv10", ++ {"RV10", "RV13", ""}}, ++ {AV_CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1", ++ {"SVQ1", ""}}, ++ {AV_CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3", ++ {"SVQ3", ""}}, ++ {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video", ++ {"MPG2", ""}}, ++ {0, TC_CODEC_UNKNOWN, NULL, {""}}}; ++#endif + + + static struct ffmpeg_codec *find_ffmpeg_codec_id(unsigned int transcode_id) +@@ -170,7 +207,7 @@ + + // Set these to the expected values so that ffmpeg's decoder can + // properly detect interlaced input. +- lavc_dec_context = avcodec_alloc_context(); ++ lavc_dec_context = avcodec_alloc_context3(NULL); + if (lavc_dec_context == NULL) { + tc_log_error(__FILE__, "Could not allocate enough memory."); + goto decoder_error; +@@ -181,12 +218,12 @@ + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + lavc_dec_context->error_resilience = 2; + #else +- lavc_dec_context->error_recognition = 2; ++ lavc_dec_context->err_recognition = 2; + #endif + lavc_dec_context->error_concealment = 3; + lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT; + +- if (avcodec_open(lavc_dec_context, lavc_dec_codec) < 0) { ++ if (avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL) < 0) { + tc_log_error(__FILE__, "Could not initialize the '%s' codec.", + codec->name); + goto decoder_error; +@@ -290,8 +327,8 @@ + + // Convert avcodec image to the requested YUV or RGB format + switch (lavc_dec_context->pix_fmt) { +- case PIX_FMT_YUVJ420P: +- case PIX_FMT_YUV420P: ++ case AV_PIX_FMT_YUVJ420P: ++ case AV_PIX_FMT_YUV420P: + // Remove "dead space" at right edge of planes, if any + if (picture.linesize[0] != lavc_dec_context->width) { + int y; +@@ -315,7 +352,7 @@ + pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT, + lavc_dec_context->width, lavc_dec_context->height); + break; +- case PIX_FMT_YUV411P: ++ case AV_PIX_FMT_YUV411P: + if (picture.linesize[0] != lavc_dec_context->width) { + int y; + for (y = 0; y < lavc_dec_context->height; y++) { +@@ -334,8 +371,8 @@ + pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT, + lavc_dec_context->width, lavc_dec_context->height); + break; +- case PIX_FMT_YUVJ422P: +- case PIX_FMT_YUV422P: ++ case AV_PIX_FMT_YUVJ422P: ++ case AV_PIX_FMT_YUV422P: + if (picture.linesize[0] != lavc_dec_context->width) { + int y; + for (y = 0; y < lavc_dec_context->height; y++) { +@@ -354,8 +391,8 @@ + pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT, + lavc_dec_context->width, lavc_dec_context->height); + break; +- case PIX_FMT_YUVJ444P: +- case PIX_FMT_YUV444P: ++ case AV_PIX_FMT_YUVJ444P: ++ case AV_PIX_FMT_YUV444P: + if (picture.linesize[0] != lavc_dec_context->width) { + int y; + for (y = 0; y < lavc_dec_context->height; y++) { +diff -Naur a/import/import_ffmpeg.c b/import/import_ffmpeg.c +--- a/import/import_ffmpeg.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/import/import_ffmpeg.c 2018-05-14 01:58:58.347408780 +0100 +@@ -58,6 +58,7 @@ + }; + + // fourCC to ID mapping taken from MPlayer's codecs.conf ++#if LIBAVCODEC_VERSION_MAJOR < 55 + static struct ffmpeg_codec ffmpeg_codecs[] = { + {CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41", + {"MP41", "DIV1", ""}}, +@@ -106,6 +107,56 @@ + {CODEC_ID_RAWVIDEO, TC_CODEC_YUV422P, "raw", + {"Y42B", ""}}, + {0, TC_CODEC_UNKNOWN, NULL, {""}}}; ++#else ++static struct ffmpeg_codec ffmpeg_codecs[] = { ++ {AV_CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41", ++ {"MP41", "DIV1", ""}}, ++ {AV_CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42", ++ {"MP42", "DIV2", ""}}, ++ {AV_CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4", ++ {"DIV3", "DIV5", "AP41", "MPG3", "MP43", ""}}, ++ {AV_CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4", ++ {"DIVX", "XVID", "MP4S", "M4S2", "MP4V", "UMP4", "DX50", ""}}, ++ {AV_CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg", ++ {"MJPG", "AVRN", "AVDJ", "JPEG", "MJPA", "JFIF", ""}}, ++ {AV_CODEC_ID_MPEG1VIDEO, TC_CODEC_MPG1, "mpeg1video", ++ {"MPG1", ""}}, ++ {AV_CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo", ++ {"DVSD", ""}}, ++ {AV_CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1", ++ {"WMV1", ""}}, ++ {AV_CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2", ++ {"WMV2", ""}}, ++ {AV_CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu", ++ {"HFYU", ""}}, ++ {AV_CODEC_ID_H263I, TC_CODEC_H263I, "h263i", ++ {"I263", ""}}, ++ {AV_CODEC_ID_H263P, TC_CODEC_H263P, "h263p", ++ {"H263", "U263", "VIV1", ""}}, ++ {AV_CODEC_ID_H264, TC_CODEC_H264, "h264", ++ {"H264", "h264", "X264", "x264", "avc1", ""}}, ++ {AV_CODEC_ID_RV10, TC_CODEC_RV10, "rv10", ++ {"RV10", "RV13", ""}}, ++ {AV_CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1", ++ {"SVQ1", ""}}, ++ {AV_CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3", ++ {"SVQ3", ""}}, ++ {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video", ++ {"MPG2", ""}}, ++ {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG, "mpeg2video", ++ {"MPG2", ""}}, ++ {AV_CODEC_ID_ASV1, TC_CODEC_ASV1, "asv1", ++ {"ASV1", ""}}, ++ {AV_CODEC_ID_ASV2, TC_CODEC_ASV2, "asv2", ++ {"ASV2", ""}}, ++ {AV_CODEC_ID_FFV1, TC_CODEC_FFV1, "ffv1", ++ {"FFV1", ""}}, ++ {AV_CODEC_ID_RAWVIDEO, TC_CODEC_YUV420P, "raw", ++ {"I420", "IYUV", ""}}, ++ {AV_CODEC_ID_RAWVIDEO, TC_CODEC_YUV422P, "raw", ++ {"Y42B", ""}}, ++ {0, TC_CODEC_UNKNOWN, NULL, {""}}}; ++#endif + + #define BUFFER_SIZE SIZE_RGB_FRAME + +@@ -302,7 +353,7 @@ + + // Set these to the expected values so that ffmpeg's decoder can + // properly detect interlaced input. +- lavc_dec_context = avcodec_alloc_context(); ++ lavc_dec_context = avcodec_alloc_context3(lavc_dec_codec); + if (lavc_dec_context == NULL) { + tc_log_error(MOD_NAME, "Could not allocate enough memory."); + return TC_IMPORT_ERROR; +@@ -310,11 +361,11 @@ + lavc_dec_context->width = x_dim; + lavc_dec_context->height = y_dim; + +- if (vob->decolor) lavc_dec_context->flags |= CODEC_FLAG_GRAY; ++ if (vob->decolor) lavc_dec_context->flags |= AV_CODEC_FLAG_GRAY; + #if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) + lavc_dec_context->error_resilience = 2; + #else +- lavc_dec_context->error_recognition = 2; ++ lavc_dec_context->err_recognition = 2; + #endif + lavc_dec_context->error_concealment = 3; + lavc_dec_context->workaround_bugs = FF_BUG_AUTODETECT; +@@ -324,6 +375,7 @@ + // XXX: some codecs need extra data + switch (codec->id) + { ++#if LIBAVCODEC_VERSION_MAJOR < 55 + case CODEC_ID_MJPEG: extra_data_size = 28; break; + case CODEC_ID_LJPEG: extra_data_size = 28; break; + case CODEC_ID_HUFFYUV: extra_data_size = 1000; break; +@@ -331,6 +383,15 @@ + case CODEC_ID_ASV2: extra_data_size = 8; break; + case CODEC_ID_WMV1: extra_data_size = 4; break; + case CODEC_ID_WMV2: extra_data_size = 4; break; ++#else ++ case AV_CODEC_ID_MJPEG: extra_data_size = 28; break; ++ case AV_CODEC_ID_LJPEG: extra_data_size = 28; break; ++ case AV_CODEC_ID_HUFFYUV: extra_data_size = 1000; break; ++ case AV_CODEC_ID_ASV1: extra_data_size = 8; break; ++ case AV_CODEC_ID_ASV2: extra_data_size = 8; break; ++ case AV_CODEC_ID_WMV1: extra_data_size = 4; break; ++ case AV_CODEC_ID_WMV2: extra_data_size = 4; break; ++#endif + default: extra_data_size = 0; break; + } + +@@ -344,7 +405,7 @@ + } + + TC_LOCK_LIBAVCODEC; +- ret = avcodec_open(lavc_dec_context, lavc_dec_codec); ++ ret = avcodec_open2(lavc_dec_context, lavc_dec_codec, NULL); + TC_UNLOCK_LIBAVCODEC; + if (ret < 0) { + tc_log_warn(MOD_NAME, "Could not initialize the '%s' codec.", +@@ -360,7 +421,11 @@ + frame_size = x_dim*y_dim + 2*UV_PLANE_SIZE(IMG_YUV_DEFAULT,x_dim,y_dim); + + // we adapt the color space ++#if LIBAVCODEC_VERSION_MAJOR < 55 + if(codec->id == CODEC_ID_MJPEG) { ++#else ++ if(codec->id == AV_CODEC_ID_MJPEG) { ++#endif + enable_levels_filter(); + } + break; +@@ -434,7 +499,11 @@ + } + + // we adapt the color space ++#if LIBAVCODEC_VERSION_MAJOR < 55 + if(codec->id == CODEC_ID_MJPEG) { ++#else ++ if(codec->id == AV_CODEC_ID_MJPEG) { ++#endif + enable_levels_filter(); + } + +@@ -504,13 +573,25 @@ + int bkey = 0; + + // check for keyframes ++#if LIBAVCODEC_VERSION_MAJOR < 55 + if (codec->id == CODEC_ID_MSMPEG4V3) { ++#else ++ if (codec->id == AV_CODEC_ID_MSMPEG4V3) { ++#endif + if (divx3_is_key(buffer)) bkey = 1; + } ++#if LIBAVCODEC_VERSION_MAJOR < 55 + else if (codec->id == CODEC_ID_MPEG4) { ++#else ++ else if (codec->id == AV_CODEC_ID_MPEG4) { ++#endif + if (mpeg4_is_key(buffer, bytes_read)) bkey = 1; + } ++#if LIBAVCODEC_VERSION_MAJOR < 55 + else if (codec->id == CODEC_ID_MJPEG) { ++#else ++ else if (codec->id == AV_CODEC_ID_MJPEG) { ++#endif + bkey = 1; + } + +@@ -580,8 +661,8 @@ + + // Convert avcodec image to our internal YUV or RGB format + switch (lavc_dec_context->pix_fmt) { +- case PIX_FMT_YUVJ420P: +- case PIX_FMT_YUV420P: ++ case AV_PIX_FMT_YUVJ420P: ++ case AV_PIX_FMT_YUV420P: + src_fmt = IMG_YUV420P; + YUV_INIT_PLANES(src_planes, frame, src_fmt, + lavc_dec_context->width, lavc_dec_context->height); +@@ -612,7 +693,7 @@ + } + break; + +- case PIX_FMT_YUV411P: ++ case AV_PIX_FMT_YUV411P: + src_fmt = IMG_YUV411P; + YUV_INIT_PLANES(src_planes, frame, src_fmt, + lavc_dec_context->width, lavc_dec_context->height); +@@ -640,8 +721,8 @@ + } + break; + +- case PIX_FMT_YUVJ422P: +- case PIX_FMT_YUV422P: ++ case AV_PIX_FMT_YUVJ422P: ++ case AV_PIX_FMT_YUV422P: + src_fmt = IMG_YUV422P; + YUV_INIT_PLANES(src_planes, frame, src_fmt, + lavc_dec_context->width, lavc_dec_context->height); +@@ -669,8 +750,8 @@ + } + break; + +- case PIX_FMT_YUVJ444P: +- case PIX_FMT_YUV444P: ++ case AV_PIX_FMT_YUVJ444P: ++ case AV_PIX_FMT_YUV444P: + src_fmt = IMG_YUV444P; + YUV_INIT_PLANES(src_planes, frame, src_fmt, + lavc_dec_context->width, lavc_dec_context->height); +diff -Naur a/import/probe_ffmpeg.c b/import/probe_ffmpeg.c +--- a/import/probe_ffmpeg.c 2011-11-19 16:50:27.000000000 +0000 ++++ b/import/probe_ffmpeg.c 2018-05-14 01:58:58.347408780 +0100 +@@ -51,8 +51,8 @@ + info->bitrate = st->codec->bit_rate / 1000; + info->width = st->codec->width; + info->height = st->codec->height; +- if (st->r_frame_rate.num > 0 && st->r_frame_rate.den > 0) { +- info->fps = av_q2d(st->r_frame_rate); ++ if (st->avg_frame_rate.num > 0 && st->avg_frame_rate.den > 0) { ++ info->fps = av_q2d(st->avg_frame_rate); + } else { + /* watch out here */ + info->fps = 1.0/av_q2d(st->codec->time_base); +@@ -99,8 +99,8 @@ + + TC_INIT_LIBAVCODEC; + +- ret = av_open_input_file(&lavf_dmx_context, ipipe->name, +- NULL, 0, NULL); ++ ret = avformat_open_input(&lavf_dmx_context, ipipe->name, ++ NULL, NULL); + if (ret != 0) { + tc_log_error(__FILE__, "unable to open '%s'" + " (libavformat failure)", +@@ -109,7 +109,7 @@ + return; + } + +- ret = av_find_stream_info(lavf_dmx_context); ++ ret = avformat_find_stream_info(lavf_dmx_context, NULL); + if (ret < 0) { + tc_log_error(__FILE__, "unable to fetch informations from '%s'" + " (libavformat failure)", +@@ -120,7 +120,11 @@ + + translate_info(lavf_dmx_context, ipipe->probe_info); + ++#if LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(53,25,0) ++ avformat_close_input(&lavf_dmx_context); ++#else + av_close_input_file(lavf_dmx_context); ++#endif + return; + } + +diff -Naur a/libtc/tcavcodec.h b/libtc/tcavcodec.h +--- a/libtc/tcavcodec.h 2011-11-19 16:50:27.000000000 +0000 ++++ b/libtc/tcavcodec.h 2018-05-14 01:58:58.347408780 +0100 +@@ -53,7 +53,6 @@ + + #define TC_INIT_LIBAVCODEC do { \ + TC_LOCK_LIBAVCODEC; \ +- avcodec_init(); \ + avcodec_register_all(); \ + TC_UNLOCK_LIBAVCODEC; \ + } while (0) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index dee8f767bb..350b6e7a4b 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -172,6 +172,107 @@ #:use-module (gnu packages xml) #:use-module (gnu packages xorg)) +(define-public transcode + (package + (name "transcode") + (version "1.1.7") + (source + (origin + (method url-fetch) + (uri + (string-append "https://sources.archlinux.org/other/community/" + name "/" name "-" version ".tar.bz2")) + (sha256 + (base32 "14ha9xjsjrj131f35jd56z5v1jb4rbsrj1nril5shqnxw3c74khy")) + (patches + (search-patches "transcode-ffmpeg.patch")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list + "--enable-libv4l2" + "--enable-libmpeg2" + "--enable-libmpeg2convert" + "--enable-v4l" + ;;; XXX: Not available. + ;"--enable-bktr" + ;"--enable-sunau" + "--enable-oss" + "--enable-alsa" + ;;; XXX: Not available. + ;"--enable-libpostproc" + "--enable-freetype2" + "--enable-xvid" + "--enable-x264" + "--enable-ogg" + "--enable-vorbis" + "--enable-theora" + ;;; XXX: Not available. + ;"--enable-pvm3" + "--enable-libdv" + "--enable-libquicktime" + "--enable-lzo" + "--enable-a52" + "--enable-faac" + "--enable-libxml2" + ;;; XXX: Not available. + ;"--enable-ibp" + ;;"--enable-mjpegtools" + "--enable-sdl" + "--enable-imagemagick" + ;;; XXX: Not available. + ;"--enable-libjpegmmx" + "--enable-libjpeg"))) + ;;; XXX: Not available. + ;"--enable-bsdav" + ;"--enable-pv3" + ;"--enable-nuv" + (native-inputs + `(("autoconf" ,autoconf) + ("automake" ,automake) + ("iconv" ,libiconv) + ("libtool" ,libtool) + ("libxml2" ,libxml2) + ("perl" ,perl) + ("pkg-config" ,pkg-config) + ("python" ,python-wrapper))) + (inputs + `(("alsa-lib" ,alsa-lib) + ("faac" ,faac) + ("ffmpeg" ,ffmpeg) + ("freetype" ,freetype) + ("imagemagick" ,imagemagick) + ("lame" ,lame) + ("liba52" ,liba52) + ("libdv" ,libdv) + ("libdvdread" ,libdvdread) + ("libjpeg" ,libjpeg-turbo) + ("libmpeg2" ,libmpeg2) + ("libogg" ,libogg) + ("libquicktime" ,libquicktime) + ("libtheora" ,libtheora) + ("libvorbis" ,libvorbis) + ("lzo" ,lzo) + ("mjepgtools" ,mjpegtools) + ("sdl" ,sdl) + ("v4l-utils" ,v4l-utils) + ("x11" ,libx11) + ("x264" ,libx264) + ("xaw" ,libxaw) + ("xext" ,libxext) + ("xpm" ,libxpm) + ("xv" ,libxv) + ("xvid" ,xvid) + ("zlib" ,zlib))) + (synopsis "Audio/Video Transcoder") + (description "Transcode is a fast, versatile and command-line based +audio/video everything to everything converter primarily focussed on producing +AVI video files with MP3 audio, but also including a program to read all the +video and audio streams from a DVD.") + (home-page + "http://linuxfromscratch.org/blfs/view/svn/multimedia/transcode.html") + (license license:gpl2+))) + (define-public svt-hevc (package (name "svt-hevc") -- cgit v1.2.3 From 2577a0196f246f73a754b9b2a0ffdd6b9e64cdda Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 19 Aug 2020 17:09:24 +0200 Subject: gnu: xf86-video-geode: Remove unnecessary patch. * gnu/packages/xorg.scm (xf86-video-geode)[source]: Remove patch. * gnu/packages/patches/xf86-video-geode-glibc-2.20.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/patches/xf86-video-geode-glibc-2.20.patch | 15 --------------- gnu/packages/xorg.scm | 3 +-- 3 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 gnu/packages/patches/xf86-video-geode-glibc-2.20.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d7f28c7a18..44680da70b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1663,7 +1663,6 @@ dist_patch_DATA = \ %D%/packages/patches/wordnet-CVE-2008-3908-pt2.patch \ %D%/packages/patches/x265-arm-flags.patch \ %D%/packages/patches/xf86-video-ark-remove-mibstore.patch \ - %D%/packages/patches/xf86-video-geode-glibc-2.20.patch \ %D%/packages/patches/xf86-video-mach64-glibc-2.20.patch \ %D%/packages/patches/xf86-video-savage-xorg-compat.patch \ %D%/packages/patches/xf86-video-siliconmotion-fix-ftbfs.patch \ diff --git a/gnu/packages/patches/xf86-video-geode-glibc-2.20.patch b/gnu/packages/patches/xf86-video-geode-glibc-2.20.patch deleted file mode 100644 index 4dc69e3611..0000000000 --- a/gnu/packages/patches/xf86-video-geode-glibc-2.20.patch +++ /dev/null @@ -1,15 +0,0 @@ -Allow builds with glibc 2.20. -Based on a patch by Peter Hutterer . -See . - ---- xf86-video-geode-2.11.16/src/lx_memory.c.~1~ 2014-07-16 16:59:37.000000000 -0400 -+++ xf86-video-geode-2.11.16/src/lx_memory.c 2014-12-19 00:38:11.753388268 -0500 -@@ -23,6 +23,8 @@ - * software without specific prior written permission. - */ - -+#include -+ - #include "xf86.h" - #include "geode.h" - #include "cim/cim_regs.h" diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 99c3431a8b..d4c4ab9ecc 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -2927,8 +2927,7 @@ It supports a variety of Adreno graphics chipsets.") (uri (string-append "mirror://xorg/individual/driver/xf86-video-geode-" version ".tar.bz2")) (sha256 - (base32 "0r2dz0agg0k5wrqdbicji6mh6svzyl0xgqk76hpcfdlzn2zx15zl")) - (patches (search-patches "xf86-video-geode-glibc-2.20.patch")))) + (base32 "0r2dz0agg0k5wrqdbicji6mh6svzyl0xgqk76hpcfdlzn2zx15zl")))) (build-system gnu-build-system) (inputs `(("xorg-server" ,xorg-server))) (native-inputs `(("pkg-config" ,pkg-config))) -- cgit v1.2.3 From 4c7d16c5516211f73cef06b39ade8022acb96f23 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 19 Aug 2020 23:01:56 +0200 Subject: gnu: unknown-horizons: Fix build with python@3.8 and python-pytest@5. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/games.scm (unknown-horizons)[source]: Add patch. [arguments]: Add a ‘fix-tests-with-pytest>=4’ phase. [native-inputs]: Add python-distro. * gnu/packages/patches/unknown-horizons-python-3.8-distro.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/games.scm | 12 ++++- .../unknown-horizons-python-3.8-distro.patch | 52 ++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/unknown-horizons-python-3.8-distro.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 44680da70b..4d1c7f366b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1616,6 +1616,7 @@ dist_patch_DATA = \ %D%/packages/patches/ucx-tcp-iface-ioctl.patch \ %D%/packages/patches/udiskie-no-appindicator.patch \ %D%/packages/patches/ungoogled-chromium-system-nspr.patch \ + %D%/packages/patches/unknown-horizons-python-3.8-distro.patch \ %D%/packages/patches/unzip-CVE-2014-8139.patch \ %D%/packages/patches/unzip-CVE-2014-8140.patch \ %D%/packages/patches/unzip-CVE-2014-8141.patch \ diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index a789fced63..0f01267827 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -3541,7 +3541,8 @@ also available.") (file-name (string-append name "-" version ".tar.gz")) (sha256 (base32 - "1n747p7h0qp48szgp262swg0xh8kxy1bw8ag1qczs4i26hyzs5x4")))) + "1n747p7h0qp48szgp262swg0xh8kxy1bw8ag1qczs4i26hyzs5x4")) + (patches (search-patches "unknown-horizons-python-3.8-distro.patch")))) (build-system python-build-system) (arguments '(#:phases @@ -3564,6 +3565,14 @@ also available.") (assoc-ref outputs "out") "/share/unknown-horizons\")")))) #t)) + (add-before 'check 'fix-tests-with-pytest>=4 + (lambda _ + (substitute* "tests/conftest.py" + (("pytest_namespace") + "pytest_configure") + (("get_marker") + "get_closest_marker")) + #t)) ;; TODO: Run GUI tests as well (replace 'check (lambda _ @@ -3582,6 +3591,7 @@ also available.") ("python-pyyaml" ,python-pyyaml))) (native-inputs `(("intltool" ,intltool) + ("python-distro" ,python-distro) ;; Required for tests ("python-greenlet" ,python-greenlet) diff --git a/gnu/packages/patches/unknown-horizons-python-3.8-distro.patch b/gnu/packages/patches/unknown-horizons-python-3.8-distro.patch new file mode 100644 index 0000000000..d43a4f3e4a --- /dev/null +++ b/gnu/packages/patches/unknown-horizons-python-3.8-distro.patch @@ -0,0 +1,52 @@ +From: Tobias Geerinckx-Rice +Date: Wed, 19 Aug 2020 22:58:32 +0200 +Subject: [PATCH] gnu: unknown-horizons: Replace ‘dist’ with ‘distro’. + +This fixes builds with Python >= 3.8. Taken verbatim from upstream[0]. + +[0]: https://github.com/unknown-horizons/unknown-horizons/commit/c40fb866f3f72ac1049d6fa7859b17d8a48fe9e1 + +From c40fb866f3f72ac1049d6fa7859b17d8a48fe9e1 Mon Sep 17 00:00:00 2001 +From: MarkusHackspacher +Date: Thu, 18 Jul 2019 11:46:39 +0200 +Subject: [PATCH] replace deprecated to distro package + +--- + requirements.txt | 1 + + setup.py | 4 +++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/requirements.txt b/requirements.txt +index a5edf794fb..b58179bfa8 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -1,6 +1,7 @@ + coverage==4.4.1 + coveralls==1.1 + crayons==0.1.2 ++distro + future==0.16.0 + greenlet==0.4.15 + isort==4.3.4 +diff --git a/setup.py b/setup.py +index 6d63a5ce15..6a237a8749 100755 +--- a/setup.py ++++ b/setup.py +@@ -32,6 +32,8 @@ + from distutils.spawn import find_executable + from shutil import copytree, rmtree + ++import distro ++ + import horizons + from horizons.constants import VERSION + from horizons.ext import polib +@@ -39,7 +41,7 @@ + # Ensure we are in the correct directory + os.chdir(os.path.realpath(os.path.dirname(__file__))) + +-if platform.dist()[0].lower() in ('debian', 'ubuntu'): ++if distro.linux_distribution(full_distribution_name=False)[0] in ('debian', 'mint', 'ubuntu'): + executable_path = 'games' + else: + executable_path = 'bin' -- cgit v1.2.3 From 1cc75fef122db08dd30a86a8074e7ac10fbc00c0 Mon Sep 17 00:00:00 2001 From: Eric Bavier Date: Thu, 20 Aug 2020 15:27:33 -0500 Subject: gnu: libmhash: Fix use-after-free in tests. * gnu/packages/patches/libmhash-hmac-fix-uaf.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/mcrypt.scm (libmhash)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/mcrypt.scm | 5 +++-- gnu/packages/patches/libmhash-hmac-fix-uaf.patch | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/libmhash-hmac-fix-uaf.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 4d1c7f366b..8d8f5b78a2 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1295,6 +1295,7 @@ dist_patch_DATA = \ %D%/packages/patches/mcrypt-CVE-2012-4426.patch \ %D%/packages/patches/mcrypt-CVE-2012-4527.patch \ %D%/packages/patches/libmemcached-build-with-gcc7.patch \ + %D%/packages/patches/libmhash-hmac-fix-uaf.patch \ %D%/packages/patches/mediastreamer2-srtp2.patch \ %D%/packages/patches/mesa-skip-disk-cache-test.patch \ %D%/packages/patches/mescc-tools-boot.patch \ diff --git a/gnu/packages/mcrypt.scm b/gnu/packages/mcrypt.scm index fb5529382e..d0cfb8f7a3 100644 --- a/gnu/packages/mcrypt.scm +++ b/gnu/packages/mcrypt.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Eric Bavier +;;; Copyright © 2014, 2020 Eric Bavier ;;; Copyright © 2016 Efraim Flashner ;;; ;;; This file is part of GNU Guix. @@ -94,7 +94,8 @@ XTEA, 3WAY, TWOFISH, BLOWFISH, ARCFOUR, WAKE and more.") (sha256 (base32 "1w7yiljan8gf1ibiypi6hm3r363imm3sxl1j8hapjdq3m591qljn")) - (patches (search-patches "mhash-keygen-test-segfault.patch")))) + (patches (search-patches "mhash-keygen-test-segfault.patch" + "libmhash-hmac-fix-uaf.patch")))) (build-system gnu-build-system) (native-inputs `(("perl" ,perl))) ;for tests diff --git a/gnu/packages/patches/libmhash-hmac-fix-uaf.patch b/gnu/packages/patches/libmhash-hmac-fix-uaf.patch new file mode 100644 index 0000000000..76f937f4f6 --- /dev/null +++ b/gnu/packages/patches/libmhash-hmac-fix-uaf.patch @@ -0,0 +1,22 @@ +--- mhash-0.9.9.9/src/hmac_test.c 2020-08-20 14:53:06.628995733 -0500 ++++ mhash-0.9.9.9/src/hmac_test.c 2020-08-20 14:53:39.424885862 -0500 +@@ -72,8 +72,6 @@ + return(MUTILS_INVALID_RESULT); + } + +- mutils_free(tmp); +- + /* Test No 2 */ + + mutils_memset(tmp, 0, sizeof(tmp)); +--- mhash-0.9.9.9/src/keygen_test.c 2020-08-20 14:53:12.940974589 -0500 ++++ mhash-0.9.9.9/src/keygen_test.c 2020-08-20 14:53:59.736817812 -0500 +@@ -94,8 +94,6 @@ + return(MUTILS_INVALID_RESULT); + } + +- mutils_free(tmp); +- + passlen = sizeof(PASSWORD2); + password = (mutils_word8 *) mutils_malloc(passlen + 1); + mutils_strncpy(password, (mutils_word8 *) PASSWORD2, passlen); -- cgit v1.2.3 From e45d7f3198a35e6c1a5cfbfba49598a7f657f106 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 25 Aug 2020 06:59:07 -0400 Subject: gnu: icecat: Update to 68.12.0-guix0-preview1 [security fixes]. Includes fixes for CVE-2020-15663, CVE-2020-15664, and CVE-2020-15669. * gnu/packages/gnuzilla.scm (%icecat-version, %icecat-build-id): Update. (icecat-source): Update gnuzilla commit, base version, and hashes. * gnu/packages/patches/icecat-makeicecat.patch: Adapt to new version. --- gnu/packages/gnuzilla.scm | 12 ++++++------ gnu/packages/patches/icecat-makeicecat.patch | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'gnu/packages/patches') diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 65e79f4ef1..fa18f2927c 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -556,8 +556,8 @@ from forcing GEXP-PROMISE." #:system system #:guile-for-build guile))) -(define %icecat-version "68.11.0-guix0-preview1") -(define %icecat-build-id "20200728000000") ;must be of the form YYYYMMDDhhmmss +(define %icecat-version "68.12.0-guix0-preview1") +(define %icecat-build-id "20200825000000") ;must be of the form YYYYMMDDhhmmss ;; 'icecat-source' is a "computed" origin that generates an IceCat tarball ;; from the corresponding upstream Firefox ESR tarball, using the 'makeicecat' @@ -579,11 +579,11 @@ from forcing GEXP-PROMISE." "firefox-" upstream-firefox-version ".source.tar.xz")) (sha256 (base32 - "0q11dmfz59a11xgwy5sdc6x89xvb8lkm51lr8yvqb9qvmz5gghci")))) + "1k17pi4zh9hrvkzbw4rzzw879a15hpvwriylp75wl22rl7r2nsdf")))) - (upstream-icecat-base-version "68.11.0") ; maybe older than base-version + (upstream-icecat-base-version "68.12.0") ; maybe older than base-version ;;(gnuzilla-commit (string-append "v" upstream-icecat-base-version)) - (gnuzilla-commit "ac907e0c0f5b8896da34d31594b168e60983bec8") + (gnuzilla-commit "15a7c3d991a670b6489d4f432b52a188358f4ca5") (gnuzilla-source (origin (method git-fetch) @@ -595,7 +595,7 @@ from forcing GEXP-PROMISE." (string-take gnuzilla-commit 8))) (sha256 (base32 - "1n2sdf48s5xwcaf69v7yqvas069ficqnfk6nf0kqvd87vryb7182")))) + "0n7p067yay413iy0gzprz0xrdkcxj5f8ywhkcghhhzw1nwajckba")))) (makeicecat-patch (local-file (search-patch "icecat-makeicecat.patch"))) diff --git a/gnu/packages/patches/icecat-makeicecat.patch b/gnu/packages/patches/icecat-makeicecat.patch index 521166b0fc..265725ce36 100644 --- a/gnu/packages/patches/icecat-makeicecat.patch +++ b/gnu/packages/patches/icecat-makeicecat.patch @@ -25,7 +25,7 @@ index 8be2362..48716f2 100755 -wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc -gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 -gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc --echo -n 91c1f7caaf1ba785b74799865227456bf784ba614d17cf5f0f41a5f25d6d2160 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +-echo -n ae692bf2a15908cacbb9d4c7ccf78525a87410ff3f13befedc1926f849bc27cc firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - - -echo Extracting Firefox tarball -tar -xf firefox-${FFVERSION}esr.source.tar.xz @@ -37,7 +37,7 @@ index 8be2362..48716f2 100755 +# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc +# gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 +# gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc -+# echo -n 91c1f7caaf1ba785b74799865227456bf784ba614d17cf5f0f41a5f25d6d2160 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - ++# echo -n ae692bf2a15908cacbb9d4c7ccf78525a87410ff3f13befedc1926f849bc27cc firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +# +# echo Extracting Firefox tarball +# tar -xf firefox-${FFVERSION}esr.source.tar.xz -- cgit v1.2.3 From 6e7bede9bed8280fe0399aa1cae7e58bf1fdc6b2 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Wed, 26 Aug 2020 17:05:56 -0400 Subject: gnu: xorg-server: Update replacement to 1.20.9 [security-fixes]. Includes fixes for CVE-2020-1436, CVE-2020-14345, CVE-2020-14346, and CVE-2020-14361. * gnu/packages/xorg.scm (xorg-server/fixed): Update to 1.20.9. * gnu/packages/patches/xorg-server-CVE-2020-14347.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - .../patches/xorg-server-CVE-2020-14347.patch | 33 ---------------------- gnu/packages/xorg.scm | 11 +++++--- 3 files changed, 7 insertions(+), 38 deletions(-) delete mode 100644 gnu/packages/patches/xorg-server-CVE-2020-14347.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 2f851afe4e..97a494f24a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1674,7 +1674,6 @@ dist_patch_DATA = \ %D%/packages/patches/xf86-video-voodoo-pcitag.patch \ %D%/packages/patches/xfce4-panel-plugins.patch \ %D%/packages/patches/xfce4-settings-defaults.patch \ - %D%/packages/patches/xorg-server-CVE-2020-14347.patch \ %D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \ %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ %D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \ diff --git a/gnu/packages/patches/xorg-server-CVE-2020-14347.patch b/gnu/packages/patches/xorg-server-CVE-2020-14347.patch deleted file mode 100644 index c54b93d764..0000000000 --- a/gnu/packages/patches/xorg-server-CVE-2020-14347.patch +++ /dev/null @@ -1,33 +0,0 @@ -From aac28e162e5108510065ad4c323affd6deffd816 Mon Sep 17 00:00:00 2001 -From: Matthieu Herrb -Date: Sat, 25 Jul 2020 19:33:23 +0200 -Subject: [PATCH] fix for ZDI-11426 - -Avoid leaking un-initalized memory to clients by zeroing the -whole pixmap on initial allocation. - -This vulnerability was discovered by: -Jan-Niklas Sohn working with Trend Micro Zero Day Initiative - -Signed-off-by: Matthieu Herrb -Reviewed-by: Alan Coopersmith ---- - dix/pixmap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/dix/pixmap.c b/dix/pixmap.c -index 1186d7dbb..5a0146bbb 100644 ---- a/dix/pixmap.c -+++ b/dix/pixmap.c -@@ -116,7 +116,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) - if (pScreen->totalPixmapSize > ((size_t) - 1) - pixDataSize) - return NullPixmap; - -- pPixmap = malloc(pScreen->totalPixmapSize + pixDataSize); -+ pPixmap = calloc(1, pScreen->totalPixmapSize + pixDataSize); - if (!pPixmap) - return NullPixmap; - --- -2.27.0 - diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index bb49d40fb6..b3aa7e7192 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -5447,15 +5447,18 @@ communicates with the user via graphical controls such as buttons and draggable titlebars and borders.") (license license:x11))) -(define xorg-server/fixed ; Fixes CVE-2020-14347 +(define xorg-server/fixed ; security fixes (package (inherit xorg-server) + (version "1.20.9") (source (origin (inherit (package-source xorg-server)) - (patches - (append (origin-patches (package-source xorg-server)) - (search-patches "xorg-server-CVE-2020-14347.patch"))))))) + (uri (string-append "mirror://xorg/individual/xserver/" + "xorg-server-" version ".tar.bz2")) + (sha256 + (base32 + "0w9mrnffvjgmwi50kln15i8rpdskxv97r78l75wlcmg4vzhg46g2")))))) ;; This package is intended to be used when building GTK+. ;; Note: It's currently marked as "hidden" to avoid having two non-eq? -- cgit v1.2.3 From 6d8dd5bad773a9bc4eaf0b3c13dd9c373c3546c3 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Thu, 27 Aug 2020 18:15:05 +0300 Subject: gnu: vcflib: Use shared libraries. * gnu/packages/bioinformatics.scm (vcflib)[source]: Add patch. Add snippet to adjust files for new locations. [inputs]: Add fastahack, smithwaterman, tabixpp, xz. [native-inputs]: Add pkg-config. Remove the package-source of fastahack, fsom, smithwaterman, tabixpp. [arguments]: Remove make-flags. Add custom phase to add the output lib directory to the rpath. Adjust custom 'unpack-submodule-sources for the change in native-inputs. Adjust custom 'install phase to also install libraries and headers. * gnu/packages/patches/vcflib-use-shared-libraries.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/bioinformatics.scm | 70 +++++------ .../patches/vcflib-use-shared-libraries.patch | 135 +++++++++++++++++++++ 3 files changed, 169 insertions(+), 37 deletions(-) create mode 100644 gnu/packages/patches/vcflib-use-shared-libraries.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 97a494f24a..76f6fe6be5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1639,6 +1639,7 @@ dist_patch_DATA = \ %D%/packages/patches/vboot-utils-fix-format-load-address.patch \ %D%/packages/patches/vboot-utils-fix-tests-show-contents.patch \ %D%/packages/patches/vboot-utils-skip-test-workbuf.patch \ + %D%/packages/patches/vcflib-use-shared-libraries.patch \ %D%/packages/patches/vigra-python-compat.patch \ %D%/packages/patches/vinagre-newer-freerdp.patch \ %D%/packages/patches/vinagre-newer-rdp-parameters.patch \ diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index afade365ca..db69819055 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -15641,9 +15641,16 @@ library automatically handles index file generation and use.") "/vcflib-" version "-src.tar.gz")) (sha256 (base32 "14zzrg8hg8cq9cvq2wdvp21j7nmxxkjrbagw2apd2yqv2kyx42lm")) + (patches (search-patches "vcflib-use-shared-libraries.patch")) (modules '((guix build utils))) (snippet `(begin + (substitute* (find-files "." "\\.(h|c)(pp)?$") + (("\"SmithWatermanGotoh.h\"") "") + (("\"convert.h\"") "") + (("\"disorder.h\"") "") + (("\"tabix.hpp\"") "") + (("\"Fasta.h\"") "")) (for-each delete-file-recursively '("fastahack" "filevercmp" "fsom" "googletest" "intervaltree" "libVCFH" "multichoose" "smithwaterman" "tabixpp")) @@ -15651,34 +15658,34 @@ library automatically handles index file generation and use.") (build-system gnu-build-system) (inputs `(("htslib" ,htslib) + ("fastahack" ,fastahack) ("perl" ,perl) ("python" ,python) + ("smithwaterman" ,smithwaterman) + ("tabixpp" ,tabixpp) + ("xz" ,xz) ("zlib" ,zlib))) (native-inputs - `(;; Submodules. + `(("pkg-config" ,pkg-config) + ;; Submodules. ;; This package builds against the .o files so we need to extract the source. - ("fastahack-src" ,(package-source fastahack)) ("filevercmp-src" ,(package-source filevercmp)) - ("fsom-src" ,(package-source fsom)) ("intervaltree-src" ,(package-source intervaltree)) - ("multichoose-src" ,(package-source multichoose)) - ("smithwaterman-src" ,(package-source smithwaterman)) - ("tabixpp-src" ,(package-source tabixpp)))) + ("multichoose-src" ,(package-source multichoose)))) (arguments `(#:tests? #f ; no tests - #:make-flags (list (string-append "HTS_LIB=" - (assoc-ref %build-inputs "htslib") - "/lib/libhts.a") - (string-append "HTS_INCLUDES= -I" - (assoc-ref %build-inputs "htslib") - "/include/htslib") - (string-append "HTS_LDFLAGS= -L" - (assoc-ref %build-inputs "htslib") - "/include/htslib" " -lhts")) #:phases (modify-phases %standard-phases + (add-after 'unpack 'set-flags + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "Makefile" + (("LDFLAGS =") + (string-append "LDFLAGS = -Wl,-rpath=" + (assoc-ref outputs "out") "/lib "))) + (substitute* "filevercmp/Makefile" + (("-c") "-c -fPIC")) + #t)) (delete 'configure) - (delete 'check) (add-after 'unpack 'unpack-submodule-sources (lambda* (#:key inputs #:allow-other-keys) (let ((unpack (lambda (source target) @@ -15690,34 +15697,23 @@ library automatically handles index file generation and use.") (assoc-ref inputs source) "--strip-components=1")))))) (and - (unpack "fastahack-src" "fastahack") (unpack "filevercmp-src" "filevercmp") - (unpack "fsom-src" "fsom") (unpack "intervaltree-src" "intervaltree") - (unpack "multichoose-src" "multichoose") - (unpack "smithwaterman-src" "smithwaterman") - (unpack "tabixpp-src" "tabixpp"))))) - (replace 'build - (lambda* (#:key inputs make-flags #:allow-other-keys) - (let ((htslib (assoc-ref inputs "htslib"))) - (with-directory-excursion "tabixpp" - (substitute* "Makefile" - (("-Ihtslib") (string-append "-I" htslib "/include/htslib")) - (("-Lhtslib") (string-append "-L" htslib "/lib/htslib")) - (("htslib/htslib") (string-append htslib "/include/htslib"))) - (invoke "make" - (string-append "HTS_LIB=" htslib "/lib/libhts.a"))) - (apply invoke "make" "CC=gcc" "CFLAGS=-Itabixpp" make-flags)))) + (unpack "multichoose-src" "multichoose"))))) (replace 'install (lambda* (#:key outputs #:allow-other-keys) - (let ((bin (string-append (assoc-ref outputs "out") "/bin")) - (lib (string-append (assoc-ref outputs "out") "/lib"))) + (let* ((out (assoc-ref outputs "out")) + (bin (string-append out "/bin")) + (lib (string-append out "/lib"))) (for-each (lambda (file) (install-file file bin)) (find-files "bin" ".*")) - ;; The header files in src/ do not interface libvcflib, - ;; therefore they are left out. - (install-file "libvcflib.a" lib)) + (install-file "libvcflib.so" lib) + (install-file "libvcflib.a" lib) + (for-each + (lambda (file) + (install-file file (string-append out "/include"))) + (find-files "include" "\\.h(pp)?$"))) #t))))) (home-page "https://github.com/vcflib/vcflib/") (synopsis "Library for parsing and manipulating VCF files") diff --git a/gnu/packages/patches/vcflib-use-shared-libraries.patch b/gnu/packages/patches/vcflib-use-shared-libraries.patch new file mode 100644 index 0000000000..e198ec663c --- /dev/null +++ b/gnu/packages/patches/vcflib-use-shared-libraries.patch @@ -0,0 +1,135 @@ +This patch is a combination of many of the patches from Debian: +https://sources.debian.org/src/libvcflib/1.0.1+dfsg-3/debian/patches/ + +--- + Makefile | 63 +++++++++++--------------------------------------------- + 1 file changed, 12 insertions(+), 51 deletions(-) + +diff --git a/Makefile b/Makefile +index 6b13350..be85f22 100644 +--- a/Makefile ++++ b/Makefile +@@ -114,43 +114,25 @@ BIN_SOURCES = src/vcfecho.cpp \ + src/vcfnull2ref.cpp \ + src/vcfinfosummarize.cpp + +-# when we can figure out how to build on mac +-# src/vcfsom.cpp +- + #BINS = $(BIN_SOURCES:.cpp=) + BINS = $(addprefix $(BIN_DIR)/,$(notdir $(BIN_SOURCES:.cpp=))) + SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=)) + +-TABIX = tabixpp/tabix.o +-FASTAHACK = fastahack/Fasta.o +-SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o +-REPEATS = smithwaterman/Repeats.o +-INDELALLELE = smithwaterman/IndelAllele.o +-DISORDER = smithwaterman/disorder.o +-LEFTALIGN = smithwaterman/LeftAlign.o +-FSOM = fsom/fsom.o + FILEVERCMP = filevercmp/filevercmp.o + +-# Work out how to find htslib +-# Use the one we ship in tabixpp unless told otherwise by the environment +-HTS_LIB ?= $(VCF_LIB_LOCAL)/tabixpp/htslib/libhts.a +-HTS_INCLUDES ?= -I$(VCF_LIB_LOCAL)/tabixpp/htslib +-HTS_LDFLAGS ?= -L$(VCF_LIB_LOCAL)/tabixpp/htslib -lhts -lbz2 -lm -lz -llzma -pthread +- +- +-INCLUDES = $(HTS_INCLUDES) -I$(INC_DIR) +-LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2 ++INCLUDES = -I$(INC_DIR) $(shell pkg-config --cflags htslib fastahack smithwaterman tabixpp) ++LDFLAGS = -L$(LIB_DIR) -lvcflib -lpthread -lz -lstdc++ -lm -llzma -lbz2 $(shell pkg-config --libs htslib fastahack smithwaterman tabixpp) + + + +-all: $(OBJECTS) $(BINS) scriptToBin ++all: $(OBJECTS) $(BINS) scriptToBin libvcflib.a + + scriptToBin: $(BINS) + $(CP) scripts/* $(BIN_DIR) + + GIT_VERSION += $(shell git describe --abbrev=4 --dirty --always) + +-CXXFLAGS = -Ofast -D_FILE_OFFSET_BITS=64 -std=c++0x ++CXXFLAGS = -Ofast -D_FILE_OFFSET_BITS=64 -std=c++0x -fPIC + #CXXFLAGS = -O2 + #CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual + +@@ -168,7 +150,7 @@ profiling: + gprof: + $(MAKE) CXXFLAGS="$(CXXFLAGS) -pg" all + +-$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP) $(FASTAHACK) ++$(OBJECTS): $(SOURCES) $(HEADERS) multichoose pre $(FILEVERCMP) + $(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && $(CP) src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ + + multichoose: pre +@@ -177,39 +159,22 @@ multichoose: pre + intervaltree: pre + cd intervaltree && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ + +-$(TABIX): pre +- cd tabixpp && INCLUDES="$(HTS_INCLUDES)" LIBPATH="-L. $(HTS_LDFLAGS)" HTSLIB="$(HTS_LIB)" $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ +- +-$(SMITHWATERMAN): pre +- cd smithwaterman && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/ +- +-$(DISORDER): $(SMITHWATERMAN) +- +-$(REPEATS): $(SMITHWATERMAN) +- +-$(LEFTALIGN): $(SMITHWATERMAN) +- +-$(INDELALLELE): $(SMITHWATERMAN) +- +-$(FASTAHACK): pre +- cd fastahack && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) Fasta.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/ +- +-#$(FSOM): +-# cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm +- + $(FILEVERCMP): pre + cd filevercmp && make && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/ + + $(SHORTBINS): pre + $(MAKE) $(BIN_DIR)/$@ + +-$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(SMITHWATERMAN) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree ++$(BINS): $(BIN_SOURCES) libvcflib.so $(OBJECTS) $(SSW) $(FILEVERCMP) pre intervaltree + $(CXX) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\" + +-libvcflib.a: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) $(TABIX) pre +- ar rs libvcflib.a $(OBJECTS) smithwaterman/sw.o $(FASTAHACK) $(SSW) $(FILEVERCMP) $(TABIX) ++libvcflib.a: $(OBJECTS) $(SSW) $(FILEVERCMP) pre ++ ar rs libvcflib.a $(OBJECTS) $(SSW) $(FILEVERCMP) + $(CP) libvcflib.a $(LIB_DIR) + ++libvcflib.so: $(OBJECTS) $(SSW) $(FILEVERCMP) pre ++ $(CXX) -shared -o libvcflib.so $(OBJECTS) $(SSW) $(FILEVERCMP) ++ $(CP) libvcflib.so $(LIB_DIR) + + test: $(BINS) + @prove -Itests/lib -w tests/*.t +@@ -230,16 +195,12 @@ clean: + $(RM) $(BINS) $(OBJECTS) + $(RM) ssw_cpp.o ssw.o + $(RM) libvcflib.a ++ $(RM) libvcflib.so + $(RM) -r $(BIN_DIR) + $(RM) -r $(LIB_DIR) + $(RM) -r $(INC_DIR) + $(RM) -r $(OBJ_DIR) +- $(MAKE) clean -C tabixpp +- $(MAKE) clean -C smithwaterman +- $(MAKE) clean -C fastahack + $(MAKE) clean -C multichoose +- $(MAKE) clean -C fsom +- $(MAKE) clean -C libVCFH + $(MAKE) clean -C test + $(MAKE) clean -C filevercmp + $(MAKE) clean -C intervaltree +-- +2.28.0 + -- cgit v1.2.3 From 8df6900dffa9e1c74ac3f64877f067974eee0eeb Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 27 Aug 2020 15:02:04 +0200 Subject: gnu: sssd: Pass '--localstatedir=/var' and '--sysconfdir=/etc'. This ensures notably that libnss_sss looks for the mmap cache files in the right place, /var/lib/sss/mc, rather than in the store. * gnu/packages/patches/sssd-system-directories.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/sssd.scm (sssd)[source]: Use it. [arguments]: Pass "--localstatedir" and "--sysconfdir". --- gnu/local.mk | 1 + gnu/packages/patches/sssd-system-directories.patch | 56 ++++++++++++++++++++++ gnu/packages/sssd.scm | 8 +++- 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/sssd-system-directories.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 76f6fe6be5..9c54368eb3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1570,6 +1570,7 @@ dist_patch_DATA = \ %D%/packages/patches/sooperlooper-build-with-wx-30.patch \ %D%/packages/patches/sphinxbase-fix-doxygen.patch \ %D%/packages/patches/sssd-fix-samba.patch \ + %D%/packages/patches/sssd-system-directories.patch \ %D%/packages/patches/steghide-fixes.patch \ %D%/packages/patches/suitesparse-mongoose-cmake.patch \ %D%/packages/patches/superlu-dist-awpm-grid.patch \ diff --git a/gnu/packages/patches/sssd-system-directories.patch b/gnu/packages/patches/sssd-system-directories.patch new file mode 100644 index 0000000000..f2ab0182e1 --- /dev/null +++ b/gnu/packages/patches/sssd-system-directories.patch @@ -0,0 +1,56 @@ +Do not attempt to create $localstatedir and $sysconfdir (i.e., /var and /etc) +upon "make install". + +diff --git a/Makefile.in b/Makefile.in +index c32cb7d..77a5c00 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -7991,7 +7991,7 @@ sssdconfdir = $(sysconfdir)/sssd + sssddatadir = $(datadir)/sssd + sssdapiplugindir = $(sssddatadir)/sssd.api.d + sssdtapscriptdir = $(sssddatadir)/systemtap +-dbuspolicydir = $(sysconfdir)/dbus-1/system.d ++dbuspolicydir = $(prefix)/etc/dbus-1/system.d + dbusservicedir = $(datadir)/dbus-1/system-services + sss_statedir = $(localstatedir)/lib/sss + pamlibdir = @pammoddir@ +@@ -8000,7 +8000,7 @@ nfslibdir = @nfsidmaplibdir@ + keytabdir = $(sss_statedir)/keytabs + pkgconfigdir = $(libdir)/pkgconfig + sudolibdir = @sudolibpath@ +-pamconfdir = $(sysconfdir)/pam.d ++pamconfdir = $(prefix)/etc/pam.d + systemtap_tapdir = @tapset_dir@ + sssdkcmdatadir = $(datadir)/sssd-kcm + deskprofilepath = $(sss_statedir)/deskprofile +@@ -43733,7 +43733,6 @@ installsssddirs:: + $(DESTDIR)$(bindir) \ + $(DESTDIR)$(sbindir) \ + $(DESTDIR)$(mandir) \ +- $(DESTDIR)$(pidpath) \ + $(DESTDIR)$(pluginpath) \ + $(DESTDIR)$(libdir)/ldb \ + $(DESTDIR)$(dbuspolicydir) \ +@@ -43743,22 +43742,9 @@ installsssddirs:: + $(DESTDIR)$(sssddatadir) \ + $(DESTDIR)$(sudolibdir) \ + $(DESTDIR)$(autofslibdir) \ +- $(DESTDIR)$(pipepath)/private \ +- $(SSSD_USER_DIRS) \ + $(NULL); + @SSSD_USER_TRUE@ -chown $(SSSD_USER):$(SSSD_USER) $(SSSD_USER_DIRS) + @SSSD_USER_TRUE@ -chown $(SSSD_USER) $(DESTDIR)$(pipepath)/private +- $(INSTALL) -d -m 0700 $(DESTDIR)$(dbpath) $(DESTDIR)$(logpath) \ +- $(DESTDIR)$(keytabdir) \ +- $(NULL) +- $(INSTALL) -d -m 0750 $(DESTDIR)$(pipepath)/private +- $(INSTALL) -d -m 0755 $(DESTDIR)$(mcpath) $(DESTDIR)$(pipepath) \ +- $(DESTDIR)$(pubconfpath) \ +- $(DESTDIR)$(pubconfpath)/krb5.include.d $(DESTDIR)$(gpocachepath) +- $(INSTALL) -d -m 0711 $(DESTDIR)$(sssdconfdir) \ +- $(DESTDIR)$(sssdconfdir)/conf.d \ +- $(DESTDIR)$(sssdconfdir)/pki +-@BUILD_SECRETS_TRUE@ $(MKDIR_P) $(DESTDIR)$(secdbpath) + + @HAVE_DOXYGEN_TRUE@docs: + @HAVE_DOXYGEN_TRUE@ $(DOXYGEN) src/doxy.config diff --git a/gnu/packages/sssd.scm b/gnu/packages/sssd.scm index c004e8c21c..aa91424b4d 100644 --- a/gnu/packages/sssd.scm +++ b/gnu/packages/sssd.scm @@ -90,7 +90,8 @@ fundamental object types for C.") (sha256 (base32 "1h6hwibaf3xa2w6qpzjiiywmfj6zkgbz4r2isf3gd0xm6vq7n6if")) - (patches (search-patches "sssd-fix-samba.patch")))) + (patches (search-patches "sssd-fix-samba.patch" + "sssd-system-directories.patch")))) (build-system gnu-build-system) (arguments `(#:make-flags @@ -103,7 +104,10 @@ fundamental object types for C.") ;; online DTDs. "XMLLINT_FLAGS = --catalogs --nonet --noent --xinclude --noout") #:configure-flags - (list "--disable-cifs-idmap-plugin" + (list "--localstatedir=/var" ;for /var/lib/sss, /var/run/sssd.pid, etc. + "--sysconfdir=/etc" ;/etc/sssd + + "--disable-cifs-idmap-plugin" "--without-nfsv4-idmapd-plugin" "--without-python2-bindings" "--without-python3-bindings" -- cgit v1.2.3 From 36a09d185343375a5cba370431870f9c4435d623 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 23 Apr 2019 02:35:03 -0400 Subject: gnu: emacs: Update to 27.1. * gnu/packages/emacs.scm (emacs): Update to 27.1. [source]: In snippet, use 'find-files' to find 'eshell/esh-groups.el' if it exists, but gracefully handle its absence. [arguments]: Add "--with-cairo" to configure-flags. Add 'restore-emacs-pdmp' and 'make-compressed-files-writable' phases. Explicitly return #t from 'install-site-start' phase. [inputs]: Add cairo, pango, harfbuzz, jansson, and gmp. Remove imagemagick. (emacs-next): Remove variable. (emacs-minimal, emacs-xwidgets): Use 'package/inherit'. [arguments]: Remove 'restore-emacs-pdmp' phase. (emacs-no-x): Use 'package/inherit'. [arguments]: Remove "--with-cairo" from configure-flags. Remove 'restore-emacs-pdmp' phase. [inputs]: Remove cairo, pango, and harfbuzz. (emacs-no-x-toolkit): Use 'package/inherit'. [arguments]: Remove 'restore-emacs-pdmp' phase. Remove superfluous quasiquote+unquote-splicing pair. (emacs-wide-int): Use 'package/inherit'. (guile-emacs): Use 'package/inherit'. [arguments]: Remove "--with-cairo" from configure-flags. Remove 'restore-emacs-pdmp' phase. * gnu/packages/patches/emacs-ignore-empty-xim-styles.patch, gnu/packages/patches/emacs-source-date-epoch.patch: Adapt to apply cleanly to emacs-27.1. * gnu/packages/patches/emacs-exec-path.patch: Replace with the previous contents of 'emacs27-exec-path.patch', but remove the superfluous comment about it being "like emacs-exec-path.patch, but for Emacs 27". * gnu/packages/patches/emacs27-exec-path.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove 'emacs27-exec-path.patch'. --- gnu/local.mk | 1 - gnu/packages/emacs.scm | 203 +++++++-------------- gnu/packages/patches/emacs-exec-path.patch | 22 +-- .../patches/emacs-ignore-empty-xim-styles.patch | 4 +- gnu/packages/patches/emacs-source-date-epoch.patch | 6 +- gnu/packages/patches/emacs27-exec-path.patch | 18 -- 6 files changed, 85 insertions(+), 169 deletions(-) delete mode 100644 gnu/packages/patches/emacs27-exec-path.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 9c54368eb3..d956e52d97 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -918,7 +918,6 @@ dist_patch_DATA = \ %D%/packages/patches/elixir-path-length.patch \ %D%/packages/patches/elm-compiler-disable-reactor.patch \ %D%/packages/patches/elm-compiler-fix-map-key.patch \ - %D%/packages/patches/emacs27-exec-path.patch \ %D%/packages/patches/emacs-exec-path.patch \ %D%/packages/patches/emacs-exwm-fix-fullscreen-states.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index ad8d4b0606..a338abc774 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2019 Ludovic Courtès ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer -;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mark H Weaver +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver ;;; Copyright © 2014, 2015, 2016, 2017 Alex Kost ;;; Copyright © 2016, 2018 Arun Isaac ;;; Copyright © 2016 Federico Beffa @@ -61,6 +61,7 @@ #:use-module (gnu packages imagemagick) #:use-module (gnu packages linux) ; alsa-lib #:use-module (gnu packages mail) ; for mailutils + #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) #:use-module (gnu packages texinfo) @@ -75,14 +76,14 @@ (define-public emacs (package (name "emacs") - (version "26.3") + (version "27.1") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/emacs/emacs-" version ".tar.xz")) (sha256 (base32 - "119ldpk7sgn9jlpyngv5y4z3i7bb8q3xp4p0qqi7i5nq39syd42d")) + "0h9f2wpmp6rb5rfwvqwv1ia1nw86h74p7hnz3vb3gjazj67i4k2a")) (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" "emacs-ignore-empty-xim-styles.patch" @@ -95,15 +96,7 @@ (for-each delete-file (append (find-files "." "\\.elc$") (find-files "." "loaddefs\\.el$") - ;; This is the only "autoloads" file that - ;; does not have "*loaddefs.el" name. - ;; TODO: Next time changing this package, - ;; replace the following with a call to - ;; `find-files', so that `delete-file' - ;; wouldn't error out when the file is - ;; missing, making the entire snippet field - ;; reusable as-is for `emacs-next' below. - '("eshell/esh-groups.el"))) + (find-files "eshell" "^esh-groups\\.el$"))) ;; Make sure Tramp looks for binaries in the right places on ;; remote Guix System machines, where 'getconf PATH' returns @@ -130,6 +123,7 @@ (arguments `(#:tests? #f ; no check target #:configure-flags (list "--with-modules" + "--with-cairo" "--disable-build-details") #:phases (modify-phases %standard-phases @@ -156,7 +150,7 @@ (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (lisp-dir (string-append out "/share/emacs/site-lisp")) - (emacs (string-append out "/bin/emacs"))) + (emacs (string-append out "/bin/emacs"))) ;; This is duplicated from emacs-utils to prevent coupling. (define* (emacs-byte-compile-directory dir) @@ -180,7 +174,31 @@ ;; which leads to conflicts. (delete-file (string-append lisp-dir "/subdirs.el")) ;; Byte compile the site-start files. - (emacs-byte-compile-directory lisp-dir))))))) + (emacs-byte-compile-directory lisp-dir)) + #t)) + (add-after 'glib-or-gtk-wrap 'restore-emacs-pdmp + ;; restore the dump file that Emacs installs somewhere in + ;; libexec/ to its original state + (lambda* (#:key outputs target #:allow-other-keys) + (let* ((libexec (string-append (assoc-ref outputs "out") + "/libexec")) + ;; each of these find-files should return one file + (pdmp (find-files libexec "^emacs\\.pdmp$")) + (pdmp-real (find-files libexec + "^\\.emacs\\.pdmp-real$"))) + (for-each (lambda (wrapper real) + (delete-file wrapper) + (rename-file real wrapper)) + pdmp pdmp-real)) + #t)) + (add-before 'reset-gzip-timestamps 'make-compressed-files-writable + ;; The 'reset-gzip-timestamps phase will throw a permission error + ;; if gzip files aren't writable then. This phase is needed when + ;; building from a git checkout. + (lambda _ + (for-each make-file-writable + (find-files %output ".*\\.t?gz$")) + #t))))) (inputs `(("gnutls" ,gnutls) ("ncurses" ,ncurses) @@ -192,12 +210,16 @@ ;; TODO: Add the optional dependencies. ("libx11" ,libx11) ("gtk+" ,gtk+) + ("cairo" ,cairo) + ("pango" ,pango) + ("harfbuzz" ,harfbuzz) ("libxft" ,libxft) ("libtiff" ,libtiff) ("giflib" ,giflib) ("libjpeg" ,libjpeg-turbo) - ("imagemagick" ,imagemagick) ("acl" ,acl) + ("jansson" ,jansson) + ("gmp" ,gmp) ;; When looking for libpng `configure' links with `-lpng -lz', so we ;; must also provide zlib as an input. @@ -243,119 +265,20 @@ large Lisp programs. It has full Unicode support for nearly all human languages.") (license license:gpl3+))) -(define-public emacs-next - (let ((commit "c36c5a3dedbb2e0349be1b6c3b7567ea7b594f1c") - (revision "0") - (emacs-version "27.0.91")) - (package - (inherit emacs) - (name "emacs-next") - (version (git-version emacs-version revision commit)) - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://git.savannah.gnu.org/git/emacs.git") - (commit commit))) - (sha256 - (base32 "0mlrg2npy1r79laahkgzhxd1qassfcdz8qk1cpw7mqgf6y5x505h")) - (file-name (git-file-name name version)) - (patches (search-patches "emacs27-exec-path.patch" - "emacs-fix-scheme-indent-function.patch" - "emacs-ignore-empty-xim-styles.patch" - "emacs-source-date-epoch.patch")) - (modules (origin-modules (package-source emacs))) - ;; TODO: once the snippet for `emacs' is changed to not fail when - ;; eshell/esh-groups.el does not exist, replace this snippet with - ;; (snippet (origin-snippet (package-source emacs))))). - (snippet - '(with-directory-excursion "lisp" - ;; Make sure Tramp looks for binaries in the right places on - ;; remote Guix System machines, where 'getconf PATH' returns - ;; something bogus. - (substitute* "net/tramp-sh.el" - ;; Patch the line after "(defcustom tramp-remote-path". - (("\\(tramp-default-remote-path") - (format #f "(tramp-default-remote-path ~s ~s ~s ~s " - "~/.guix-profile/bin" "~/.guix-profile/sbin" - "/run/current-system/profile/bin" - "/run/current-system/profile/sbin"))) - - ;; Make sure Man looks for C header files in the right - ;; places. - (substitute* "man.el" - (("\"/usr/local/include\"" line) - (string-join - (list line - "\"~/.guix-profile/include\"" - "\"/var/guix/profiles/system/profile/include\"") - " "))) - #t)))) - (arguments - (substitute-keyword-arguments (package-arguments emacs) - ((#:configure-flags flags) - `(cons* "--with-harfbuzz" ,flags)) - ((#:phases phases) - `(modify-phases ,phases - ;; The 'reset-gzip-timestamps phase will throw a - ;; permission error if gzip files aren't writable then - (add-before - 'reset-gzip-timestamps - 'make-compressed-files-writable - (lambda _ - (for-each make-file-writable - (find-files %output ".*\\.t?gz$")) - #t)) - ;; restore the dump file that Emacs installs somewhere in - ;; libexec/ to its original state - (add-after 'glib-or-gtk-wrap 'restore-emacs-pdmp - (lambda* (#:key outputs target #:allow-other-keys) - (let* ((libexec (string-append (assoc-ref outputs "out") - "/libexec")) - ;; each of these find-files should return one file - (pdmp (find-files libexec "^emacs\\.pdmp$")) - (pdmp-real (find-files libexec - "^\\.emacs\\.pdmp-real$"))) - (for-each (lambda (wrapper real) - (delete-file wrapper) - (rename-file real wrapper)) - pdmp pdmp-real) - #t))))))) - (inputs - `(("jansson" ,jansson) - ("harfbuzz" ,harfbuzz) - ;; Emacs no longer uses ImageMagick by default - ;; https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-27.0.91&id=c36c5a3dedbb2e0349be1b6c3b7567ea7b594f1c#n102 - ,@(alist-delete "imagemagick" (package-inputs emacs)))) - (native-inputs - `(("autoconf" ,autoconf) ; needed when building from trunk - ,@(package-native-inputs emacs))) - - ;; TODO: consider changing `emacs' to use a more robust way of - ;; specifying version for "EMACSLOADPATH", so as to avoid having to - ;; duplicate native-search-paths here. - (native-search-paths - (list (search-path-specification - (variable "EMACSLOADPATH") - ;; The versioned entry is for the Emacs' builtin libraries. - (files - (list "share/emacs/site-lisp" - (string-append "share/emacs/" emacs-version "/lisp")))) - (search-path-specification - (variable "INFOPATH") - (files '("share/info")))))))) - (define-public emacs-minimal ;; This is the version that you should use as an input to packages that just ;; need to byte-compile .el files. - (package (inherit emacs) + (package/inherit emacs (name "emacs-minimal") (synopsis "The extensible text editor (used only for byte-compilation)") (build-system gnu-build-system) (arguments (substitute-keyword-arguments (package-arguments emacs) ((#:configure-flags flags ''()) - `(list "--with-gnutls=no" "--disable-build-details")))) + `(list "--with-gnutls=no" "--disable-build-details")) + ((#:phases phases) + `(modify-phases ,phases + (delete 'restore-emacs-pdmp))))) (inputs `(("guix-emacs.el" ,(search-auxiliary-file "emacs/guix-emacs.el")) ("ncurses" ,ncurses))) @@ -363,8 +286,7 @@ languages.") `(("pkg-config" ,pkg-config))))) (define-public emacs-xwidgets - (package - (inherit emacs) + (package/inherit emacs (name "emacs-xwidgets") (synopsis "The extensible, customizable, self-documenting text editor (with xwidgets support)") @@ -372,14 +294,17 @@ editor (with xwidgets support)") (arguments (substitute-keyword-arguments (package-arguments emacs) ((#:configure-flags flags ''()) - `(cons "--with-xwidgets" ,flags)))) + `(cons "--with-xwidgets" ,flags)) + ((#:phases phases) + `(modify-phases ,phases + (delete 'restore-emacs-pdmp))))) (inputs `(("webkitgtk" ,webkitgtk) ("libxcomposite" ,libxcomposite) ,@(package-inputs emacs))))) (define-public emacs-no-x - (package (inherit emacs) + (package/inherit emacs (name "emacs-no-x") (synopsis "The extensible, customizable, self-documenting text editor (console only)") @@ -388,13 +313,20 @@ editor (console only)") (package-inputs emacs) '("libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg" "imagemagick" "libpng" "librsvg" "libxpm" "libice" - "libsm" + "libsm" "cairo" "pango" "harfbuzz" ;; These depend on libx11, so remove them as well. - "libotf" "m17n-lib" "dbus"))))) + "libotf" "m17n-lib" "dbus"))) + (arguments + (substitute-keyword-arguments (package-arguments emacs) + ((#:configure-flags flags ''()) + `(delete "--with-cairo" ,flags)) + ((#:phases phases) + `(modify-phases ,phases + (delete 'restore-emacs-pdmp))))))) (define-public emacs-no-x-toolkit - (package (inherit emacs) + (package/inherit emacs (name "emacs-no-x-toolkit") (synopsis "The extensible, customizable, self-documenting text editor (without an X toolkit)" ) @@ -402,13 +334,15 @@ editor (without an X toolkit)" ) (inputs (append `(("inotify-tools" ,inotify-tools)) (alist-delete "gtk+" (package-inputs emacs)))) (arguments - `(,@(substitute-keyword-arguments (package-arguments emacs) - ((#:configure-flags cf) - `(cons "--with-x-toolkit=no" ,cf))))))) + (substitute-keyword-arguments (package-arguments emacs) + ((#:configure-flags flags ''()) + `(cons "--with-x-toolkit=no" ,flags)) + ((#:phases phases) + `(modify-phases ,phases + (delete 'restore-emacs-pdmp))))))) (define-public emacs-wide-int - (package - (inherit emacs) + (package/inherit emacs (name "emacs-wide-int") (synopsis "The extensible, customizable, self-documenting text editor (with wide ints)" ) @@ -420,7 +354,7 @@ editor (with wide ints)" ) (define-public guile-emacs (let ((commit "41120e0f595b16387eebfbf731fff70481de1b4b") (revision "0")) - (package (inherit emacs) + (package/inherit emacs (name "guile-emacs") (version (git-version "0.0.0" revision commit)) (source (origin @@ -444,6 +378,8 @@ editor (with wide ints)" ) ;; Tests aren't passing for now. #:tests? #f ,@(package-arguments emacs)) + ((#:configure-flags flags ''()) + `(delete "--with-cairo" ,flags)) ((#:phases phases) `(modify-phases ,phases (add-after 'unpack 'autogen @@ -452,7 +388,8 @@ editor (with wide ints)" ) ;; Build sometimes fails: deps/dispnew.d: No such file or directory (add-before 'build 'make-deps-dir (lambda _ - (invoke "mkdir" "-p" "src/deps")))))))))) + (invoke "mkdir" "-p" "src/deps"))) + (delete 'restore-emacs-pdmp)))))))) (define-public m17n-db (package diff --git a/gnu/packages/patches/emacs-exec-path.patch b/gnu/packages/patches/emacs-exec-path.patch index 884fa94a64..7303599df1 100644 --- a/gnu/packages/patches/emacs-exec-path.patch +++ b/gnu/packages/patches/emacs-exec-path.patch @@ -4,15 +4,13 @@ with things like GCC being referenced. --- a/lisp/loadup.el +++ b/lisp/loadup.el -@@ -64,6 +64,11 @@ - (expand-file-name "textmodes" dir) - (expand-file-name "vc" dir))))) - -+;; Reset 'exec-path' so we don't capture the build-time $PATH in the -+;; 'emacs' executable. -+(setq-default exec-path nil) -+(setq exec-path nil) -+ - (if (eq t purify-flag) - ;; Hash consing saved around 11% of pure space in my tests. - (setq purify-flag (make-hash-table :test 'equal :size 70000))) +@@ -481,7 +481,8 @@ lost after dumping"))) + ((equal dump-mode "dump") "emacs") + ((equal dump-mode "bootstrap") "emacs") + ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp") +- (t (error "unrecognized dump mode %s" dump-mode))))) ++ (t (error "unrecognized dump mode %s" dump-mode)))) ++ (exec-path nil)) + (message "Dumping under the name %s" output) + (condition-case () + (delete-file output) diff --git a/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch index 606d3ece6f..398e65bdc8 100644 --- a/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch +++ b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch @@ -5,7 +5,7 @@ Index: emacs-26.3/src/xfns.c =================================================================== --- emacs-26.3.orig/src/xfns.c +++ emacs-26.3/src/xfns.c -@@ -2533,6 +2533,8 @@ xic_free_xfontset (struct frame *f) +@@ -2628,6 +2628,8 @@ xic_free_xfontset (struct frame *f) static XIMStyle best_xim_style (XIMStyles *xim) { @@ -14,7 +14,7 @@ Index: emacs-26.3/src/xfns.c int i, j; int nr_supported = ARRAYELTS (supported_xim_styles); -@@ -2541,6 +2543,7 @@ best_xim_style (XIMStyles *xim) +@@ -2636,6 +2638,7 @@ best_xim_style (XIMStyles *xim) if (supported_xim_styles[i] == xim->supported_styles[j]) return supported_xim_styles[i]; diff --git a/gnu/packages/patches/emacs-source-date-epoch.patch b/gnu/packages/patches/emacs-source-date-epoch.patch index 41c03ef514..77ea7ac15c 100644 --- a/gnu/packages/patches/emacs-source-date-epoch.patch +++ b/gnu/packages/patches/emacs-source-date-epoch.patch @@ -3,9 +3,9 @@ Honor SOURCE_DATE_EPOCH variable to avoid non-determinism in generated --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el -@@ -378,8 +378,12 @@ - "Insert the section-header line, - which lists the file name and which functions are in it, etc." +@@ -419,8 +419,12 @@ + ;; nil t)) + ;; (match-end 2)))) (insert generate-autoload-section-header) - (prin1 `(autoloads ,autoloads ,load-name ,file ,time) - outbuf) diff --git a/gnu/packages/patches/emacs27-exec-path.patch b/gnu/packages/patches/emacs27-exec-path.patch deleted file mode 100644 index 418aa633a1..0000000000 --- a/gnu/packages/patches/emacs27-exec-path.patch +++ /dev/null @@ -1,18 +0,0 @@ -Do not capture the build-time value of $PATH in the 'emacs' executable -since this can noticeably increase the size of the closure of Emacs -with things like GCC being referenced. - -(like emacs-exec-path.patch, but for Emacs 27) - ---- a/lisp/loadup.el -+++ b/lisp/loadup.el -@@ -479,7 +479,8 @@ lost after dumping"))) - ((equal dump-mode "dump") "emacs") - ((equal dump-mode "bootstrap") "emacs") - ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp") -- (t (error "unrecognized dump mode %s" dump-mode))))) -+ (t (error "unrecognized dump mode %s" dump-mode)))) -+ (exec-path nil)) - (message "Dumping under the name %s" output) - (condition-case () - (delete-file output) -- cgit v1.2.3 From fae995d309be226c793e77241cbb7f2c8a0800a6 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 27 Jan 2017 00:18:45 -0500 Subject: gnu: Add fpc. * gnu/packages/pascal.scm: New file. * gnu/packages/patches/fpc-reproducibility.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add pascal.scm. (dist_patch_DATA): Register patch. Signed-off-by: Danny Milosavljevic --- gnu/local.mk | 2 + gnu/packages/pascal.scm | 215 +++++++++++++++++++++++++ gnu/packages/patches/fpc-reproducibility.patch | 28 ++++ 3 files changed, 245 insertions(+) create mode 100644 gnu/packages/pascal.scm create mode 100644 gnu/packages/patches/fpc-reproducibility.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d956e52d97..8854698178 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -414,6 +414,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/package-management.scm \ %D%/packages/pantheon.scm \ %D%/packages/parallel.scm \ + %D%/packages/pascal.scm \ %D%/packages/password-utils.scm \ %D%/packages/patchutils.scm \ %D%/packages/pciutils.scm \ @@ -962,6 +963,7 @@ dist_patch_DATA = \ %D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \ %D%/packages/patches/foomatic-filters-CVE-2015-8560.patch \ %D%/packages/patches/fontconfig-hurd-path-max.patch \ + %D%/packages/patches/fpc-reproducibility.patch \ %D%/packages/patches/freedink-engine-fix-sdl-hints.patch \ %D%/packages/patches/freeimage-unbundle.patch \ %D%/packages/patches/fuse-overlapping-headers.patch \ diff --git a/gnu/packages/pascal.scm b/gnu/packages/pascal.scm new file mode 100644 index 0000000000..1353e8adfd --- /dev/null +++ b/gnu/packages/pascal.scm @@ -0,0 +1,215 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2017 Kei Kebreau +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages pascal) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages bootstrap) + #:use-module (gnu packages commencement) + #:use-module (gnu packages compression) + #:use-module (gnu packages gcc) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages xml) + #:use-module (ice-9 match)) + +(define fpc-bootstrap-i386-3.0.4 + (origin + (method url-fetch) + (uri + "mirror://sourceforge/freepascal/Linux/3.0.4/fpc-3.0.4.i386-linux.tar") + (sha256 + (base32 + "05xfgxa6vb0y2ryfsgn21m2kwaxhci6l2zxa3akvlnqminjsjvda")))) + +(define fpc-bootstrap-x86_64-3.0.4 + (origin + (method url-fetch) + (uri + "mirror://sourceforge/freepascal/Linux/3.0.4/fpc-3.0.4.x86_64-linux.tar") + (sha256 + (base32 + "0xzxh689iyjfmkqkhcqg9plrjmdx82hbyywyyc7jm0n92fpmp5ky")))) + +(define-public fpc + (package + (name "fpc") + (version "3.2.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://sourceforge/freepascal/Source/" + version "/fpcbuild-" version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "0f38glyn3ffmqww432snhx2b8wyrq0yj1njkp4zh56lqrvm19fgr")) + (patches (search-patches "fpc-reproducibility.patch")) + (modules '((guix build utils))) + (snippet + '(begin + (rename-file "install/doc" "install-doc") + (rename-file "install/man" "install-man") + ;; Contains executables--some of them created by + ;; closed-source compilers. + (delete-file-recursively "install") + (mkdir-p "install") + (rename-file "install-doc" "install/doc") + (rename-file "install-man" "install/man") + (delete-file "fpcsrc/tests/utils/dosbox/exitcode.exe") + #t)))) + (build-system gnu-build-system) + (supported-systems '("i686-linux" "x86_64-linux")) + (inputs + `(("expat" ,expat) + ("glibc" ,glibc) + ("ld-wrapper" ,ld-wrapper) + ("ncurses" ,ncurses) + ("zlib" ,zlib))) + (native-inputs + ;; FPC is built with FPC, so we need bootstrap binaries. + `(("fpc-binary" + ,(match (or (%current-target-system) + (%current-system)) + ("i686-linux" fpc-bootstrap-i386-3.0.4) + ;("powerpc64le-linux" fpc-bootstrap-ppc64le-3.0.4) + ;("powerpc-linux" fpc-bootstrap-ppc-3.0.4) + ("x86_64-linux" fpc-bootstrap-x86_64-3.0.4) + (_ fpc-bootstrap-x86_64-3.0.4))))) + (arguments + `(#:tests? #f ; no tests available + #:phases + (let ((fpc-bootstrap-path + (string-append (getcwd) "/" ,name "-" ,version "/fpc-bin")) + (arch ,(match (or (%current-target-system) + (%current-system)) + ("i686-linux" "i386") + ("x86_64-linux" "x86_64") + (_ "unknown")))) + (modify-phases %standard-phases + (add-after 'unpack 'unpack-bin + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p fpc-bootstrap-path) + (with-directory-excursion fpc-bootstrap-path + (invoke "tar" "xvf" (assoc-ref inputs "fpc-binary"))))) + (add-after 'unpack-bin 'install-bin + (lambda* (#:key inputs #:allow-other-keys) + (with-directory-excursion + (string-append fpc-bootstrap-path "/fpc-3.0.4." + arch "-linux") + (let ((binary-tarball + (string-append "binary." arch "-linux.tar")) + (compiler-tarball + (string-append "base." arch "-linux.tar.gz")) + (fpcmake-tarball + (string-append "utils-fpcm." arch "-linux.tar.gz"))) + ;; Only the base compiler and fpcmake are needed. + (invoke "tar" "xvf" binary-tarball compiler-tarball + fpcmake-tarball) + (invoke "tar" "xvf" compiler-tarball "-C..") + (invoke "tar" "xvf" fpcmake-tarball "-C.."))))) + (add-after 'patch-source-shebangs 'patch-inline-shebangs + (lambda _ + (substitute* "fpcsrc/compiler/cscript.pas" + (("#!/bin/sh") (string-append "#!" (which "sh")))) + #t)) + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (substitute* "fpcsrc/compiler/systems/t_linux.pas" + ;; Point to the current glibc dynamic linker. + (("/lib/ld-linux.so.2") + (string-append (assoc-ref inputs "libc") + ,(glibc-dynamic-linker))) + (("/lib64/ld-linux-x86-64.so.2") + (string-append (assoc-ref inputs "libc") + ,(glibc-dynamic-linker))) + ; TODO: /lib/ld-linux-armhf.so.3 + ; TODO: /lib/ld-linux-aarch64.so.1 + ; TODO: /lib64/ld64.so.2 + ;; Add glibc to ld's search path. + (("if \\(isdll\\) then") + (string-append + "Add('SEARCH_DIR(\"" + (assoc-ref inputs "libc") "/lib" + "\")');\n" + "if (isdll) then"))) + (substitute* "fpcsrc/compiler/options.pas" + (("exepath\\+'../etc/'") + (string-append "'" (assoc-ref outputs "out") "/etc'"))) + #t)) + (replace 'build + (lambda* (#:key inputs #:allow-other-keys) + (let* ((fpc-bin (string-append fpc-bootstrap-path "/bin")) + (fpc (string-append fpc-bin "/fpc")) + (fpcmake (string-append fpc-bin "/fpcmake"))) + ;; The fpc binary needs to run the ppc[arch] binary (which + ;; does the actual compiling) in this directory. + (setenv "PATH" + (string-append (getenv "PATH") ":" + fpc-bootstrap-path + "/lib/fpc/3.0.4")) + (setenv "FPC" fpc) + ;; Specify target operating system using "-T" option + (invoke fpcmake (string-append "-T" arch "-linux")) + (invoke "make" "build" "NOGDB=1")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + ;; This is the suffix of the ppc[arch] binary. + (suffix (if (string= arch "x86_64") + "x64" + "386")) + (ppc (string-append "ppc" suffix))) + (invoke "make" "install" "NOGDB=1" + (string-append "INSTALL_PREFIX=" out)) + ;; Remove files that fail RUNPATH validation. + ;; TODO: Fix it instead. + (delete-file (string-append out "/lib/libpas2jslib.so")) + ;; Add a symlink to the ppc[arch] binary so fpc works. + (symlink (string-append out "/lib/fpc/" ,version "/" ppc) + (string-append out "/bin/" ppc)) + ;; Install the example configuration file. + (mkdir (string-append out "/etc")) + (invoke + (string-append out "/lib/fpc/" ,version "/samplecfg") + (string-append out "/lib/fpc/" ,version) + (string-append out "/etc"))))) + (add-after 'install 'wrap + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (fpc (string-append out "/bin/fpc")) + (ld (assoc-ref inputs "ld-wrapper")) + (glibc (assoc-ref inputs "glibc"))) + (wrap-program fpc + `("PATH" ":" prefix (,(string-append ld "/bin"))) + `("LIBRARY_PATH" ":" prefix (,(string-append glibc "/lib")))) + #t))))))) + ;; fpc invokes gcc, so make sure LIBRARY_PATH et.al are set. + ;(native-search-paths (package-native-search-paths gcc)) + (home-page "http://www.freepascal.org") + (synopsis "The Free Pascal Compiler") + (description + "Free Pascal is a professional Object Pascal compiler. It supports the +Turbo Pascal 7.0, Delphi, and Mac Pascal dialects. Free Pascal also supports +many useful extensions to the Pascal programming language.") + ;; The majority of the software included is licensed under the GPLv2 + ;; or later. For more licensing details, see the appropriate files in + ;; the install/doc directory of the source distribution. + (license license:gpl2+))) diff --git a/gnu/packages/patches/fpc-reproducibility.patch b/gnu/packages/patches/fpc-reproducibility.patch new file mode 100644 index 0000000000..619f42b3b5 --- /dev/null +++ b/gnu/packages/patches/fpc-reproducibility.patch @@ -0,0 +1,28 @@ +Remove/patch metadata timestamps for reproducibility. + +diff -ur fpcbuild-3.0.0.old/fpcsrc/packages/fpmkunit/src/fpmkunit.pp fpcbuild-3.0.0/fpcsrc/packages/fpmkunit/src/fpmkunit.pp +--- fpcbuild-3.0.0.old/fpcsrc/packages/fpmkunit/src/fpmkunit.pp 2015-11-04 16:17:00.000000000 -0500 ++++ fpcbuild-3.0.0/fpcsrc/packages/fpmkunit/src/fpmkunit.pp 2017-01-26 16:25:29.327339282 -0500 +@@ -3779,7 +3779,7 @@ + Values[KeyName]:=Name; + Values[KeyVersion]:=Version; + // TODO Generate checksum based on PPUs +- InstalledChecksum:=DateTimeToFileDate(Now); ++ InstalledChecksum:=0; + Values[KeyChecksum]:=IntToStr(InstalledChecksum); + Values[KeyCPU]:=CPUToString(ACPU); + Values[KeyOS]:=OSToString(AOS); +diff -ur fpcbuild-3.0.0.old/fpcsrc/utils/fpcmkcfg/fpcmkcfg.pp fpcbuild-3.0.0/fpcsrc/utils/fpcmkcfg/fpcmkcfg.pp +--- fpcbuild-3.0.0.old/fpcsrc/utils/fpcmkcfg/fpcmkcfg.pp 2013-06-01 18:27:16.000000000 -0400 ++++ fpcbuild-3.0.0/fpcsrc/utils/fpcmkcfg/fpcmkcfg.pp 2017-01-26 16:24:22.949044903 -0500 +@@ -234,8 +234,8 @@ + TemplateParser.Values['FPCTARGETOS'] := BuildOSTarget; + TemplateParser.Values['FPCBIN'] := 'fpc'; + TemplateParser.Values['PWD'] := GetCurrentDir; +- TemplateParser.Values['BUILDDATE'] := DateToStr(Date); +- TemplateParser.Values['BUILDTIME'] := TimeToStr(Time); ++ TemplateParser.Values['BUILDDATE'] := ''; ++ TemplateParser.Values['BUILDTIME'] := ''; + + TemplateParser.Values['LOCALREPOSITORY'] := GetDefaultLocalRepository; + TemplateParser.Values['LOCALBASEPATH'] := GetDefaultLocalBasepath; -- cgit v1.2.3 From 312789abc565aa7f86d7d6554c190ec34a77a26c Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 31 Aug 2020 17:57:51 +0200 Subject: gnu: sooperlooper: Update to 1.7.4. * gnu/packages/music.scm (sooperlooper): Update to 1.7.4. [source]: Remove upstreamed patch. * gnu/packages/patches/sooperlooper-build-with-wx-30.patch: Delete file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/music.scm | 17 +- .../patches/sooperlooper-build-with-wx-30.patch | 179 --------------------- 3 files changed, 8 insertions(+), 189 deletions(-) delete mode 100644 gnu/packages/patches/sooperlooper-build-with-wx-30.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 8854698178..3db43f1bf5 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1568,7 +1568,6 @@ dist_patch_DATA = \ %D%/packages/patches/slim-login.patch \ %D%/packages/patches/slim-display.patch \ %D%/packages/patches/snappy-add-O2-flag-in-CmakeLists.txt.patch \ - %D%/packages/patches/sooperlooper-build-with-wx-30.patch \ %D%/packages/patches/sphinxbase-fix-doxygen.patch \ %D%/packages/patches/sssd-fix-samba.patch \ %D%/packages/patches/sssd-system-directories.patch \ diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index d6ac1da109..cdfe7aff7d 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -3226,15 +3226,14 @@ with a number of bugfixes and changes to improve IT playback.") (define-public sooperlooper (package (name "sooperlooper") - (version "1.7.3") - (source (origin - (method url-fetch) - (uri (string-append "http://essej.net/sooperlooper/sooperlooper-" - version ".tar.gz")) - (sha256 - (base32 - "0n2gdxw1fx8nxxnpzf4sj0kp6k6zi1yq59cbz6qqzcnsnpnvszbs")) - (patches (search-patches "sooperlooper-build-with-wx-30.patch")))) + (version "1.7.4") + (source + (origin + (method url-fetch) + (uri (string-append "http://essej.net/sooperlooper/sooperlooper-" + version ".tar.gz")) + (sha256 + (base32 "1jjvq4aflbyr3nr8b318k1vkad16xfa1jkqn9ckzw4419qc6c1k5")))) (build-system gnu-build-system) (arguments `(#:phases diff --git a/gnu/packages/patches/sooperlooper-build-with-wx-30.patch b/gnu/packages/patches/sooperlooper-build-with-wx-30.patch deleted file mode 100644 index 43f4b9be69..0000000000 --- a/gnu/packages/patches/sooperlooper-build-with-wx-30.patch +++ /dev/null @@ -1,179 +0,0 @@ -Downloaded from https://anonscm.debian.org/cgit/pkg-multimedia/sooperlooper.git/plain/debian/patches/04-build_with_wx_30.patch -O gnu/packages/patches/sooperlooper-build-with-wx-30.patch - -Author: Jaromír Mikeš , Olly Betts -Description: build against wx 3.0. -Forwarded: yes - -Index: sooperlooper/src/gui/main_panel.cpp -=================================================================== ---- sooperlooper.orig/src/gui/main_panel.cpp -+++ sooperlooper/src/gui/main_panel.cpp -@@ -448,7 +448,7 @@ MainPanel::init_loopers (int count) - while (count < (int)_looper_panels.size()) { - looperpan = _looper_panels.back(); - _looper_panels.pop_back(); -- _main_sizer->Remove(looperpan); -+ _main_sizer->Detach(looperpan); - looperpan->Destroy(); - } - } -@@ -1277,7 +1277,7 @@ void MainPanel::misc_action (bool releas - } - - -- wxString filename = do_file_selector (wxT("Choose file to save loop"), wxT("wav"), wxT("WAVE files (*.wav)|*.wav;*.WAV;*.Wav"), wxSAVE|wxCHANGE_DIR|wxOVERWRITE_PROMPT); -+ wxString filename = do_file_selector (wxT("Choose file to save loop"), wxT("wav"), wxT("WAVE files (*.wav)|*.wav;*.WAV;*.Wav"), wxFD_SAVE|wxFD_CHANGE_DIR|wxFD_OVERWRITE_PROMPT); - - if ( !filename.empty() ) - { -@@ -1296,7 +1296,7 @@ void MainPanel::misc_action (bool releas - index = 0; - } - -- wxString filename = do_file_selector (wxT("Choose file to open"), wxT(""), wxT("*.slsess"), wxOPEN|wxCHANGE_DIR); -+ wxString filename = do_file_selector (wxT("Choose file to open"), wxT(""), wxT("*.slsess"), wxFD_OPEN|wxFD_CHANGE_DIR); - - if ( !filename.empty() ) - { -@@ -1408,7 +1408,7 @@ void MainPanel::set_curr_loop (int index - - void MainPanel::do_load_session () - { -- wxString filename = do_file_selector (wxT("Choose session to load"), wxT("*.slsess"), wxT("*.slsess"), wxOPEN|wxCHANGE_DIR); -+ wxString filename = do_file_selector (wxT("Choose session to load"), wxT("*.slsess"), wxT("*.slsess"), wxFD_OPEN|wxFD_CHANGE_DIR); - - if ( !filename.empty() ) - { -@@ -1419,7 +1419,7 @@ void MainPanel::do_load_session () - - void MainPanel::do_save_session (bool write_audio) - { -- wxString filename = do_file_selector (wxT("Choose file to save session"), wxT("slsess"), wxT("*.slsess"), wxSAVE|wxCHANGE_DIR|wxOVERWRITE_PROMPT); -+ wxString filename = do_file_selector (wxT("Choose file to save session"), wxT("slsess"), wxT("*.slsess"), wxFD_SAVE|wxFD_CHANGE_DIR|wxFD_OVERWRITE_PROMPT); - - if ( !filename.empty() ) - { -Index: sooperlooper/src/gui/pix_button.cpp -=================================================================== ---- sooperlooper.orig/src/gui/pix_button.cpp -+++ sooperlooper/src/gui/pix_button.cpp -@@ -250,7 +250,7 @@ PixButton::OnMouseEvents (wxMouseEvent & - pt.x += bounds.x; - pt.y += bounds.y; - -- if (bounds.Inside(pt)) { -+ if (bounds.Contains(pt)) { - clicked (get_mouse_button(ev)); // emit - - if (ev.MiddleUp() && ev.ControlDown()) { -Index: sooperlooper/src/gui/looper_panel.cpp -=================================================================== ---- sooperlooper.orig/src/gui/looper_panel.cpp -+++ sooperlooper/src/gui/looper_panel.cpp -@@ -1428,7 +1428,7 @@ LooperPanel::clicked_events (int button, - if (cmd == wxT("save")) - { - wxString filename = _mainpanel->do_file_selector (wxT("Choose file to save loop"), -- wxT("wav"), wxT("WAVE files (*.wav)|*.wav;*.WAV;*.Wav"), wxSAVE|wxCHANGE_DIR|wxOVERWRITE_PROMPT); -+ wxT("wav"), wxT("WAVE files (*.wav)|*.wav;*.WAV;*.Wav"), wxFD_SAVE|wxFD_CHANGE_DIR|wxFD_OVERWRITE_PROMPT); - - if ( !filename.empty() ) - { -@@ -1442,7 +1442,7 @@ LooperPanel::clicked_events (int button, - } - else if (cmd == wxT("load")) - { -- wxString filename = _mainpanel->do_file_selector(wxT("Choose file to open"), wxT(""), wxT("Audio files (*.wav,*.aif)|*.wav;*.WAV;*.Wav;*.aif;*.aiff;*.AIF;*.AIFF|All files (*.*)|*.*"), wxOPEN|wxCHANGE_DIR); -+ wxString filename = _mainpanel->do_file_selector(wxT("Choose file to open"), wxT(""), wxT("Audio files (*.wav,*.aif)|*.wav;*.WAV;*.Wav;*.aif;*.aiff;*.AIF;*.AIFF|All files (*.*)|*.*"), wxFD_OPEN|wxFD_CHANGE_DIR); - - if ( !filename.empty() ) - { -Index: sooperlooper/src/gui/keyboard_target.cpp -=================================================================== ---- sooperlooper.orig/src/gui/keyboard_target.cpp -+++ sooperlooper/src/gui/keyboard_target.cpp -@@ -553,10 +553,10 @@ KeyboardTarget::keycode_from_name (const - keycode = WXK_RETURN; - } - else if ( keyname == wxT("PGUP") ) { -- keycode = WXK_PRIOR; -+ keycode = WXK_PAGEUP; - } - else if ( keyname == wxT("PGDN") ) { -- keycode = WXK_NEXT; -+ keycode = WXK_PAGEDOWN; - } - else if ( keyname == wxT("LEFT") ) { - keycode = WXK_LEFT; -@@ -630,10 +630,10 @@ wxString KeyboardTarget::name_from_keyco - case WXK_RETURN: - text += wxT("return"); - break; -- case WXK_PRIOR: -+ case WXK_PAGEUP: - text += wxT("pageup"); - break; -- case WXK_NEXT: -+ case WXK_PAGEDOWN: - text += wxT("pagedown"); - break; - case WXK_LEFT: -Index: sooperlooper/src/gui/check_box.cpp -=================================================================== ---- sooperlooper.orig/src/gui/check_box.cpp -+++ sooperlooper/src/gui/check_box.cpp -@@ -237,7 +237,7 @@ CheckBox::OnMouseEvents (wxMouseEvent &e - } - else if (ev.LeftUp()) - { -- if (bounds.Inside(ev.GetPosition())) { -+ if (bounds.Contains(ev.GetPosition())) { - // toggle value - _value = !_value; - -Index: sooperlooper/src/gui/midi_bind_panel.cpp -=================================================================== ---- sooperlooper.orig/src/gui/midi_bind_panel.cpp -+++ sooperlooper/src/gui/midi_bind_panel.cpp -@@ -880,7 +880,7 @@ void MidiBindPanel::on_button (wxCommand - } - else if (ev.GetId() == ID_LoadButton) - { -- wxString filename = _parent->do_file_selector(wxT("Choose midi binding file to open"), wxT(""), wxT("*.slb"), wxOPEN|wxCHANGE_DIR); -+ wxString filename = _parent->do_file_selector(wxT("Choose midi binding file to open"), wxT(""), wxT("*.slb"), wxFD_OPEN|wxFD_CHANGE_DIR); - if ( !filename.empty() ) - { - _parent->get_loop_control().load_midi_bindings(filename, _append_check->GetValue()); -@@ -888,7 +888,7 @@ void MidiBindPanel::on_button (wxCommand - } - else if (ev.GetId() == ID_SaveButton) - { -- wxString filename = _parent->do_file_selector(wxT("Choose midi binding file to save"), wxT(""), wxT("*.slb"), wxSAVE|wxCHANGE_DIR|wxOVERWRITE_PROMPT); -+ wxString filename = _parent->do_file_selector(wxT("Choose midi binding file to save"), wxT(""), wxT("*.slb"), wxFD_SAVE|wxFD_CHANGE_DIR|wxFD_OVERWRITE_PROMPT); - - if ( !filename.empty() ) - { -Index: sooperlooper/src/gui/config_panel.cpp -=================================================================== ---- sooperlooper.orig/src/gui/config_panel.cpp -+++ sooperlooper/src/gui/config_panel.cpp -@@ -378,7 +378,7 @@ void ConfigPanel::on_button (wxCommandEv - else if (ev.GetId() == ID_MidiBrowseButton) { - - _parent->get_keyboard().set_enabled(false); -- wxString filename = _parent->do_file_selector(wxT("Choose midi binding file to use"), wxT(""), wxT("*.slb"), wxOPEN|wxCHANGE_DIR); -+ wxString filename = _parent->do_file_selector(wxT("Choose midi binding file to use"), wxT(""), wxT("*.slb"), wxFD_OPEN|wxFD_CHANGE_DIR); - _parent->get_keyboard().set_enabled(true); - - if ( !filename.empty() ) -@@ -389,8 +389,8 @@ void ConfigPanel::on_button (wxCommandEv - else if (ev.GetId() == ID_SessionBrowseButton) { - - _parent->get_keyboard().set_enabled(false); -- wxString filename = _parent->do_file_selector(wxT("Choose session file to use"), wxT(""), wxT("*.slsess"), wxOPEN|wxCHANGE_DIR); -- //wxString filename = wxFileSelector(wxT("Choose session file to use"), wxT(""), wxT(""), wxT(""), wxT("*.slsess"), wxOPEN|wxCHANGE_DIR); -+ wxString filename = _parent->do_file_selector(wxT("Choose session file to use"), wxT(""), wxT("*.slsess"), wxFD_OPEN|wxFD_CHANGE_DIR); -+ //wxString filename = wxFileSelector(wxT("Choose session file to use"), wxT(""), wxT(""), wxT(""), wxT("*.slsess"), wxFD_OPEN|wxFD_CHANGE_DIR); - _parent->get_keyboard().set_enabled(true); - - if ( !filename.empty() ) -- cgit v1.2.3 From 30714da09a50bf20780e9903104e29c930da855a Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Tue, 1 Sep 2020 04:28:05 +0200 Subject: gnu: wgetpaste: Update bpaste URL & regular expressions. * gnu/packages/wget.scm (wgetpaste)[source]: Add patch. * gnu/packages/patches/wgetpaste-update-bpaste.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/patches/wgetpaste-update-bpaste.patch | 27 ++++++++++++++++++++++ gnu/packages/wget.scm | 3 ++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/wgetpaste-update-bpaste.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 3db43f1bf5..67cc13d35e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1656,6 +1656,7 @@ dist_patch_DATA = \ %D%/packages/patches/webkitgtk-share-store.patch \ %D%/packages/patches/webkitgtk-bind-all-fonts.patch \ %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch \ + %D%/packages/patches/wgetpaste-update-bpaste.patch \ %D%/packages/patches/wicd-bitrate-none-fix.patch \ %D%/packages/patches/wicd-get-selected-profile-fix.patch \ %D%/packages/patches/wicd-urwid-1.3.patch \ diff --git a/gnu/packages/patches/wgetpaste-update-bpaste.patch b/gnu/packages/patches/wgetpaste-update-bpaste.patch new file mode 100644 index 0000000000..f92a0c17ed --- /dev/null +++ b/gnu/packages/patches/wgetpaste-update-bpaste.patch @@ -0,0 +1,27 @@ +From: Tobias Geerinckx-Rice +Date: Tue, 01 Sep 2020 04:23:25 +0200 +Subject: [PATCH] Update bpaste URL & regular expressions. + +diff -Naur wgetpaste-2.30/wgetpaste wgetpaste-2.30a/wgetpaste +--- wgetpaste-2.30/wgetpaste 2020-07-31 23:56:05.000000000 +0200 ++++ wgetpaste-2.30a/wgetpaste 2020-09-01 04:22:37.499898403 +0200 +@@ -16,7 +16,7 @@ + SERVICES="codepad bpaste dpaste gists snippets" + # bpaste + ENGINE_bpaste=pinnwand +-URL_bpaste="https://bpaste.net/" ++URL_bpaste="https://bpa.st/" + DEFAULT_EXPIRATION_bpaste="1week" + DEFAULT_LANGUAGE_bpaste="text" + # codepad +@@ -194,8 +194,8 @@ + xml+velocity xml xquery xslt xtend yaml" + EXPIRATIONS_pinnwand="1day 1week 1month never" + POST_pinnwand="submit=Paste! % % lexer expiry % code" +-REGEX_LOC_pinnwand="\(/show/[^ ]*\).*$|https://bpaste.net\1" +-REGEX_RAW_pinnwand='s|^\(https\?://[^/]*/\)show\(/[^ ]*/\?\)$|\1raw\2|' ++REGEX_LOC_pinnwand="\(/[^ ]*\).*$|https://bpa.st\1" ++REGEX_RAW_pinnwand='s|^\(https\?://[^/]*\)\(/[^ ]*/\?\)$|\1/raw\2|' + + ### errors + die() { diff --git a/gnu/packages/wget.scm b/gnu/packages/wget.scm index a8345da818..7950b3b729 100644 --- a/gnu/packages/wget.scm +++ b/gnu/packages/wget.scm @@ -83,7 +83,8 @@ in downloaded documents to relative links.") (uri (string-append "https://wgetpaste.zlin.dk/wgetpaste-" version ".tar.bz2")) (sha256 - (base32 "14k5i6j6f34hcf9gdb9cnvfwscn0ys2dgd73ci421wj9zzqkbv73")))) + (base32 "14k5i6j6f34hcf9gdb9cnvfwscn0ys2dgd73ci421wj9zzqkbv73")) + (patches (search-patches "wgetpaste-update-bpaste.patch")))) (build-system gnu-build-system) (arguments `(#:modules ((guix build gnu-build-system) -- cgit v1.2.3 From 49db1ef2b0a0be730f2bd0cfd6396e146990b1d1 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 1 Sep 2020 23:16:29 +0300 Subject: gnu: xf86-video-sis: Update to 0.12.0. * gnu/packages/xorg.scm (xf86-video-sis): Update to 0.12.0. [source]: Remove patch. * gnu/packages/patches/xf86-video-sis-xorg-compat.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/patches/xf86-video-sis-xorg-compat.patch | 18 ------------------ gnu/packages/xorg.scm | 9 ++++----- 3 files changed, 4 insertions(+), 24 deletions(-) delete mode 100644 gnu/packages/patches/xf86-video-sis-xorg-compat.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index dfb9640b47..44f7d612ad 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1673,7 +1673,6 @@ dist_patch_DATA = \ %D%/packages/patches/xf86-video-mach64-glibc-2.20.patch \ %D%/packages/patches/xf86-video-savage-xorg-compat.patch \ %D%/packages/patches/xf86-video-siliconmotion-fix-ftbfs.patch \ - %D%/packages/patches/xf86-video-sis-xorg-compat.patch \ %D%/packages/patches/xf86-video-tga-remove-mibstore.patch \ %D%/packages/patches/xf86-video-voodoo-pcitag.patch \ %D%/packages/patches/xfce4-panel-plugins.patch \ diff --git a/gnu/packages/patches/xf86-video-sis-xorg-compat.patch b/gnu/packages/patches/xf86-video-sis-xorg-compat.patch deleted file mode 100644 index ebe9715d13..0000000000 --- a/gnu/packages/patches/xf86-video-sis-xorg-compat.patch +++ /dev/null @@ -1,18 +0,0 @@ -Remove use of interface no longer provided by xorg-server. - -Patch taken from upstream: -https://cgit.freedesktop.org/xorg/driver/xf86-video-sis/commit/?id=4b1356a2b7fd06e9a05d134caa4033681c939737 - -diff --git a/src/sis_driver.c b/src/sis_driver.c -index 8f06164..513f68b 100644 ---- a/src/sis_driver.c -+++ b/src/sis_driver.c -@@ -2738,7 +2738,7 @@ SiSPrintModes(ScrnInfoPtr pScrn) - float hsync, refresh = 0.0; - char *desc, *desc2, *prefix, *uprefix, *output; - -- xf86DrvMsg(pScrn->scrnIndex, pScrn->virtualFrom, "Virtual size is %dx%d " -+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Virtual size is %dx%d " - "(pitch %d)\n", pScrn->virtualX, pScrn->virtualY, - pScrn->displayWidth); - diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index e777e778a7..868a0626b5 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -3363,7 +3363,7 @@ Xorg X server.") (define-public xf86-video-sis (package (name "xf86-video-sis") - (version "0.10.9") + (version "0.12.0") (source (origin (method url-fetch) @@ -3371,16 +3371,15 @@ Xorg X server.") "mirror://xorg/individual/driver/xf86-video-sis-" version ".tar.bz2")) - (patches (search-patches "xf86-video-sis-xorg-compat.patch")) (sha256 - (base32 - "03f1abjjf68y8y1iz768rn95va9d33wmbwfbsqrgl6k0gi0bf9jj")))) + (base32 + "0nrs6cjldlhakx5987fiiggjrlzilsbdc7l9pz22x1iwslbkz78i")))) (build-system gnu-build-system) (inputs `(("mesa" ,mesa) ("xorgproto" ,xorgproto) ("xorg-server" ,xorg-server))) (native-inputs - `(("pkg-config" ,pkg-config))) + `(("pkg-config" ,pkg-config))) (home-page "https://www.x.org/wiki/") (synopsis "Sis video driver for X server") (description -- cgit v1.2.3 From 0be22e44749a570d31f530e49097094aa9f5addf Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 1 Sep 2020 23:36:52 +0300 Subject: gnu: ttfautohint: Update to 1.8.3. * gnu/packages/fontutils.scm (ttfautohint): Update to 1.8.3. [source]: Remove patch. * gnu/packages/patches/ttfautohint-source-date-epoch.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Remove it. --- gnu/local.mk | 1 - gnu/packages/fontutils.scm | 7 +-- .../patches/ttfautohint-source-date-epoch.patch | 70 ---------------------- 3 files changed, 3 insertions(+), 75 deletions(-) delete mode 100644 gnu/packages/patches/ttfautohint-source-date-epoch.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 44f7d612ad..6e47d74e0a 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1611,7 +1611,6 @@ dist_patch_DATA = \ %D%/packages/patches/tk-find-library.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ - %D%/packages/patches/ttfautohint-source-date-epoch.patch \ %D%/packages/patches/tomb-fix-errors-on-open.patch \ %D%/packages/patches/tup-unbundle-dependencies.patch \ %D%/packages/patches/tuxpaint-stamps-path.patch \ diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index b53365e0d5..19b3c8da84 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2013, 2014, 2015 Andreas Enge ;;; Copyright © 2014, 2016 Eric Bavier ;;; Copyright © 2016 Mark H Weaver -;;; Copyright © 2016, 2017 Efraim Flashner +;;; Copyright © 2016, 2017, 2020 Efraim Flashner ;;; Copyright © 2017 Rene Saavedra ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2017 Nikita @@ -100,7 +100,7 @@ anti-aliased glyph bitmap generation with 256 gray levels.") (define-public ttfautohint (package (name "ttfautohint") - (version "1.5") + (version "1.8.3") (source (origin (method url-fetch) @@ -108,8 +108,7 @@ anti-aliased glyph bitmap generation with 256 gray levels.") version ".tar.gz")) (sha256 (base32 - "1lgghck46p33z3hg8dnl76jryig4fh6d8rhzms837zp7x4hyfkv4")) - (patches (list (search-patch "ttfautohint-source-date-epoch.patch"))))) + "0zpqgihn3yh3v51ynxwr8asqrijvs4gv686clwv7bm8sawr4kfw7")))) (build-system gnu-build-system) (native-inputs `(("flex" ,flex) diff --git a/gnu/packages/patches/ttfautohint-source-date-epoch.patch b/gnu/packages/patches/ttfautohint-source-date-epoch.patch deleted file mode 100644 index e42fdbf6b0..0000000000 --- a/gnu/packages/patches/ttfautohint-source-date-epoch.patch +++ /dev/null @@ -1,70 +0,0 @@ -Honour an external definition of SOURCE_DATE_EPOCH when updating the embedded -modification date in TTF/TTC files. - ---- a/lib/tatime.c -+++ b/lib/tatime.c -@@ -15,6 +15,8 @@ - - #include - #include -+#include -+#include - - #include "ta.h" - -@@ -27,12 +29,51 @@ TA_get_current_time(FT_ULong* high, - { - /* there have been 24107 days between January 1st, 1904 (the epoch of */ - /* OpenType), and January 1st, 1970 (the epoch of the `time' function) */ -- TA_ULongLong seconds_to_1970 = 24107 * 24 * 60 * 60; -- TA_ULongLong seconds_to_today = seconds_to_1970 + (TA_ULongLong)time(NULL); -+ const TA_ULongLong seconds_to_1970 = 24107 * 24 * 60 * 60; -+ TA_ULongLong seconds_to_build; - -+ time_t now; -+ char *source_date_epoch, *endptr; -+ TA_ULongLong epoch; -+ source_date_epoch = getenv("SOURCE_DATE_EPOCH"); -+ if (source_date_epoch) { -+ errno = 0; -+ epoch = strtoull(source_date_epoch, &endptr, 10); -+ if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0)) -+ || (errno != 0 && epoch == 0)) { -+ fprintf(stderr, -+ "Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n", -+ strerror(errno)); -+ exit(EXIT_FAILURE); -+ } -+ if (endptr == source_date_epoch) { -+ fprintf(stderr, -+ "Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n", -+ endptr); -+ exit(EXIT_FAILURE); -+ } -+ if (*endptr != '\0') { -+ fprintf(stderr, -+ "Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n", -+ endptr); -+ exit(EXIT_FAILURE); -+ } -+ if (epoch > ULONG_MAX) { -+ fprintf(stderr, -+ "Environment variable $SOURCE_DATE_EPOCH: value must be smaller " -+ "than or equal to: %lu but was found to be: %llu \n", -+ ULONG_MAX, epoch); -+ exit(EXIT_FAILURE); -+ } -+ now = epoch; -+ } else { -+ now = time(NULL); -+ } - -- *high = (FT_ULong)(seconds_to_today >> 32); -- *low = (FT_ULong)seconds_to_today; -+ seconds_to_build = seconds_to_1970 + (TA_ULongLong)now; -+ -+ *high = (FT_ULong)(seconds_to_build >> 32); -+ *low = (FT_ULong)seconds_to_build; - } - - /* end of tatime.c */ -- cgit v1.2.3 From 57983029a9ad86dfad3ae5e352c24557ffae9829 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Wed, 2 Sep 2020 18:05:36 -0400 Subject: gnu: xmonad: Add patch to support dynamic linking. Fixes . * gnu/packages/patches/xmonad-dynamic-linking.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/wm.scm (xmonad)[source]: Use it. --- gnu/local.mk | 1 + gnu/packages/patches/xmonad-dynamic-linking.patch | 16 ++++++++++++++++ gnu/packages/wm.scm | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/xmonad-dynamic-linking.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 6e47d74e0a..d2753f52ae 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1676,6 +1676,7 @@ dist_patch_DATA = \ %D%/packages/patches/xf86-video-voodoo-pcitag.patch \ %D%/packages/patches/xfce4-panel-plugins.patch \ %D%/packages/patches/xfce4-settings-defaults.patch \ + %D%/packages/patches/xmonad-dynamic-linking.patch \ %D%/packages/patches/xplanet-1.3.1-cxx11-eof.patch \ %D%/packages/patches/xplanet-1.3.1-libdisplay_DisplayOutput.cpp.patch \ %D%/packages/patches/xplanet-1.3.1-libimage_gif.c.patch \ diff --git a/gnu/packages/patches/xmonad-dynamic-linking.patch b/gnu/packages/patches/xmonad-dynamic-linking.patch new file mode 100644 index 0000000000..4f3386e53a --- /dev/null +++ b/gnu/packages/patches/xmonad-dynamic-linking.patch @@ -0,0 +1,16 @@ +This patch is required for xmonad to make use of shared libraries. +Without it, xmonad will not work since we do not (by default) use +statically linked Haskell libraries. + +diff -ruN xmonad-0.15-a/src/XMonad/Core.hs xmonad-0.15-b/src/XMonad/Core.hs +--- xmonad-0.15-a/src/XMonad/Core.hs 1969-12-31 19:00:00.000000000 -0500 ++++ xmonad-0.15-b/src/XMonad/Core.hs 1969-12-31 19:00:00.000000000 -0500 +@@ -681,6 +681,8 @@ + compileGHC bin dir errHandle = + runProcess "ghc" ["--make" + , "xmonad.hs" ++ , "-dynamic" ++ , "-fPIC" + , "-i" + , "-ilib" + , "-fforce-recomp" diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm index bb5a91a230..15fbf43ec7 100644 --- a/gnu/packages/wm.scm +++ b/gnu/packages/wm.scm @@ -655,7 +655,8 @@ desktop environment.") "xmonad-" version ".tar.gz")) (sha256 (base32 - "0a7rh21k9y6g8fwkggxdxjns2grvvsd5hi2ls4klmqz5xvk4hyaa")))) + "0a7rh21k9y6g8fwkggxdxjns2grvvsd5hi2ls4klmqz5xvk4hyaa")) + (patches (search-patches "xmonad-dynamic-linking.patch")))) (build-system haskell-build-system) (inputs `(("ghc-extensible-exceptions" ,ghc-extensible-exceptions) -- cgit v1.2.3 From d6983b1331fce3a014c19963379af7a7e00a2780 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Fri, 31 Jul 2020 14:37:20 +0200 Subject: gnu: r-httpuv: Unvendor libuv. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/cran.scm (r-httpuv) [source]: Remove bundled libuv, add patch. [arguments] Rewrite header locations, fix pipe server issue. [inputs] Add libuv. * gnu/packages/patches/r-httpuv-1.5.4-unvendor-libuv.patch: New file. * gnu/local.mk: Add it. Signed-off-by: Ludovic Courtès --- gnu/local.mk | 1 + gnu/packages/cran.scm | 32 +++++++++++- .../patches/r-httpuv-1.5.4-unvendor-libuv.patch | 59 ++++++++++++++++++++++ 3 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/r-httpuv-1.5.4-unvendor-libuv.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index d2753f52ae..3b97b8fdf3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1524,6 +1524,7 @@ dist_patch_DATA = \ %D%/packages/patches/readline-link-ncurses.patch \ %D%/packages/patches/readline-6.2-CVE-2014-2524.patch \ %D%/packages/patches/reposurgeon-add-missing-docbook-files.patch \ + %D%/packages/patches/r-httpuv-1.5.4-unvendor-libuv.patch \ %D%/packages/patches/ri-li-modernize_cpp.patch \ %D%/packages/patches/ripperx-missing-file.patch \ %D%/packages/patches/rpcbind-CVE-2017-8779.patch \ diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm index f06e10be58..994637e3b6 100644 --- a/gnu/packages/cran.scm +++ b/gnu/packages/cran.scm @@ -24,6 +24,7 @@ ;;; Copyright © 2020 Eric Brown ;;; Copyright © 2020 Peter Lo ;;; Copyright © 2020 Rafael Luque Leiva +;;; Copyright © 2020 Lars-Dominik Braun ;;; ;;; This file is part of GNU Guix. ;;; @@ -47,6 +48,7 @@ #:use-module (guix git-download) #:use-module (guix utils) #:use-module (guix build-system r) + #:use-module (gnu packages) #:use-module (gnu packages algebra) #:use-module (gnu packages autotools) #:use-module (gnu packages base) @@ -69,6 +71,7 @@ #:use-module (gnu packages imagemagick) #:use-module (gnu packages java) #:use-module (gnu packages javascript) + #:use-module (gnu packages libevent) #:use-module (gnu packages lisp-xyz) #:use-module (gnu packages machine-learning) #:use-module (gnu packages maths) @@ -830,8 +833,35 @@ into a pipeline of data manipulation and visualisation.") (uri (cran-uri "httpuv" version)) (sha256 (base32 - "066rprqvz9qln6xd85x1yh1wbbmzd157xjl8zq1zbgr8l6347inm")))) + "066rprqvz9qln6xd85x1yh1wbbmzd157xjl8zq1zbgr8l6347inm")) + ;; Unvendor bundled libraries. As of 1.5.4 the vendored libuv + ;; only contains fixes for building on Solaris. + (patches (search-patches "r-httpuv-1.5.4-unvendor-libuv.patch")) + (modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-1))) + (snippet + `(begin + (delete-file-recursively "src/libuv") + ;; Cannot unbundle http-parser, because it contains local + ;; modifications. + #t)))) (build-system r-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'unbundle-libuv + (lambda* (#:key outputs #:allow-other-keys) + (substitute* (find-files "src" "\\.cpp$|\\.h$") + (("\"libuv/include/uv\\.h\"") + "")) + ;; Fix https://github.com/rstudio/httpuv/issues/282 + (substitute* "src/http.cpp" + (("uv_pipe_init\\(pLoop, &pSocket->handle\\.pipe, true\\);") + "uv_pipe_init(pLoop, &pSocket->handle.pipe, 0);")) + #t))))) + (inputs + `(("libuv" ,libuv))) (propagated-inputs `(("r-bh" ,r-bh) ("r-later" ,r-later) diff --git a/gnu/packages/patches/r-httpuv-1.5.4-unvendor-libuv.patch b/gnu/packages/patches/r-httpuv-1.5.4-unvendor-libuv.patch new file mode 100644 index 0000000000..0947718059 --- /dev/null +++ b/gnu/packages/patches/r-httpuv-1.5.4-unvendor-libuv.patch @@ -0,0 +1,59 @@ +Removes references to bundled libuv. + +--- a/src/Makevars 2020-07-31 11:53:30.576484531 +0200 ++++ b/src/Makevars 2020-07-31 11:54:19.369863118 +0200 +@@ -5,7 +5,7 @@ + + UNAME := $(shell uname) + +-PKG_LIBS = ./libuv/.libs/libuv.a ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread ++PKG_LIBS = -luv ./http-parser/http_parser.o ./sha1/sha1.o ./base64/base64.o -pthread + + ifeq ($(UNAME), Darwin) + PKG_LIBS += -framework CoreServices +@@ -23,7 +23,7 @@ + + PKG_CFLAGS = $(C_VISIBILITY) -DSTRICT_R_HEADERS + PKG_CXXFLAGS = $(CXX_VISIBILITY) -DSTRICT_R_HEADERS +-PKG_CPPFLAGS = -Ilibuv/include -pthread ++PKG_CPPFLAGS = -pthread + + # To avoid spurious warnings from `R CMD check --as-cran`, about compiler + # warning flags like -Werror. +@@ -43,35 +43,5 @@ + # PKG_CPPFLAGS += -D_GLIBCXX_ASSERTIONS + + +-$(SHLIB): libuv/.libs/libuv.a http-parser/http_parser.o sha1/sha1.o base64/base64.o ++$(SHLIB): http-parser/http_parser.o sha1/sha1.o base64/base64.o + +-# We needed to rename lt~obsolete.m4 because the name causes problems with R +-# CMD check. Here we rename it back. +-libuv/m4/lt~obsolete.m4: libuv/m4/lt_obsolete.m4 +- cp -p -f libuv/m4/lt_obsolete.m4 libuv/m4/lt~obsolete.m4 +- +-# Run ./configure. We need to touch various autotools-related files to avoid +-# it trying to run autotools programs again. We also need to make sure +-# configure is executable, because on some platforms, calling unzip() in R +-# does not preserve the executable bit. +-# +-# It's VERY IMPORTANT that mtime(aclocal.m4) <= mtime(configure), and also +-# mtime(aclocal.m4) <= mtime(Makefile.in). On some platforms, passing multiple +-# files to a single touch command gives them all the same time, but on others +-# (Solaris and possibly some Fedoras) the timestamps are slightly increasing +-# from one to the next, i.e. the order matters. To remove this fragility, we +-# use "-r aclocal.m4" to ensure that all three files are guaranteed to have +-# precisely the same timestamp value. +-libuv/Makefile: libuv/m4/lt~obsolete.m4 +- (cd libuv \ +- && touch aclocal.m4 \ +- && touch -r aclocal.m4 configure Makefile.in \ +- && chmod +x configure \ +- && CC="$(CC)" CFLAGS="$(CFLAGS) $(CPICFLAGS) $(C_VISIBILITY)" AR="$(AR)" RANLIB="$(RANLIB)" LDFLAGS="$(LDFLAGS)" ./configure $(CONFIGURE_FLAGS)) +- +-libuv/.libs/libuv.a: libuv/Makefile +- $(MAKE) --directory=libuv \ +- HAVE_DTRACE=0 +- +-clean: +- $(MAKE) --directory=libuv distclean -- cgit v1.2.3 From 6c36daaac74b15cceae41caba0b291ae6d62ae17 Mon Sep 17 00:00:00 2001 From: raingloom Date: Fri, 4 Sep 2020 20:17:51 +0200 Subject: gnu: Update gPodder to 3.10.16 and disable updater. * gnu/packages/gpodder.scm (gpodder): Update to 3.10.16 and add patch. * gnu/packages/patches/gpodder-disable-updater.patch: New file * gnu/local.mk (dist_patch_DATA): Add patch Signed-off-by: Andreas Enge --- gnu/local.mk | 1 + gnu/packages/gpodder.scm | 7 ++++--- gnu/packages/patches/gpodder-disable-updater.patch | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/gpodder-disable-updater.patch (limited to 'gnu/packages/patches') diff --git a/gnu/local.mk b/gnu/local.mk index 3b97b8fdf3..b059dedfe3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1074,6 +1074,7 @@ dist_patch_DATA = \ %D%/packages/patches/gobject-introspection-girepository.patch \ %D%/packages/patches/go-skip-gc-test.patch \ %D%/packages/patches/gpm-glibc-2.26.patch \ + %D%/packages/patches/gpodder-disable-updater.patch \ %D%/packages/patches/gpsbabel-minizip.patch \ %D%/packages/patches/gpsbabel-qstring.patch \ %D%/packages/patches/grantlee-merge-theme-dirs.patch \ diff --git a/gnu/packages/gpodder.scm b/gnu/packages/gpodder.scm index 734599483b..26ea15ba56 100644 --- a/gnu/packages/gpodder.scm +++ b/gnu/packages/gpodder.scm @@ -38,7 +38,7 @@ (define-public gpodder (package (name "gpodder") - (version "3.10.15") + (version "3.10.16") (source (origin (method git-fetch) @@ -47,8 +47,9 @@ (commit version))) (sha256 (base32 - "0ghbanj142n0hgydzfjmnkdgri2kswsjal3mn10c723kih4ir4yr")) - (file-name (git-file-name name version)))) + "0pbpaasd7kj6y25nm45y1qyb9sxd4570f7g6zkfcpf6pa3nx7qkq")) + (file-name (git-file-name name version)) + (patches (search-patches "gpodder-disable-updater.patch")))) (build-system python-build-system) (native-inputs `(("intltool" ,intltool) diff --git a/gnu/packages/patches/gpodder-disable-updater.patch b/gnu/packages/patches/gpodder-disable-updater.patch new file mode 100644 index 0000000000..1aa0afe4f1 --- /dev/null +++ b/gnu/packages/patches/gpodder-disable-updater.patch @@ -0,0 +1,18 @@ +Description: Modify the default value for check_on_startup to false. + This prevents an privacy/information disclosure unless the user + explicitly opts-in for the update check. +Forwarded: not-needed +Origin: vendor +Author: tony mancill + +--- a/src/gpodder/config.py ++++ b/src/gpodder/config.py +@@ -93,7 +93,7 @@ + + # Software updates from gpodder.org + 'software_update': { +- 'check_on_startup': True, # check for updates on start ++ 'check_on_startup': False, # check for updates on start + 'last_check': 0, # unix timestamp of last update check + 'interval': 5, # interval (in days) to check for updates + }, -- cgit v1.2.3