Skip to content

Commit

Permalink
Get screenshots to work, kinda
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Nov 2, 2023
1 parent 373a889 commit 97f21ae
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 50 deletions.
68 changes: 31 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ BOOTSTRAP_FILES += $(PAWPAW_PREFIX)/include/armadillo
# ---------------------------------------------------------------------------------------------------------------------
# List of files for mod-app packaging, often symlinks to the real files

TARGETS = build/lib-ui/libmod_utils$(SO_EXT)
TARGETS = build-ui/lib/libmod_utils$(SO_EXT)

ifeq ($(MACOS),true)
TARGETS += build/mod-app.app/Contents/Info.plist
Expand All @@ -95,10 +95,9 @@ TARGETS += build/mod-app.app/Contents/MacOS/jack/mod-midi-broadcaster.so
TARGETS += build/mod-app.app/Contents/MacOS/jack/mod-midi-merger.so
TARGETS += build/mod-app.app/Contents/MacOS/libjack.0.dylib
TARGETS += build/mod-app.app/Contents/MacOS/libjackserver.0.dylib
TARGETS += build/mod-app.app/Contents/MacOS/lib-screenshot/library.zip
TARGETS += build/mod-app.app/Contents/MacOS/lib-ui/library.zip
TARGETS += build/mod-app.app/Contents/MacOS/lib/library.zip
TARGETS += build/mod-app.app/Contents/MacOS/mod-app
TARGETS += build/mod-app.app/Contents/MacOS/mod-screenshot
TARGETS += build/mod-app.app/Contents/MacOS/mod-pedalboard
TARGETS += build/mod-app.app/Contents/MacOS/mod-ui
TARGETS += build/mod-app.app/Contents/MacOS/mod
TARGETS += build/mod-app.app/Contents/MacOS/modtools
Expand All @@ -121,10 +120,9 @@ TARGETS += build/jack/jack-session.conf
TARGETS += build/jack/mod-host$(SO_EXT)
TARGETS += build/jack/mod-midi-broadcaster$(SO_EXT)
TARGETS += build/jack/mod-midi-merger$(SO_EXT)
TARGETS += build/lib-screenshot/library.zip
TARGETS += build/lib-ui/library.zip
TARGETS += build/lib/library.zip
TARGETS += build/mod-app$(APP_EXT)
TARGETS += build/mod-screenshot$(APP_EXT)
TARGETS += build/mod-pedalboard$(APP_EXT)
TARGETS += build/mod-ui$(APP_EXT)
TARGETS += build/mod
TARGETS += build/modtools
Expand Down Expand Up @@ -255,7 +253,7 @@ clean:
rm -rf mod-midi-merger/build
rm -rf build
rm -rf build-plugin-stamps
rm -rf build-screenshot
rm -rf build-pedalboard
rm -rf build-ui

plugins: $(foreach PLUGIN,$(PLUGINS),$(call PLUGIN_STAMP,$(PLUGIN)))
Expand Down Expand Up @@ -294,7 +292,7 @@ win64-plugins:

# ---------------------------------------------------------------------------------------------------------------------

build/lib-ui/libmod_utils$(SO_EXT): mod-ui/utils/libmod_utils$(SO_EXT) build/lib-ui/library.zip
build-ui/lib/libmod_utils$(SO_EXT): mod-ui/utils/libmod_utils$(SO_EXT) build/lib/library.zip
ln -sf $(abspath $<) $@
touch $@

Expand All @@ -308,7 +306,7 @@ build/mod-app.app/Contents/Frameworks/Qt%.framework: $(PAWPAW_PREFIX)/lib/Qt%.fr
@mkdir -p build/mod-app.app/Contents/Frameworks
ln -sf $(abspath $<) $@

build/mod-app.app/Contents/MacOS/jackd: $(PAWPAW_PREFIX)/bin/jackd$(APP_EXT)
build/mod-app.app/Contents/MacOS/jackd: $(PAWPAW_PREFIX)/bin/jackd
@mkdir -p build/mod-app.app/Contents/MacOS
ln -sf $(abspath $<) $@

Expand Down Expand Up @@ -336,25 +334,20 @@ build/mod-app.app/Contents/MacOS/libjack%: $(PAWPAW_PREFIX)/lib/libjack%
@mkdir -p build/mod-app.app/Contents/MacOS
ln -sf $(abspath $<) $@

build/mod-app.app/Contents/MacOS/lib-ui/library.zip: build-ui/mod-ui$(APP_EXT)
build/mod-app.app/Contents/MacOS/lib/library.zip: build-pedalboard/mod-pedalboard build-ui/mod-ui
@mkdir -p build
ln -sf $(abspath build-ui/lib) build/mod-app.app/Contents/MacOS/lib-ui
touch $@

