apply gin local changes as patches at build time

modules/ is gitignored, so local Gin edits cannot live in the submodule.
They are stored in patches/ and re-applied (idempotently) before every
configure and build via 'make apply-patches'.

Also improve the submodule guard: git submodule update is a no-op here,
so print concrete restore instructions instead.
This commit is contained in:
Armin 2026-10-06 13:54:57 +02:00
commit 7efcd527cf
2 changed files with 146 additions and 3 deletions

View file

@ -3,7 +3,7 @@
# bundles into ~/Library/Audio/Plug-Ins and the factory resources into
# /Library/Audio/Presets (see the PRESET_ROOT note below).
.PHONY: all configure check-submodules build clean install uninstall uninstall-system pkg
.PHONY: all configure check-submodules apply-patches build clean install uninstall uninstall-system pkg
PRESET ?= $(shell \
if command -v xcodebuild >/dev/null 2>&1 && xcodebuild -version >/dev/null 2>&1; then \
@ -26,8 +26,27 @@ SUBMODULE_FILES = modules/gin/ci/toolchains/base.json \
modules/juce/CMakeLists.txt
# CMakePresets.json includes the gin toolchain presets, so configuring dies with
# a bare "File not found" if the submodules are missing or mid-update.
SUBMODULE_GUARD = for f in $(SUBMODULE_FILES); do test -e "$$f" || { echo "Missing $$f"; echo "Run: git submodule update --init --recursive"; exit 1; }; done
# a bare "File not found" if a module directory is missing or half-deleted.
# modules/ is gitignored and has no gitlink entries in the index, so
# "git submodule update" is a no-op here and cannot restore anything.
SUBMODULE_GUARD = for f in $(SUBMODULE_FILES); do test -e "$$f" || { m=`echo $$f | cut -d/ -f1-2`; r=`echo $$f | sed 's|^[^/]*/[^/]*/||'`; echo "Missing $$f"; echo " restore one file: git -C $$m checkout -- $$r"; echo " whole module: git clone <url from .gitmodules> $$m"; echo " note: 'git submodule update' is a no-op, modules/ is gitignored"; exit 1; }; done
# Local modifications to Gin live in patches/ (modules/ is gitignored, so the
# changes cannot be committed as submodule edits). Re-applied on every build;
# idempotent - patches already in the tree are skipped.
PATCHES = $(wildcard patches/*.patch)
apply-patches:
@test -d modules/gin/.git || { echo "modules/gin missing - see 'make check-submodules'"; exit 1; }
@for p in $(PATCHES); do \
if git -C modules/gin apply --reverse --check "$(CURDIR)/$$p" >/dev/null 2>&1; then \
echo "Patch already applied: $$p"; \
elif git -C modules/gin apply --check "$(CURDIR)/$$p" >/dev/null 2>&1; then \
git -C modules/gin apply "$(CURDIR)/$$p" && echo "Applied: $$p"; \
else \
echo "Cannot apply $$p to modules/gin (upstream changed?)"; exit 1; \
fi; \
done
# Bundles go in the user directory so no sudo is needed and hosts prefer them.
PLUGIN_ROOT = $(HOME)/Library/Audio/Plug-Ins
@ -48,9 +67,11 @@ check-submodules:
$(CACHE):
@$(SUBMODULE_GUARD)
@$(MAKE) --no-print-directory apply-patches
cmake --preset $(PRESET)
build: $(CACHE)
@$(MAKE) --no-print-directory apply-patches
cmake --build --preset $(PRESET) --config $(CONFIG)
clean:

122
patches/gin-accents.patch Normal file
View file

@ -0,0 +1,122 @@
From 6838c7dd9c479315bb245c3663819711d00f7321 Mon Sep 17 00:00:00 2001
From: Armin <armin@cherry>
Date: Tue, 6 Oct 2026 13:47:14 +0200
Subject: [PATCH] yellow/green accents, darker theme, highlighted headers
---
modules/gin_plugin/components/gin_parambox.h | 12 +++---
.../lookandfeel/gin_copperlookandfeel.cpp | 42 +++++++++----------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/modules/gin_plugin/components/gin_parambox.h b/modules/gin_plugin/components/gin_parambox.h
index 98c5fa8011..fe5d077704 100644
--- a/modules/gin_plugin/components/gin_parambox.h
+++ b/modules/gin_plugin/components/gin_parambox.h
@@ -33,16 +33,16 @@ private:
auto rc = getLocalBounds();
gradientRect (g, rc, findColour (PluginLookAndFeel::title1ColourId), findColour (PluginLookAndFeel::title2ColourId));
- g.setColour (findColour (PluginLookAndFeel::whiteColourId).withAlpha (0.15f));
- g.fillRect (rc.removeFromTop (1));
+ g.setColour (findColour (PluginLookAndFeel::accentColourId).withAlpha (0.5f));
+ g.fillRect (rc.removeFromBottom (1));
#if JUCE_MAJOR_VERSION >= 8
- auto f = juce::Font (juce::FontOptions()).withPointHeight (10.0).withExtraKerningFactor (0.25);
+ auto f = juce::Font (juce::FontOptions()).withPointHeight (10.0).withExtraKerningFactor (0.35);
#else
- auto f = juce::Font().withPointHeight (10.0).withExtraKerningFactor (0.25);
+ auto f = juce::Font().withPointHeight (10.0).withExtraKerningFactor (0.35);
#endif
- g.setColour (findColour (PluginLookAndFeel::whiteColourId).withAlpha (0.6f));
+ g.setColour (findColour (PluginLookAndFeel::whiteColourId).withAlpha (0.8f));
g.drawText (name.toUpperCase(), getLocalBounds(), juce::Justification::centred);
}
@@ -303,7 +303,7 @@ private:
auto rc = getLocalBounds();
gradientRect (g, rc, findColour (PluginLookAndFeel::glass1ColourId), findColour (PluginLookAndFeel::glass2ColourId));
- g.setColour (findColour (PluginLookAndFeel::whiteColourId).withAlpha (0.15f));
+ g.setColour (findColour (PluginLookAndFeel::accentColourId).withAlpha (0.3f));
g.fillRect (rc.removeFromTop (1));
if (name.isNotEmpty())
diff --git a/modules/gin_plugin/lookandfeel/gin_copperlookandfeel.cpp b/modules/gin_plugin/lookandfeel/gin_copperlookandfeel.cpp
index 49e7150117..a130efadd9 100644
--- a/modules/gin_plugin/lookandfeel/gin_copperlookandfeel.cpp
+++ b/modules/gin_plugin/lookandfeel/gin_copperlookandfeel.cpp
@@ -6,24 +6,24 @@ CopperLookAndFeel::CopperLookAndFeel()
setColour (whiteColourId, juce::Colour (0xffFFFFFF));
setColour (blackColourId, juce::Colour (0xff000000));
setColour (displayColourId, juce::Colour (0xff0D0E0F));
- setColour (backgroundColourId, juce::Colour (0xff16171A));
- setColour (groupColourId, juce::Colour (0xff28292E));
- setColour (lightGroupColourId, juce::Colour (0xff35373D));
- setColour (grey30ColourId, juce::Colour (0xff585A62));
- setColour (grey45ColourId, juce::Colour (0xff797C84));
- setColour (grey60ColourId, juce::Colour (0xff9B9EA5));
- setColour (grey90ColourId, juce::Colour (0xffE6E6E9));
- setColour (glass1ColourId, juce::Colour (0xff0f1012));
- setColour (glass2ColourId, juce::Colour (0xff0b0b0d));
- setColour (matte1ColourId, juce::Colour (0xff18191C));
- setColour (matte2ColourId, juce::Colour (0xff131417));
- setColour (title1ColourId, juce::Colour (0xff2A2C30));
- setColour (title2ColourId, juce::Colour (0xff25272B));
- setColour (accentColourId, juce::Colour (0xffCC8866));
-
- setColour (WavetableComponent::phaseWaveColourId, juce::Colours::purple);
- setColour (WavetableComponent::waveColourId, juce::Colours::green.withAlpha (0.3f));
- setColour (WavetableComponent::activeWaveColourId, juce::Colours::yellow);
+ setColour (backgroundColourId, juce::Colour (0xff000000));
+ setColour (groupColourId, juce::Colour (0xff16171c));
+ setColour (lightGroupColourId, juce::Colour (0xff1e2026));
+ setColour (grey30ColourId, juce::Colour (0xff3d3f48));
+ setColour (grey45ColourId, juce::Colour (0xff5a5d6a));
+ setColour (grey60ColourId, juce::Colour (0xff7a7d8c));
+ setColour (grey90ColourId, juce::Colour (0xffc8cad4));
+ setColour (glass1ColourId, juce::Colour (0xff0b0c10));
+ setColour (glass2ColourId, juce::Colour (0xff07080c));
+ setColour (matte1ColourId, juce::Colour (0xff0f1116));
+ setColour (matte2ColourId, juce::Colour (0xff0b0d11));
+ setColour (title1ColourId, juce::Colour (0xff181a21));
+ setColour (title2ColourId, juce::Colour (0xff13151b));
+ setColour (accentColourId, juce::Colour (0xffDDFF33));
+
+ setColour (WavetableComponent::phaseWaveColourId, juce::Colour (0xffFF44AA));
+ setColour (WavetableComponent::waveColourId, juce::Colour (0xffDDFF33).withAlpha (0.12f));
+ setColour (WavetableComponent::activeWaveColourId, juce::Colour (0xffEEFF55));
setColour (juce::BubbleComponent::backgroundColourId, findColour (backgroundColourId));
setColour (juce::BubbleComponent::outlineColourId, findColour (grey45ColourId));
@@ -61,7 +61,7 @@ CopperLookAndFeel::CopperLookAndFeel()
setColour (juce::PopupMenu::textColourId, findColour (grey60ColourId));
setColour (juce::PopupMenu::headerTextColourId, findColour (grey60ColourId));
setColour (juce::PopupMenu::highlightedBackgroundColourId, findColour (accentColourId));
- setColour (juce::PopupMenu::highlightedTextColourId, findColour (whiteColourId));
+ setColour (juce::PopupMenu::highlightedTextColourId, juce::Colours::black);
setColour (juce::AlertWindow::backgroundColourId, findColour (backgroundColourId));
setColour (juce::AlertWindow::textColourId, findColour (grey60ColourId));
@@ -170,7 +170,7 @@ void CopperLookAndFeel::drawRotarySlider (juce::Graphics& g, int x, int y, int w
auto depth = (float)slider.getProperties()["modDepth"];
bool bipolar = (bool)slider.getProperties()["modBipolar"];
- g.setColour (slider.findColour (GinLookAndFeel::whiteColourId, true).withAlpha (0.9f));
+ g.setColour (slider.findColour (GinLookAndFeel::accentColourId, true).withAlpha (0.6f));
juce::Path filledArc;
if (bipolar)
@@ -190,7 +190,7 @@ void CopperLookAndFeel::drawRotarySlider (juce::Graphics& g, int x, int y, int w
if (slider.getProperties().contains ("modValues") && slider.isEnabled())
{
- g.setColour (slider.findColour (GinLookAndFeel::whiteColourId, true).withAlpha (0.9f));
+ g.setColour (slider.findColour (GinLookAndFeel::accentColourId, true).withAlpha (0.7f));
auto varArray = slider.getProperties()["modValues"];
if (varArray.isArray())
--
2.54.0 (Apple Git-157)