Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the native build process for Windows. #91

Merged
merged 5 commits into from
Dec 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions 0001-build-fix-build-failures-with-MinGW-new-headers.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 3e90bc76b036124c2a94f9bf006af527755271cf Mon Sep 17 00:00:00 2001
From: erw7 <[email protected]>
Date: Wed, 3 Nov 2021 00:28:42 +0900
Subject: [PATCH] build: fix build failures with MinGW new headers

A structure definition was added to mstcpip.h in
mingw-w64-x86_64-headers-git 9.0.0.6327.f29c1101f,
which causes a conflict and the build fails. Fix this by
changing the name in the definition in mstcpip.h.

PR-URL: https://github.com/libuv/libuv/pull/3345
---
include/uv/win.h | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/include/uv/win.h b/include/uv/win.h
index f5f1d3a3..5fecf4bf 100644
--- a/include/uv/win.h
+++ b/include/uv/win.h
@@ -45,7 +45,14 @@ typedef struct pollfd {
#endif

#include <mswsock.h>
+// Disable the typedef in mstcpip.h of MinGW.
+#define _TCP_INITIAL_RTO_PARAMETERS _TCP_INITIAL_RTO_PARAMETERS__AVOID
+#define TCP_INITIAL_RTO_PARAMETERS TCP_INITIAL_RTO_PARAMETERS__AVOID
+#define PTCP_INITIAL_RTO_PARAMETERS PTCP_INITIAL_RTO_PARAMETERS__AVOID
#include <ws2tcpip.h>
+#undef _TCP_INITIAL_RTO_PARAMETERS
+#undef TCP_INITIAL_RTO_PARAMETERS
+#undef PTCP_INITIAL_RTO_PARAMETERS
#include <windows.h>

#include <process.h>
--
2.33.0

27 changes: 15 additions & 12 deletions Makefile.mingw64.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ build_fftw: $(DEPS_PATH)/fftw

build_libio: $(DEPS_PATH)/liblo
cd $< ; \
./autogen.sh --prefix=$(PREFIX_PATH) --disable-shared --enable-static
./configure --prefix=$(PREFIX_PATH) --disable-shared --enable-static

$(MAKE) -C $<
$(MAKE) -C $< install
Expand Down Expand Up @@ -89,23 +89,24 @@ build_zynaddsubfx:
#

apply_mruby_patches: fetch_zest
cd $(ZEST_PATH)/deps/mruby-dir-glob ; \
ifneq ($(ZEST_COMMIT), DIRTY)
cd $(ZEST_PATH)/mruby ; \
Gopall marked this conversation as resolved.
Show resolved Hide resolved
git checkout -- . ; \
patch -N < $(TOP)/mruby-dir-glob-no-process.patch
patch -p1 -N < ../string-backtraces.diff
endif

cd $(ZEST_PATH)/deps/mruby-io ; \
git checkout -- . ; \
patch -N < $(TOP)/mruby-io-libname.patch

cd $(ZEST_PATH)/mruby ; \
#this patch is to fix a conflict between mingw and libuv.
# the conflict is fixed in later versions of libuv, but mruby-zest uses an earlier version currently.
cd $(ZEST_PATH)/deps/libuv ; \
git checkout -- . ; \
patch -p1 -N < $(TOP)/mruby-float-patch.patch

patch -p1 -N < $(TOP)/0001-build-fix-build-failures-with-MinGW-new-headers.patch


setup_zest: fetch_zest apply_mruby_patches setup_libuv
cd $(ZEST_PATH) ; \
ruby rebuild-fcache.rb

$(MAKE) -C $(ZEST_PATH) --always-make builddepwin

#
# Final Make rule
Expand Down Expand Up @@ -134,7 +135,9 @@ build_zest:
############################ Packing Up Rules ############################
#

TARGET_ZIP_FILE := $(BUILD_PATH)/zyn-fusion-windows-64bit-$(MODE).zip
TARGET_ZIP_FILE := $(BUILD_PATH)/zyn-fusion-windows-64bit-$(VER)-$(MODE).zip
ZYN_FUSION_OUT := $(BUILD_PATH)/zyn-fusion-windows-64bit-$(VER)-$(MODE)


copy_zest_files:
rm -rf $(ZYN_FUSION_OUT)
Expand All @@ -151,7 +154,7 @@ copy_zest_files:
cp $(shell find $(ZEST_PATH)/deps/nanovg -type f | grep ttf$$) $(ZYN_FUSION_OUT)/font/
cp $(ZEST_PATH)/src/osc-bridge/schema/test.json $(ZYN_FUSION_OUT)/schema/

cp $(ZYNADDSUBFX_BUILD_DIR)/src/Plugin/ZynAddSubFX/ZynAddSubFX.dll $(ZYN_FUSION_OUT)/
cp $(ZYNADDSUBFX_BUILD_DIR)/src/Plugin/ZynAddSubFX/vst/ZynAddSubFX.dll $(ZYN_FUSION_OUT)/
Gopall marked this conversation as resolved.
Show resolved Hide resolved
cp $(ZYNADDSUBFX_BUILD_DIR)/src/zynaddsubfx.exe $(ZYN_FUSION_OUT)/

cp $(PREFIX_PATH)/bin/libportaudio-2.dll $(ZYN_FUSION_OUT)/
Expand Down