build/mod-app.app/Contents/MacOS/lib-screenshot/library.zip: build-screenshot/mod-screenshot$(APP_EXT)
@mkdir -p build
ln -sf $(abspath build-screenshot/lib) build/mod-app.app/Contents/MacOS/lib-screenshot
ln -sf $(abspath build-ui/lib) build/mod-app.app/Contents/MacOS/lib
touch $@

build/mod-app.app/Contents/MacOS/mod-app: systray/mod-app
@mkdir -p build/mod-app.app/Contents/MacOS
cp -v $(abspath $<) $@

build/mod-app.app/Contents/MacOS/mod-screenshot: build-screenshot/mod-screenshot
build/mod-app.app/Contents/MacOS/mod-pedalboard: build-pedalboard/mod-pedalboard
@mkdir -p build/mod-app.app/Contents/MacOS
ln -sf $(abspath $<) $@

build/mod-app.app/Contents/MacOS/mod-ui: build-ui/mod-ui$(APP_EXT)
build/mod-app.app/Contents/MacOS/mod-ui: build-ui/mod-ui
@mkdir -p build/mod-app.app/Contents/MacOS
ln -sf $(abspath $<) $@

Expand Down Expand Up @@ -441,20 +434,21 @@ build/jack/mod-midi-merger$(SO_EXT): mod-midi-merger/build/mod-midi-merger$(SO_E
@mkdir -p build/jack
ln -sf $(abspath $<) $@

build/lib: build-ui/mod-ui$(APP_EXT)
rm -f $@
ln -sf $(abspath build-ui/lib) $@
build/lib/library.zip: build-pedalboard/mod-pedalboard$(APP_EXT) build-ui/mod-ui$(APP_EXT)
@mkdir -p build
rm -f build/lib
ln -sf $(abspath build-ui/lib) build/lib
touch $@

build/mod-app$(APP_EXT): systray/mod-app$(APP_EXT)
@mkdir -p build
ln -sf $(abspath $<) $@

build/mod-ui$(APP_EXT): build-ui/mod-ui$(APP_EXT)
build/mod-pedalboard$(APP_EXT): build-pedalboard/mod-pedalboard$(APP_EXT)
@mkdir -p build
ln -sf $(abspath $<) $@

build/mod-screenshot$(APP_EXT): build-screenshot/mod-screenshot$(APP_EXT)
build/mod-ui$(APP_EXT): build-ui/mod-ui$(APP_EXT)
@mkdir -p build
ln -sf $(abspath $<) $@

Expand Down Expand Up @@ -490,16 +484,6 @@ build/jack/jack_%: $(PAWPAW_PREFIX)/lib/jack/jack_%
@mkdir -p build/jack
ln -sf $(abspath $<) $@

build/lib-ui/library.zip: build-ui/mod-ui$(APP_EXT)
@mkdir -p build
ln -sf $(abspath build-ui/lib) build/lib-ui
touch $@

build/lib-screenshot/library.zip: build-screenshot/mod-screenshot$(APP_EXT)
@mkdir -p build
ln -sf $(abspath build-screenshot/lib) build/lib-screenshot
touch $@

build/libjack%: $(PAWPAW_PREFIX)/lib/libjack%
@mkdir -p build
ln -sf $(abspath $<) $@
Expand Down Expand Up @@ -534,14 +518,24 @@ build/styles/q%.dll: $(PAWPAW_PREFIX)/lib/qt5/plugins/styles/q%.dll

# ---------------------------------------------------------------------------------------------------------------------

build-screenshot/mod-screenshot$(APP_EXT): utils/cxfreeze/mod-screenshot.py utils/cxfreeze/mod-screenshot-setup.py $(BOOTSTRAP_FILES)
./utils/run.sh $(PAWPAW_TARGET) python3 utils/cxfreeze/mod-screenshot.py build_exe
ifeq ($(WINDOWS),true)
PYNSEP = '-'
else
PYNSEP = '_'
endif

build-pedalboard/mod-pedalboard$(APP_EXT): utils/cxfreeze/mod-pedalboard.py utils/cxfreeze/mod-pedalboard-setup.py $(BOOTSTRAP_FILES)
./utils/run.sh $(PAWPAW_TARGET) python3 utils/cxfreeze/mod-pedalboard.py build_exe
rm -rf build-pedalboard/lib/PyQt5
unzip -o build-pedalboard/lib/library.zip mod$(PYNSEP)pedalboard__init__.pyc mod$(PYNSEP)pedalboard__main__.pyc -d build-pedalboard
touch $@

# ---------------------------------------------------------------------------------------------------------------------

build-ui/mod-ui$(APP_EXT): utils/cxfreeze/mod-ui.py utils/cxfreeze/mod-ui-setup.py $(BOOTSTRAP_FILES)
build-ui/mod-ui$(APP_EXT): utils/cxfreeze/mod-ui.py utils/cxfreeze/mod-ui-setup.py build-pedalboard/mod-pedalboard$(APP_EXT)
./utils/run.sh $(PAWPAW_TARGET) python3 utils/cxfreeze/mod-ui.py build_exe
rm -rf build-ui/lib/PyQt5
zip -j build-ui/lib/library.zip build-pedalboard/mod$(PYNSEP)pedalboard__init__.pyc build-pedalboard/mod$(PYNSEP)pedalboard__main__.pyc
touch $@

mod-ui/utils/libmod_utils$(SO_EXT): $(BOOTSTRAP_FILES) mod-ui/utils/utils.h mod-ui/utils/utils_jack.cpp mod-ui/utils/utils_lilv.cpp
Expand Down
2 changes: 1 addition & 1 deletion mod-ui
4 changes: 4 additions & 0 deletions systray/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ CXXFLAGS += $(shell pkg-config --cflags portaudio-2.0)
LDFLAGS += $(shell pkg-config --libs portaudio-2.0)
endif

ifneq ($(MACOS)$(WINDOWS),true)
LDFLAGS += -ldl
endif

ifeq ($(shell pkg-config --exists Qt5Core Qt5Gui Qt5Svg Qt5Widgets && echo true)$(WINDOWS),truefalse)
QT5_HOSTBINS = $(shell pkg-config --variable=host_bins Qt5Core)
QT5_FLAGS = $(shell pkg-config --cflags Qt5Core Qt5Gui Qt5Svg Qt5Widgets)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import sys
import json
import aggdraw
import PIL

ROOT = os.path.abspath(os.path.dirname(sys.argv[0]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@

options = {
"zip_include_packages": ["*"],
"zip_exclude_packages": ["PIL","modtools"],
"replace_paths": [["*",f".{s}lib-screenshot{s}"]],
"build_exe": f".{s}build-screenshot",
"zip_exclude_packages": ["PIL","mod","modtools"],
"replace_paths": [["*",f".{s}lib{s}"]],
"build_exe": f".{s}build-pedalboard",
"optimize": True,
}

exe_options = {
"script": f".{s}utils{s}cxfreeze{s}mod-screenshot-setup.py",
"script": f".{s}utils{s}cxfreeze{s}mod-pedalboard-setup.py",
"copyright": "Copyright (C) 2023 MOD Audio UG",
"targetName": f"mod-screenshot{exe}",
"targetName": f"mod-pedalboard{exe}",
}

setup(name = "mod-screenshot",
setup(name = "mod-pedalboard",
version = "0.0.0",
description = "MOD Pedalboard screenshot",
description = "MOD Pedalboard tools",
options = {"build_exe": options},
executables = [Executable(**exe_options)])

Expand Down
4 changes: 3 additions & 1 deletion utils/cxfreeze/mod-ui-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import sys
import json
import uuid
import aggdraw
import PIL
from tornado import gen, iostream, web, websocket

ROOT = os.path.abspath(os.path.dirname(sys.argv[0]))
DATA_DIR = os.getenv('MOD_DATA_DIR')
DATA_DIR = os.getenv('MOD_DATA_DIR', os.path.join(ROOT, 'data'))

sys.path = [ROOT] + sys.path

Expand Down
4 changes: 2 additions & 2 deletions utils/cxfreeze/mod-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

options = {
"zip_include_packages": ["*"],
"zip_exclude_packages": ["mod","modtools"],
"replace_paths": [["*",f".{s}lib-ui{s}"]],
"zip_exclude_packages": ["PIL","mod","modtools","PyQt5"],
"replace_paths": [["*",f".{s}lib{s}"]],
"build_exe": f".{s}build-ui",
"optimize": True,
}
Expand Down
3 changes: 1 addition & 2 deletions utils/win64/win64-installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ Source: "..\..\build\html\resources\*.html"; DestDir: "{app}\html\resources"; Fl
Source: "..\..\build\html\resources\pedals\*.css"; DestDir: "{app}\html\resources\pedals"; Flags: ignoreversion;
Source: "..\..\build\html\resources\pedals\*.png"; DestDir: "{app}\html\resources\pedals"; Flags: ignoreversion;
Source: "..\..\build\html\resources\templates\*.html"; DestDir: "{app}\html\resources\templates"; Flags: ignoreversion;
Source: "..\..\build\lib-screenshot\*.*"; DestDir: "{app}\lib-screenshot"; Flags: ignoreversion;
Source: "..\..\build\lib-ui\*.*"; DestDir: "{app}\lib-ui"; Flags: ignoreversion;
Source: "..\..\build\lib\*.*"; DestDir: "{app}\lib"; Flags: ignoreversion;
Source: "..\..\build\mod\*.py"; DestDir: "{app}\mod"; Flags: ignoreversion;
Source: "..\..\build\mod\communication\*.py"; DestDir: "{app}\mod\communication"; Flags: ignoreversion;
Source: "..\..\build\modtools\*.py"; DestDir: "{app}\modtools"; Flags: ignoreversion;
Expand Down

0 comments on commit 97f21ae

Please sign in to comment.