Skip to content

Commit

Permalink
win/mac related build fixes
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Oct 29, 2023
1 parent 6508a68 commit 6c0d4cd
Show file tree
Hide file tree
Showing 16 changed files with 465 additions and 4 deletions.
13 changes: 13 additions & 0 deletions plugins/package/bolliedelay/02_fix-mac-win-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index 05988f0..d5273a4 100644
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ install: build
install -d $(DESTDIR)$(PREFIX)/lib/lv2/bolliedelay.lv2
install -d $(DESTDIR)$(PREFIX)/lib/lv2/bolliedelay.lv2/modgui

- install -m 644 $(BUILDDIR)/*.so $(DESTDIR)$(PREFIX)/lib/lv2/bolliedelay.lv2/
+ install -m 644 $(BUILDDIR)/*$(LIB_EXT) $(DESTDIR)$(PREFIX)/lib/lv2/bolliedelay.lv2/
install -m 644 $(BUILDDIR)/*.ttl $(DESTDIR)$(PREFIX)/lib/lv2/bolliedelay.lv2/
cp -rv $(BUILDDIR)/modgui/* $(DESTDIR)$(PREFIX)/lib/lv2/bolliedelay.lv2/modgui/

76 changes: 76 additions & 0 deletions plugins/package/caps-lv2/004_fix-win32-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
diff --git a/basics.h b/basics.h
index 7b1d10d..e954952 100644
--- a/basics.h
+++ b/basics.h
@@ -38,6 +38,7 @@
#define _ISOC99_SOURCE 1
#define _ISOC9X_SOURCE 1

+#include <stdint.h>
#include <stdlib.h>
#include <string.h>

@@ -49,14 +50,14 @@

#include "ladspa.h"

-typedef __int8_t int8;
-typedef __uint8_t uint8;
-typedef __int16_t int16;
-typedef __uint16_t uint16;
-typedef __int32_t int32;
-typedef __uint32_t uint32;
-typedef __int64_t int64;
-typedef __uint64_t uint64;
+typedef int8_t int8;
+typedef uint8_t uint8;
+typedef int16_t int16;
+typedef uint16_t uint16;
+typedef int32_t int32;
+typedef uint32_t uint32;
+typedef int64_t int64;
+typedef uint64_t uint64;

#define MIN_GAIN 1e-6 /* -120 dB */
/* smallest non-denormal 32 bit IEEE float is 1.18e-38 */
@@ -124,7 +125,11 @@ T clamp (T value, T lower, T upper)
return value;
}

+#ifdef _WIN32
+static inline float frandom() { return (float) rand() / (float) RAND_MAX; }
+#else
static inline float frandom() { return (float) random() / (float) RAND_MAX; }
+#endif

/* NB: also true if 0 */
inline bool
diff --git a/dsp/util.h b/dsp/util.h
index 50c6cb6..73cf527 100644
--- a/dsp/util.h
+++ b/dsp/util.h
@@ -28,6 +28,8 @@
#ifndef DSP_UTIL_H
#define DSP_UTIL_H

+#include <stdint.h>
+
namespace DSP {

inline float pow2 (float x) { return x * x; }
diff --git a/dsp/v4f_IIR2.h b/dsp/v4f_IIR2.h
index ebd1234..fd7d96b 100644
--- a/dsp/v4f_IIR2.h
+++ b/dsp/v4f_IIR2.h
@@ -32,8 +32,10 @@

namespace DSP {

-#ifdef __APPLE__
+#if defined(__APPLE__)
inline float exp10f(float f) {return __exp10f(f);}
+#elif defined(_WIN32)
+inline float exp10f(float f) {return __builtin_exp10f(f);}
#endif

class RBJv4
4 changes: 2 additions & 2 deletions plugins/package/invada-lv2/0003-pass_flags.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ index 47b98bd..1a8e77d 100644
+CC ?= gcc
+LD ?= gcc
+CFLAGS += -I. -O3 -Wall -fomit-frame-pointer -fstrength-reduce -funroll-loops -ffast-math -c -fPIC -DPIC
+LDFLAGS += -shared -Llibrary -lc -lm -linv_common -fPIC -DPIC
+LDFLAGS += -shared -Llibrary -lm -linv_common -fPIC -DPIC

PLUGINS = inv_compressor.so \
inv_delay.so \
Expand Down Expand Up @@ -45,7 +45,7 @@ index 3a9ceb4..85e7f9c 100644
-CFLAGS = -I. `pkg-config --cflags cairo gtk+-2.0` -O3 -Wall -fomit-frame-pointer -fstrength-reduce -funroll-loops -ffast-math -c -fPIC -DPIC
-LDFLAGS = -shared -Lwidgets -L../plugin/library -lc -lm -linv_widgets -linv_common `pkg-config --libs cairo gtk+-2.0` -fPIC -DPIC
+CFLAGS += -I. `pkg-config --cflags cairo gtk+-2.0` -O3 -Wall -fomit-frame-pointer -fstrength-reduce -funroll-loops -ffast-math -c -fPIC -DPIC
+LDFLAGS += -shared -Lwidgets -L../plugin/library -lc -lm -linv_widgets -linv_common `pkg-config --libs cairo gtk+-2.0` -fPIC -DPIC
+LDFLAGS += -shared -Lwidgets -L../plugin/library -lm -linv_widgets -linv_common `pkg-config --libs cairo gtk+-2.0` -fPIC -DPIC


GUIS = inv_compressor_gui.so \
28 changes: 28 additions & 0 deletions plugins/package/invada-lv2/0007-fix-win32-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/plugin/library/common.c b/plugin/library/common.c
index ca00815..310ee9e 100644
--- a/plugin/library/common.c
+++ b/plugin/library/common.c
@@ -176,7 +176,11 @@ calculateSingleIReverbER(struct ERunit * er, float Width, float Length, float He
ERRelGainR = (ERRelGain * (1 + (ERAngle/PI_ON_2)))/2;

er->Active=1;
+#ifdef _WIN32
+ er->rand=(double)rand()/RAND_MAX;
+#else
er->rand=drand48();
+#endif
er->DelayActual=ERRelDelayActual;
er->Reflections=Reflections;
er->AbsGain=fabs(ERRelGain);
@@ -227,7 +231,11 @@ calculateIReverbER(struct ERunit *erarray, int erMax,
MaxGain=0.000000000001; /* this is used to scale up the reflections so that the loudest one has a gain of 1 (0db) */

/* seed the random sequence*/
+#ifdef _WIN32
+ srand(31415);
+#else
srand48(314159265);
+#endif

// reflections from the left wall
// 0: S->Left->D
11 changes: 11 additions & 0 deletions plugins/package/mod-ams-lv2/02_fix-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/src/lfo2_freq.cpp b/src/lfo2_freq.cpp
index 7111507..fb39bc9 100644
--- a/src/lfo2_freq.cpp
+++ b/src/lfo2_freq.cpp
@@ -1,5 +1,6 @@
#include <lvtk-1/lvtk/plugin.hpp>
#include <iostream>
+#include <ctime>

#include "lfo2_freq.hpp"
#include "lfo2_freq_ttl.hpp"
10 changes: 8 additions & 2 deletions plugins/package/mod-ams-lv2/mod-ams-lv2.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ MOD_AMS_LV2_SITE = $(call github,moddevices,ams-lv2,$(MOD_AMS_LV2_VERSION))
MOD_AMS_LV2_DEPENDENCIES = fftw-double lvtk-1
MOD_AMS_LV2_BUNDLES = mod-ams.lv2

MOD_AMS_LV2_TARGET_WAF = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(HOST_DIR)/usr/bin/python ./waf
ifeq ($(BR2_PAWPAW),y)
MOD_AMS_LV2_PYTHON = $(HOST_DIR)/usr/bin/python3
else
MOD_AMS_LV2_PYTHON = $(HOST_DIR)/usr/bin/python
endif

MOD_AMS_LV2_TARGET_WAF = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MOD_AMS_LV2_PYTHON) ./waf

define MOD_AMS_LV2_CONFIGURE_CMDS
(cd $(@D); $(MOD_AMS_LV2_TARGET_WAF) configure --prefix=/usr)
(cd $(@D); $(MOD_AMS_LV2_TARGET_WAF) configure --prefix=/usr --lv2dir=/usr/lib/lv2)
endef

define MOD_AMS_LV2_BUILD_CMDS
Expand Down
25 changes: 25 additions & 0 deletions plugins/package/mod-audio-mixers/01_fix-win-mac-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/Makefile b/Makefile
index 715cc27..4afe655 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ plugins:
$(MAKE) all -C plugins/$(MIXER_MONO)
$(MAKE) all -C plugins/$(MIXER_STEREO)

-ifneq ($(CROSS_COMPILING),true)
+ifneq ($(CROSS_COMPILING_DONT_CARE),true)
gen: plugins dpf/utils/lv2_ttl_generator
#@$(CURDIR)/dpf/utils/generate-ttl.sh
cp plugins/$(MIXER_MONO)/lv2-data/* bin/$(MIXER_MONO).lv2/
@@ -48,9 +48,9 @@ install:
install -d $(DESTDIR)$(libdir)/lv2/$(MIXER_MONO).lv2
install -d $(DESTDIR)$(libdir)/lv2/$(MIXER_STEREO).lv2

- install -m 644 bin/$(MIXER_MONO).lv2/*.so $(DESTDIR)$(libdir)/lv2/$(MIXER_MONO).lv2/
+ install -m 644 bin/$(MIXER_MONO).lv2/*$(LIB_EXT) $(DESTDIR)$(libdir)/lv2/$(MIXER_MONO).lv2/
install -m 644 bin/$(MIXER_MONO).lv2/*.ttl $(DESTDIR)$(libdir)/lv2/$(MIXER_MONO).lv2/
- install -m 644 bin/$(MIXER_STEREO).lv2/*.so $(DESTDIR)$(libdir)/lv2/$(MIXER_STEREO).lv2/
+ install -m 644 bin/$(MIXER_STEREO).lv2/*$(LIB_EXT) $(DESTDIR)$(libdir)/lv2/$(MIXER_STEREO).lv2/
install -m 644 bin/$(MIXER_STEREO).lv2/*.ttl $(DESTDIR)$(libdir)/lv2/$(MIXER_STEREO).lv2/


1 change: 1 addition & 0 deletions plugins/package/mod-cv-plugins/mod-cv-plugins.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

MOD_CV_PLUGINS_VERSION = 5b175482a32094f39eb46d569ffbc718b157a0ee
MOD_CV_PLUGINS_SITE = https://github.com/moddevices/mod-cv-plugins.git
MOD_CV_PLUGINS_SITE_METHOD = git
MOD_CV_PLUGINS_DEPENDENCIES =
MOD_CV_PLUGINS_BUNDLES = logic-operators.lv2 mod-audio-to-cv.lv2 mod-button-to-cv.lv2 mod-cv-abs.lv2 mod-cv-attenuverter.lv2 mod-cv-clock.lv2 mod-cv-control.lv2 mod-cv-gate.lv2 mod-cv-meter.lv2 mod-cv-parameter-modulation.lv2 mod-cv-random.lv2 mod-cv-range.lv2 mod-cv-round.lv2 mod-cv-slew.lv2 mod-cv-switch1.lv2 mod-cv-switch2.lv2 mod-cv-switch3.lv2 mod-cv-switch4.lv2 mod-midi-to-cv-mono.lv2 mod-midi-to-cv-poly.lv2
# unused:
Expand Down
157 changes: 157 additions & 0 deletions plugins/package/mod-pitchshifter/01_fix-win32-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
diff --git a/2Voices/src/2Voices.cpp b/2Voices/src/2Voices.cpp
index e466cac..647e379 100644
--- a/2Voices/src/2Voices.cpp
+++ b/2Voices/src/2Voices.cpp
@@ -3,6 +3,8 @@
#include "PitchShifterClasses.h"
#include "GainClass.h"

+#undef IN
+
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/2Voices"
@@ -203,4 +205,4 @@ void TwoVoices::cleanup(LV2_Handle instance)
const void* TwoVoices::extension_data(const char* uri)
{
return NULL;
-}
\ No newline at end of file
+}
diff --git a/Capo/src/Capo.cpp b/Capo/src/Capo.cpp
index 8116cc6..9cd8b2f 100644
--- a/Capo/src/Capo.cpp
+++ b/Capo/src/Capo.cpp
@@ -3,6 +3,9 @@
#include "PitchShifterClasses.h"
#include "GainClass.h"

+#undef IN
+#undef OUT
+
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/Capo"
@@ -184,4 +187,4 @@ void Capo::cleanup(LV2_Handle instance)
const void* Capo::extension_data(const char* uri)
{
return NULL;
-}
\ No newline at end of file
+}
diff --git a/Drop/src/Drop.cpp b/Drop/src/Drop.cpp
index a8dbb7c..352287a 100644
--- a/Drop/src/Drop.cpp
+++ b/Drop/src/Drop.cpp
@@ -3,6 +3,9 @@
#include "PitchShifterClasses.h"
#include "GainClass.h"

+#undef IN
+#undef OUT
+
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/Drop"
@@ -185,4 +188,4 @@ void Drop::cleanup(LV2_Handle instance)
const void* Drop::extension_data(const char* uri)
{
return NULL;
-}
\ No newline at end of file
+}
diff --git a/Harmonizer/src/Harmonizer.cpp b/Harmonizer/src/Harmonizer.cpp
index 8cbf270..f346ed6 100644
--- a/Harmonizer/src/Harmonizer.cpp
+++ b/Harmonizer/src/Harmonizer.cpp
@@ -5,6 +5,8 @@
#include "HarmonizerLib.h"
#include "GainClass.h"

+#undef IN
+
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/Harmonizer"
@@ -210,4 +212,4 @@ void Harmonizer::cleanup(LV2_Handle instance)
const void* Harmonizer::extension_data(const char* uri)
{
return NULL;
-}
\ No newline at end of file
+}
diff --git a/Harmonizer2/src/Harmonizer2.cpp b/Harmonizer2/src/Harmonizer2.cpp
index 7ac19db..e990daf 100644
--- a/Harmonizer2/src/Harmonizer2.cpp
+++ b/Harmonizer2/src/Harmonizer2.cpp
@@ -5,6 +5,8 @@
#include "HarmonizerLib.h"
#include "GainClass.h"

+#undef IN
+
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/Harmonizer2"
@@ -227,4 +229,4 @@ void Harmonizer2::cleanup(LV2_Handle instance)
const void* Harmonizer2::extension_data(const char* uri)
{
return NULL;
-}
\ No newline at end of file
+}
diff --git a/HarmonizerCS/src/HarmonizerCS.cpp b/HarmonizerCS/src/HarmonizerCS.cpp
index 4799142..a384c1a 100644
--- a/HarmonizerCS/src/HarmonizerCS.cpp
+++ b/HarmonizerCS/src/HarmonizerCS.cpp
@@ -5,6 +5,8 @@
#include "HarmonizerLib.h"
#include "GainClass.h"

+#undef IN
+
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/HarmonizerCS"
@@ -219,4 +221,4 @@ void HarmonizerCS::cleanup(LV2_Handle instance)
const void* HarmonizerCS::extension_data(const char* uri)
{
return NULL;
-}
\ No newline at end of file
+}
diff --git a/SuperCapo/src/SuperCapo.cpp b/SuperCapo/src/SuperCapo.cpp
index 9482ab0..1f0f4d6 100644
--- a/SuperCapo/src/SuperCapo.cpp
+++ b/SuperCapo/src/SuperCapo.cpp
@@ -3,6 +3,9 @@
#include "PitchShifterClasses.h"
#include "GainClass.h"

+#undef IN
+#undef OUT
+
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/SuperCapo"
diff --git a/SuperWhammy/src/SuperWhammy.cpp b/SuperWhammy/src/SuperWhammy.cpp
index 6ad9cb4..021fcf3 100644
--- a/SuperWhammy/src/SuperWhammy.cpp
+++ b/SuperWhammy/src/SuperWhammy.cpp
@@ -3,6 +3,9 @@
#include "PitchShifterClasses.h"
#include "GainClass.h"

+#undef IN
+#undef OUT
+
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/SuperWhammy"
@@ -201,4 +204,4 @@ void SuperWhammy::cleanup(LV2_Handle instance)
const void* SuperWhammy::extension_data(const char* uri)
{
return NULL;
-}
\ No newline at end of file
+}
32 changes: 32 additions & 0 deletions plugins/package/screcord/01_fix-win32-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/screcord/Makefile b/screcord/Makefile
index 959ccbf..d3b2f6d 100644
--- a/screcord/Makefile
+++ b/screcord/Makefile
@@ -63,7 +63,10 @@
# set compile flags
CXXFLAGS += -I. -I./dsp -fPIC -DPIC -O2 -Wall -funroll-loops `pkg-config --cflags sndfile`\
-ffast-math -fomit-frame-pointer -fstrength-reduce -fdata-sections -Wl,--gc-sections $(SSE_CFLAGS)
- LDFLAGS += -I. -lm -pthread -shared -Llibrary -lc -lm -lrt -fPIC -DPIC `pkg-config --libs sndfile`
+ LDFLAGS += -I. -lm -pthread -shared -Llibrary -lm -fPIC -DPIC `pkg-config --libs sndfile`
+ifneq ($(MACOS)$(WINDOWS),true)
+ LDFLAGS += -lrt
+endif
GUI_LDFLAGS += -I. -I$(HEADER_DIR) \
-L. $(LIB_DIR)libxputty.a -shared `pkg-config --static --cflags --libs cairo x11` -lm
# invoke build files
diff --git a/screcord/screcord1.cc b/screcord/screcord1.cc
index 19894da..2ac4a5c 100644
--- a/screcord/screcord1.cc
+++ b/screcord/screcord1.cc
@@ -146,7 +146,11 @@ inline std::string SCapture::get_ffilename() {
#endif
is_wav = int(*fformat) ? false : true;
if (!(stat(pPath.c_str(), &sb) == 0 && S_ISDIR(sb.st_mode))) {
+#ifdef _WIN32
+ mkdir(pPath.c_str());
+#else
mkdir(pPath.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+#endif
}

#ifndef __MOD_DEVICES__
Loading

0 comments on commit 6c0d4cd

Please sign in to comment.