Compare commits

...

20 Commits

Author SHA1 Message Date
Zach Bacon
d297faa25e cmake: exposed TILED_RENDERING option
This was originally added for the use of the libretro
core, figured it should be added to cmake as a compile time
option. Can be triggered when invoking cmake using
-DENABLE_TILEDRENDER=ON

Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2025-04-22 05:42:58 -04:00
Rafael Kitover
9e724ea4b8 build: support building ARM64 binary for Mac
Make some adjustments to the Mac build scripts to support building an
ARM64 binary for Apple Silicon.

Also support cross-compiling for Intel on Apple Silicon.

Also prefer using Ninja for CMake ports.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-22 05:55:19 +00:00
Rafael Kitover
eb26ec2ef6 Enable Hide Status Bar in UI Settings for macOS
Enable Hide Status Bar in UI Settings for macOS, it was previously
missing because the whole UI Settings submenu was removed on macOS.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-22 05:29:51 +00:00
Zach Bacon
6a9eeeaece core.sh Switched to github source for nasm
Nasm.us is down currently and unable to pull the tarball
down from that source.

Signed-off-by: Zach Bacon <zachbacon@vba-m.com>
2025-04-21 00:00:19 -04:00
Squall Leonhart
9f6285842d initialize sound_buffer_len_ to silence a warning. 2025-04-16 02:20:53 +10:00
Rafael Kitover
e5ad7b3403 build: find_package(nanosvg) w/ vcpkg
When using vcpkg wxWidgets, call `find_package(nanosvg)` so that
`NanoSVG::` link target is available.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-12 22:47:55 +00:00
Squall Leonhart
94752f8314 [FAudio]Correct the behavior of device_changed check
Fixes the behavior to take the timeout into account properly, fixing the throttled behavior so that it matches (or strives to) the configured value instead of being stuck at <90%
2025-04-13 03:58:40 +10:00
Rafael Kitover
3c32bad886 translations: transifex pull
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-12 08:00:19 +00:00
Rafael Kitover
8936feaa71 build: add libtiff to Nix derivation
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-11 22:43:18 +00:00
Rafael Kitover
f93a32ab0b build: add libtiff to brews on macOS
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-11 21:52:08 +00:00
Rafael Kitover
3fa850c15d build: capitalize ARCH_NAME in CMake
Use capitalized `ARM` instead of `arm` for ARCH_NAME in
Architecture.cmake so that the Mac Apple Silicon zip releases are
suffixed `ARM64` not `arm64`.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-07 01:43:00 -07:00
Rafael Kitover
364776b833 build: s/-Ofast/-O3 -ffast-math/
Use `-O3 -ffast-math` instead of `-Ofast`, which is deprecated by the
latest clang. In both our options and for libretro.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-07 01:28:45 -07:00
Rafael Kitover
2d439f7ba6 build: fix link error on macOS
Add `tiff zstd deflate` to link libs for macOS to fix a link error
caused by libzstd and libdeflate not being linked for libtiff which is
linked by wxWidgets.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-07 01:24:02 -07:00
Rafael Kitover
11a6068a03 build: update vcpkg install command to new form
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-06 12:21:47 -07:00
Rafael Kitover
6139428207 translations: remove dup Chinese translations
Remove zh.po, which is not on Transifex anymore and zh-Hans.po, which I
have removed from Transifex just now, leaving zh-CN.po, as suggested by
@wuweiran.

Fix #1435.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-02 13:45:14 +00:00
Rafael Kitover
5a5579d27f build: minor followup on SFML 3.x API change
Followup on 29e85e5d (build: update Link SFML usage to SFML 3.x APIs,
2025-04-01) to alias an optional.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-02 09:07:54 +00:00
Rafael Kitover
29e85e5d87 build: update Link SFML usage to SFML 3.x APIs
Make some changes for the SFML Network library for the 3.x APIs.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-04-01 23:34:58 +00:00
Fabrice de Gans
e228394656 [Input] Process key down event for some controls
In #1424, the app event handler was disabling all key down events,
preventing controls that depend on them to properly handle these. This
was done to work around an issue on macOS where unhandled keyboard
events would fire an audio alert.
Since this breaks text controls, these changes check for the currently
focused window and let the event propagate for text controls.

Fixes #1434
2025-04-01 18:57:26 +02:00
Rafael Kitover
d5ac2a853b Revert "Update Link SFML usage to SFML 3.x APIs"
This reverts commit e82ae7bb13.

Sorry, somehow I pushed to the wrong branch.
2025-03-29 19:40:59 +00:00
Rafael Kitover
e82ae7bb13 Update Link SFML usage to SFML 3.x APIs
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
2025-03-29 18:54:53 +00:00
25 changed files with 360 additions and 7837 deletions

View File

@@ -88,6 +88,10 @@ if(NOT EXISTS "${CMAKE_SOURCE_DIR}/.git")
set(BUILD_TESTING OFF)
endif()
if(ENABLE_TILEDRENDER)
_add_compile_definitions(TILED_RENDERING)
endif()
# Configure gtest
if(BUILD_TESTING)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

View File

@@ -57,11 +57,11 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "[xX]86|i[3-9]86|[aA][mM][dD]64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "[aA][aA][rR][cC][hH]|[aA][rR][mM]")
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4) # 32 bit
set(ARM32 ON)
set(ARCH_NAME arm32)
set(ARCH_NAME ARM32)
set(WINARCH arm)
elseif(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
set(ARM64 ON)
set(ARCH_NAME arm64)
set(ARCH_NAME ARM64)
set(WINARCH arm64)
endif()

View File

@@ -15,9 +15,14 @@ endif()
option(ENABLE_SDL "Build the SDL port" ${ENABLE_SDL_DEFAULT})
option(ENABLE_WX "Build the wxWidgets port" ${BUILD_DEFAULT})
option(ENABLE_TILEDRENDER "Enable tiled renderer" ${BUILD_DEFAULT})
option(ENABLE_DEBUGGER "Enable the debugger" ON)
option(ENABLE_ASAN "Enable -fsanitize=address by default. Requires debug build with GCC/Clang" OFF)
if(ENABLE_TILEDRENDER)
set(ENABLE_TILEDRENDER OFF)
endif()
# Static linking
set(VBAM_STATIC_DEFAULT OFF)
if(VCPKG_TARGET_TRIPLET MATCHES -static OR CMAKE_TOOLCHAIN_FILE MATCHES "mxe|-static")
@@ -71,18 +76,13 @@ find_package(PkgConfig)
if(TRANSLATIONS_ONLY)
set(ENABLE_LINK_DEFAULT OFF)
else()
find_package(SFML 2.4 COMPONENTS network system)
find_package(SFML 3.0 COMPONENTS network system)
set(ENABLE_LINK_DEFAULT OFF)
if(SFML_FOUND)
set(ENABLE_LINK_DEFAULT ON)
endif()
endif()
option(ENABLE_LINK "Enable GBA linking functionality (BROKEN)" ${ENABLE_LINK_DEFAULT})
if(ENABLE_LINK)
# Always disable link for now as SFML 2 is broken and we don't have a replacement yet.
set(ENABLE_LINK OFF CACHE BOOL "Enable GBA linking functionality (BROKEN)" FORCE)
endif()
option(ENABLE_LINK "Enable GBA linking functionality" ${ENABLE_LINK_DEFAULT})
# FFMpeg
set(FFMPEG_DEFAULT OFF)

View File

@@ -502,7 +502,7 @@ function(vcpkg_set_toolchain)
# Install core deps.
execute_process(
COMMAND ${vcpkg_exe} install ${VCPKG_DEPS_QUALIFIED}
COMMAND ${vcpkg_exe} --triplet ${VCPKG_TARGET_TRIPLET} install ${pkg}
WORKING_DIRECTORY ${VCPKG_ROOT}
)
@@ -544,7 +544,7 @@ function(vcpkg_set_toolchain)
set(dep_qualified "${dep}:${VCPKG_TARGET_TRIPLET}")
execute_process(
COMMAND ${vcpkg_exe} install ${dep_qualified}
COMMAND --triplet ${VCPKG_TARGET_TRIPLET} ${vcpkg_exe} install ${dep}
WORKING_DIRECTORY ${VCPKG_ROOT}
)

View File

@@ -5,7 +5,11 @@ endif()
if(UPSTREAM_RELEASE)
if(X86_64)
# Require and optimize for Core2 level support, tune for generic.
add_compile_options(-march=core2 -mtune=generic)
if(APPLE)
add_compile_options(-march=core2 -mtune=skylake)
else()
add_compile_options(-march=core2 -mtune=generic)
endif()
elseif(X86_32)
# Optimize for pentiumi3 and tune for generic for Windows XP builds.
set(WINXP TRUE)
@@ -50,7 +54,7 @@ endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-ggdb3 -fno-omit-frame-pointer -Wall -Wextra)
else()
add_compile_options(-Ofast -fomit-frame-pointer)
add_compile_options(-O3 -ffast-math -fomit-frame-pointer)
endif()
# for some reason this is necessary

View File

