Skip to content
Snippets Groups Projects
Commit feff5241 authored by Tatsuki Makino's avatar Tatsuki Makino Committed by Vladimir Druzenko
Browse files

audio/libopenshot-audio: Update 0.3.3 → 0.4.0

Update as part of update multimedia/openshot 3.2.1 → 3.3.0.

Changelog:
https://github.com/OpenShot/libopenshot-audio/releases/tag/v0.4.0

PR:	284374
parent 68df49bc
No related branches found
No related tags found
No related merge requests found
Showing
with 155 additions and 359 deletions
PORTNAME= libopenshot-audio PORTNAME= libopenshot-audio
DISTVERSIONPREFIX= v DISTVERSIONPREFIX= v
DISTVERSION= 0.3.3 DISTVERSION= 0.4.0
CATEGORIES= audio multimedia CATEGORIES= audio multimedia
MAINTAINER= tatsuki_makino@hotmail.com MAINTAINER= tatsuki_makino@hotmail.com
...@@ -10,11 +10,10 @@ WWW= https://www.openshot.org/ ...@@ -10,11 +10,10 @@ WWW= https://www.openshot.org/
LICENSE= GPLv3+ LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/COPYING LICENSE_FILE= ${WRKSRC}/COPYING
LIB_DEPENDS= libasound.so:audio/alsa-lib \ LIB_DEPENDS= libasound.so:audio/alsa-lib
libsysinfo.so:devel/libsysinfo
RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins RUN_DEPENDS= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:audio/alsa-plugins
USES= cmake compiler:c++14-lang USES= cmake compiler:c++17-lang
USE_GITHUB= yes USE_GITHUB= yes
GH_ACCOUNT= OpenShot GH_ACCOUNT= OpenShot
USE_LDCONFIG= yes USE_LDCONFIG= yes
......
TIMESTAMP = 1719370800 TIMESTAMP = 1737807753
SHA256 (OpenShot-libopenshot-audio-v0.3.3_GH0.tar.gz) = 5c0f9972828a5cc1614e10d54bea8ebeabf3bfe361024f28516a856918f5e8f2 SHA256 (OpenShot-libopenshot-audio-v0.4.0_GH0.tar.gz) = 1abdedf9c8686c972c42225a283f518ed2ade445c2e454996b6709d8cc8d1704
SIZE (OpenShot-libopenshot-audio-v0.3.3_GH0.tar.gz) = 1772184 SIZE (OpenShot-libopenshot-audio-v0.4.0_GH0.tar.gz) = 2260995
--- CMakeLists.txt.orig 2024-05-11 01:22:43 UTC --- CMakeLists.txt.orig 2024-12-21 22:21:33 UTC
+++ CMakeLists.txt +++ CMakeLists.txt
@@ -175,6 +175,12 @@ set_target_properties(openshot-audio PROPERTIES @@ -180,6 +180,16 @@ set_target_properties(openshot-audio PROPERTIES
EXPORT_NAME Audio # Exports as OpenShot::Audio target EXPORT_NAME Audio # Exports as OpenShot::Audio target
) )
+#
+include(CheckFunctionExists)
+include(CheckLibraryExists)
+
+# Thread library +# Thread library
+find_package(Threads REQUIRED) +find_package(Threads REQUIRED)
+if(Threads_FOUND) +if(Threads_FOUND)
...@@ -13,7 +17,7 @@ ...@@ -13,7 +17,7 @@
# Require language features we use # Require language features we use
if(CMAKE_VERSION VERSION_GREATER 3.8) if(CMAKE_VERSION VERSION_GREATER 3.8)
target_compile_features(openshot-audio PUBLIC target_compile_features(openshot-audio PUBLIC
@@ -193,7 +199,8 @@ endif() @@ -198,7 +208,8 @@ endif()
# Enable stack-unwinding support in c objects on gcc-based platforms. # Enable stack-unwinding support in c objects on gcc-based platforms.
# Failing to do so will cause your program to be terminated when a png # Failing to do so will cause your program to be terminated when a png
# or a jpeg exception is thrown on linux or macosx. # or a jpeg exception is thrown on linux or macosx.
...@@ -23,27 +27,26 @@ ...@@ -23,27 +27,26 @@
target_compile_options(openshot-audio PRIVATE -fexceptions) target_compile_options(openshot-audio PRIVATE -fexceptions)
endif() endif()
@@ -256,8 +263,8 @@ if(UNIX AND NOT APPLE) @@ -262,8 +273,10 @@ if(UNIX AND NOT APPLE)
INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR} INTERFACE_INCLUDE_DIRECTORIES ${ALSA_INCLUDE_DIR}
INTERFACE_LINK_LIBRARIES ${ALSA_LIBRARIES}) INTERFACE_LINK_LIBRARIES ${ALSA_LIBRARIES})
endif() endif()
- target_compile_definitions(openshot-audio PUBLIC LINUX) + if(LINUX)
target_compile_definitions(openshot-audio PUBLIC LINUX)
- target_link_libraries(openshot-audio PUBLIC ALSA::ALSA) - target_link_libraries(openshot-audio PUBLIC ALSA::ALSA)
+ #target_compile_definitions(openshot-audio PUBLIC LINUX) + endif(LINUX)
+ target_link_libraries(openshot-audio PRIVATE ALSA::ALSA) + target_link_libraries(openshot-audio PRIVATE ALSA::ALSA)
else() else()
# For EXPORTED Config # For EXPORTED Config
set(NEED_ALSA FALSE) set(NEED_ALSA FALSE)
@@ -265,10 +272,68 @@ endif() @@ -271,10 +284,52 @@ find_package(ZLIB REQUIRED)
# ZLIB -- uses IMPORTED target ZLIB::ZLIB which has existed since CMake 3.1 # ZLIB -- uses IMPORTED target ZLIB::ZLIB which has existed since CMake 3.1
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
-target_link_libraries(openshot-audio PUBLIC ZLIB::ZLIB) -target_link_libraries(openshot-audio PUBLIC ZLIB::ZLIB)
+target_link_libraries(openshot-audio PRIVATE ZLIB::ZLIB) +target_link_libraries(openshot-audio PRIVATE ZLIB::ZLIB)
+# EXECINFO, SYSINFO +# EXECINFO
+include(CheckFunctionExists)
+include(CheckLibraryExists)
+check_function_exists(backtrace FUNCTION_BACKTRACE_FOUND) +check_function_exists(backtrace FUNCTION_BACKTRACE_FOUND)
+if(NOT FUNCTION_BACKTRACE_FOUND) +if(NOT FUNCTION_BACKTRACE_FOUND)
+ find_library(EXECINFO_LIBRARY NAMES execinfo) + find_library(EXECINFO_LIBRARY NAMES execinfo)
...@@ -58,20 +61,6 @@ ...@@ -58,20 +61,6 @@
+if(EXECINFO_LIBRARY) +if(EXECINFO_LIBRARY)
+ target_link_libraries(openshot-audio PRIVATE ${EXECINFO_LIBRARY}) + target_link_libraries(openshot-audio PRIVATE ${EXECINFO_LIBRARY})
+endif(EXECINFO_LIBRARY) +endif(EXECINFO_LIBRARY)
+check_function_exists(sysinfo FUNCTION_SYSINFO_FOUND)
+if(NOT FUNCTION_SYSINFO_FOUND)
+ find_library(SYSINFO_LIBRARY NAMES sysinfo)
+ if(SYSINFO_LIBRARY)
+ unset(FUNCTION_SYSINFO_FOUND CACHE)
+ check_library_exists(${SYSINFO_LIBRARY} sysinfo "" FUNCTION_SYSINFO_FOUND)
+ endif(SYSINFO_LIBRARY)
+endif(NOT FUNCTION_SYSINFO_FOUND)
+if(NOT FUNCTION_SYSINFO_FOUND)
+ message(FATAL_ERROR "sysinfo - ${FUNCTION_SYSINFO_FOUND}")
+endif(NOT FUNCTION_SYSINFO_FOUND)
+if(SYSINFO_LIBRARY)
+ target_link_libraries(openshot-audio PRIVATE ${SYSINFO_LIBRARY})
+endif(SYSINFO_LIBRARY)
+ +
+# JACK +# JACK
+if(ENABLE_JACK) +if(ENABLE_JACK)
......
--- JuceLibraryCode/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp.orig 2019-04-17 16:56:20 UTC
+++ JuceLibraryCode/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp
@@ -62,15 +62,15 @@ AudioIODeviceType* AudioIODeviceType::createAudioIODev
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ASIO() { return nullptr; }
#endif
-#if ! (JUCE_LINUX && JUCE_ALSA)
+#if ! ((JUCE_BSD || JUCE_LINUX) && JUCE_ALSA)
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return nullptr; }
#endif
-#if ! (JUCE_LINUX && JUCE_JACK)
+#if ! ((JUCE_BSD || JUCE_LINUX) && JUCE_JACK)
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return nullptr; }
#endif
-#if ! (JUCE_LINUX && JUCE_BELA)
+#if ! ((JUCE_BSD || JUCE_LINUX) && JUCE_BELA)
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_Bela() { return nullptr; }
#endif
--- JuceLibraryCode/modules/juce_audio_devices/juce_audio_devices.cpp.orig 2020-09-11 12:10:25 UTC
+++ JuceLibraryCode/modules/juce_audio_devices/juce_audio_devices.cpp
@@ -119,7 +119,7 @@
#endif
//==============================================================================
-#elif JUCE_LINUX
+#elif JUCE_BSD || JUCE_LINUX
#if JUCE_ALSA
/* Got an include error here? If so, you've either not got ALSA installed, or you've
not got your paths set up correctly to find its header files.
@@ -211,7 +211,7 @@
#endif
//==============================================================================
-#elif JUCE_LINUX
+#elif JUCE_BSD || JUCE_LINUX
#if JUCE_ALSA
#include "native/juce_linux_ALSA.cpp"
#endif
--- JuceLibraryCode/modules/juce_audio_devices/midi_io/juce_MidiDevices.h.orig 2020-09-11 12:10:25 UTC
+++ JuceLibraryCode/modules/juce_audio_devices/midi_io/juce_MidiDevices.h
@@ -108,7 +108,7 @@ class JUCE_API MidiInput final (public)
*/
static std::unique_ptr<MidiInput> openDevice (const String& deviceIdentifier, MidiInputCallback* callback);
- #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN
+ #if JUCE_BSD || JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN
/** This will try to create a new midi input device (only available on Linux, macOS and iOS).
This will attempt to create a new midi input device with the specified name for other
@@ -264,7 +264,7 @@ class JUCE_API MidiOutput final : private Thread (p
*/
static std::unique_ptr<MidiOutput> openDevice (const String& deviceIdentifier);
- #if JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN
+ #if JUCE_BSD || JUCE_LINUX || JUCE_MAC || JUCE_IOS || DOXYGEN
/** This will try to create a new midi output device (only available on Linux, macOS and iOS).
This will attempt to create a new midi output device with the specified name that other
--- JuceLibraryCode/modules/juce_audio_devices/native/juce_JackAudio_linux.cpp.orig 2024-12-21 22:21:33 UTC
+++ JuceLibraryCode/modules/juce_audio_devices/native/juce_JackAudio_linux.cpp
@@ -182,6 +182,8 @@ class JackAudioIODevice final : public AudioIODevice (
{
juce::jack_set_error_function (errorCallback);
+ if (inputId.isNotEmpty())
+ {
// open input ports
const StringArray inputChannels (getInputChannelNames());
for (int i = 0; i < inputChannels.size(); ++i)
@@ -192,7 +194,10 @@ class JackAudioIODevice final : public AudioIODevice (
inputPorts.add (juce::jack_port_register (client, inputChannelName.toUTF8(),
JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0));
}
+ }
+ if (outputId.isNotEmpty())
+ {
// open output ports
const StringArray outputChannels (getOutputChannelNames());
for (int i = 0; i < outputChannels.size(); ++i)
@@ -202,6 +207,7 @@ class JackAudioIODevice final : public AudioIODevice (
outputPorts.add (juce::jack_port_register (client, outputChannelName.toUTF8(),
JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0));
+ }
}
inChans.calloc (totalNumberOfInputChannels + 2);
--- JuceLibraryCode/modules/juce_audio_devices/native/juce_Midi_linux.cpp.orig 2024-12-21 22:21:33 UTC
+++ JuceLibraryCode/modules/juce_audio_devices/native/juce_Midi_linux.cpp
@@ -23,7 +23,7 @@
namespace juce
{
-#if JUCE_ALSA
+#if 0 && JUCE_ALSA
//==============================================================================
class AlsaClient
--- JuceLibraryCode/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp.orig 2023-04-17 13:00:42 UTC
+++ JuceLibraryCode/modules/juce_audio_devices/native/juce_linux_JackAudio.cpp
@@ -175,6 +175,8 @@ class JackAudioIODevice : public AudioIODevice (publ
{
juce::jack_set_error_function (errorCallback);
+ if (inputId.isNotEmpty())
+ {
// open input ports
const StringArray inputChannels (getInputChannelNames());
for (int i = 0; i < inputChannels.size(); ++i)
@@ -185,7 +187,10 @@ class JackAudioIODevice : public AudioIODevice (publ
inputPorts.add (juce::jack_port_register (client, inputName.toUTF8(),
JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0));
}
+ }
+ if (outputId.isNotEmpty())
+ {
// open output ports
const StringArray outputChannels (getOutputChannelNames());
for (int i = 0; i < outputChannels.size(); ++i)
@@ -196,6 +201,7 @@ class JackAudioIODevice : public AudioIODevice (publ
outputPorts.add (juce::jack_port_register (client, outputName.toUTF8(),
JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0));
}
+ }
inChans.calloc (totalNumberOfInputChannels + 2);
outChans.calloc (totalNumberOfOutputChannels + 2);
@@ -273,26 +279,40 @@ class JackAudioIODevice : public AudioIODevice (publ
if (! inputChannels.isZero())
{
- for (JackPortIterator i (client, true); i.next();)
+ int idx = 0;
+ for (JackPortIterator i (client, true); i.next() && idx < inputPorts.size();)
{
- if (inputChannels [i.index] && i.clientName == getName())
+ if (i.clientName != getName())
+ continue;
+ if (inputChannels [idx])
{
- int error = juce::jack_connect (client, i.ports[i.index], juce::jack_port_name ((jack_port_t*) inputPorts[i.index]));
+ int error = juce::jack_connect (client, i.ports[i.index], juce::jack_port_name ((jack_port_t*) inputPorts[idx]));
if (error != 0)
+ {
JUCE_JACK_LOG ("Cannot connect input port " + String (i.index) + " (" + i.name + "), error " + String (error));
+ }
+ else
+ ++idx;
}
}
}
if (! outputChannels.isZero())
{
- for (JackPortIterator i (client, false); i.next();)
+ int idx = 0;
+ for (JackPortIterator i (client, false); i.next() && idx < outputPorts.size();)
{
- if (outputChannels [i.index] && i.clientName == getName())
+ if (i.clientName != getName())
+ continue;
+ if (outputChannels [idx])
{
- int error = juce::jack_connect (client, juce::jack_port_name ((jack_port_t*) outputPorts[i.index]), i.ports[i.index]);
+ int error = juce::jack_connect (client, juce::jack_port_name ((jack_port_t*) outputPorts[idx]), i.ports[i.index]);
if (error != 0)
+ {
JUCE_JACK_LOG ("Cannot connect output port " + String (i.index) + " (" + i.name + "), error " + String (error));
+ }
+ else
+ ++idx;
}
}
}
@@ -536,20 +556,20 @@ class JackAudioIODeviceType : public AudioIODeviceTyp
// scan for output devices
for (JackPortIterator i (client, false); i.next();)
{
- if (i.clientName != (JUCE_JACK_CLIENT_NAME) && ! inputNames.contains (i.clientName))
+ if (i.clientName != (JUCE_JACK_CLIENT_NAME) && ! outputNames.contains (i.clientName))
{
- inputNames.add (i.clientName);
- inputIds.add (i.ports [i.index]);
+ outputNames.add (i.clientName);
+ outputIds.add (i.ports [i.index]);
}
}
// scan for input devices
for (JackPortIterator i (client, true); i.next();)
{
- if (i.clientName != (JUCE_JACK_CLIENT_NAME) && ! outputNames.contains (i.clientName))
+ if (i.clientName != (JUCE_JACK_CLIENT_NAME) && ! inputNames.contains (i.clientName))
{
- outputNames.add (i.clientName);
- outputIds.add (i.ports [i.index]);
+ inputNames.add (i.clientName);
+ inputIds.add (i.ports [i.index]);
}
}
--- JuceLibraryCode/modules/juce_core/files/juce_File.cpp.orig 2020-09-11 12:10:25 UTC
+++ JuceLibraryCode/modules/juce_core/files/juce_File.cpp
@@ -231,7 +231,7 @@ String File::addTrailingSeparator (const String& path)
}
//==============================================================================
-#if JUCE_LINUX
+#if JUCE_BSD || JUCE_LINUX
#define NAMES_ARE_CASE_SENSITIVE 1
#endif
@@ -973,7 +973,7 @@ bool File::createSymbolicLink (const File& linkFileToC
linkFileToCreate.deleteFile();
}
- #if JUCE_MAC || JUCE_LINUX
+ #if JUCE_BSD || JUCE_MAC || JUCE_LINUX
// one common reason for getting an error here is that the file already exists
if (symlink (nativePathOfTarget.toRawUTF8(), linkFileToCreate.getFullPathName().toRawUTF8()) == -1)
{
--- JuceLibraryCode/modules/juce_core/juce_core.cpp.orig 2020-09-11 12:10:25 UTC
+++ JuceLibraryCode/modules/juce_core/juce_core.cpp
@@ -64,7 +64,7 @@
#endif
#else
- #if JUCE_LINUX || JUCE_ANDROID
+ #if JUCE_BSD || JUCE_LINUX || JUCE_ANDROID
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/errno.h>
@@ -72,7 +72,7 @@
#include <netinet/in.h>
#endif
- #if JUCE_LINUX
+ #if JUCE_BSD || JUCE_LINUX
#include <stdio.h>
#include <langinfo.h>
#include <ifaddrs.h>
@@ -207,7 +207,7 @@
#include "native/juce_win32_Threads.cpp"
//==============================================================================
-#elif JUCE_LINUX
+#elif JUCE_BSD || JUCE_LINUX
#include "native/juce_linux_CommonFile.cpp"
#include "native/juce_linux_Files.cpp"
#include "native/juce_linux_Network.cpp"
--- JuceLibraryCode/modules/juce_core/native/juce_BasicNativeHeaders.h.orig 2021-05-09 14:57:33 UTC
+++ JuceLibraryCode/modules/juce_core/native/juce_BasicNativeHeaders.h
@@ -272,6 +272,9 @@
#include <sys/wait.h>
#include <utime.h>
#include <poll.h>
+ #include <net/if_dl.h>
+ #include <pthread_np.h>
+ #include <sys/sysinfo.h>
//==============================================================================
#elif JUCE_ANDROID
--- JuceLibraryCode/modules/juce_core/native/juce_linux_Files.cpp.orig 2019-04-17 16:56:20 UTC --- JuceLibraryCode/modules/juce_core/native/juce_Files_linux.cpp.orig 2024-12-21 22:21:33 UTC
+++ JuceLibraryCode/modules/juce_core/native/juce_linux_Files.cpp +++ JuceLibraryCode/modules/juce_core/native/juce_Files_linux.cpp
@@ -35,8 +35,16 @@ bool File::isOnCDRomDrive() const @@ -35,8 +35,16 @@ bool File::isOnCDRomDrive() const
{ {
struct statfs buf; struct statfs buf;
...@@ -12,26 +12,29 @@ ...@@ -12,26 +12,29 @@
+ return false; + return false;
+#else +#else
return statfs (getFullPathName().toUTF8(), &buf) == 0 return statfs (getFullPathName().toUTF8(), &buf) == 0
&& buf.f_type == (short) U_ISOFS_SUPER_MAGIC; && buf.f_type == (unsigned int) U_ISOFS_SUPER_MAGIC;
+#endif +#endif
} }
bool File::isOnHardDisk() const bool File::isOnHardDisk() const
@@ -45,6 +53,13 @@ bool File::isOnHardDisk() const @@ -45,6 +53,16 @@ bool File::isOnHardDisk() const
if (statfs (getFullPathName().toUTF8(), &buf) == 0) if (statfs (getFullPathName().toUTF8(), &buf) == 0)
{ {
+#if JUCE_BSD +#if JUCE_BSD
+ String s(buf.f_fstypename); + String s(buf.f_fstypename);
+ if (s.compare("cd9660") == 0 || s.compare("udf") == 0 || + if (s.compare("cd9660") == 0 ||
+ s.compare("nfs") == 0 || s.compare("smbfs") == 0) { + s.compare("udf") == 0 ||
+ return false; + s.compare("msdosfs") == 0 ||
+ } + s.compare("nfs") == 0 ||
+ s.compare("smbfs") == 0) {
+ return false;
+ }
+#else +#else
switch (buf.f_type) switch (buf.f_type)
{ {
case U_ISOFS_SUPER_MAGIC: // CD-ROM case U_ISOFS_SUPER_MAGIC: // CD-ROM
@@ -55,6 +70,7 @@ bool File::isOnHardDisk() const @@ -55,6 +73,7 @@ bool File::isOnHardDisk() const
default: break; default: break;
} }
...@@ -39,12 +42,14 @@ ...@@ -39,12 +42,14 @@
} }
// Assume so if this fails for some reason // Assume so if this fails for some reason
@@ -216,7 +232,7 @@ bool Process::openDocument (const String& fileName, co @@ -122,8 +141,8 @@ File File::getSpecialLocation (const SpecialLocationTy
setsid(); case userDesktopDirectory: return resolveXDGFolder ("XDG_DESKTOP_DIR", "~/Desktop");
case userApplicationDataDirectory: return resolveXDGFolder ("XDG_CONFIG_HOME", "~/.config");
// Child process case commonDocumentsDirectory:
- execve (argv[0], (char**) argv, environ); - case commonApplicationDataDirectory: return File ("/opt");
+ execv (argv[0], (char**) argv); - case globalApplicationsDirectory: return File ("/usr");
exit (0); + case commonApplicationDataDirectory: return {}; // File ("/opt");
} + case globalApplicationsDirectory: return {}; // File ("/usr");
case tempDirectory:
{
--- JuceLibraryCode/modules/juce_core/native/juce_linux_Network.cpp.orig 2020-09-11 12:10:25 UTC --- JuceLibraryCode/modules/juce_core/native/juce_Network_linux.cpp.orig 2020-09-11 12:10:25 UTC
+++ JuceLibraryCode/modules/juce_core/native/juce_linux_Network.cpp +++ JuceLibraryCode/modules/juce_core/native/juce_Network_linux.cpp
@@ -35,6 +35,14 @@ void MACAddress::findAllAddresses (Array<MACAddress>& @@ -35,6 +35,14 @@ void MACAddress::findAllAddresses (Array<MACAddress>&
{ {
for (auto* i = addrs; i != nullptr; i = i->ifa_next) for (auto* i = addrs; i != nullptr; i = i->ifa_next)
......
--- JuceLibraryCode/modules/juce_core/native/juce_SystemStats_linux.cpp.orig 2024-12-21 22:21:33 UTC
+++ JuceLibraryCode/modules/juce_core/native/juce_SystemStats_linux.cpp
@@ -56,7 +56,11 @@ SystemStats::OperatingSystemType SystemStats::getOpera
String SystemStats::getOperatingSystemName()
{
+#ifdef __FreeBSD__
+ return "FreeBSD";
+#else
return "Linux";
+#endif
}
bool SystemStats::isOperatingSystem64Bit()
@@ -318,18 +322,17 @@ String SystemStats::getUniqueDeviceID()
return {};
};
- auto data = call ("cat /sys/class/dmi/id/board_serial");
+ auto data = call ("kenv smbios.planar.serial");
// 'board_serial' is enough on its own, fallback to bios stuff if we can't find it.
if (data.isEmpty())
{
- data = call ("cat /sys/class/dmi/id/bios_date")
- + call ("cat /sys/class/dmi/id/bios_release")
- + call ("cat /sys/class/dmi/id/bios_vendor")
- + call ("cat /sys/class/dmi/id/bios_version");
+ data = call ("kenv smbios.bios.reldate")
+ + call ("kenv smbios.bios.vendor")
+ + call ("kenv smbios.bios.version");
}
- auto cpuData = call ("lscpu");
+ auto cpuData = String {};
if (cpuData.isNotEmpty())
{
--- JuceLibraryCode/modules/juce_core/native/juce_linux_SystemStats.cpp.orig 2021-05-09 14:57:33 UTC
+++ JuceLibraryCode/modules/juce_core/native/juce_linux_SystemStats.cpp
@@ -139,8 +139,13 @@ static String getLocaleValue (nl_item key)
return result;
}
+#if JUCE_BSD
+String SystemStats::getUserLanguage() { return String(); }
+String SystemStats::getUserRegion() { return String(); }
+#else
String SystemStats::getUserLanguage() { return getLocaleValue (_NL_IDENTIFICATION_LANGUAGE); }
String SystemStats::getUserRegion() { return getLocaleValue (_NL_IDENTIFICATION_TERRITORY); }
+#endif
String SystemStats::getDisplayLanguage() { return getUserLanguage() + "-" + getUserRegion(); }
//==============================================================================
--- JuceLibraryCode/modules/juce_core/native/juce_posix_SharedCode.h.orig 2020-09-11 12:10:25 UTC
+++ JuceLibraryCode/modules/juce_core/native/juce_posix_SharedCode.h
@@ -59,7 +59,7 @@ void JUCE_CALLTYPE Process::terminate()
}
-#if JUCE_MAC || JUCE_LINUX
+#if JUCE_BSD || JUCE_MAC || JUCE_LINUX
bool Process::setMaxNumberOfFileHandles (int newMaxNumber) noexcept
{
rlimit lim;
@@ -253,7 +253,7 @@ uint64 File::getFileIdentifier() const
static bool hasEffectiveRootFilePermissions()
{
- #if JUCE_LINUX
+ #if JUCE_BSD || JUCE_LINUX
return geteuid() == 0;
#else
return false;
@@ -924,6 +924,8 @@ void JUCE_CALLTYPE Thread::setCurrentThreadName (const
{
[[NSThread currentThread] setName: juceStringToNS (name)];
}
+ #elif JUCE_BSD
+ pthread_set_name_np(pthread_self(), name.toRawUTF8());
#elif JUCE_LINUX || JUCE_ANDROID
#if ((JUCE_LINUX && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012) \
|| JUCE_ANDROID && __ANDROID_API__ >= 9)
@@ -977,14 +979,20 @@ void JUCE_CALLTYPE Thread::yield()
void JUCE_CALLTYPE Thread::setCurrentThreadAffinityMask (uint32 affinityMask)
{
#if SUPPORT_AFFINITIES
+ #if JUCE_BSD
+ cpuset_t affinity;
+ #else
cpu_set_t affinity;
+ #endif
CPU_ZERO (&affinity);
for (int i = 0; i < 32; ++i)
if ((affinityMask & (uint32) (1 << i)) != 0)
CPU_SET ((size_t) i, &affinity);
- #if (! JUCE_ANDROID) && ((! JUCE_LINUX) || ((__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2004))
+ #if JUCE_BSD
+ pthread_setaffinity_np (pthread_self(), sizeof (cpuset_t), &affinity);
+ #elif (! JUCE_ANDROID) && ((! JUCE_LINUX) || ((__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2004))
pthread_setaffinity_np (pthread_self(), sizeof (cpu_set_t), &affinity);
#elif JUCE_ANDROID
sched_setaffinity (gettid(), sizeof (cpu_set_t), &affinity);
--- JuceLibraryCode/modules/juce_core/system/juce_PlatformDefs.h.orig 2019-04-17 16:56:20 UTC
+++ JuceLibraryCode/modules/juce_core/system/juce_PlatformDefs.h
@@ -57,7 +57,7 @@ namespace juce
#endif
//==============================================================================
-#if JUCE_IOS || JUCE_LINUX
+#if JUCE_BSD || JUCE_IOS || JUCE_LINUX
/** This will try to break into the debugger if the app is currently being debugged.
If called by an app that's not being debugged, the behaviour isn't defined - it may
crash or not, depending on the platform.
--- JuceLibraryCode/modules/juce_core/system/juce_StandardHeader.h.orig 2020-09-11 12:10:25 UTC
+++ JuceLibraryCode/modules/juce_core/system/juce_StandardHeader.h
@@ -80,7 +80,7 @@
#endif
#endif
-#if JUCE_LINUX
+#if JUCE_BSD || JUCE_LINUX
#include <cstring>
#include <signal.h>
--- JuceLibraryCode/modules/juce_core/text/juce_CharPointer_ASCII.h.orig 2019-04-17 16:56:20 UTC
+++ JuceLibraryCode/modules/juce_core/text/juce_CharPointer_ASCII.h
@@ -335,7 +335,7 @@ class CharPointer_ASCII final (public)
/** Parses this string as a 64-bit integer. */
int64 getIntValue64() const noexcept
{
- #if JUCE_LINUX || JUCE_ANDROID || JUCE_MINGW
+ #if JUCE_BSD || JUCE_LINUX || JUCE_ANDROID || JUCE_MINGW
return atoll (data);
#elif JUCE_WINDOWS
return _atoi64 (data);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment