From 64b1480e00ec596b5a5f9d7c0846602a17da32e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Thu, 1 Aug 2019 22:59:55 +0200 Subject: [PATCH] distrho-ports: get rid of DOS line-endings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Müller --- recipes-musicians/distrho/distrho-ports.bb | 2 +- ...usl-by-removing-unused-SystemStats-g.patch | 164 ++++++++-------- ...sl-fix-by-removal-of-unused-function.patch | 180 +++++++++--------- 3 files changed, 173 insertions(+), 173 deletions(-) diff --git a/recipes-musicians/distrho/distrho-ports.bb b/recipes-musicians/distrho/distrho-ports.bb index a343c25..29177c9 100644 --- a/recipes-musicians/distrho/distrho-ports.bb +++ b/recipes-musicians/distrho/distrho-ports.bb @@ -34,7 +34,7 @@ SRC_URI[linuxsynths-vex-patches2.sha256sum] = "378cff261dab333c5f29246b6f3f557e0 REQUIRED_DISTRO_FEATURES = "x11 opengl" -inherit lv2-postinst-helper distro_features_check pack_audio_plugins +inherit dos2unix lv2-postinst-helper distro_features_check pack_audio_plugins DEPENDS += " \ premake3-native \ diff --git a/recipes-musicians/distrho/distrho-ports/0003-Fix-build-with-musl-by-removing-unused-SystemStats-g.patch b/recipes-musicians/distrho/distrho-ports/0003-Fix-build-with-musl-by-removing-unused-SystemStats-g.patch index 19138c2..7435c57 100644 --- a/recipes-musicians/distrho/distrho-ports/0003-Fix-build-with-musl-by-removing-unused-SystemStats-g.patch +++ b/recipes-musicians/distrho/distrho-ports/0003-Fix-build-with-musl-by-removing-unused-SystemStats-g.patch @@ -20,13 +20,13 @@ Removing SystemStats::getStackBacktrace does not cause any harm because it is not used. I am aware that there might be an update of JUCE or other prugins using -getStackBacktrace in the future but till then musl fan boys are happy. - +getStackBacktrace in the future but till then musl fan boys are happy. + Upstream-Status: Submitted [3] [1] https://www.musl-libc.org/ [2] https://www.gnu.org/software/gnulib/manual/html_node/execinfo_002eh.html -[3] https://github.com/DISTRHO/DISTRHO-Ports/pull/31 +[3] https://github.com/DISTRHO/DISTRHO-Ports/pull/31 Signed-off-by: Andreas Müller --- @@ -40,95 +40,95 @@ index 136dd284..06c7d17f 100644 --- a/libs/juce/source/modules/juce_core/juce_core.cpp +++ b/libs/juce/source/modules/juce_core/juce_core.cpp @@ -94,9 +94,6 @@ - #include - #include - -- #if ! JUCE_ANDROID -- #include -- #endif - #endif - - #if JUCE_MAC || JUCE_IOS + #include + #include + +- #if ! JUCE_ANDROID +- #include +- #endif + #endif + + #if JUCE_MAC || JUCE_IOS diff --git a/libs/juce/source/modules/juce_core/system/juce_SystemStats.cpp b/libs/juce/source/modules/juce_core/system/juce_SystemStats.cpp index c073331b..6f814213 100644 --- a/libs/juce/source/modules/juce_core/system/juce_SystemStats.cpp +++ b/libs/juce/source/modules/juce_core/system/juce_SystemStats.cpp @@ -118,58 +118,6 @@ bool SystemStats::hasAVX2() noexcept { return getCPUInformation().has - bool SystemStats::hasNeon() noexcept { return getCPUInformation().hasNeon; } - - --//============================================================================== --String SystemStats::getStackBacktrace() --{ -- String result; -- -- #if JUCE_ANDROID || JUCE_MINGW -- jassertfalse; // sorry, not implemented yet! -- -- #elif JUCE_WINDOWS -- HANDLE process = GetCurrentProcess(); -- SymInitialize (process, nullptr, TRUE); -- -- void* stack[128]; -- int frames = (int) CaptureStackBackTrace (0, numElementsInArray (stack), stack, nullptr); -- -- HeapBlock symbol; -- symbol.calloc (sizeof (SYMBOL_INFO) + 256, 1); -- symbol->MaxNameLen = 255; -- symbol->SizeOfStruct = sizeof (SYMBOL_INFO); -- -- for (int i = 0; i < frames; ++i) -- { -- DWORD64 displacement = 0; -- -- if (SymFromAddr (process, (DWORD64) stack[i], &displacement, symbol)) -- { -- result << i << ": "; -- -- IMAGEHLP_MODULE64 moduleInfo; -- zerostruct (moduleInfo); -- moduleInfo.SizeOfStruct = sizeof (moduleInfo); -- -- if (::SymGetModuleInfo64 (process, symbol->ModBase, &moduleInfo)) -- result << moduleInfo.ModuleName << ": "; -- -- result << symbol->Name << " + 0x" << String::toHexString ((int64) displacement) << newLine; -- } -- } -- -- #else -- void* stack[128]; -- int frames = backtrace (stack, numElementsInArray (stack)); -- char** frameStrings = backtrace_symbols (stack, frames); -- -- for (int i = 0; i < frames; ++i) -- result << frameStrings[i] << newLine; -- -- ::free (frameStrings); -- #endif -- -- return result; --} - - //============================================================================== - static SystemStats::CrashHandlerFunction globalCrashHandler = nullptr; + bool SystemStats::hasNeon() noexcept { return getCPUInformation().hasNeon; } + + +-//============================================================================== +-String SystemStats::getStackBacktrace() +-{ +- String result; +- +- #if JUCE_ANDROID || JUCE_MINGW +- jassertfalse; // sorry, not implemented yet! +- +- #elif JUCE_WINDOWS +- HANDLE process = GetCurrentProcess(); +- SymInitialize (process, nullptr, TRUE); +- +- void* stack[128]; +- int frames = (int) CaptureStackBackTrace (0, numElementsInArray (stack), stack, nullptr); +- +- HeapBlock symbol; +- symbol.calloc (sizeof (SYMBOL_INFO) + 256, 1); +- symbol->MaxNameLen = 255; +- symbol->SizeOfStruct = sizeof (SYMBOL_INFO); +- +- for (int i = 0; i < frames; ++i) +- { +- DWORD64 displacement = 0; +- +- if (SymFromAddr (process, (DWORD64) stack[i], &displacement, symbol)) +- { +- result << i << ": "; +- +- IMAGEHLP_MODULE64 moduleInfo; +- zerostruct (moduleInfo); +- moduleInfo.SizeOfStruct = sizeof (moduleInfo); +- +- if (::SymGetModuleInfo64 (process, symbol->ModBase, &moduleInfo)) +- result << moduleInfo.ModuleName << ": "; +- +- result << symbol->Name << " + 0x" << String::toHexString ((int64) displacement) << newLine; +- } +- } +- +- #else +- void* stack[128]; +- int frames = backtrace (stack, numElementsInArray (stack)); +- char** frameStrings = backtrace_symbols (stack, frames); +- +- for (int i = 0; i < frames; ++i) +- result << frameStrings[i] << newLine; +- +- ::free (frameStrings); +- #endif +- +- return result; +-} + + //============================================================================== + static SystemStats::CrashHandlerFunction globalCrashHandler = nullptr; diff --git a/libs/juce/source/modules/juce_core/system/juce_SystemStats.h b/libs/juce/source/modules/juce_core/system/juce_SystemStats.h index 89d3854e..a99d830a 100644 --- a/libs/juce/source/modules/juce_core/system/juce_SystemStats.h +++ b/libs/juce/source/modules/juce_core/system/juce_SystemStats.h @@ -186,12 +186,6 @@ public: - static int getPageSize(); - - //============================================================================== -- /** Returns a backtrace of the current call-stack. -- The usefulness of the result will depend on the level of debug symbols -- that are available in the executable. -- */ -- static String getStackBacktrace(); -- - /** A function type for use in setApplicationCrashHandler(). The parameter will contain - platform-specific data about the crash. - */ + static int getPageSize(); + + //============================================================================== +- /** Returns a backtrace of the current call-stack. +- The usefulness of the result will depend on the level of debug symbols +- that are available in the executable. +- */ +- static String getStackBacktrace(); +- + /** A function type for use in setApplicationCrashHandler(). The parameter will contain + platform-specific data about the crash. + */ -- 2.20.1 diff --git a/recipes-musicians/distrho/distrho-ports/0004-Further-musl-fix-by-removal-of-unused-function.patch b/recipes-musicians/distrho/distrho-ports/0004-Further-musl-fix-by-removal-of-unused-function.patch index ce940d0..ca74121 100644 --- a/recipes-musicians/distrho/distrho-ports/0004-Further-musl-fix-by-removal-of-unused-function.patch +++ b/recipes-musicians/distrho/distrho-ports/0004-Further-musl-fix-by-removal-of-unused-function.patch @@ -16,10 +16,10 @@ are not in use there is no harm caused by removing them. Same: I am aware that there might be an update of JUCE or other prugins using getStackBacktrace in the future but till then musl fan boys are happy. - -Upstream-Status: Submitted [1] - -[1] https://github.com/DISTRHO/DISTRHO-Ports/pull/31 + +Upstream-Status: Submitted [1] + +[1] https://github.com/DISTRHO/DISTRHO-Ports/pull/31 Signed-off-by: Andreas Müller --- @@ -35,112 +35,112 @@ index a1bdd59e..6055352f 100644 --- a/libs/juce/source/modules/juce_core/native/juce_android_SystemStats.cpp +++ b/libs/juce/source/modules/juce_core/native/juce_android_SystemStats.cpp @@ -445,10 +445,6 @@ String SystemStats::getComputerName() - } - - --String SystemStats::getUserLanguage() { return AndroidStatsHelpers::getLocaleValue (false); } --String SystemStats::getUserRegion() { return AndroidStatsHelpers::getLocaleValue (true); } --String SystemStats::getDisplayLanguage() { return getUserLanguage() + "-" + getUserRegion(); } -- - //============================================================================== - void CPUInformation::initialise() noexcept - { + } + + +-String SystemStats::getUserLanguage() { return AndroidStatsHelpers::getLocaleValue (false); } +-String SystemStats::getUserRegion() { return AndroidStatsHelpers::getLocaleValue (true); } +-String SystemStats::getDisplayLanguage() { return getUserLanguage() + "-" + getUserRegion(); } +- + //============================================================================== + void CPUInformation::initialise() noexcept + { diff --git a/libs/juce/source/modules/juce_core/native/juce_linux_SystemStats.cpp b/libs/juce/source/modules/juce_core/native/juce_linux_SystemStats.cpp index 40f19187..07a99749 100644 --- a/libs/juce/source/modules/juce_core/native/juce_linux_SystemStats.cpp +++ b/libs/juce/source/modules/juce_core/native/juce_linux_SystemStats.cpp @@ -129,10 +129,6 @@ static String getLocaleValue (nl_item key) - return result; - } - --String SystemStats::getUserLanguage() { return getLocaleValue (_NL_IDENTIFICATION_LANGUAGE); } --String SystemStats::getUserRegion() { return getLocaleValue (_NL_IDENTIFICATION_TERRITORY); } --String SystemStats::getDisplayLanguage() { return getUserLanguage() + "-" + getUserRegion(); } -- - //============================================================================== - void CPUInformation::initialise() noexcept - { + return result; + } + +-String SystemStats::getUserLanguage() { return getLocaleValue (_NL_IDENTIFICATION_LANGUAGE); } +-String SystemStats::getUserRegion() { return getLocaleValue (_NL_IDENTIFICATION_TERRITORY); } +-String SystemStats::getDisplayLanguage() { return getUserLanguage() + "-" + getUserRegion(); } +- + //============================================================================== + void CPUInformation::initialise() noexcept + { diff --git a/libs/juce/source/modules/juce_core/native/juce_mac_SystemStats.mm b/libs/juce/source/modules/juce_core/native/juce_mac_SystemStats.mm index 81f62192..b0a751dd 100644 --- a/libs/juce/source/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/libs/juce/source/modules/juce_core/native/juce_mac_SystemStats.mm @@ -241,17 +241,6 @@ static String getLocaleValue (CFStringRef key) - return result; - } - --String SystemStats::getUserLanguage() { return getLocaleValue (kCFLocaleLanguageCode); } --String SystemStats::getUserRegion() { return getLocaleValue (kCFLocaleCountryCode); } -- --String SystemStats::getDisplayLanguage() --{ -- CFArrayRef cfPrefLangs = CFLocaleCopyPreferredLanguages(); -- const String result (String::fromCFString ((CFStringRef) CFArrayGetValueAtIndex (cfPrefLangs, 0))); -- CFRelease (cfPrefLangs); -- return result; --} -- - //============================================================================== - /* NB: these are kept outside the HiResCounterInfo struct and initialised to 1 to avoid - division-by-zero errors if some other static constructor calls us before this file's + return result; + } + +-String SystemStats::getUserLanguage() { return getLocaleValue (kCFLocaleLanguageCode); } +-String SystemStats::getUserRegion() { return getLocaleValue (kCFLocaleCountryCode); } +- +-String SystemStats::getDisplayLanguage() +-{ +- CFArrayRef cfPrefLangs = CFLocaleCopyPreferredLanguages(); +- const String result (String::fromCFString ((CFStringRef) CFArrayGetValueAtIndex (cfPrefLangs, 0))); +- CFRelease (cfPrefLangs); +- return result; +-} +- + //============================================================================== + /* NB: these are kept outside the HiResCounterInfo struct and initialised to 1 to avoid + division-by-zero errors if some other static constructor calls us before this file's diff --git a/libs/juce/source/modules/juce_core/native/juce_win32_SystemStats.cpp b/libs/juce/source/modules/juce_core/native/juce_win32_SystemStats.cpp index e2b44093..c78cf747 100644 --- a/libs/juce/source/modules/juce_core/native/juce_win32_SystemStats.cpp +++ b/libs/juce/source/modules/juce_core/native/juce_win32_SystemStats.cpp @@ -469,26 +469,4 @@ static String getLocaleValue (LCID locale, LCTYPE key, const char* defaultValue) - return defaultValue; - } - --String SystemStats::getUserLanguage() { return getLocaleValue (LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, "en"); } --String SystemStats::getUserRegion() { return getLocaleValue (LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, "US"); } -- --String SystemStats::getDisplayLanguage() --{ -- DynamicLibrary dll ("kernel32.dll"); -- JUCE_LOAD_WINAPI_FUNCTION (dll, GetUserDefaultUILanguage, getUserDefaultUILanguage, LANGID, (void)) -- -- if (getUserDefaultUILanguage == nullptr) -- return "en"; -- -- const DWORD langID = MAKELCID (getUserDefaultUILanguage(), SORT_DEFAULT); -- -- String mainLang (getLocaleValue (langID, LOCALE_SISO639LANGNAME, "en")); -- String region (getLocaleValue (langID, LOCALE_SISO3166CTRYNAME, nullptr)); -- -- if (region.isNotEmpty()) -- mainLang << '-' << region; -- -- return mainLang; --} -- - } // namespace juce + return defaultValue; + } + +-String SystemStats::getUserLanguage() { return getLocaleValue (LOCALE_USER_DEFAULT, LOCALE_SISO639LANGNAME, "en"); } +-String SystemStats::getUserRegion() { return getLocaleValue (LOCALE_USER_DEFAULT, LOCALE_SISO3166CTRYNAME, "US"); } +- +-String SystemStats::getDisplayLanguage() +-{ +- DynamicLibrary dll ("kernel32.dll"); +- JUCE_LOAD_WINAPI_FUNCTION (dll, GetUserDefaultUILanguage, getUserDefaultUILanguage, LANGID, (void)) +- +- if (getUserDefaultUILanguage == nullptr) +- return "en"; +- +- const DWORD langID = MAKELCID (getUserDefaultUILanguage(), SORT_DEFAULT); +- +- String mainLang (getLocaleValue (langID, LOCALE_SISO639LANGNAME, "en")); +- String region (getLocaleValue (langID, LOCALE_SISO3166CTRYNAME, nullptr)); +- +- if (region.isNotEmpty()) +- mainLang << '-' << region; +- +- return mainLang; +-} +- + } // namespace juce diff --git a/libs/juce/source/modules/juce_core/system/juce_SystemStats.h b/libs/juce/source/modules/juce_core/system/juce_SystemStats.h index a99d830a..ca560670 100644 --- a/libs/juce/source/modules/juce_core/system/juce_SystemStats.h +++ b/libs/juce/source/modules/juce_core/system/juce_SystemStats.h @@ -106,23 +106,6 @@ public: - /** Returns the host-name of the computer. */ - static String getComputerName(); - -- /** Returns the language of the user's locale. -- The return value is a 2 or 3 letter language code (ISO 639-1 or ISO 639-2) -- */ -- static String getUserLanguage(); -- -- /** Returns the region of the user's locale. -- The return value is a 2 letter country code (ISO 3166-1 alpha-2). -- */ -- static String getUserRegion(); -- -- /** Returns the user's display language. -- The return value is a 2 or 3 letter language code (ISO 639-1 or ISO 639-2). -- Note that depending on the OS and region, this may also be followed by a dash -- and a sub-region code, e.g "en-GB" -- */ -- static String getDisplayLanguage(); -- - /** This will attempt to return some kind of string describing the device. - If no description is available, it'll just return an empty string. You may - want to use this for things like determining the type of phone/iPad, etc. + /** Returns the host-name of the computer. */ + static String getComputerName(); + +- /** Returns the language of the user's locale. +- The return value is a 2 or 3 letter language code (ISO 639-1 or ISO 639-2) +- */ +- static String getUserLanguage(); +- +- /** Returns the region of the user's locale. +- The return value is a 2 letter country code (ISO 3166-1 alpha-2). +- */ +- static String getUserRegion(); +- +- /** Returns the user's display language. +- The return value is a 2 or 3 letter language code (ISO 639-1 or ISO 639-2). +- Note that depending on the OS and region, this may also be followed by a dash +- and a sub-region code, e.g "en-GB" +- */ +- static String getDisplayLanguage(); +- + /** This will attempt to return some kind of string describing the device. + If no description is available, it'll just return an empty string. You may + want to use this for things like determining the type of phone/iPad, etc. -- 2.20.1