From bbcb4ff76c5bcce5c824fa2bf26e6e753da9fe70 Mon Sep 17 00:00:00 2001 From: Alexey Dokuchaev Date: Fri, 25 Aug 2017 18:14:00 +0000 Subject: [PATCH] - Update `audio/flacon' to version 3.1.1 - Add upstream patch to fix sporadic crash on program's start-up due to notorious C++ "static initialization order fiasco" [*] Because GitHub releases (tarballs) are not fetched with correct modification time, set TIMESTAMP to 1502219275 which corresponds to commit 8f81f61 tagged as this release. [*] https://isocpp.org/wiki/faq/ctors#static-init-order --- audio/flacon/Makefile | 2 +- audio/flacon/distinfo | 6 ++-- audio/flacon/files/patch-49e72de | 62 ++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 audio/flacon/files/patch-49e72de diff --git a/audio/flacon/Makefile b/audio/flacon/Makefile index af3132a8736a..fa9e1a628745 100644 --- a/audio/flacon/Makefile +++ b/audio/flacon/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= flacon -PORTVERSION= 3.0.0 +PORTVERSION= 3.1.1 DISTVERSIONPREFIX= v CATEGORIES= audio diff --git a/audio/flacon/distinfo b/audio/flacon/distinfo index 8623ac818569..baec42b88759 100644 --- a/audio/flacon/distinfo +++ b/audio/flacon/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1497981519 -SHA256 (flacon-flacon-v3.0.0_GH0.tar.gz) = 5349fdc29c6cb173e7d40260e7ea4ba13ae39f4a144c22028fbfa132ceef5bb3 -SIZE (flacon-flacon-v3.0.0_GH0.tar.gz) = 430724 +TIMESTAMP = 1502219275 +SHA256 (flacon-flacon-v3.1.1_GH0.tar.gz) = ca5bd24ba61fc06a39e95b4b7fda188af437ad3eff666b55071895bde11bd15a +SIZE (flacon-flacon-v3.1.1_GH0.tar.gz) = 431743 diff --git a/audio/flacon/files/patch-49e72de b/audio/flacon/files/patch-49e72de new file mode 100644 index 000000000000..1595a6b7a703 --- /dev/null +++ b/audio/flacon/files/patch-49e72de @@ -0,0 +1,62 @@ +diff --git a/formats/format.cpp b/formats/format.cpp +index 53f7ed0..89abaf9 100644 +--- formats/format.cpp.orig ++++ formats/format.cpp +@@ -32,7 +32,14 @@ + #include + #include + +-AudioFormatList AudioFormat::mAllFormats; ++/************************************************ ++ * ++ ************************************************/ ++AudioFormatList &formatList() ++{ ++ static AudioFormatList *afl = new AudioFormatList(); ++ return *afl; ++} + + + /************************************************ +@@ -43,9 +50,9 @@ bool AudioFormat::registerFormat(const AudioFormat &f) + // Some formats can be embedded as a chunk of RIFF stream. + // So the WAV format should be last and be checked in the last turn. + if (f.ext() == "wav") +- mAllFormats.append(&f); ++ formatList().append(&f); + else +- mAllFormats.insert(0, &f); ++ formatList().insert(0, &f); + return true; + } + +@@ -71,7 +78,7 @@ AudioFormat::~AudioFormat() + ************************************************/ + const AudioFormatList &AudioFormat::allFormats() + { +- return mAllFormats; ++ return formatList(); + } + + +diff --git a/formats/format.h b/formats/format.h +index b159b7a..0f9fcb6 100644 +--- formats/format.h.orig ++++ formats/format.h +@@ -70,8 +70,6 @@ class AudioFormat + protected: + virtual bool checkMagic(const QByteArray &data) const; + +-private: +- static QList mAllFormats; + }; + + +@@ -79,6 +77,6 @@ class AudioFormat + + #define REGISTER_FORMAT(FORMAT) \ + static FORMAT static_##FORMAT##_Instance; \ +- static bool is_##FORMAT##_loaded = AudioFormat::registerFormat(static_##FORMAT##_Instance); ++ static bool is_##FORMAT##_loaded = AudioFormat::registerFormat(static_##FORMAT##_Instance); + + #endif // FORMAT_H