@@ -2,7 +2,7 @@ with import <nixpkgs> {};
stdenv.mkDerivation {
name = "visualboyadvance-m";
buildInputs = if stdenv.isDarwin then
[ ninja cmake nasm faudio gettext libintl pkg-config zip zlib openal ffmpeg wxGTK32 SDL2 pcre pcre2 darwin.apple_sdk.frameworks.System darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa darwin.apple_sdk.frameworks.QuartzCore darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.OpenGL darwin.apple_sdk.frameworks.OpenAL llvmPackages_latest.clang llvmPackages_latest.bintools ]
[ ninja cmake nasm faudio gettext libintl libtiff pkg-config zip zlib openal ffmpeg wxGTK32 SDL2 pcre pcre2 darwin.apple_sdk.frameworks.System darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa darwin.apple_sdk.frameworks.QuartzCore darwin.apple_sdk.frameworks.AudioToolbox darwin.apple_sdk.frameworks.OpenGL darwin.apple_sdk.frameworks.OpenAL llvmPackages_latest.clang llvmPackages_latest.bintools ]
else
[ ninja cmake gcc clang llvm llvmPackages.libcxx nasm faudio gettext libintl pkg-config zip zlib openal ffmpeg wxGTK32 libGL libGLU glfw SDL2 gtk3-x11 pcre pcre2 util-linuxMinimal libselinux libsepol libthai libdatrie xorg.libXdmcp xorg.libXtst libxkbcommon libepoxy dbus at-spi2-core ];
[ ninja cmake gcc clang llvm llvmPackages.libcxx nasm faudio gettext libintl libtiff pkg-config zip zlib openal ffmpeg wxGTK32 libGL libGLU glfw SDL2 gtk3-x11 pcre pcre2 util-linuxMinimal libselinux libsepol libthai libdatrie xorg.libXdmcp xorg.libXtst libxkbcommon libepoxy dbus at-spi2-core ];
}

View File

