oggvideotools: fix build on gcc-12

While at it:

- uploaded gcc-10 fix to upstream bugtracker and pulled patch from there
- dropped explicit -O0 from CXXFLAGS to enable default optimisations
This commit is contained in:
Sergei Trofimovich 2021-11-13 08:13:49 +00:00
parent 1ad8cd2d56
commit c6b8047eb1
2 changed files with 23 additions and 12 deletions

View file

@ -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 ];

View file

@ -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 <vector>
#include <iostream>
+#include <cstring>
int main(int argc, char* argv[])
{