On Thu, Jun 20, 2019 at 10:29:10PM +0200, Raphael Graf wrote: > The attached diff fixes this nasty issue: > https://github.com/taglib/taglib/issues/864 > > It is easy to reproduce, for example with audio/clementine, > see https://github.com/clementine-player/Clementine/issues/5524 > > ok? >
Maybe the tests should be enabled for this port.., here's an updated diff. All tests pass with and without the bugfix. Any opinions?
Index: Makefile =================================================================== RCS file: /cvs/ports/audio/taglib/Makefile,v retrieving revision 1.43 diff -u -p -u -p -r1.43 Makefile --- Makefile 24 Oct 2018 14:27:58 -0000 1.43 +++ Makefile 21 Jun 2019 12:35:03 -0000 @@ -2,7 +2,7 @@ COMMENT= managing meta-data of audio formats DISTNAME= taglib-1.11.1 -REVISION= 1 +REVISION= 2 CATEGORIES= audio devel @@ -21,10 +21,12 @@ COMPILER = base-clang ports-gcc base-gc MASTER_SITES= https://taglib.github.io/releases/ MODULES= devel/cmake -BUILD_DEPENDS= devel/boost +BUILD_DEPENDS= devel/boost \ + devel/cppunit -CONFIGURE_ARGS= -DBUILD_SHARED_LIBS:BOOL=ON +CONFIGURE_ARGS= -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTS=ON -NO_TEST= Yes +TEST_TARGET= check .include <bsd.port.mk> Index: patches/patch-CMakeLists_txt =================================================================== RCS file: patches/patch-CMakeLists_txt diff -N patches/patch-CMakeLists_txt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-CMakeLists_txt 21 Jun 2019 12:35:03 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: CMakeLists.txt +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -143,7 +143,7 @@ if(BUILD_BINDINGS) + add_subdirectory(bindings) + endif() + +-if(BUILD_TESTS AND NOT BUILD_SHARED_LIBS) ++if(BUILD_TESTS) + enable_testing() + add_subdirectory(tests) + endif() Index: patches/patch-ConfigureChecks_cmake =================================================================== RCS file: patches/patch-ConfigureChecks_cmake diff -N patches/patch-ConfigureChecks_cmake --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-ConfigureChecks_cmake 21 Jun 2019 12:35:03 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ + +Index: ConfigureChecks.cmake +--- ConfigureChecks.cmake.orig ++++ ConfigureChecks.cmake +@@ -238,7 +238,7 @@ endif() + + # Determine whether CppUnit is installed. + +-if(BUILD_TESTS AND NOT BUILD_SHARED_LIBS) ++if(BUILD_TESTS) + find_package(CppUnit) + if(NOT CppUnit_FOUND) + message(STATUS "CppUnit not found, disabling tests.") Index: patches/patch-taglib_ogg_oggfile_cpp =================================================================== RCS file: patches/patch-taglib_ogg_oggfile_cpp diff -N patches/patch-taglib_ogg_oggfile_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-taglib_ogg_oggfile_cpp 21 Jun 2019 12:35:03 -0000 @@ -0,0 +1,18 @@ +$OpenBSD$ + +Fix possible Ogg packet losses. +https://github.com/taglib/taglib/issues/864 +https://github.com/taglib/taglib/commit/9336c82 + +Index: taglib/ogg/oggfile.cpp +--- taglib/ogg/oggfile.cpp.orig ++++ taglib/ogg/oggfile.cpp +@@ -253,7 +253,7 @@ void Ogg::File::writePacket(unsigned int i, const Byte + ByteVectorList packets = firstPage->packets(); + packets[i - firstPage->firstPacketIndex()] = packet; + +- if(firstPage != lastPage && lastPage->packetCount() > 2) { ++ if(firstPage != lastPage && lastPage->packetCount() > 1) { + ByteVectorList lastPagePackets = lastPage->packets(); + lastPagePackets.erase(lastPagePackets.begin()); + packets.append(lastPagePackets);