@@ -1193,7 +1193,7 @@ brew_installdeps() {
check brew -v update
brews="nasm cmake ccache gettext pkg-config sdl2 wxwidgets faudio ccache ninja zlib"
brews="nasm cmake ccache gettext libtiff pkg-config sdl2 wxwidgets faudio ccache ninja zlib"
[ -n "$ENABLE_FFMPEG" ] && brews="$brews ffmpeg"

View File

@@ -9,7 +9,7 @@
# Alexey Ter <lexalamer@mail.ru>, 2016
# Anton Fedenko <gang296@mail.ru>, 2015
# Artem Abramov <aabramovrussia@yandex.com>, 2015
# George Matsune <georg29387878@gmail.com>, 2017
# aa26bd9ab58eaf66f2dd8a133c45eb7b_740a4a0 <e0546a0601f08ad77df0edd7ee27c670_658246>, 2017
# Irina Fedulova <istartlin@gmail.com>, 2020
# Koshak Magnificent <coschack@mail.ru>, 2020
# Matvey Nazarov, 2022

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -41,17 +41,22 @@
#define snprintf _snprintf
#endif
#ifdef UPDATE_REG
#undef UPDATE_REG
#endif
#define UPDATE_REG(address, value) WRITE16LE(((uint16_t*)&g_ioMem[address]), value)
static int vbaid = 0;
const char* MakeInstanceFilename(const char* Input)
{
if (vbaid == 0)
if (vbaid == 0) {
return Input;
}
static char* result = NULL;
if (result != NULL)
if (result != NULL) {
free(result);
}
result = (char*)malloc(strlen(Input) + 3);
char* p = strrchr((char*)Input, '.');
@@ -270,7 +275,7 @@ class RFUServer {
public:
sf::TcpSocket tcpsocket[5];
sf::IpAddress udpaddr[5];
sf::IpAddress udpaddr[5] = { sf::IpAddress{0}, sf::IpAddress{0}, sf::IpAddress{0}, sf::IpAddress{0}, sf::IpAddress{0} };
RFUServer(void);
sf::Packet& Serialize(sf::Packet& packet, int slave);
void DeSerialize(sf::Packet& packet, int slave);
@@ -283,7 +288,7 @@ class RFUClient {
int numbytes;
public:
sf::IpAddress serveraddr;
sf::IpAddress serveraddr{0};
unsigned short serverport;
bool transferring;
RFUClient(void);
@@ -392,7 +397,7 @@ enum {
typedef struct {
sf::TcpSocket tcpsocket;
sf::TcpListener tcplistener;
int numslaves;
uint16_t numslaves;
int connectedSlaves;
int type;
bool server;
@@ -412,7 +417,7 @@ class CableServer {
public:
sf::TcpSocket tcpsocket[4];
sf::IpAddress udpaddr[4];
sf::IpAddress udpaddr[4] = { sf::IpAddress{0}, sf::IpAddress{0}, sf::IpAddress{0}, sf::IpAddress{0} };
CableServer(void);
void Send(void);
void Recv(void);
@@ -430,7 +435,7 @@ class CableClient {
int numbytes;
public:
sf::IpAddress serveraddr;
sf::IpAddress serveraddr{0};
unsigned short serverport;
bool transferring;
CableClient(void);
@@ -520,33 +525,48 @@ LinkMode GetLinkMode()
return LINK_DISCONNECTED;
}
void GetLinkServerHost(char* const host, size_t size)
bool GetLinkServerHost(char* const host, size_t size)
{
if (host == NULL || size == 0)
return;
if (host == NULL || size == 0) {
return false;
}
host[0] = '\0';
if (linkDriver && linkDriver->mode == LINK_GAMECUBE_DOLPHIN)
if (linkDriver && linkDriver->mode == LINK_GAMECUBE_DOLPHIN) {
strncpy(host, joybusHostAddr.toString().c_str(), size);
else if (lanlink.server) {
if (IP_LINK_BIND_ADDRESS == "*")
strncpy(host, sf::IpAddress::getLocalAddress().toString().c_str(), size);
else
} else if (lanlink.server) {
if (IP_LINK_BIND_ADDRESS == "*") {
auto local_addr = sf::IpAddress::getLocalAddress();
if (local_addr) {
strncpy(host, local_addr.value().toString().c_str(), size);
} else {
return false;
}
} else {
strncpy(host, IP_LINK_BIND_ADDRESS.c_str(), size);
}
}
else
else {
strncpy(host, lc.serveraddr.toString().c_str(), size);
}
return true;
}
bool SetLinkServerHost(const char* host)
{
sf::IpAddress addr = sf::IpAddress(host);
sf::IpAddress addr{0};
auto resolved = sf::IpAddress::resolve(host);
if (!resolved) {
return false;
}
addr = resolved.value();
lc.serveraddr = addr;
joybusHostAddr = addr;
return addr != sf::IpAddress::None;
return true;
}
int GetLinkPlayerId()
@@ -1044,11 +1064,13 @@ static ConnectionState InitSocket()
{
linkid = 0;
for (int i = 0; i < 4; i++)
for (int i = 0; i < 4; i++) {
cable_data[i] = 0xffff;
}
for (int i = 0; i < 4; i++)
for (int i = 0; i < 4; i++) {
cable_gb_data[i] = 0xff;
}
if (lanlink.server) {
lanlink.connectedSlaves = 0;
@@ -1057,26 +1079,33 @@ static ConnectionState InitSocket()
// too bad Listen() doesn't take an address as well
// then again, old code used INADDR_ANY anyway
sf::IpAddress bind_ip = IP_LINK_BIND_ADDRESS == "*" ? sf::IpAddress::Any : IP_LINK_BIND_ADDRESS;
sf::IpAddress bind_ip{0};
if (lanlink.tcplistener.listen(IP_LINK_PORT, bind_ip) == sf::Socket::Error)
if (IP_LINK_BIND_ADDRESS != "*") {
auto resolved = sf::IpAddress::resolve(IP_LINK_BIND_ADDRESS);
if (resolved) {
bind_ip = resolved.value();
} else {
return LINK_ERROR;
}
}
if (lanlink.tcplistener.listen(IP_LINK_PORT, bind_ip) == sf::Socket::Status::Error) {
// Note: old code closed socket & retried once on bind failure
return LINK_ERROR; // FIXME: error code?
else
} else {
return LINK_NEEDS_UPDATE;
}
} else {
lc.serverport = IP_LINK_PORT;
if (lc.serveraddr == sf::IpAddress::None) {
lanlink.tcpsocket.setBlocking(false);
sf::Socket::Status status = lanlink.tcpsocket.connect(lc.serveraddr, lc.serverport);
if (status == sf::Socket::Status::Error || status == sf::Socket::Status::Disconnected) {
return LINK_ERROR;
} else {
lanlink.tcpsocket.setBlocking(false);
sf::Socket::Status status = lanlink.tcpsocket.connect(lc.serveraddr, lc.serverport);
if (status == sf::Socket::Error || status == sf::Socket::Disconnected)
return LINK_ERROR;
else
return LINK_NEEDS_UPDATE;
return LINK_NEEDS_UPDATE;
}
}
}
@@ -1090,11 +1119,11 @@ static ConnectionState ConnectUpdateSocket(char* const message, size_t size)
fdset.add(lanlink.tcplistener);
if (fdset.wait(sf::milliseconds(150))) {
int nextSlave = lanlink.connectedSlaves + 1;
uint16_t nextSlave = lanlink.connectedSlaves + 1;
sf::Socket::Status st = lanlink.tcplistener.accept(ls.tcpsocket[nextSlave]);
if (st == sf::Socket::Error) {
if (st == sf::Socket::Status::Error) {
for (int j = 1; j < nextSlave; j++)
ls.tcpsocket[j].disconnect();
@@ -1102,8 +1131,7 @@ static ConnectionState ConnectUpdateSocket(char* const message, size_t size)
newState = LINK_ERROR;
} else {
sf::Packet packet;
packet << static_cast<sf::Uint16>(nextSlave)
<< static_cast<sf::Uint16>(lanlink.numslaves);
packet << nextSlave << lanlink.numslaves;
ls.tcpsocket[nextSlave].send(packet);
@@ -1129,13 +1157,13 @@ static ConnectionState ConnectUpdateSocket(char* const message, size_t size)
sf::Packet packet;
sf::Socket::Status status = lanlink.tcpsocket.receive(packet);
if (status == sf::Socket::Error || status == sf::Socket::Disconnected) {
if (status == sf::Socket::Status::Error || status == sf::Socket::Status::Disconnected) {
snprintf(message, size, N_("Network error."));
newState = LINK_ERROR;
} else if (status == sf::Socket::Done) {
} else if (status == sf::Socket::Status::Done) {
if (linkid == 0) {
sf::Uint16 receivedId, receivedSlaves;
uint16_t receivedId, receivedSlaves;
packet >> receivedId >> receivedSlaves;
if (packet) {
@@ -1540,7 +1568,7 @@ void RFUServer::Recv(void)
sf::Packet packet;
tcpsocket[i + 1].setBlocking(false);
sf::Socket::Status status = tcpsocket[i + 1].receive(packet);
if (status == sf::Socket::Disconnected) {
if (status == sf::Socket::Status::Disconnected) {
char message[30];
sprintf(message, _("Player %d disconnected."), i + 1);
systemScreenMessage(message);
@@ -1650,7 +1678,7 @@ void RFUClient::Recv(void)
}
sf::Packet packet;
sf::Socket::Status status = lanlink.tcpsocket.receive(packet);
if (status == sf::Socket::Disconnected) {
if (status == sf::Socket::Status::Disconnected) {
systemScreenMessage(_("Server disconnected."));
CloseLink();
return;
@@ -1671,7 +1699,7 @@ static ConnectionState ConnectUpdateRFUSocket(char* const message, size_t size)
sf::Socket::Status st = lanlink.tcplistener.accept(rfu_server.tcpsocket[nextSlave]);
if (st == sf::Socket::Error) {
if (st == sf::Socket::Status::Error) {
for (int j = 1; j < nextSlave; j++)
rfu_server.tcpsocket[j].disconnect();
@@ -1679,8 +1707,7 @@ static ConnectionState ConnectUpdateRFUSocket(char* const message, size_t size)
newState = LINK_ERROR;
} else {
sf::Packet packet;
packet << static_cast<sf::Uint16>(nextSlave)
<< static_cast<sf::Uint16>(lanlink.numslaves);
packet << nextSlave << lanlink.numslaves;
rfu_server.tcpsocket[nextSlave].send(packet);
@@ -1707,13 +1734,13 @@ static ConnectionState ConnectUpdateRFUSocket(char* const message, size_t size)
lanlink.tcpsocket.setBlocking(false);
sf::Socket::Status status = lanlink.tcpsocket.receive(packet);
if (status == sf::Socket::Error || status == sf::Socket::Disconnected) {
if (status == sf::Socket::Status::Error || status == sf::Socket::Status::Disconnected) {
snprintf(message, size, N_("Network error."));
newState = LINK_ERROR;
} else if (status == sf::Socket::Done) {
} else if (status == sf::Socket::Status::Done) {
if (linkid == 0) {
sf::Uint16 receivedId, receivedSlaves;
uint16_t receivedId, receivedSlaves;
packet >> receivedId >> receivedSlaves;
if (packet) {

View File

@@ -86,8 +86,9 @@ extern bool SetLinkServerHost(const char* host);
* If in lan client mode, returns the IP adress of the host to connect to
* If in gamecube mode, returns the IP adress of the dolphin host
*
* @return false on error
*/
extern void GetLinkServerHost(char* const host, size_t size);
extern bool GetLinkServerHost(char* const host, size_t size);
/**
* Set the value in milliseconds of the timeout after which a connection is

View File

@@ -8,10 +8,7 @@
GBASockClient::GBASockClient(sf::IpAddress _server_addr)
{
if (_server_addr == sf::IpAddress::None)
server_addr = sf::IpAddress::getPublicAddress();
else
server_addr = _server_addr;
server_addr = _server_addr;
client.connect(server_addr, 0xd6ba);
client.setBlocking(false);
@@ -44,8 +41,9 @@ void GBASockClient::Send(std::vector<char> data)
// Returns cmd for convenience
char GBASockClient::ReceiveCmd(char* data_in, bool block)
{
if (IsDisconnected())
if (IsDisconnected()) {
return data_in[0];
}
std::size_t num_received = 0;
if (block || clock_sync == 0) {
@@ -53,8 +51,9 @@ char GBASockClient::ReceiveCmd(char* data_in, bool block)
Selector.add(client);
Selector.wait(sf::seconds(6));
}
if (client.receive(data_in, 5, num_received) == sf::Socket::Disconnected)
if (client.receive(data_in, 5, num_received) == sf::Socket::Status::Disconnected) {
Disconnect();
}
return data_in[0];
}
@@ -67,13 +66,15 @@ void GBASockClient::ReceiveClock(bool block)
char sync_ticks[4] = { 0, 0, 0, 0 };
std::size_t num_received = 0;
if (clock_client.receive(sync_ticks, 4, num_received) == sf::Socket::Disconnected)
if (clock_client.receive(sync_ticks, 4, num_received) == sf::Socket::Status::Disconnected) {
Disconnect();
}
if (num_received == 4) {
clock_sync_ticks = 0;
for (int i = 0; i < 4; i++)
for (int i = 0; i < 4; i++) {
clock_sync_ticks |= (uint8_t)(sync_ticks[i]) << ((3 - i) * 8);
}
clock_sync += clock_sync_ticks;
}
}

View File

@@ -24,7 +24,7 @@ public:
bool IsDisconnected();
private:
sf::IpAddress server_addr;
sf::IpAddress server_addr{0};
sf::TcpSocket client;
sf::TcpSocket clock_client;

View File

@@ -79,7 +79,7 @@ else ifeq ($(platform), classic_armv7_a7)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -fPIC
CFLAGS += -Ofast \
CFLAGS += -O3 -ffast-math \
-flto=4 -fwhole-program -fuse-linker-plugin \
-fdata-sections -ffunction-sections -Wl,--gc-sections \
-fno-stack-protector -fno-ident -fomit-frame-pointer \
@@ -112,7 +112,7 @@ else ifeq ($(platform), classic_armv8_a35)
fpic := -fPIC
SHARED := -shared
TILED_RENDERING=1
CFLAGS += -Ofast \
CFLAGS += -O3 -ffast-math \
-flto=4 -fwhole-program -fuse-linker-plugin \
-fdata-sections -ffunction-sections -Wl,--gc-sections \
-fno-stack-protector -fno-ident -fomit-frame-pointer \

View File

@@ -153,6 +153,7 @@ unset(wx_find_extra)
if(CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg")
set(wx_find_extra NO_DEFAULT_PATH)
set(wxWidgets_DIR "${VCPKG_ROOT}/installed/${VCPKG_TARGET_TRIPLET}/share/wxwidgets")
find_package(nanosvg)
endif()
set(ENABLE_OPENGL TRUE)
@@ -404,6 +405,9 @@ if(APPLE)
target_sources(visualboyadvance-m PRIVATE
macsupport.mm
)
target_link_libraries(visualboyadvance-m
tiff zstd deflate)
endif()
# link libgcc/libstdc++ statically on mingw
@@ -900,7 +904,7 @@ if(APPLE)
if(CMAKE_BUILD_TYPE MATCHES "^(Release|MinSizeRel)$")
add_custom_command(
TARGET visualboyadvance-m POST_BUILD
COMMAND ${CMAKE_SOURCE_DIR}/tools/macOS/third_party_libs_tool ./visualboyadvance-m.app
COMMAND bash ${CMAKE_SOURCE_DIR}/tools/macOS/third_party_libs_tool ./visualboyadvance-m.app
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
endif()

View File

@@ -59,6 +59,17 @@ int FAGetDev(FAudio* fa) {
class FAudio_BufferNotify : public FAudioVoiceCallback {
public:
FAudio_BufferNotify() {
OnBufferEnd = &FAudio_BufferNotify::StaticOnBufferEnd;
OnVoiceProcessingPassStart = &FAudio_BufferNotify::StaticOnVoiceProcessingPassStart;
OnVoiceProcessingPassEnd = &FAudio_BufferNotify::StaticOnVoiceProcessingPassEnd;
OnStreamEnd = &FAudio_BufferNotify::StaticOnStreamEnd;
OnBufferStart = &FAudio_BufferNotify::StaticOnBufferStart;
OnLoopEnd = &FAudio_BufferNotify::StaticOnLoopEnd;
OnVoiceError = &FAudio_BufferNotify::StaticOnVoiceError;
}
~FAudio_BufferNotify() = default;
// Waits for the buffer end event to be signaled for 10 seconds.
// Returns true if the buffer end event was signaled, false if the wait timed out.
bool WaitForSignal() {
@@ -71,17 +82,6 @@ public:
return was_signaled;
}
FAudio_BufferNotify() {
OnBufferEnd = &FAudio_BufferNotify::StaticOnBufferEnd;
OnVoiceProcessingPassStart = &FAudio_BufferNotify::StaticOnVoiceProcessingPassStart;
OnVoiceProcessingPassEnd = &FAudio_BufferNotify::StaticOnVoiceProcessingPassEnd;
OnStreamEnd = &FAudio_BufferNotify::StaticOnStreamEnd;
OnBufferStart = &FAudio_BufferNotify::StaticOnBufferStart;
OnLoopEnd = &FAudio_BufferNotify::StaticOnLoopEnd;
OnVoiceError = &FAudio_BufferNotify::StaticOnVoiceError;
}
~FAudio_BufferNotify() = default;
private:
// Signals that the buffer end event has occurred.
void SignalBufferEnd() {
@@ -157,6 +157,7 @@ FAudio_Output::FAudio_Output() : buffer_count_(OPTION(kSoundBuffers)) {
playing = false;
freq_ = 0;
currentBuffer = 0;
sound_buffer_len_ = 0;
device_changed = false;
faud = nullptr;
mVoice = nullptr;
@@ -391,7 +392,7 @@ void FAudio_Output::write(uint16_t* finalWave, int) {
// the maximum number of buffers is currently queued
if (!coreOptions.speedup && coreOptions.throttle && !gba_joybus_active) {
// wait for one buffer to finish playing
if (notify.WaitForSignal()) {
if (!notify.WaitForSignal()) {
device_changed = true;
}
} else {
@@ -511,4 +512,4 @@ std::unique_ptr<SoundDriver> CreateFAudioDriver() {
}
} // namespace internal
} // namespace audio
} // namespace audio

View File

@@ -142,7 +142,10 @@ public:
if (server) {
char host[length];
GetLinkServerHost(host, length);
if (!GetLinkServerHost(host, length)) {
wxMessageBox(_("You must enter a valid host name"),
_("Host name invalid"), wxICON_ERROR | wxOK);
}
title.Printf(_("Waiting for clients..."));
connmsg.Printf(_("Server IP address is: %s\n"), wxString(host, wxConvLibc).c_str());
} else {
@@ -1825,10 +1828,10 @@ bool MainFrame::BindControls()
#endif
#ifdef __WXMAC__
// Remove UI Config menu item, because it only has an option that does nothing on mac.
wxMenuItem* ui_config_mi = XRCITEM("UIConfigure");
ui_config_mi->GetMenu()->Remove(ui_config_mi);
ui_config_mi = nullptr;
// Remove hide menubar in the UI Config submenu on macOS, because it is meaningless there.
wxMenuItem* hide_menu_bar = XRCITEM("HideMenuBar");
hide_menu_bar->GetMenu()->Remove(hide_menu_bar);
hide_menu_bar = nullptr;
#endif

View File

@@ -20,6 +20,7 @@
#include <wx/progdlg.h>
#include <wx/protocol/http.h>
#include <wx/regex.h>
#include <wx/spinctrl.h>
#include <wx/sstream.h>
#include <wx/stdpaths.h>
#include <wx/string.h>
@@ -1412,6 +1413,17 @@ int wxvbamApp::FilterEvent(wxEvent& event)
bool wxvbamApp::ProcessEvent(wxEvent& event) {
if (event.GetEventType() == wxEVT_KEY_DOWN) {
// First, figure out if the focused window can process the key down event.
wxWindow* focused_window = wxWindow::FindFocus();
wxTextCtrl* text_ctrl = wxDynamicCast(focused_window, wxTextCtrl);
if (text_ctrl) {
return wxApp::ProcessEvent(event);
}
wxSpinCtrl* spin_ctrl = wxDynamicCast(focused_window, wxSpinCtrl);
if (spin_ctrl) {
return wxApp::ProcessEvent(event);
}
// Mark the event as processed. This prevents wxWidgets from firing alerts on macOS.
// See https://github.com/wxWidgets/wxWidgets/issues/25262 for details.
return true;

View File

@@ -22,4 +22,4 @@ else()
optional_CONFIG_SELECT_OPTIONAL=optional_OPTIONAL_STD
variant_CONFIG_SELECT_VARIANT=variant_VARIANT_STD
)
endif()
endif()

View File

@@ -12,7 +12,7 @@
#define NONSTD_OPTIONAL_LITE_HPP
#define optional_lite_MAJOR 3
#define optional_lite_MINOR 5
#define optional_lite_MINOR 6
#define optional_lite_PATCH 0
#define optional_lite_VERSION optional_STRINGIFY(optional_lite_MAJOR) "." optional_STRINGIFY(optional_lite_MINOR) "." optional_STRINGIFY(optional_lite_PATCH)
@@ -50,6 +50,14 @@
#define optional_CONFIG_NO_EXTENSIONS 0
#endif
// Control marking class bad_optional_access and several methods with [[nodiscard]]]:
#if !defined(optional_CONFIG_NO_NODISCARD)
# define optional_CONFIG_NO_NODISCARD 0
#else
# define optional_CONFIG_NO_NODISCARD 1
#endif
// Control presence of exception handling (try and auto discover):
#ifndef optional_CONFIG_NO_EXCEPTIONS
@@ -386,7 +394,7 @@ namespace nonstd {
# define optional_constexpr14 /*constexpr*/
#endif
#if optional_HAVE( NODISCARD )
#if optional_HAVE( NODISCARD ) && !optional_CONFIG_NO_NODISCARD
# define optional_nodiscard [[nodiscard]]
#else
# define optional_nodiscard /*[[nodiscard]]*/
@@ -789,7 +797,7 @@ union storage_t
void construct_value( value_type && v )
{
::new( value_ptr() ) value_type( std::move( v ) );
::new( const_cast<void *>(static_cast<const volatile void *>(value_ptr())) ) value_type( std::move( v ) );
}
template< class... Args >
@@ -801,13 +809,13 @@ union storage_t
template< class... Args >
void emplace( Args&&... args )
{
::new( value_ptr() ) value_type( std::forward<Args>(args)... );
::new( const_cast<void *>(static_cast<const volatile void *>(value_ptr())) ) value_type( std::forward<Args>(args)... );
}
template< class U, class... Args >
void emplace( std::initializer_list<U> il, Args&&... args )
{
::new( value_ptr() ) value_type( il, std::forward<Args>(args)... );
::new( const_cast<void *>(static_cast<const volatile void *>(value_ptr())) ) value_type( il, std::forward<Args>(args)... );
}
#endif
@@ -917,7 +925,7 @@ const nullopt_t nullopt(( nullopt_t::init() ));
#if ! optional_CONFIG_NO_EXCEPTIONS
class bad_optional_access : public std::logic_error
class optional_nodiscard bad_optional_access : public std::logic_error
{
public:
explicit bad_optional_access()
@@ -1555,7 +1563,7 @@ private:
void initialize( V && value )
{
assert( ! has_value() );
contained.construct_value( std::move( value ) );
contained.construct_value( std::forward<V>( value ) );
has_value_ = true;
}

View File

@@ -47,6 +47,14 @@
# define variant_CONFIG_OMIT_VARIANT_ALTERNATIVE_T_MACRO 0
#endif
// Control marking class bad_variant_access with [[nodiscard]]]:
#if !defined(variant_CONFIG_NO_NODISCARD)
# define variant_CONFIG_NO_NODISCARD 0
#else
# define variant_CONFIG_NO_NODISCARD 1
#endif
// Control presence of exception handling (try and auto discover):
#ifndef variant_CONFIG_NO_EXCEPTIONS
@@ -364,7 +372,7 @@ namespace nonstd {
// Presence of C++17 language features:
// no flag
#define variant_HAVE_NODISCARD variant_CPP17_000
// Presence of C++ library features:
@@ -404,6 +412,12 @@ namespace nonstd {
# define variant_nullptr NULL
#endif
#if variant_HAVE_NODISCARD && !variant_CONFIG_NO_NODISCARD
# define variant_nodiscard [[nodiscard]]
#else
# define variant_nodiscard /*[[nodiscard]]*/
#endif
#if variant_HAVE_OVERRIDE
# define variant_override override
#else
@@ -1266,7 +1280,7 @@ static const std::size_t variant_npos = static_cast<std::size_t>( -1 );
// 19.7.11 Class bad_variant_access
class bad_variant_access : public std::exception
class variant_nodiscard bad_variant_access : public std::exception
{
public:
#if variant_CPP11_OR_GREATER

View File

@@ -263,10 +263,10 @@ zlib_dist=$(table_line DISTS zlib-target)
table_line_remove DISTS zlib-target
table_insert_after DISTS cmake "zlib-target $zlib_dist"
table_insert_after DISTS curl "zlib-target $zlib_dist"
# mingw -ldl equivalent, needed by some things
table_insert_after DISTS cmake "dlfcn https://github.com/dlfcn-win32/dlfcn-win32/archive/v1.1.2.tar.gz lib/libdl.a"
table_insert_after DISTS curl "dlfcn https://github.com/dlfcn-win32/dlfcn-win32/archive/v1.1.2.tar.gz lib/libdl.a"
table_line_replace DIST_CONFIGURE_TYPES dlfcn cmake

View File

@@ -38,11 +38,18 @@ case "\$CC" in
;;
esac
export CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-I\$BUILD_ROOT/root/include -DCURL_STATICLIB -DGRAPHITE2_STATIC -DFLOAT_APPROX"
export CFLAGS="$CFLAGS${CFLAGS:+ }-fPIC -I\$BUILD_ROOT/root/include -L\$BUILD_ROOT/root/lib -pthread -lm -DCURL_STATICLIB -DGRAPHITE2_STATIC -DFLOAT_APPROX -Ofast -march=core2 -mtune=generic -pipe -Wno-error=implicit-int"
export CXXFLAGS="$CXXFLAGS${CXXFLAGS:+ }-fPIC -I\$BUILD_ROOT/root/include -L\$BUILD_ROOT/root/lib -std=gnu++17 -fpermissive -pthread -lm -DCURL_STATICLIB -DGRAPHITE2_STATIC -DFLOAT_APPROX -Ofast -march=core2 -mtune=generic -pipe"
export OBJCXXFLAGS="$OBJCXXFLAGS${OBJCXXFLAGS:+ }-fPIC -I\$BUILD_ROOT/root/include -L\$BUILD_ROOT/root/lib -std=gnu++17 -fpermissive -pthread -lm -DCURL_STATICLIB -DGRAPHITE2_STATIC -DFLOAT_APPROX -Ofast -march=core2 -mtune=generic -pipe"
export LDFLAGS="$LDFLAGS${LDFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -pthread -lm -Ofast -march=core2 -mtune=generic -pipe"
if [ -n "APPLE_SILICON" ]; then
export MARCH="arm64"
else
# Intel and compatibility with old machines.
export MARCH="core2"
fi
export CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-isystem \$BUILD_ROOT/root/include -DCURL_STATICLIB -DGRAPHITE2_STATIC -DFLOAT_APPROX -Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close"
export CFLAGS="-mtune=generic $CFLAGS${CFLAGS:+ }-fPIC -isystem \$BUILD_ROOT/root/include -L\$BUILD_ROOT/root/lib -pthread -lm -O3 -ffast-math $MARCH -pipe -Wno-error=implicit-int"
export CXXFLAGS="-mtune=generic $CXXFLAGS${CXXFLAGS:+ }-fPIC -isystem \$BUILD_ROOT/root/include -L\$BUILD_ROOT/root/lib -std=gnu++17 -fpermissive -pthread -lm -DCURL_STATICLIB -DGRAPHITE2_STATIC -DFLOAT_APPROX -O3 -ffast-math $MARCH -pipe"
export OBJCXXFLAGS="-mtune=generic $OBJCXXFLAGS${OBJCXXFLAGS:+ }-fPIC -isystem \$BUILD_ROOT/root/include -L\$BUILD_ROOT/root/lib -std=gnu++17 -fpermissive -pthread -lm -DCURL_STATICLIB -DGRAPHITE2_STATIC -DFLOAT_APPROX -O3 -ffast-math $MARCH -mtune=generic -pipe"
export LDFLAGS="-mtune=generic $LDFLAGS${LDFLAGS:+ }-fPIC -L\$BUILD_ROOT/root/lib -pthread -lm -O3 -ffast-math $MARCH -pipe"
export STRIP="\${STRIP:-strip}"
if [ -z "\$OPENMP" ] && echo "\$CC" | grep -Eq gcc; then
@@ -77,7 +84,7 @@ case "\$PATH" in
;;
esac
export MANPATH="\$BUILD_ROOT/root/man:\$BUILD_ROOT/root/share/man:/usr/share/man:/usr/local/share/man"
export MANPATH="\$BUILD_ROOT/root/man:\$BUILD_ROOT/root/share/man:/usr/share/man:/usr/local/share/man:$BREW_PREFIX/share/man"
export XML_CATALOG_FILES="\$(cygpath -m "\$BUILD_ROOT/root/etc/xml/catalog.xml" 2>/dev/null)"
@@ -104,22 +111,25 @@ DISTS=$DISTS'
bzip2 ftp://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz lib/libbz2.a
xz https://tukaani.org/xz/xz-5.2.6.tar.gz lib/liblzma.a
unzip https://downloads.sourceforge.net/project/infozip/UnZip%206.x%20%28latest%29/UnZip%206.0/unzip60.tar.gz bin/unzip
zlib-ng https://github.com/zlib-ng/zlib-ng/archive/ce01b1e41da298334f8214389cc9369540a7560f.tar.gz lib/libz.a
zip https://downloads.sourceforge.net/project/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz bin/zip
openssl https://www.openssl.org/source/openssl-1.1.1w.tar.gz lib/libssl.a
curl https://github.com/curl/curl/releases/download/curl-8_4_0/curl-8.4.0.tar.bz2 lib/libcurl.a
cmake https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1.tar.gz bin/cmake
zstd https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz lib/libzstd.a
hiredis https://github.com/redis/hiredis/archive/refs/tags/v1.0.2.tar.gz lib/libhiredis.a
ccache https://github.com/ccache/ccache/releases/download/v4.6.3/ccache-4.6.3.tar.xz bin/ccache
m4 http://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.xz bin/m4
autoconf https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz bin/autoconf
autoconf-archive http://gnu.askapache.com/autoconf-archive/autoconf-archive-2022.09.03.tar.xz share/aclocal/ax_check_gl.m4
automake https://ftp.gnu.org/gnu/automake/automake-1.16.5.tar.xz bin/automake
libtool https://ftp.gnu.org/gnu/libtool/libtool-2.4.7.tar.xz bin/libtool
libtool https://ftp.gnu.org/gnu/libtool/libtool-2.5.4.tar.xz bin/libtool
libiconv https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz lib/libiconv.a
zlib-ng https://github.com/zlib-ng/zlib-ng/archive/ce01b1e41da298334f8214389cc9369540a7560f.tar.gz lib/libz.a
zip https://downloads.sourceforge.net/project/infozip/Zip%203.x%20%28latest%29/3.0/zip30.tar.gz bin/zip
openssl https://www.openssl.org/source/openssl-1.1.1w.tar.gz lib/libssl.a
libunistring https://ftp.gnu.org/gnu/libunistring/libunistring-1.3.tar.xz lib/libunistring.a
libpsl https://github.com/rockdaboot/libpsl/releases/download/0.21.5/libpsl-0.21.5.tar.gz lib/libpsl.a
curl https://github.com/curl/curl/releases/download/curl-8_13_0/curl-8.13.0.tar.bz2 lib/libcurl.a
cmake https://github.com/Kitware/CMake/releases/download/v4.0.0/cmake-4.0.0.tar.gz bin/cmake
zstd https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz lib/libzstd.a
libdeflate https://github.com/ebiggers/libdeflate/releases/download/v1.23/libdeflate-1.23.tar.gz lib/libdeflate.a
hiredis https://github.com/redis/hiredis/archive/refs/tags/v1.2.0.tar.gz lib/libhiredis.a
ccache https://github.com/ccache/ccache/releases/download/v4.6.3/ccache-4.6.3.tar.xz bin/ccache
m4 http://ftp.gnu.org/gnu/m4/m4-1.4.19.tar.xz bin/m4
xorg-macros https://www.x.org/archive//individual/util/util-macros-1.19.1.tar.bz2 share/pkgconfig/xorg-macros.pc
help2man https://ftp.gnu.org/gnu/help2man/help2man-1.49.2.tar.xz bin/help2man
libiconv https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz lib/libiconv.a
gettext http://ftp.gnu.org/pub/gnu/gettext/gettext-0.22.5.tar.xz lib/libintl.a
getopt http://frodo.looijaard.name/system/files/software/getopt/getopt-1.1.6.tar.gz bin/getopt
gsed http://ftp.gnu.org/gnu/sed/sed-4.9.tar.xz bin/sed
@@ -131,11 +141,10 @@ DISTS=$DISTS'
gperf http://ftp.gnu.org/pub/gnu/gperf/gperf-3.1.tar.gz bin/gperf
libicu https://github.com/unicode-org/icu/releases/download/release-71-1/icu4c-71_1-src.tgz lib/libicud*t*.a
pkgconf https://github.com/pkgconf/pkgconf/archive/refs/tags/pkgconf-1.9.3.tar.gz bin/pkgconf
nasm https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.xz bin/nasm
yasm http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz bin/yasm
nasm https://github.com/netwide-assembler/nasm/archive/refs/tags/nasm-2.16.03.tar.gz bin/nasm
pcre https://downloads.sourceforge.net/project/pcre/pcre/8.45/pcre-8.45.tar.bz2 lib/libpcre.a
pcre2 https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.40/pcre2-10.40.tar.bz2 lib/libpcre2-posix.a
libffi https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz lib/libffi.a
libffi https://github.com/libffi/libffi/releases/download/v3.4.7/libffi-3.4.7.tar.gz lib/libffi.a
c2man https://github.com/fribidi/c2man/archive/577ed4095383ef5284225d45709e6b5f0598a064.tar.gz bin/c2man
libxml2 https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.10.2/libxml2-v2.10.2.tar.bz2 lib/libxml2.a
libxslt https://gitlab.gnome.org/GNOME/libxslt/-/archive/v1.1.37/libxslt-v1.1.37.tar.bz2 lib/libxslt.a
@@ -144,14 +153,14 @@ DISTS=$DISTS'
XML-SAX https://cpan.metacpan.org/authors/id/G/GR/GRANTM/XML-SAX-1.02.tar.gz perl5/lib/perl5/XML/SAX.pm
docbook2x https://downloads.sourceforge.net/project/docbook2x/docbook2x/0.8.8/docbook2X-0.8.8.tar.gz bin/docbook2man
expat https://github.com/libexpat/libexpat/releases/download/R_2_4_8/expat-2.4.8.tar.xz lib/libexpat.a
libpng https://download.sourceforge.net/libpng/libpng-1.6.37.tar.xz lib/libpng.a
libpng https://download.sourceforge.net/libpng/libpng-1.6.47.tar.xz lib/libpng.a
libjpeg-turbo https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.1.4.tar.gz lib/libjpeg.a
libtiff https://download.osgeo.org/libtiff/tiff-4.4.0.tar.xz lib/libtiff.a
# libcroco http://ftp.gnome.org/pub/gnome/sources/libcroco/0.6/libcroco-0.6.13.tar.xz lib/libcroco-0.6.a
libuuid https://downloads.sourceforge.net/project/libuuid/libuuid-1.0.3.tar.gz lib/libuuid.a
freetype http://download.savannah.gnu.org/releases/freetype/freetype-2.12.1.tar.xz lib/libfreetype.a
fontconfig https://freedesktop.org/software/fontconfig/release/fontconfig-2.13.1.tar.bz2 lib/libfontconfig.a
libgd https://github.com/libgd/libgd/releases/download/gd-2.3.3/libgd-2.3.3.tar.xz lib/libgd.a
freetype https://gitlab.freedesktop.org/freetype/freetype/-/archive/VER-2-13-3/freetype-VER-2-13-3.tar.bz2 lib/libfreetype.a
fontconfig https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/2.16.1/fontconfig-2.16.1.tar.xz lib/libfontconfig.a
libgd https://github.com/libgd/libgd/archive/2be005f311232bc3d8a544f73ce8049d2b2fb885.tar.gz lib/libgd.a
dejavu http://sourceforge.net/projects/dejavu/files/dejavu/2.37/dejavu-fonts-ttf-2.37.tar.bz2 share/fonts/dejavu/DejaVuSansMono.ttf
liberation https://github.com/liberationfonts/liberation-fonts/files/7261482/liberation-fonts-ttf-2.1.5.tar.gz share/fonts/liberation/LiberationMono-Regular.ttf
urw https://github.com/ArtifexSoftware/urw-base35-fonts/archive/refs/tags/20200910.tar.gz share/fonts/urw/URWBookman-Light.ttf
@@ -169,11 +178,10 @@ DISTS=$DISTS'
python3 https://www.python.org/ftp/python/3.10.6/Python-3.10.6.tar.xz bin/python3
swig https://sourceforge.net/projects/swig/files/swig/swig-4.0.2/swig-4.0.2.tar.gz/download bin/swig
doxygen https://www.doxygen.nl/files/doxygen-1.9.5.src.tar.gz bin/doxygen
bakefile https://github.com/vslavik/bakefile/archive/7a218d89d860f01d64b558b7e198bb0cbc538511.tar.gz bin/bakefile_gen
XML-Parser https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-2.46.tar.gz perl5/man/man3/XML*Parser.3*
intltool https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz bin/intltoolize
ninja https://github.com/ninja-build/ninja/archive/v1.11.1.tar.gz bin/ninja
glib https://gitlab.gnome.org/GNOME/glib/-/archive/046f70cc0ddd1db310d30b02c692ee1364c41e16/glib-046f70cc0ddd1db310d30b02c692ee1364c41e16.tar.bz2 lib/libglib-2.0.a
glib https://download.gnome.org/sources/glib/2.84/glib-2.84.1.tar.xz lib/libglib-2.0.a
libgpg-error https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.45.tar.bz2 lib/libgpg-error.a
libgcrypt https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.10.1.tar.bz2 lib/libgcrypt.a
libsecret https://gitlab.gnome.org/GNOME/libsecret/-/archive/0.20.5/libsecret-0.20.5.tar.bz2 lib/libsecret-1.a
@@ -181,9 +189,9 @@ DISTS=$DISTS'
faudio https://github.com/FNA-XNA/FAudio/archive/refs/tags/24.09.tar.gz lib/libFAudio.a
flac https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.4.tar.xz lib/libFLAC.a
harfbuzz https://github.com/harfbuzz/harfbuzz/releases/download/10.0.1/harfbuzz-10.0.1.tar.xz lib/libharfbuzz.a
sfml https://github.com/SFML/SFML/archive/refs/tags/2.6.1.tar.gz lib/libsfml-system-s.a
sfml https://github.com/SFML/SFML/releases/download/3.0.0/SFML-3.0.0-sources.zip lib/libsfml-system-s.a
shared-mime-info https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/2.2/shared-mime-info-2.2.tar.bz2 bin/update-mime-database
wxwidgets https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.tar.bz2 lib/libwx_baseu-3.*.a
wxwidgets https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.7/wxWidgets-3.2.7.tar.bz2 lib/libwx_baseu-3.*.a
ffmpeg http://ffmpeg.org/releases/ffmpeg-7.0.2.tar.xz lib/libavformat.a
'
@@ -199,13 +207,13 @@ PROJECT_ARGS="-DDISABLE_MACOS_PACKAGE_MANAGERS=TRUE -DENABLE_ONLINEUPDATES=OFF -
: ${PATH_SEP:=':'}
export CMAKE_BASE_ARGS="$CMAKE_BASE_ARGS -DBUILD_SHARED_LIBS=NO -DENABLE_SHARED=NO -DCMAKE_PREFIX_PATH:FILEPATH=\"\$CMAKE_PREFIX_PATH\" -DCMAKE_BUILD_TYPE=Release"
export CMAKE_BASE_ARGS="$CMAKE_BASE_ARGS -DBUILD_SHARED_LIBS=NO -DENABLE_SHARED=NO -DCMAKE_PREFIX_PATH:FILEPATH=\"\$CMAKE_PREFIX_PATH\" -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM=3.5"
export CONFIGURE_INSTALL_ARGS="--prefix=/usr --sysconfdir=/etc"
export CMAKE_INSTALL_ARGS="-DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_FULL_SYSCONFDIR=/etc"
export MESON=meson
export MESON='meson setup'
export MAKE=make
export MESON_INSTALL_ARGS="--prefix /usr --sysconfdir /etc"
@@ -218,7 +226,7 @@ fi
export CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-shared $CONFIGURE_INSTALL_ARGS"
export CMAKE_ARGS="$CMAKE_BASE_ARGS $CMAKE_ARGS $CMAKE_INSTALL_ARGS"
export MESON_ARGS="$MESON_BASE_ARGS --buildtype release --default-library static $MESON_INSTALL_ARGS"
export MESON_ARGS="$meSON_BASE_ARGS --buildtype release --default-library=static -Ddefault_both_libraries=static -Dprefer_static=true $MESON_INSTALL_ARGS"
DIST_PATCHES=$DIST_PATCHES'
docbook2x https://gist.githubusercontent.com/rkitover/0b5dcc95a0703a9b0e0e7eb6d325a98e/raw/e256d2fad8d19633ac8abe02a0d1e119063d1fd9/docbook2x.patch
@@ -234,8 +242,8 @@ DIST_CONFIGURE_TYPES="$DIST_CONFIGURE_TYPES
unzip make
zip make
pkgconf autoreconf_noargs
fontconfig autoreconf
libgd autoreconf
libffi autoreconf
libgd cmake
python2 autoreconf
python3 autoreconf
graphviz autoreconf
@@ -250,23 +258,14 @@ DIST_RELOCATION_TYPES="$DIST_RELOCATION_TYPES
"
DIST_PRE_BUILD="$DIST_PRE_BUILD
# xz mkdir -p build-aux; touch build-aux/config.rpath; mkdir -p po; touch po/Makefile.in.in; sed -i.bak 's/ po / /g' Makefile.am;
getopt sed -i.bak 's/\\\$(LDFLAGS)\\(.*\\)\$/\\1 \$(LDFLAGS)/' Makefile;
libicu cd source;
# c2man sed -i.bak 's/exit(\\([^)]*\\));/return \\1;/g' Configure
# flex-2.6.3 sed -i.bak '/^'\"\$TAB\"'tests \\\\\$/d' Makefile.am;
flex mkdir -p build-aux; touch build-aux/config.rpath; mkdir -p po; touch po/Makefile.in.in; sed -i.bak '/po \\\\$/d' Makefile.am;
fontconfig sed -i.bak 'd;q' test/Makefile.am;
python3 sed -i.bak '/-Wl,-stack_size,/d' configure.ac;
bakefile sed -i.bak '/SUBDIRS = doc/d' Makefile.am;
unzip rm -f unix/Contents; ln -sf \$(find unix -mindepth 1 -maxdepth 1) .;
zip rm -f unix/Contents; ln -sf \$(find unix -mindepth 1 -maxdepth 1) .;
gettext sed -i.bak 's/-Wl,--disable-auto-import//' m4/woe32-dll.m4;
glib cd subprojects/gvdb; \
curl -sLO 'https://gitlab.gnome.org/GNOME/gvdb/-/archive/89dbdb9ab45721189e195c7e70ed620143d840f7/gvdb-89dbdb9ab45721189e195c7e70ed620143d840f7.tar.bz2'; \
tar --strip-components=1 -jxf gvdb-89dbdb9ab45721189e195c7e70ed620143d840f7.tar.bz2; \
rm gvdb-89dbdb9ab45721189e195c7e70ed620143d840f7.tar.bz2; \
cd ../..;
glib sed -i.bak 's/-Werror=implicit-function-declaration/-Wno-error=implicit-function-declaration/' meson.build;
expat sed -i.bak '/doc\\/Makefile/d' configure.ac; \
sed -i.bak '/SUBDIRS/{; s/ doc//; }' Makefile.am;
graphviz sed -i.bak 's/ -export-symbols/ -Wl,-export-symbols/g' \$(find . -name Makefile.am); \
@@ -294,15 +293,13 @@ DIST_POST_BUILD="$DIST_POST_BUILD
harfbuzz rebuild_dist freetype -Dharfbuzz=enabled;
flex-2.6.3 build_dist flex || :;
libtool ln -sf \"\$BUILD_ROOT/root/bin/libtoolize\" \"\$BUILD_ROOT/root/bin/glibtoolize\";
glib rebuild_dist gettext --without-included-glib --without-included-libxml;
# graphviz (cd \"\$BUILD_ROOT/root/bin\"; path_exists dot_static && ! path_exists dot && ln -sf \"\$BUILD_ROOT/root/bin/dot_static\" ./dot || :);
libxml2 mkdir -p \"\$BUILD_ROOT/root/etc/xml\"; \
xmlcatalog --noout --create \"\$(cygpath -m \"\$BUILD_ROOT/root/etc/xml/catalog.xml\")\" || :;
python2 python2 -m pip install six;
python3 python3 -m pip install six; \
rm \"\$BUILD_ROOT/root/bin/meson\"; \
python3 -m pip install meson; \
rebuild_dist libxml2 --with-python --with-python3;
rebuild_dist libxml2 --with-python;
fontconfig mkdir -p \"\$BUILD_ROOT/root/etc/fonts\"; \
touch \"\$BUILD_ROOT/root/etc/fonts/fonts.conf\"; \
sed -i.bak \"s|/usr/share/fonts|\$BUILD_ROOT/root/share/fonts|g\" \"\$BUILD_ROOT/root/etc/fonts/fonts.conf\";
@@ -345,6 +342,8 @@ DIST_BUILD_OVERRIDES="$DIST_BUILD_OVERRIDES
DIST_ARGS="$DIST_ARGS
pkgconf --disable-tests
libdeflate -DLIBDEFLATE_BUILD_STATIC_LIB=TRUE -DLIBDEFLATE_BUILD_SHARED_LIB=FALSE
libpsl -Druntime=no
curl --with-openssl --without-nghttp2 --without-libidn2 --without-librtmp --without-brotli
libffi --enable-static
libicu --enable-static --disable-extras --disable-tools --disable-tests --disable-samples --with-library-bits=64
@@ -354,12 +353,11 @@ DIST_ARGS="$DIST_ARGS
pcre --enable-utf --enable-unicode-properties --enable-pcre16 --enable-pcre32 --enable-jit
pcre2 --enable-utf8 --enable-pcre2-8 --enable-pcre2-16 --enable-pcre2-32 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-jit
libxslt --without-python --without-crypto
libgd --without-xpm
fontconfig --with-baseconfigdir=/etc/fonts
fontconfig -Dbaseconfig-dir=/etc/fonts -Diconv=enabled -Dxml-backend=libxml2 -Ddoc=disabled
libgd -DBUILD_SHARED_LIBS=FALSE -DBUILD_STATIC_LIBS=TRUE
graphviz --disable-ltdl --without-x --disable-swig CFLAGS=\"-include \$PWD/declspec.h \$CFLAGS\" CC=\"\$CXX\"
python2 --with-ensurepip=install --with-system-expat
python3 --with-ensurepip=install --with-system-expat
bakefile --enable-shared
XML-Parser EXPATINCPATH=\"\$BUILD_ROOT/root/include\" EXPATLIBPATH=\"\$BUILD_ROOT/root/lib\"
doxygen -DICONV_ACCEPTS_NONCONST_INPUT:BOOL=FALSE -DICONV_ACCEPTS_CONST_INPUT:BOOL=TRUE
sfml -DSFML_USE_SYSTEM_DEPS=TRUE -DSFML_BUILD_AUDIO=FALSE
@@ -396,7 +394,6 @@ DIST_MAKE_ARGS="$DIST_MAKE_ARGS
expat DOCBOOK_TO_MAN=docbook2man
shared-mime-info -j1
xvidcore -j1
fontconfig LIBS=\"-lintl -liconv\"
libgsm CC=\"\$CC \$CFLAGS\"
"
@@ -410,6 +407,7 @@ DIST_EXTRA_LDFLAGS="$DIST_EXTRA_LDFLAGS
graphviz -lpcreposix
doxygen -lintl -liconv
ffmpeg -lm -llzma -lpthread
fontconfig -llzma
"
DIST_EXTRA_CXXFLAGS="$DIST_EXTRA_CXXFLAGS
@@ -586,6 +584,8 @@ setup_perl() {
perl=/usr/bin/perl
elif [ -x /usr/local/bin/perl ]; then
perl=/usr/local/bin/perl
elif [ -x "$BREW_PREFIX"/bin/perl ]; then
perl="$BREW_PREFIX"/bin/perl
else
perl=$(command -v perl || :)
fi
@@ -606,6 +606,8 @@ setup_meson() {
if ! [ -x "$BUILD_ROOT/root/bin/meson" ]; then
if [ -x /usr/local/bin/meson ]; then
meson=/usr/local/bin/meson
elif [ -x "$BREW_PREFIX"/bin/meson ]; then
meson="$BREW_PREFIX"/bin/meson
else
meson=$(command -v meson || :)
fi
@@ -631,6 +633,8 @@ setup_ccache() {
setup_ninja() {
if [ -x /usr/local/bin/ninja ]; then
ninja=/usr/local/bin/ninja
elif [ -x "$BREW_PREFIX"/bin/ninja ]; then
ninja="$BREW_PREFIX"/bin/ninja
else
ninja=$(command -v ninja || :)
fi
@@ -819,14 +823,21 @@ mac_install_core_deps() {
error 'Please install XCode and the XCode Command Line Tools, then run this script again. On newer systems this can be done with: ;xcode-select --install'
fi
if ! [ -x /usr/local/bin/brew ]; then
error 'Please install Mac Homebrew: ;https://brew.sh/'
if ! [ -x "$BREW_PREFIX"/bin/brew ]; then
error 'Please install Mac Homebrew: https://brew.sh/'
fi
/usr/local/bin/brew install -q perl meson ninja
"$BREW_PREFIX"/bin/brew install -q m4 perl perl-xml-parser meson ninja pyenv
if ! [ -d "$(pyenv root)/versions/2.7.18" ]; then
pyenv install -s 2.7.18
fi
pyenv global 2.7.18
export PATH=$(pyenv root)/shims:$PATH
# This is necessary because someone broke my compiler.
/usr/local/bin/brew unlink openssl@3 >/dev/null 2>&1 || :
"$BREW_PREFIX"/bin/brew unlink openssl@3 >/dev/null 2>&1 || :
}
setup_tmp_dir() {
@@ -1412,6 +1423,11 @@ rebuild_dist() {
build_dist "$current_dist" "$@"
}
run_ninja() {
eval "set -- $(dist_ninja_args "$current_dist")"
echo_run ninja "$@"
}
build_dist() {
current_dist=$1
[ -n "$current_dist" ] || die 'build_dist: dist name required'
@@ -1473,8 +1489,7 @@ build_dist() {
echo_run $MESON .. "$@"
fi
dist_post_configure "$current_dist"
eval "set -- $(dist_ninja_args "$current_dist")"
echo_run ninja "$@"
run_ninja
if [ -z "$install_override" ]; then
rm -rf destdir
@@ -1570,7 +1585,7 @@ build_dist() {
fi
check_install_artifact "$current_dist"
elif [ "$config_type" = cmakeninja ]; then
elif [ "$config_type" = cmake ] || [ "$config_type" = cmakeninja ] || [ -f CMakeLists.txt ]; then
if ! command -v ninja >/dev/null; then
error "configure type 'cmakeninja' requested but ninja is not available yet";
fi
@@ -1586,8 +1601,7 @@ build_dist() {
echo_run cmake .. "$@"
fi
dist_post_configure "$current_dist"
eval "set -- $(dist_ninja_args "$current_dist")"
echo_run ninja "$@"
run_ninja
if [ -z "$install_override" ]; then
rm -rf destdir
@@ -1595,36 +1609,9 @@ build_dist() {
eval "set -- $(dist_make_install_args "$current_dist")"
echo_run $MAKE "$@" install DESTDIR="$PWD/destdir" || :
install_dist "$current_dist"
else
echo_eval_run "$install_override $(dist_make_install_args "$current_dist")"
fi
check_install_artifact "$current_dist"
elif [ "$config_type" = cmake ] || [ -z "$config_type" -a -f CMakeLists.txt ]; then
mkdir -p build
cd build
if [ -n "$configure_override" ]; then
eval "set -- $extra_dist_args"
echo_eval_run "$configure_override $@"
else
eval "set -- $CMAKE_REQUIRED_ARGS $(dist_args "$current_dist" cmake) $extra_dist_args"
echo_run cmake .. "$@"
fi
dist_post_configure "$current_dist"
eval "set -- $(dist_make_args "$current_dist")"
echo_run $MAKE -j$NUM_CPUS "$@"
if [ -z "$install_override" ]; then
rm -rf destdir
mkdir destdir
eval "set -- $(dist_make_install_args "$current_dist")"
echo_run $MAKE "$@" install DESTDIR="$PWD/destdir" || :
export DESTDIR="$PWD/destdir"
echo_run ninja install "$@"
unset DESTDIR
install_dist "$current_dist"
else
@@ -1838,7 +1825,15 @@ install_dist() {
f=$(normalize_relative_path "$f")
[ -n "$f" ] || continue
putsln "$f" >> "$file_list"
# We never want shared libs on macOS.
case "$f" in
*.dylib)
continue
;;
*)
putsln "$f" >> "$file_list"
;;
esac
done)
IFS=$OIFS
[ -f "$file_list" ]
@@ -2752,7 +2747,7 @@ build_project() {
puts "${NL}Building Release...${NL}${NL}"
cd release
echo_eval_run cmake "'$CHECKOUT'" $CMAKE_REQUIRED_ARGS -DVBAM_STATIC=ON -DENABLE_LTO=${lto} -DUPSTREAM_RELEASE=TRUE $CMAKE_ARGS $PROJECT_ARGS -G Ninja $@
echo_run ninja -j$NUM_CPUS -v
run_ninja
dist_post_build project
cd ..
@@ -2760,7 +2755,7 @@ build_project() {
puts "${NL}Building Debug...${NL}${NL}"
cd debug
echo_eval_run cmake "'$CHECKOUT'" $CMAKE_REQUIRED_ARGS -DVBAM_STATIC=ON -DENABLE_LTO=${lto} -DUPSTREAM_RELEASE=TRUE $CMAKE_ARGS $PROJECT_ARGS -DCMAKE_BUILD_TYPE=Debug -G Ninja $@
echo_run ninja -j$NUM_CPUS -v
run_ninja
dist_post_build project
cd ..

View File

@@ -5,45 +5,82 @@ set -e
LANG=C LC_COLLATE=C LC_CTYPE=C LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C LC_TIME=C LC_ALL=C
export LANG LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LC_ALL
## bash 3 does not work for this code
#if [ -z "$IN_DASH" ]; then
# if command -v dash >/dev/null; then
# export IN_DASH=1
# exec dash "$0" "$@"
# else
# echo >&2 "please install dash from homebrew or macports to run this script"
# exit 1
# fi
#fi
# bash 3 does not work for this code
if [ -z "$IN_DASH" ]; then
if command -v dash >/dev/null; then
export IN_DASH=1
exec dash "$0" "$@"
else
echo >&2 "Please install dash from Nix/Homebrew to run this script."
exit 1
fi
fi
target_bits=64
target_cpu=x86_64
target_build_arch=-m64
if [ "$(uname -m)" = arm64 ]; then
export APPLE_SILICON=1
target_cpu=ARM64
else
target_cpu=x86_64
fi
case "$1" in
-[Ii][Nn][Tt][Ee][Ll])
intel_target=1
shift
;;
-[Ii][Nn][Tt][Ee][Ll]64)
intel_target=1
shift
;;
-[Xx]86_64)
intel_target=1
shift
;;
-64)
shift
;;
-32)
target_bits=32
target_cpu=i386
-[Aa][Rr][Mm]64)
shift
;;
-arm64)
target_bits=arm64
target_cpu=arm64
-32)
target_build_arch=-m32
target_cpu=i386
shift
;;
esac
if [ -n "$APPLE_SILICON" ]; then
if [ -n "$intel_target" ]; then
target_build_arch='-target x86_64-apple-macos10.15 -march=core2 -mtune=skylake'
target_cpu=x86_64
export MACOSX_DEPLOYMENT_TARGET=10.15 # Catalina
else
export MACOSX_DEPLOYMENT_TARGET=11.0 # Big Sur
fi
elif [ "$target_cpu" = x86_64 ]; then
target_build_arch='-m64 -march=core2 -mtune=skylake'
fi
# Need to use Xcode 9 for 32 bit builds on Mojave and newer.
# Place it in /Applications/Xcode9.app .
if [ "$target_bits" -eq 32 ] && [ -d /Applications/Xcode9.app ]; then
if [ "$target_cpu" = i386 ] && [ -d /Applications/Xcode9.app ]; then
PREV_XCODE=$(xcode-select -p)
printf "\nSetting Xcode9 as the default Xcode for 32 bit build...\n\n"
sudo xcode-select -s /Applications/Xcode9.app/Contents/Developer
fi
export BUILD_ROOT="${BUILD_ROOT:-$HOME/vbam-build-mac-${target_bits}bit}$BUILD_ROOT_SUFFIX"
if command -v brew >/dev/null; then
export BREW_PREFIX=$(brew --prefix)
elif [ -f /usr/local/bin/brew ]; then
export BREW_PREFIX=$(/usr/local/bin/brew --prefix)
elif [ -f /opt/homebrew/bin/brew ]; then
export BREW_PREFIX=$(/opt/homebrew/bin/brew --prefix)
fi
export BUILD_ROOT="${BUILD_ROOT:-$HOME/vbam-build-mac-${target_cpu}}$BUILD_ROOT_SUFFIX"
ver_file=$(mktemp)
sw_vers -productVersion | sed 's/\./ /g' > "$ver_file"
@@ -62,7 +99,7 @@ best_llvm=$(
fi
done
for brew_llvm in $(find /usr/local/opt -maxdepth 1 -type l -name 'llvm*'); do
for brew_llvm in $(find "$BREW_PREFIX"/Cellar -maxdepth 1 -type l -name 'llvm*'); do
if [ -x "$brew_llvm/bin/clang++" ]; then
echo "$brew_llvm $($brew_llvm/bin/clang++ --version | head -1 | awk '{ print $NF }')"
fi
@@ -71,19 +108,19 @@ best_llvm=$(
)
BUILD_ENV=$(cat <<EOF
export MACOSX_DEPLOYMENT_TARGET=10.10
export MACOSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET
export COMMAND_MODE=unix2003
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
export PATH=/usr/bin:/bin:/usr/sbin:/sbin:"$BREW_PREFIX"/bin
[ -n "$best_llvm" ] && export PATH="$best_llvm/bin:\$PATH"
export CC=clang
export CXX=clang++
export CPPFLAGS="-DICONV_CONST="
export CFLAGS="-m${target_bits} -framework Carbon -framework Foundation -framework CoreServices -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
export CXXFLAGS="-m${target_bits} -framework Carbon -framework Foundation -framework CoreServices -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
export OBJCXXFLAGS="-m${target_bits} -framework Carbon -framework Foundation -framework CoreServices -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
export LDFLAGS="-m${target_bits} -framework Carbon -framework Foundation -framework CoreServices -Wno-unused-command-line-argument -Wl,-no_compact_unwind"
export CPPFLAGS=-DICONV_CONST=
export CFLAGS="$target_build_arch -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
export CXXFLAGS="$target_build_arch -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
export OBJCXXFLAGS="$target_build_arch -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -DICONV_CONST= -Wl,-no_compact_unwind"
export LDFLAGS="$target_build_arch -framework Carbon -framework Foundation -framework CoreServices -framework SystemConfiguration -Wno-unused-command-line-argument -Wl,-no_compact_unwind"
export UUID_CFLAGS="-I\$BUILD_ROOT/root/stow/libuuid/include"
export UUID_LIBS="-L\$BUILD_ROOT/root/stow/libuuid/lib -luuid"
@@ -108,14 +145,6 @@ for dist in flex libsecret c2man graphviz zip; do
table_line_remove DISTS "$dist"
done
# LLVM libunwind.
table_insert_after DISTS cmake '
libunwind https://github.com/llvm-mirror/libunwind/archive/3e6ec2ae9afaa3683269b690612f84d907943ea2.tar.gz lib/libunwind.a
'
table_line_replace DIST_ARGS libunwind '-DLIBUNWIND_ENABLE_STATIC=ON -DLIBUNWIND_ENABLE_SHARED=OFF'
# issues with perl modules linked to our libs and brew perl
table_line_remove DISTS shared-mime-info
@@ -127,8 +156,10 @@ table_line_append DIST_PRE_BUILD zip " \
if [ "$target_cpu" = i386 ]; then
table_line_replace DIST_CONFIGURE_OVERRIDES openssl './Configure darwin-i386-cc no-shared --prefix=/usr --openssldir=/etc/ssl'
elif [ "$target_cpu" = ARM64 ]; then
table_line_replace DIST_CONFIGURE_OVERRIDES openssl "./Configure darwin64-arm64-cc no-shared --prefix=/usr --openssldir=/etc/ssl"
else
table_line_replace DIST_CONFIGURE_OVERRIDES openssl './Configure darwin64-x86_64-cc no-shared --prefix=/usr --openssldir=/etc/ssl'
table_line_replace DIST_CONFIGURE_OVERRIDES openssl "./Configure darwin64-${target_cpu}-cc no-shared --prefix=/usr --openssldir=/etc/ssl"
fi
stdint_h=
@@ -173,12 +204,18 @@ if [ "$target_cpu" = i386 ]; then
table_line_append DIST_ARGS libicu '--host= --build='
fi
table_line_remove DISTS ninja
table_line_replace DIST_CONFIGURE_TYPES libmodplug autoreconf
table_line_append DIST_PRE_BUILD libmodplug " \
sed -i.bak '/-mmacosx-version-min=/d' configure.ac; \
sed -i.bak 's/-lstdc++/-lc++/g' libmodplug.pc.in; \
"
if [ -z "$APPLE_SILICON" ]; then
table_line_replace DISTS glib 'https://download.gnome.org/sources/glib/2.78/glib-2.78.3.tar.xz lib/libglib-2.0.a'
fi
table_line_append DIST_PRE_BUILD libzmq "sed -i.bak 's/-lstdc++/-lc++/g' src/libzmq.pc.in"
table_line_append DIST_PRE_BUILD ffmpeg "sed -i.bak 's/-lstdc++/-lc++/g' configure"
@@ -198,6 +235,21 @@ table_line_append DIST_CONFIGURE_OVERRIDES ffmpeg "--disable-videotoolbox --extr
#table_line_append DIST_PATCHES ffmpeg "-p0 https://gist.githubusercontent.com/rkitover/db75d083b74617b186eec11965c1da74/raw/20da2f8c6d8c02ce284096c5e805ae671351cc6e/ffmpeg-macos10-7.patch"
table_line_remove DISTS python2
table_line_append DIST_PRE_BUILD sfml " \
sed -E -i.bak '/OSX_DEPLOYMENT_TARGET/d' CMakeLists.txt; \
"
if [ -n "$APPLE_SILICON" ] && [ "$target_cpu" != ARM64 ]; then
table_line_remove DISTS m4
table_line_remove DISTS XML-Parser
table_line_remove DISTS libffi
table_line_remove DISTS libgcrypt
table_line_append DIST_CONFIGURE_OVERRIDES ffmpeg '--disable-asm'
fi
builder "$@"
if [ -n "$PREV_XCODE" ]; then