From 979ec8e98ba1bf83bef4915cb4178c56d5fcb71d Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 3 Jan 2020 12:57:00 -0800 Subject: ffmpeg: Remove version.sh patch For build reproducibility, we don't use version.sh anymore, and instead create it ourselves. --- .../patch/0001-Fix-build-with-LibreSSL.patch | 71 ++++++++++++++++++++++ .../0001-version.sh-Replace-all-slashes.patch | 25 -------- .../patch/0002-Fix-build-with-LibreSSL.patch | 71 ---------------------- ...-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch | 43 +++++++++++++ ...-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch | 43 ------------- pkg/ffmpeg/ver | 2 +- 6 files changed, 115 insertions(+), 140 deletions(-) create mode 100644 pkg/ffmpeg/patch/0001-Fix-build-with-LibreSSL.patch delete mode 100644 pkg/ffmpeg/patch/0001-version.sh-Replace-all-slashes.patch delete mode 100644 pkg/ffmpeg/patch/0002-Fix-build-with-LibreSSL.patch create mode 100644 pkg/ffmpeg/patch/0002-libavformat-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch delete mode 100644 pkg/ffmpeg/patch/0003-libavformat-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch (limited to 'pkg/ffmpeg') diff --git a/pkg/ffmpeg/patch/0001-Fix-build-with-LibreSSL.patch b/pkg/ffmpeg/patch/0001-Fix-build-with-LibreSSL.patch new file mode 100644 index 00000000..5e4a070c --- /dev/null +++ b/pkg/ffmpeg/patch/0001-Fix-build-with-LibreSSL.patch @@ -0,0 +1,71 @@ +From 22d9fc0b4c4b8e83d638a3dffa848292f6b58437 Mon Sep 17 00:00:00 2001 +From: Michael Forney +Date: Fri, 28 Oct 2016 00:33:53 -0700 +Subject: [PATCH] Fix build with LibreSSL + +Signed-off-by: Michael Forney +--- + libavformat/tls_openssl.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c +index 59a86150a7..eb9e0bc24f 100644 +--- a/libavformat/tls_openssl.c ++++ b/libavformat/tls_openssl.c +@@ -43,7 +43,7 @@ typedef struct TLSContext { + TLSShared tls_shared; + SSL_CTX *ctx; + SSL *ssl; +-#if OPENSSL_VERSION_NUMBER >= 0x1010000fL ++#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) + BIO_METHOD* url_bio_method; + #endif + } TLSContext; +@@ -137,7 +137,7 @@ static int tls_close(URLContext *h) + SSL_CTX_free(c->ctx); + if (c->tls_shared.tcp) + ffurl_close(c->tls_shared.tcp); +-#if OPENSSL_VERSION_NUMBER >= 0x1010000fL ++#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000f) + if (c->url_bio_method) + BIO_meth_free(c->url_bio_method); + #endif +@@ -147,7 +147,7 @@ static int tls_close(URLContext *h) + + static int url_bio_create(BIO *b) + { +-#if OPENSSL_VERSION_NUMBER >= 0x1010000fL ++#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) + BIO_set_init(b, 1); + BIO_set_data(b, NULL); + BIO_set_flags(b, 0); +@@ -164,7 +164,7 @@ static int url_bio_destroy(BIO *b) + return 1; + } + +-#if OPENSSL_VERSION_NUMBER >= 0x1010000fL ++#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) + #define GET_BIO_DATA(x) BIO_get_data(x) + #else + #define GET_BIO_DATA(x) (x)->ptr +@@ -212,7 +212,7 @@ static int url_bio_bputs(BIO *b, const char *str) + return url_bio_bwrite(b, str, strlen(str)); + } + +-#if OPENSSL_VERSION_NUMBER < 0x1010000fL ++#if OPENSSL_VERSION_NUMBER < 0x1010000fL || defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL + static BIO_METHOD url_bio_method = { + .type = BIO_TYPE_SOURCE_SINK, + .name = "urlprotocol bio", +@@ -276,7 +276,7 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op + ret = AVERROR(EIO); + goto fail; + } +-#if OPENSSL_VERSION_NUMBER >= 0x1010000fL ++#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) + p->url_bio_method = BIO_meth_new(BIO_TYPE_SOURCE_SINK, "urlprotocol bio"); + BIO_meth_set_write(p->url_bio_method, url_bio_bwrite); + BIO_meth_set_read(p->url_bio_method, url_bio_bread); +-- +2.17.0 + diff --git a/pkg/ffmpeg/patch/0001-version.sh-Replace-all-slashes.patch b/pkg/ffmpeg/patch/0001-version.sh-Replace-all-slashes.patch deleted file mode 100644 index d970c36f..00000000 --- a/pkg/ffmpeg/patch/0001-version.sh-Replace-all-slashes.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 333db73f3ce45055c77bf951153c8fddb3de5e42 Mon Sep 17 00:00:00 2001 -From: Michael Forney -Date: Sat, 2 Jul 2016 11:58:07 -0700 -Subject: [PATCH] version.sh: Replace all slashes - ---- - ffbuild/version.sh | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ffbuild/version.sh b/ffbuild/version.sh -index edc4dd33c5..331aa385c3 100755 ---- a/ffbuild/version.sh -+++ b/ffbuild/version.sh -@@ -49,7 +49,7 @@ NEW_REVISION="#define FFMPEG_VERSION \"$version\"" - OLD_REVISION=$(cat "$2" 2> /dev/null | head -4 | tail -1) - - # String used for preprocessor guard --GUARD=$(echo "$2" | sed 's/\//_/' | sed 's/\./_/' | tr '[:lower:]' '[:upper:]' | sed 's/LIB//') -+GUARD=$(echo "$2" | sed 's/\//_/g' | sed 's/\./_/' | tr '[:lower:]' '[:upper:]' | sed 's/LIB//') - - # Update version header only on revision changes to avoid spurious rebuilds - if test "$NEW_REVISION" != "$OLD_REVISION"; then --- -2.14.2 - diff --git a/pkg/ffmpeg/patch/0002-Fix-build-with-LibreSSL.patch b/pkg/ffmpeg/patch/0002-Fix-build-with-LibreSSL.patch deleted file mode 100644 index 5e4a070c..00000000 --- a/pkg/ffmpeg/patch/0002-Fix-build-with-LibreSSL.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 22d9fc0b4c4b8e83d638a3dffa848292f6b58437 Mon Sep 17 00:00:00 2001 -From: Michael Forney -Date: Fri, 28 Oct 2016 00:33:53 -0700 -Subject: [PATCH] Fix build with LibreSSL - -Signed-off-by: Michael Forney ---- - libavformat/tls_openssl.c | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c -index 59a86150a7..eb9e0bc24f 100644 ---- a/libavformat/tls_openssl.c -+++ b/libavformat/tls_openssl.c -@@ -43,7 +43,7 @@ typedef struct TLSContext { - TLSShared tls_shared; - SSL_CTX *ctx; - SSL *ssl; --#if OPENSSL_VERSION_NUMBER >= 0x1010000fL -+#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) - BIO_METHOD* url_bio_method; - #endif - } TLSContext; -@@ -137,7 +137,7 @@ static int tls_close(URLContext *h) - SSL_CTX_free(c->ctx); - if (c->tls_shared.tcp) - ffurl_close(c->tls_shared.tcp); --#if OPENSSL_VERSION_NUMBER >= 0x1010000fL -+#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000f) - if (c->url_bio_method) - BIO_meth_free(c->url_bio_method); - #endif -@@ -147,7 +147,7 @@ static int tls_close(URLContext *h) - - static int url_bio_create(BIO *b) - { --#if OPENSSL_VERSION_NUMBER >= 0x1010000fL -+#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) - BIO_set_init(b, 1); - BIO_set_data(b, NULL); - BIO_set_flags(b, 0); -@@ -164,7 +164,7 @@ static int url_bio_destroy(BIO *b) - return 1; - } - --#if OPENSSL_VERSION_NUMBER >= 0x1010000fL -+#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) - #define GET_BIO_DATA(x) BIO_get_data(x) - #else - #define GET_BIO_DATA(x) (x)->ptr -@@ -212,7 +212,7 @@ static int url_bio_bputs(BIO *b, const char *str) - return url_bio_bwrite(b, str, strlen(str)); - } - --#if OPENSSL_VERSION_NUMBER < 0x1010000fL -+#if OPENSSL_VERSION_NUMBER < 0x1010000fL || defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL - static BIO_METHOD url_bio_method = { - .type = BIO_TYPE_SOURCE_SINK, - .name = "urlprotocol bio", -@@ -276,7 +276,7 @@ static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **op - ret = AVERROR(EIO); - goto fail; - } --#if OPENSSL_VERSION_NUMBER >= 0x1010000fL -+#if OPENSSL_VERSION_NUMBER >= 0x1010000fL && (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL) - p->url_bio_method = BIO_meth_new(BIO_TYPE_SOURCE_SINK, "urlprotocol bio"); - BIO_meth_set_write(p->url_bio_method, url_bio_bwrite); - BIO_meth_set_read(p->url_bio_method, url_bio_bread); --- -2.17.0 - diff --git a/pkg/ffmpeg/patch/0002-libavformat-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch b/pkg/ffmpeg/patch/0002-libavformat-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch new file mode 100644 index 00000000..521b5288 --- /dev/null +++ b/pkg/ffmpeg/patch/0002-libavformat-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch @@ -0,0 +1,43 @@ +From 1ea65b2fd8798766d6965378b0484ecf1cf72e6a Mon Sep 17 00:00:00 2001 +From: Michael Forney +Date: Mon, 9 Dec 2019 16:36:57 -0800 +Subject: [PATCH] libavformat/tls_libtls: handle TLS_WANT_POLLIN and + TLS_WANT_POLLOUT return values + +These values may be returned by libtls (even in the case of blocking +file descriptors) when we need to read/write more TLS record data in +order to read/write application data. + +The URLProtocol documentation says AVERROR(EAGAIN) should be returned +in these cases. + +Signed-off-by: Michael Forney +--- + libavformat/tls_libtls.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/libavformat/tls_libtls.c b/libavformat/tls_libtls.c +index ba83b56ffe..286454e452 100644 +--- a/libavformat/tls_libtls.c ++++ b/libavformat/tls_libtls.c +@@ -159,6 +159,8 @@ static int ff_tls_read(URLContext *h, uint8_t *buf, int size) + return ret; + else if (ret == 0) + return AVERROR_EOF; ++ else if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) ++ return AVERROR(EAGAIN); + av_log(h, AV_LOG_ERROR, "%s\n", tls_error(p->ctx)); + return AVERROR(EIO); + } +@@ -172,6 +174,8 @@ static int ff_tls_write(URLContext *h, const uint8_t *buf, int size) + return ret; + else if (ret == 0) + return AVERROR_EOF; ++ else if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) ++ return AVERROR(EAGAIN); + av_log(h, AV_LOG_ERROR, "%s\n", tls_error(p->ctx)); + return AVERROR(EIO); + } +-- +2.24.0 + diff --git a/pkg/ffmpeg/patch/0003-libavformat-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch b/pkg/ffmpeg/patch/0003-libavformat-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch deleted file mode 100644 index 521b5288..00000000 --- a/pkg/ffmpeg/patch/0003-libavformat-tls_libtls-handle-TLS_WANT_POLLIN-and-TL.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 1ea65b2fd8798766d6965378b0484ecf1cf72e6a Mon Sep 17 00:00:00 2001 -From: Michael Forney -Date: Mon, 9 Dec 2019 16:36:57 -0800 -Subject: [PATCH] libavformat/tls_libtls: handle TLS_WANT_POLLIN and - TLS_WANT_POLLOUT return values - -These values may be returned by libtls (even in the case of blocking -file descriptors) when we need to read/write more TLS record data in -order to read/write application data. - -The URLProtocol documentation says AVERROR(EAGAIN) should be returned -in these cases. - -Signed-off-by: Michael Forney ---- - libavformat/tls_libtls.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/libavformat/tls_libtls.c b/libavformat/tls_libtls.c -index ba83b56ffe..286454e452 100644 ---- a/libavformat/tls_libtls.c -+++ b/libavformat/tls_libtls.c -@@ -159,6 +159,8 @@ static int ff_tls_read(URLContext *h, uint8_t *buf, int size) - return ret; - else if (ret == 0) - return AVERROR_EOF; -+ else if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) -+ return AVERROR(EAGAIN); - av_log(h, AV_LOG_ERROR, "%s\n", tls_error(p->ctx)); - return AVERROR(EIO); - } -@@ -172,6 +174,8 @@ static int ff_tls_write(URLContext *h, const uint8_t *buf, int size) - return ret; - else if (ret == 0) - return AVERROR_EOF; -+ else if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) -+ return AVERROR(EAGAIN); - av_log(h, AV_LOG_ERROR, "%s\n", tls_error(p->ctx)); - return AVERROR(EIO); - } --- -2.24.0 - diff --git a/pkg/ffmpeg/ver b/pkg/ffmpeg/ver index 910e79f3..f857e9aa 100644 --- a/pkg/ffmpeg/ver +++ b/pkg/ffmpeg/ver @@ -1 +1 @@ -4.2.1 r1 +4.2.1 r2 -- cgit v1.2.3