From 42972152fd82549fae96e2afb742ab58fc4235dc Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 21 Sep 2023 13:34:20 +0200 Subject: [PATCH] More MOD build tweaks Signed-off-by: falkTX --- build-mod-plugin.sh | 1 + setup/mod-audio/app.py | 31 +++++++++++++++++++++++++++++++ setup/mod-audio/app.sh | 30 ++++++++++++++++++++++++++++++ setup/mod-audio/builder.mk | 30 +++++++++++++++++++++++------- 4 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 setup/mod-audio/app.py create mode 100755 setup/mod-audio/app.sh diff --git a/build-mod-plugin.sh b/build-mod-plugin.sh index 8594701..94484e5 100755 --- a/build-mod-plugin.sh +++ b/build-mod-plugin.sh @@ -56,6 +56,7 @@ export CMAKE export PAWPAW_BUILDDIR export PAWPAW_DOWNLOADDIR export PAWPAW_PREFIX +export TOOLCHAIN_PREFIX if [ ! -e mod-plugin-builder ]; then echo "missing mod-plugin-builder" diff --git a/setup/mod-audio/app.py b/setup/mod-audio/app.py new file mode 100644 index 0000000..1883be5 --- /dev/null +++ b/setup/mod-audio/app.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# ------------------------------------------------------------------------------------------------------------ +# Imports (cx_Freeze) + +from cx_Freeze import setup, Executable + +# ------------------------------------------------------------------------------------------------------------ + +options = { + "zip_include_packages": ["*"], + "zip_exclude_packages": ["mod","modtools"], + "replace_paths": [["*",".\\lib\\"]], + "build_exe": ".\\build", + "optimize": True, +} + +exe_options = { + "script": ".\\server.py", + "copyright": "Copyright (C) 2023 MOD Audio UG", + "targetName": "mod-ui.exe", +} + +setup(name = "mod-ui", + version = "0.0.0", + description = "MOD Web interface", + options = {"build_exe": options}, + executables = [Executable(**exe_options)]) + +# ------------------------------------------------------------------------------------------------------------ diff --git a/setup/mod-audio/app.sh b/setup/mod-audio/app.sh new file mode 100755 index 0000000..295cb59 --- /dev/null +++ b/setup/mod-audio/app.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -e + +cd $(dirname ${0})/../.. +PAWPAW_ROOT="${PWD}" + +# --------------------------------------------------------------------------------------------------------------------- +# check target + +target="${1}" + +if [ -z "${target}" ]; then + echo "usage: ${0} " + exit 1 +fi + +# --------------------------------------------------------------------------------------------------------------------- + +export PAWPAW_SKIP_LTO=1 +source local.env win64 + +# export PYTHONPATH="$(pwd);${PAWPAW_PREFIX}/lib/python3.8/site-packages" +export PYTHONPATH="Z:\\home\\falktx\\PawPawBuilds\\targets\\win64\\lib\\python3.8\\site-packages" + +cd ../../MOD/mod-ui +# rm -rf build +${EXE_WRAPPER} "${PAWPAW_PREFIX}/bin/python3${APP_EXT}" "${PAWPAW_ROOT}/setup/mod-audio/app.py" build_exe + +# --------------------------------------------------------------------------------------------------------------------- diff --git a/setup/mod-audio/builder.mk b/setup/mod-audio/builder.mk index 4f7203c..a828414 100644 --- a/setup/mod-audio/builder.mk +++ b/setup/mod-audio/builder.mk @@ -31,8 +31,10 @@ endef $(eval $(call caseconvert-helper,UPPERCASE,$(join $(addsuffix :,$([FROM])),$([TO])))) $(eval $(call caseconvert-helper,LOWERCASE,$(join $(addsuffix :,$([TO])),$([FROM])))) -space = -space += +# utilities +blank = +comma = , +space = $(blank) $(blank) # Sanitize macro cleans up generic strings so it can be used as a filename # and in rules. Particularly useful for VCS version strings, that can contain @@ -61,12 +63,29 @@ TARGET_LDFLAGS = $(LDFLAGS) TARGET_DIR = $(PAWPAW_PREFIX) +ifeq ($(MACOS),true) +libtoolize = glibtoolize +else +libtoolize = libtoolize +endif + +ifeq ($(MACOS),true) +STRIP = true +else ifeq ($(WINDOWS),true) +BR2_SKIP_LTO = y +endif + +ifneq ($(TOOLCHAIN_PREFIX),) +BR2_EXTRA_CONFIGURE_OPTS = --host=$(TOOLCHAIN_PREFIX) ac_cv_build=$(shell uname -m)-linux-gnu ac_cv_host=$(TOOLCHAIN_PREFIX) +endif + define generic-package endef define autotools-package + define $$(PKG)_CONFIGURE_CMDS (cd $$($$(PKG)_BUILDDIR) && \ ./configure \ @@ -75,6 +94,7 @@ define $$(PKG)_CONFIGURE_CMDS --disable-docs \ --disable-maintainer-mode \ --prefix='/usr' \ + $(BR2_EXTRA_CONFIGURE_OPTS) \ $$($$(PKG)_CONF_OPTS) \ ) endef @@ -138,10 +158,6 @@ STAMP_INSTALLED = $($(PKG)_BUILDDIR)/.stamp_installed PAWPAW_TMPDIR = /tmp/PawPaw PAWPAW_TMPNAME = git-dl -ifeq ($(MACOS),true) -STRIP = true -endif - all: $(STAMP_INSTALLED) $(STAMP_INSTALLED): $(STAMP_BUILT) @@ -169,7 +185,7 @@ $(STAMP_CONFIGURED): $(STAMP_PATCHED) ifeq ($($(PKG)_AUTORECONF),YES) (cd $($(PKG)_BUILDDIR) && \ aclocal --force && \ - glibtoolize --force --automake --copy && \ + $(libtoolize) --force --automake --copy && \ autoheader --force && \ autoconf --force && \ automake -a --copy \