Files
meta-musicians/recipes-musicians/ardour/ardour5/waf-backport/0004-Tweaks-to-build-package-scripts-for-new-waf.patch
Andreas Müller 948e5f2d3d ardour: python3-/out-of-tree-build
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
2020-01-25 23:42:49 +01:00

129 lines
4.7 KiB
Diff

From 5a841ef4624ef4b776e578af80d2397241754b00 Mon Sep 17 00:00:00 2001
From: Robin Gareus <robin@gareus.org>
Date: Wed, 22 Jan 2020 00:47:33 +0100
Subject: [PATCH 5/8] Tweaks to build/package scripts for new waf
* Windows: delete waf installed .dll.a files
* Windows: override waf's conf.env.LIBDIR = conf.env.BINDIR
with explicit --libdir
* Windows: fix asm (`x86_64-w64-mingw32-as` -D flag is for
debug messages, -D defines are not available)
* Mac: override waf adding -install_name (and
-Wl,-compatibility_version -Wl,-current_version)
by moving -dynamiclib from linkflags to ldflags
* Mac: Allow libs with compat version number suffix
(not needed anymore, but may help in the future)
Upstream-Status: Backport [1]
[1] https://github.com/Ardour/ardour/commit/5a841ef4624ef4b776e578af80d2397241754b00
---
libs/ardour/wscript | 7 ++++++-
tools/osx_packaging/osx_build | 2 +-
tools/x-win/compile.sh | 3 ++-
tools/x-win/package.sh | 1 +
wscript | 17 +++++++++++++++++
5 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
index 8a65daaaf0..a27826953a 100644
--- a/libs/ardour/wscript
+++ b/libs/ardour/wscript
@@ -1,6 +1,6 @@
#!/usr/bin/env python
from waflib.extras import autowaf as autowaf
-from waflib import Options
+from waflib import Options, Task, Tools
import os
import sys
import re
@@ -369,6 +369,11 @@ def build(bld):
# micro increment <=> no interface changes
LIBARDOUR_LIB_VERSION = "3.0.0"
+ # remove '${DEFINES_ST:DEFINES}' from run_str.
+ # x86_64-w64-mingw32-as (mingw) -D flag is for debug messages
+ if bld.env['build_target'] == 'mingw':
+ class asm(Task.classes['asm']): run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
+
# operate on copy to avoid adding sources twice
sources = list(libardour_sources)
if bld.is_tracks_build():
diff --git a/tools/osx_packaging/osx_build b/tools/osx_packaging/osx_build
index 2b417b86af..cb681bafd1 100755
--- a/tools/osx_packaging/osx_build
+++ b/tools/osx_packaging/osx_build
@@ -449,7 +449,7 @@ while [ true ] ; do
strip -u -r -arch all $file &>/dev/null
fi
- deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | grep -v "$(basename $file)"`
+ deps=`otool -L $file | awk '{print $1}' | egrep "($GTKSTACK_ROOT|$ARDOURSTACK_ROOT|/opt/|/local/|libs/$STDCPP)" | grep -v 'libjack\.' | egrep -v "$(basename $file .dylib).*.dylib"`
# echo -n "."
for dep in $deps ; do
base=`basename $dep`
diff --git a/tools/x-win/compile.sh b/tools/x-win/compile.sh
index d778e921b5..4f54f6623d 100755
--- a/tools/x-win/compile.sh
+++ b/tools/x-win/compile.sh
@@ -79,7 +79,8 @@ LDFLAGS="-L${PREFIX}/lib" ./waf configure \
--dist-target=mingw \
--also-include=${PREFIX}/include \
$ARDOURCFG \
- --prefix=${PREFIX}
+ --prefix=${PREFIX} \
+ --libdir=${PREFIX}/lib
./waf ${CONCURRENCY}
if [ "$(id -u)" = "0" ]; then
diff --git a/tools/x-win/package.sh b/tools/x-win/package.sh
index bfb7381e41..032c45a192 100755
--- a/tools/x-win/package.sh
+++ b/tools/x-win/package.sh
@@ -200,6 +200,7 @@ cp gtk2_ardour/icons/cursor_square/* $DESTDIR/share/${LOWERCASE_DIRNAME}/icons/
# clean build-dir after depoyment
echo " === bundle completed, cleaning up"
./waf uninstall
+find $DESTDIR -name "*.dll.a" | xargs rm
echo " === complete"
du -sh $DESTDIR
diff --git a/wscript b/wscript
index d4724ecb72..9fd84bb2ca 100644
--- a/wscript
+++ b/wscript
@@ -915,6 +915,12 @@ def configure(conf):
conf.env.append_value ('CXXFLAGS', '-DSILENCE_AFTER')
conf.define ('FREEBIE', 1)
+ # set explicit LIBDIR, otherwise mingw/windows builds use
+ # conf.env.LIBDIR = conf.env.BINDIR and `waf install` fails
+ # because $BINDIR/ardour6 is the main binary, and $LIBDIR/ardour6/ a directory
+ if Options.options.libdir:
+ conf.env.LIBDIR = Options.options.libdir
+
if Options.options.lv2dir:
conf.env['LV2DIR'] = Options.options.lv2dir
else:
@@ -1247,6 +1253,17 @@ int main () { return 0; }
# Fix utterly braindead FLAC include path to not smash assert.h
conf.env['INCLUDES_FLAC'] = []
+ if sys.platform == 'darwin':
+ # override waf's -install_name added in
+ # waflib/Tools/ccroot.py when -dynamiclib is used
+ if conf.env.LINKFLAGS_cshlib:
+ conf.env.LINKFLAGS_cshlib = [];
+ conf.env.LDFLAGS_cshlib = ['-dynamiclib']
+
+ if conf.env.LINKFLAGS_cxxshlib:
+ conf.env.LINKFLAGS_cxxshlib = [];
+ conf.env.LDFLAGS_cxxshlib = ['-dynamiclib']
+
config_text = open('libs/ardour/config_text.cc', "w")
config_text.write('''#include "ardour/ardour.h"
namespace ARDOUR {
--
2.21.0