aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/openscenegraph-ffmpeg3.patch156
-rw-r--r--gnu/packages/patches/rust-bootstrap-stage0-test.patch55
-rw-r--r--gnu/packages/patches/rust-coresimd-doctest.patch21
-rw-r--r--gnu/packages/patches/syncthing-fix-crash.patch72
-rw-r--r--gnu/packages/patches/xapian-revert-5489fb2f8.patch23
5 files changed, 171 insertions, 156 deletions
diff --git a/gnu/packages/patches/openscenegraph-ffmpeg3.patch b/gnu/packages/patches/openscenegraph-ffmpeg3.patch
deleted file mode 100644
index 02c04a5583..0000000000
--- a/gnu/packages/patches/openscenegraph-ffmpeg3.patch
+++ /dev/null
@@ -1,156 +0,0 @@
-Description: Replace deprecated FFmpeg API
-Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-See <http://forum.openscenegraph.org/viewtopic.php?t=15832>.
---- a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
-+++ b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
-@@ -71,7 +71,7 @@ void FFmpegDecoderVideo::open(AVStream *
- findAspectRatio();
-
- // Find out whether we support Alpha channel
-- m_alpha_channel = (m_context->pix_fmt == PIX_FMT_YUVA420P);
-+ m_alpha_channel = (m_context->pix_fmt == AV_PIX_FMT_YUVA420P);
-
- // Find out the framerate
- m_frame_rate = av_q2d(stream->avg_frame_rate);
-@@ -91,20 +91,19 @@ void FFmpegDecoderVideo::open(AVStream *
- throw std::runtime_error("avcodec_open() failed");
-
- // Allocate video frame
-- m_frame.reset(avcodec_alloc_frame());
-+ m_frame.reset(av_frame_alloc());
-
- // Allocate converted RGB frame
-- m_frame_rgba.reset(avcodec_alloc_frame());
-- m_buffer_rgba[0].resize(avpicture_get_size(PIX_FMT_RGB24, width(), height()));
-+ m_frame_rgba.reset(av_frame_alloc());
-+ m_buffer_rgba[0].resize(avpicture_get_size(AV_PIX_FMT_RGB24, width(), height()));
- m_buffer_rgba[1].resize(m_buffer_rgba[0].size());
-
- // Assign appropriate parts of the buffer to image planes in m_frame_rgba
-- avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], PIX_FMT_RGB24, width(), height());
-+ avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], AV_PIX_FMT_RGB24, width(), height());
-
- // Override get_buffer()/release_buffer() from codec context in order to retrieve the PTS of each frame.
- m_context->opaque = this;
-- m_context->get_buffer = getBuffer;
-- m_context->release_buffer = releaseBuffer;
-+ m_context->get_buffer2 = getBuffer;
- }
-
-
-@@ -263,8 +262,8 @@ int FFmpegDecoderVideo::convert(AVPictur
- #ifdef USE_SWSCALE
- if (m_swscale_ctx==0)
- {
-- m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat) src_pix_fmt,
-- src_width, src_height, (PixelFormat) dst_pix_fmt,
-+ m_swscale_ctx = sws_getContext(src_width, src_height, (AVPixelFormat) src_pix_fmt,
-+ src_width, src_height, (AVPixelFormat) dst_pix_fmt,
- /*SWS_BILINEAR*/ SWS_BICUBIC, NULL, NULL, NULL);
- }
-
-@@ -311,14 +310,14 @@ void FFmpegDecoderVideo::publishFrame(co
- AVPicture * const dst = (AVPicture *) m_frame_rgba.get();
-
- // Assign appropriate parts of the buffer to image planes in m_frame_rgba
-- avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB24, width(), height());
-+ avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], AV_PIX_FMT_RGB24, width(), height());
-
- // Convert YUVA420p (i.e. YUV420p plus alpha channel) using our own routine
-
-- if (m_context->pix_fmt == PIX_FMT_YUVA420P)
-+ if (m_context->pix_fmt == AV_PIX_FMT_YUVA420P)
- yuva420pToRgba(dst, src, width(), height());
- else
-- convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width(), height());
-+ convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width(), height());
-
- // Wait 'delay' seconds before publishing the picture.
- int i_delay = static_cast<int>(delay * 1000000 + 0.5);
-@@ -345,7 +344,7 @@ void FFmpegDecoderVideo::publishFrame(co
-
- void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, AVPicture * const src, int width, int height)
- {
-- convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width, height);
-+ convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width, height);
-
- const size_t bpp = 4;
-
-@@ -363,31 +362,28 @@ void FFmpegDecoderVideo::yuva420pToRgba(
- }
- }
-
--
--
--int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture)
-+int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture, int flags)
- {
-+ AVBufferRef *ref;
- const FFmpegDecoderVideo * const this_ = reinterpret_cast<const FFmpegDecoderVideo*>(context->opaque);
-
-- const int result = avcodec_default_get_buffer(context, picture);
-+ const int result = avcodec_default_get_buffer2(context, picture, flags);
- int64_t * p_pts = reinterpret_cast<int64_t*>( av_malloc(sizeof(int64_t)) );
-
- *p_pts = this_->m_packet_pts;
- picture->opaque = p_pts;
-
-+ ref = av_buffer_create((uint8_t *)picture->opaque, sizeof(int64_t), FFmpegDecoderVideo::freeBuffer, picture->buf[0], flags);
-+ picture->buf[0] = ref;
-+
- return result;
- }
-
--
--
--void FFmpegDecoderVideo::releaseBuffer(AVCodecContext * const context, AVFrame * const picture)
-+void FFmpegDecoderVideo::freeBuffer(void *opaque, uint8_t *data)
- {
-- if (picture != 0)
-- av_freep(&picture->opaque);
--
-- avcodec_default_release_buffer(context, picture);
-+ AVBufferRef *ref = (AVBufferRef *)opaque;
-+ av_buffer_unref(&ref);
-+ av_free(data);
- }
-
--
--
- } // namespace osgFFmpeg
---- a/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
-+++ b/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
-@@ -94,8 +94,8 @@ private:
- int src_pix_fmt, int src_width, int src_height);
-
-
-- static int getBuffer(AVCodecContext * context, AVFrame * picture);
-- static void releaseBuffer(AVCodecContext * context, AVFrame * picture);
-+ static int getBuffer(AVCodecContext * context, AVFrame * picture, int flags);
-+ static void freeBuffer(void * opaque, uint8_t *data);
-
- PacketQueue & m_packets;
- FFmpegClocks & m_clocks;
---- a/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
-+++ b/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
-@@ -19,7 +19,7 @@ extern "C"
- #include <libavutil/pixdesc.h>
- }
-
--inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
-+inline AVPixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
-
-
- namespace osgFFmpeg {
---- a/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp 2016-02-18 21:25:39.627923629 +0000
-+++ b/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp 2016-02-18 21:26:17.071140100 +0000
-@@ -227,8 +227,7 @@
- if (avcodec_open2(m_context, p_codec, NULL) < 0)
- throw std::runtime_error("avcodec_open() failed");
-
-- m_context->get_buffer = avcodec_default_get_buffer;
-- m_context->release_buffer = avcodec_default_release_buffer;
-+ m_context->get_buffer2 = avcodec_default_get_buffer2;
-
- }
-
diff --git a/gnu/packages/patches/rust-bootstrap-stage0-test.patch b/gnu/packages/patches/rust-bootstrap-stage0-test.patch
new file mode 100644
index 0000000000..e8484903e5
--- /dev/null
+++ b/gnu/packages/patches/rust-bootstrap-stage0-test.patch
@@ -0,0 +1,55 @@
+Bootstrap tests failed with local stage0 cargo and rustc
+Backported changes from https://github.com/rust-lang/rust/pull/51977
+
+From 0834d9d771e912f51deca6c25699e44734624546 Mon Sep 17 00:00:00 2001
+From: Nikolai Merinov <nikolai.merinov@member.fsf.org>
+Date: Mon, 2 Jul 2018 01:45:35 +0500
+Subject: [PATCH] bootstrap: tests should use rustc from config.toml
+
+Tests should always use "rustc" and "cargo" from config.toml instead
+of assuming that stage0 binaries was downloaded to build directory.
+---
+ src/bootstrap/bootstrap.py | 2 ++
+ src/bootstrap/config.rs | 6 ++----
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
+index 487440becf..1701f7b83a 100644
+--- a/src/bootstrap/bootstrap.py
++++ b/src/bootstrap/bootstrap.py
+@@ -788,6 +788,8 @@ def bootstrap(help_triggered):
+ env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
+ env["BOOTSTRAP_PYTHON"] = sys.executable
+ env["BUILD_DIR"] = build.build_dir
++ env["CARGO"] = build.cargo()
++ env["RUSTC"] = build.rustc()
+ run(args, env=env, verbose=build.verbose)
+
+
+diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
+index 6dd6291be2..d1a0deb583 100644
+--- a/src/bootstrap/config.rs
++++ b/src/bootstrap/config.rs
+@@ -23,7 +23,6 @@ use std::cmp;
+
+ use num_cpus;
+ use toml;
+-use util::exe;
+ use cache::{INTERNER, Interned};
+ use flags::Flags;
+ pub use flags::Subcommand;
+@@ -362,9 +361,8 @@ impl Config {
+ config.src = Config::path_from_python("SRC");
+ config.out = Config::path_from_python("BUILD_DIR");
+
+- let stage0_root = config.out.join(&config.build).join("stage0/bin");
+- config.initial_rustc = stage0_root.join(exe("rustc", &config.build));
+- config.initial_cargo = stage0_root.join(exe("cargo", &config.build));
++ config.initial_rustc = Config::path_from_python("RUSTC");
++ config.initial_cargo = Config::path_from_python("CARGO");
+
+ config
+ }
+--
+2.17.1
+
diff --git a/gnu/packages/patches/rust-coresimd-doctest.patch b/gnu/packages/patches/rust-coresimd-doctest.patch
new file mode 100644
index 0000000000..bfa0ab224b
--- /dev/null
+++ b/gnu/packages/patches/rust-coresimd-doctest.patch
@@ -0,0 +1,21 @@
+Doctest coresimd::x86::__m256 failed on processors withouth "avx" feature.
+Backported patch with changes from https://github.com/rust-lang-nursery/stdsimd/issues/481
+
+--- rustc-1.26.2-src-orig/src/stdsimd/coresimd/x86/mod.rs 1970-01-01 05:00:00.000000000 +0500
++++ rustc-1.26.2-src/src/stdsimd/coresimd/x86/mod.rs 2018-06-22 00:01:55.142026720 +0500
+@@ -293,13 +293,13 @@
+ /// use std::arch::x86_64::*;
+ ///
+ /// # fn main() {
+- /// # #[target_feature(enable = "sse")]
++ /// # #[target_feature(enable = "avx")]
+ /// # unsafe fn foo() {
+ /// let eight_zeros = _mm256_setzero_ps();
+ /// let eight_ones = _mm256_set1_ps(1.0);
+ /// let eight_floats = _mm256_set_ps(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0);
+ /// # }
+- /// # if is_x86_feature_detected!("sse") { unsafe { foo() } }
++ /// # if is_x86_feature_detected!("avx") { unsafe { foo() } }
+ /// # }
+ /// ```
+ pub struct __m256(f32, f32, f32, f32, f32, f32, f32, f32);
diff --git a/gnu/packages/patches/syncthing-fix-crash.patch b/gnu/packages/patches/syncthing-fix-crash.patch
new file mode 100644
index 0000000000..d27e543982
--- /dev/null
+++ b/gnu/packages/patches/syncthing-fix-crash.patch
@@ -0,0 +1,72 @@
+Avoid a crash:
+
+https://github.com/syncthing/syncthing/issues/5002
+
+Patch copied from upstream source repository:
+
+https://github.com/syncthing/syncthing/commit/35a75a95dc6383b2d73ab645f1407f7907ec1a2c
+
+From 35a75a95dc6383b2d73ab645f1407f7907ec1a2c Mon Sep 17 00:00:00 2001
+From: Jakob Borg <jakob@kastelo.net>
+Date: Wed, 13 Jun 2018 19:07:52 +0200
+Subject: [PATCH] lib/model: Don't panic when rechecking file (fixes #5002)
+ (#5003)
+
+---
+ lib/model/model.go | 2 +-
+ lib/model/model_test.go | 26 ++++++++++++++++++++++++++
+ 2 files changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/lib/model/model.go b/lib/model/model.go
+index 5a9146e0..302f06c5 100644
+--- a/lib/model/model.go
++++ b/lib/model/model.go
+@@ -1373,7 +1373,7 @@ func (m *Model) recheckFile(deviceID protocol.DeviceID, folderFs fs.Filesystem,
+ return
+ }
+
+- if blockIndex > len(cf.Blocks) {
++ if blockIndex >= len(cf.Blocks) {
+ l.Debugf("%v recheckFile: %s: %q / %q i=%d: block index too far", m, deviceID, folder, name, blockIndex)
+ return
+ }
+diff --git a/lib/model/model_test.go b/lib/model/model_test.go
+index 295eafc1..456bbc4a 100644
+--- a/lib/model/model_test.go
++++ b/lib/model/model_test.go
+@@ -3608,6 +3608,32 @@ func TestIssue4903(t *testing.T) {
+ }
+ }
+
++func TestIssue5002(t *testing.T) {
++ // recheckFile should not panic when given an index equal to the number of blocks
++
++ db := db.OpenMemory()
++ m := NewModel(defaultCfgWrapper, protocol.LocalDeviceID, "syncthing", "dev", db, nil)
++ m.AddFolder(defaultFolderConfig)
++ m.StartFolder("default")
++
++ m.ServeBackground()
++ defer m.Stop()
++
++ if err := m.ScanFolder("default"); err != nil {
++ t.Error(err)
++ }
++
++ file, ok := m.CurrentFolderFile("default", "foo")
++ if !ok {
++ t.Fatal("test file should exist")
++ }
++ nBlocks := len(file.Blocks)
++
++ m.recheckFile(protocol.LocalDeviceID, defaultFolderConfig.Filesystem(), "default", "foo", nBlocks-1, []byte{1, 2, 3, 4})
++ m.recheckFile(protocol.LocalDeviceID, defaultFolderConfig.Filesystem(), "default", "foo", nBlocks, []byte{1, 2, 3, 4}) // panic
++ m.recheckFile(protocol.LocalDeviceID, defaultFolderConfig.Filesystem(), "default", "foo", nBlocks+1, []byte{1, 2, 3, 4})
++}
++
+ func addFakeConn(m *Model, dev protocol.DeviceID) *fakeConnection {
+ fc := &fakeConnection{id: dev, model: m}
+ m.AddConnection(fc, protocol.HelloResult{})
+--
+2.18.0
+
diff --git a/gnu/packages/patches/xapian-revert-5489fb2f8.patch b/gnu/packages/patches/xapian-revert-5489fb2f8.patch
new file mode 100644
index 0000000000..7b78e2abb5
--- /dev/null
+++ b/gnu/packages/patches/xapian-revert-5489fb2f8.patch
@@ -0,0 +1,23 @@
+Revert this upstream commit which breaks a test case in "notmuch":
+
+https://git.xapian.org/?p=xapian;a=commitdiff;h=5489fb2f838c0f0b0a593b4c17df282a93a1fe5a
+
+See the notmuch FAQ entry:
+
+https://notmuchmail.org/faq/#index12h2
+
+This should be fixed for later releases.
+
+diff --git a/backends/glass/glass_postlist.cc b/xapian-core/backends/glass/glass_postlist.cc
+index 80e578b85..a47f14a68 100644
+--- a/backends/glass/glass_postlist.cc
++++ b/backends/glass/glass_postlist.cc
+@@ -759,7 +759,7 @@ GlassPostList::open_nearby_postlist(const std::string & term_,
+ (void)need_pos;
+ if (term_.empty())
+ RETURN(NULL);
+- if (!this_db.get() || this_db->postlist_table.is_modified())
++ if (!this_db.get() || this_db->postlist_table.is_writable())
+ RETURN(NULL);
+ RETURN(new GlassPostList(this_db, term_, cursor->clone()));
+ }