diff --git a/pkgs/tools/misc/oggvideotools/default.nix b/pkgs/tools/misc/oggvideotools/default.nix index 2780354aa0e6..e6b8d9a1d288 100644 --- a/pkgs/tools/misc/oggvideotools/default.nix +++ b/pkgs/tools/misc/oggvideotools/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, cmake, pkg-config, boost, gd, libogg, libtheora, libvorbis }: +{ lib, stdenv, fetchurl, fetchpatch, cmake, pkg-config, boost, gd, libogg, libtheora, libvorbis }: stdenv.mkDerivation rec { pname = "oggvideotools"; @@ -10,9 +10,30 @@ stdenv.mkDerivation rec { }; patches = [ - ./fix-compile.patch + # Fix pending upstream inclusion for missing includes: + # https://sourceforge.net/p/oggvideotools/bugs/12/ + (fetchpatch { + name = "gcc-10.patch"; + url = "https://sourceforge.net/p/oggvideotools/bugs/12/attachment/fix-compile.patch"; + sha256 = "sha256-mJttoC3jCLM3vmPhlyqh+W0ryp2RjJGIBXd6sJfLJA4="; + }) + + # Fix pending upstream inclusion for build failure on gcc-12: + # https://sourceforge.net/p/oggvideotools/bugs/13/ + (fetchpatch { + name = "gcc-12.patch"; + url = "https://sourceforge.net/p/oggvideotools/bugs/13/attachment/fix-gcc-12.patch"; + sha256 = "sha256-zuDXe86djWkR8SgYZHkuAJJ7Lf2VYsVRBrlEaODtMKE="; + # svn patch, rely on prefix added by fetchpatch: + extraPrefix = ""; + }) ]; + postPatch = '' + # Don't disable optimisations + substituteInPlace CMakeLists.txt --replace " -O0 " "" + ''; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ boost gd libogg libtheora libvorbis ]; diff --git a/pkgs/tools/misc/oggvideotools/fix-compile.patch b/pkgs/tools/misc/oggvideotools/fix-compile.patch deleted file mode 100644 index 65c3dd6a2351..000000000000 --- a/pkgs/tools/misc/oggvideotools/fix-compile.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- oggvideotools-0.9.1/src/base/test/decoderTest.cpp 2016-09-05 10:35:14.000000000 +0200 -+++ oggvideotools-0.9.1/src/base/test/decoderTest.cpp 2021-10-22 22:42:48.980473419 +0200 -@@ -5,6 +5,7 @@ - #include "oggDecoder.h" - #include - #include -+#include - - int main(int argc, char* argv[]) - {