Commit 8e46bfe6 authored by Jonathan Wilkes's avatar Jonathan Wilkes

Merge branch 'aggraef/purr-data-taremup-fixes'

parents fa9c517a c1d1e9f2
# Toplevel Makefile for Purr Data. Please note that at present this is just a
# thin wrapper around l2ork_addons/tar_em_up.sh, the traditional Pd-l2ork
# build script.
# The Pd-l2ork build system is very arcane and intricate. Its main purpose is
# putting together a staging area with a complete Pd-l2ork installation and
# then building installers for the supported platforms from that, pulling
# together a bunch of separate packages, each with their own build system.
# Compiling sources is just one of the tasks that the builder does. Therefore
# you'll notice that, unlike with other less complicated source packages,
# `make` will rebuild lots of things even if you just finished another build.
# The available build targets are:
# all: produce a native installer for the host platform (equivalent to
# `tar_em_up.sh -Tk`); note that in order to force a complete rebuild (like
# what `tar_em_up.sh -T` does), you'll have to run `make clean` first
# incremental: like `all`, but does an "incremental build" (equivalent to
# `tar_em_up.sh -tk`), bypassing Gem which takes an eternity to compile; please
# check the tar_em_up.sh script for details
# light: like `incremental`, but does a light build (equivalent to
# `tar_em_up.sh -tkl`) which only includes the most essential externals;
# please check the tar_em_up.sh script for details
# checkout: convenience target to check out all submodules in preparation for
# a subsequent build (the `all`, `incremental` and `dist` targets also do this
# automatically when needed)
# clean: does something similar to what `tar_em_up.sh` does in order to start
# from a clean slate, so that a subsequent build starts from scratch again
# realclean: put the sources into pristine state again (WARNING: this will get
# rid of any uncommitted source changes, too); use this as a last resort to
# get the sources into a compilable state again after things have gone awry
# dist: create a self-contained distribution tarball of the source
# NOTES:
# The incremental and light builds assume an existing staging area
# (packages/*/build directory) which is *not* cleaned before installing. This
# makes it possible to update the existing staging area after recompiling just
# a part of the system (all but Gem in the case of "incremental", only the
# Pd core and a few essential externals in the case of "light"). Use `make
# clean` beforehand if you want to install into a clean staging area.
# The realclean and dist targets use git commands and thus only work in a
# working copy of the git repo, not in the static tarball snapshots produced
# by the dist target.
# On Linux systems running `make` will try to produce a Debian package. On
# Linux distributions like Arch which are no Debian derivatives, the Debian
# packaging tools are not available. In this case, `make` will stop right
# before creating the actual package and leave the ready-made staged
# installation tree under `packages/linux_make/build` from where it can be
# copied or packaged up in any desired way.
.PHONY: all incremental checkout clean realclean dist
# Installation prefix under which Pd-l2ork is installed (Linux only). If this
# isn't set, a default location will be used (usually /usr/local). NOTE: We
# *always* assume that this variable is set properly in the install targets
# (see below).
prefix = /usr
ifneq ($(prefix),)
env = inst_dir="$(prefix)"
endif
all:
cd l2ork_addons && $(env) ./tar_em_up.sh -Tk
incremental:
cd l2ork_addons && $(env) ./tar_em_up.sh -tk
light:
cd l2ork_addons && $(env) ./tar_em_up.sh -tkl
checkout:
git submodule update --init
clean:
test "$(shell uname -s)" = "Darwin" && make -C packages/darwin_app clean || true
cd pd/src && aclocal && autoconf && make clean || true
cd externals/miXed && make clean || true
cd Gem/src/ && test -f Makefile && make distclean || true
cd Gem/src/ && rm -rf ./.libs && rm -rf ./*/.libs || true
cd Gem/ && test -f Makefile && make distclean || true
cd Gem/ && rm -f gemglutwindow.pd_linux Gem.pd_linux || true
rm -rf packages/*/build/
realclean:
# This requires a working copy of the git repo.
@test -d .git || (echo "Not a git repository, bailing out." && false)
git submodule deinit --all -f
git checkout .
git clean -dffx -e pd/nw/nw/
# Installation targets. These don't work on Mac and Windows right now, you
# should use the generated installers on these systems instead. Also,
# $(prefix) must be set. $(DESTDIR) is supported as well, so you can do staged
# installs (but then again presumably you already have a staged install
# sitting in packages/*/build, so you might as well use that instead).
# Note that these targets simply (un)install whatever is in the
# packages/*/build directory at the time they're invoked, so you need to run
# `make` (or `make incremental`, etc.) first. Also note that some old cruft
# under build/etc (all but the bash auto-completions) isn't installed as it
# isn't needed on modern Linux systems any more.
builddir = $(firstword $(wildcard packages/*/build))
manifest = etc/bash_completion.d/pd-l2ork $(prefix:/%=%)/include/pd-l2ork $(prefix:/%=%)/lib/pd-l2ork $(patsubst $(builddir)/%,%, $(wildcard $(builddir)/$(prefix:/%=%)/bin/*) $(shell find $(builddir)/usr/share -type f))
install:
test -z "$(DESTDIR)" || (rm -rf "$(DESTDIR)" && mkdir -p "$(DESTDIR)")
tar -c -C $(builddir) $(manifest) | tar -x -C $(DESTDIR)/
# Edit the library paths in the default user.settings file so that it matches
# our installation prefix.
test -f "$(DESTDIR)"$(prefix)/lib/pd-l2ork/default.settings && cd "$(DESTDIR)"$(prefix)/lib/pd-l2ork && sed -e "s!/usr/lib/pd-l2ork!$(prefix)/lib/pd-l2ork!g" -i default.settings || true
uninstall:
rm -rf $(addprefix $(DESTDIR)/, $(manifest))
# Build a self-contained distribution tarball (snapshot). This is pretty much
# the same as in debuild/Makefile and must be run in a working copy of the git
# repo.
# The Debian version gets derived from the date and serial number of the last
# commit.
debversion = $(shell grep PD_L2ORK_VERSION pd/src/m_pd.h | sed 's|^.define *PD_L2ORK_VERSION *"\(.*\)".*|\1|')+git$(shell test -d .git && git rev-list --count HEAD)+$(shell test -d .git && git rev-parse --short HEAD)
# Source tarball and folder.
debsrc = purr-data_$(debversion).orig.tar.gz
debdist = purr-data-$(debversion)
# Submodules (Gem, etc.).
submodules = $(sort $(shell test -d .git && (git config --file .gitmodules --get-regexp path | awk '{ print $$2 }')))
dist: $(debsrc)
# Determine the build version which needs git to be computed, so we can't do
# it in a stand-alone build from a tarball.
PD_BUILD_VERSION := $(shell test -d .git && (git log -1 --format=%cd --date=short | sed -e 's/-//g'))-rev.$(shell test -d .git && git rev-parse --short HEAD)
$(debsrc):
@test -d .git || (echo "Not a git repository, bailing out." && false)
rm -rf $(debdist)
# Make sure that the submodules are initialized.
git submodule update --init
# Grab the main source.
git archive --format=tar.gz --prefix=$(debdist)/ HEAD | tar xfz -
# Grab the submodules.
for x in $(submodules); do (cd $(debdist) && rm -rf $$x && git -C ../$$x archive --format=tar.gz --prefix=$$x/ HEAD | tar xfz -); done
# Pre-generate and put s_stuff.h into the tarball (see above; the build
# version is generated using git which can't be done outside the git repo).
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' pd/src/s_stuff.h.in > $(debdist)/pd/src/s_stuff.h
# Create the source tarball.
tar cfz $(debsrc) $(debdist)
rm -rf $(debdist)
......@@ -87,6 +87,15 @@ from the following site:
### Build Guide
**NOTE:** The instructions below talk about running the `tar_em_up.sh` build
script, which is still the recommended way to build Purr Data right now.
However, Purr Data also has a new (and experimental) toplevel Makefile so that
just typing `make` will build the package. You may find this easier. The
Makefile also offers the customary targets to clean (`make clean`, or
`make realclean` to put the sources in pristine state again) and to roll a
self-contained distribution tarball (`make dist`). Please check the comments
at the beginning of the Makefile for more information.
#### Linux
Time to build: *40 minutes to 1.5 hours*
......
......@@ -76,13 +76,6 @@ deb: $(debsrc) $(addprefix debian/nwjs/, $(nwjs))
tar xfz $(debsrc)
# Add the NW.js binaries to the source package.
cd debian/source && rm -f include-binaries && for x in $(addprefix debian/nwjs/, $(nwjs)); do echo "$$x" >> include-binaries; done
# This works around some problems compiling externals on Precise and earlier
# (patch from pd-extended by Hans-Christoph Steiner, modified for pd-l2ork).
# This can be removed once Ubuntu 12.04 finally goes the way of the dodo.
# cd $(debdist) && patch -p1 < ../precise-configure.patch
# Patch the user config dir name so that purr-data can coexist with pd-l2ork.
# Not needed with purr-data 2.4.5+ any more.
# cd $(debdist) && patch -Np1 < ../userconfig.patch
# Make sure to copy the Debian files which may have uncommitted changes.
# Then run debuild to create the package.
cd $(debdist) && cp -R ../debian . && debuild $(DEBUILD_FLAGS)
......@@ -90,13 +83,13 @@ deb: $(debsrc) $(addprefix debian/nwjs/, $(nwjs))
rm -rf $(debdist)
debsrc:
$(MAKE) deb DEBUILD_FLAGS=-S
$(MAKE) deb DEBUILD_FLAGS="-S -d"
deb-us:
$(MAKE) deb DEBUILD_FLAGS="-us -uc"
debsrc-us:
$(MAKE) deb DEBUILD_FLAGS="-S -us -uc"
$(MAKE) deb DEBUILD_FLAGS="-S -d -us -uc"
# Determine the build version which needs git to be computed, so we can't do
# it in a stand-alone build from a tarball.
......@@ -113,9 +106,6 @@ $(debsrc):
# Pre-generate and put s_stuff.h into the tarball (see above; the build
# version is generated using git which can't be done outside the git repo).
sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' ../pd/src/s_stuff.h.in > $(debdist)/pd/src/s_stuff.h
# Patch packages/Makefile so that we do *not* try to regenerate s_stuff.h
# during the build.
cd $(debdist) && patch -p1 < ../packages-Makefile.patch
# Create the source tarball.
tar cfz $(debsrc) $(debdist)
rm -rf $(debdist)
......
purr-data (2.4.9+git3840+b9f17566-1) bionic; urgency=low
* Build from latest upstream source.
-- Albert Graef <aggraef@gmail.com> Fri, 09 Mar 2018 10:45:41 +0100
purr-data (2.0+git3322+50e3805-1) xenial; urgency=low
* Build from latest upstream source.
......
......@@ -25,6 +25,8 @@ prefix = /opt/purr-data
override_dh_auto_configure:
override_dh_auto_clean:
override_dh_auto_build:
# Copy the nw.js sources to where purr-data wants them.
tar -xf debian/nwjs/$(nwjspkg)-$(arch).tar.gz && rm -rf pd/nw/nw && mv $(nwjspkg)-$(arch) pd/nw/nw
......
diff --git a/packages/Makefile b/packages/Makefile
index f5c1f8c0..0a285b52 100644
--- a/packages/Makefile
+++ b/packages/Makefile
@@ -373,12 +373,14 @@ doc_format:
# AG: The set_version target is broken since it modifies m_pd.h in-place
# during the build, which is a bad thing to do to files which are supposed to
# be kept in a source code repository. Instead, we create s_stuff.h from
-# s_stuff.h.in, where the latter is kept in the repo and the former gets created
-# from the latter by substituting PD_BUILD_VERSION.
+# s_stuff.h.in, where the latter is kept in the repo and the former gets
+# created from the latter by substituting PD_BUILD_VERSION. (Only try to do
+# this if we're actually in the git repo, otherwise we'll get an empty
+# revision number.)
git_version: $(pd_src)/src/s_stuff.h.in
- cd $(pd_src)/src/ && \
- sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_stuff.h.in > s_stuff.h
+ test -d $(cvs_root_dir)/.git && cd $(pd_src)/src/ && \
+ sed 's|^\(#define PD_BUILD_VERSION "\).*"|\1$(PD_BUILD_VERSION)"|' s_stuff.h.in > s_stuff.h || true
set_version:
# change Pd's version number to reflect the extended build
@@ -421,7 +423,7 @@ distclean: cruft_clean
$(MAKE) -C $(abstractions_src) distclean
$(MAKE) -C $(extensions_src) distclean
$(MAKE) -C $(externals_src) distclean
- -$(MAKE) -C $(pd_src) distclean
+ -$(MAKE) -C $(pd_src) clean
test_locations:
@echo "PD_VERSION: $(PD_VERSION)"
Fix up LDFLAGS for Precise and earlier (patch by Hans-Christoph Steiner,
updated to pd-l2ork by Albert Graef).
Description: fix ./configure dying thinking we're cross-compiling
When building using debuild on Debian/squeeze or Ubuntu < quantal,
./configure somehow gets some LDFLAGS for shared libraries and uses them in
the gcc tests. The executable then fails to run since its a shared library,
and ./configure thinks we're cross-compiling. This patch forces no LDFLAGS.
diff --git a/externals/Makefile b/externals/Makefile
index 7b64f45..6b7c49b 100644
--- a/externals/Makefile
+++ b/externals/Makefile
@@ -611,6 +611,7 @@ $(gem_src)/Gem.pd_linux: $(gem_src)/configure
test -s $(gem_src)/Gem.pd_linux || \
cd $(gem_src) && ./configure \
CXXFLAGS="-DHAVE_S_STUFF_H" \
+ LDFLAGS= \
--prefix=$(prefix) \
--with-video=plugins \
--with-film=plugins \
@@ -649,7 +650,7 @@ $(externals_src)/gem2pdp/configure: $(externals_src)/gem2pdp/configure.ac
cd $(externals_src)/gem2pdp && aclocal && autoconf
$(externals_src)/gem2pdp/Makefile: $(externals_src)/gem2pdp/Makefile.in
- cd $(externals_src)/gem2pdp && ./configure --with-pddir=$(pd_src) \
+ cd $(externals_src)/gem2pdp && ./configure LDFLAGS= --with-pddir=$(pd_src) \
--with-gemdir=$(gem_src) --with-pdpdir=$(externals_src)/pdp
gem2pdp: $(externals_src)/gem2pdp/configure $(externals_src)/gem2pdp/Makefile
@@ -885,7 +886,7 @@ $(IEM16_DIR)/configure: $(IEM16_DIR)/configure.ac $(IEM16_DIR)/aclocal.m4
$(IEM16_DIR)/Make.config: $(IEM16_DIR)/Make.config.in \
$(IEM16_DIR)/configure
- cd $(IEM16_DIR) && ./configure --disable-library \
+ cd $(IEM16_DIR) && ./configure LDFLAGS= --disable-library \
--with-pd=$(pd_src)
iem16: $(IEM16_DIR)/Make.config
@@ -1269,11 +1270,11 @@ $(externals_src)/OSCx/configure: $(externals_src)/OSCx/configure.ac
cd $(externals_src)/OSCx && autoconf
$(externals_src)/OSCx/Makefile: $(externals_src)/OSCx/Makefile.in
- cd $(externals_src)/OSCx && ./configure
+ cd $(externals_src)/OSCx && ./configure LDFLAGS=
$(externals_src)/OSCx/libOSC/Makefile: $(externals_src)/OSCx/libOSC/Makefile.in
- cd $(externals_src)/OSCx && ./configure
+ cd $(externals_src)/OSCx && ./configure LDFLAGS=
$(externals_src)/OSCx/src/Makefile: $(externals_src)/OSCx/src/Makefile.in
- cd $(externals_src)/OSCx && ./configure
+ cd $(externals_src)/OSCx && ./configure LDFLAGS=
$(externals_src)/OSCx/src/OSCroute.$(EXTENSION): $(externals_src)/OSCx/configure \
$(externals_src)/OSCx/Makefile
@@ -1356,7 +1357,7 @@ $(externals_src)/pdp/configure: $(externals_src)/pdp/configure.ac
cd $(externals_src)/pdp && autoconf
$(externals_src)/pdp/Makefile.config: $(externals_src)/pdp/configure $(externals_src)/pdp/Makefile.config.in
- cd $(externals_src)/pdp && ./configure PD_CPPFLAGS="-I$(pd_src)/src" \
+ cd $(externals_src)/pdp && ./configure LDFLAGS= PD_CPPFLAGS="-I$(pd_src)/src" \
$(PDP_OPTIONS)
$(externals_src)/pdp/pdp.$(EXTENSION): $(externals_src)/pdp/Makefile.config
@@ -1770,6 +1771,7 @@ $(zexy_src)/configure: $(zexy_src)/configure.ac
$(zexy_src)/Makefile: $(zexy_src)/configure $(zexy_src)/Makefile.am $(zexy_src)/src/Makefile.am
cd $(zexy_src) && ./configure --disable-library \
+ LDFLAGS= \
--with-extension=$(EXTENSION) \
--prefix=$(prefix) \
--libdir=$(objectsdir) \
diff --git a/externals/iem16/src/Makefile b/externals/iem16/src/Makefile
index 25e5bbe..5be876d 100644
--- a/externals/iem16/src/Makefile
+++ b/externals/iem16/src/Makefile
@@ -22,7 +22,7 @@ aclocal.m4: acinclude.m4
aclocal
Make.config: Make.config.in configure
- ./configure $(CONFIGUREFLAGS)
+ ./configure $(CONFIGUREFLAGS) LDFLAGS=
-include $(SOURCES:.c=.d)
diff --git a/externals/moocow/extended/Makefile b/externals/moocow/extended/Makefile
index 2726d1a..9da4944 100644
--- a/externals/moocow/extended/Makefile
+++ b/externals/moocow/extended/Makefile
@@ -36,7 +36,7 @@ MOOCOW_BUILD_VERSION ?=2009-04-27.002
# CFLAGS="$(shell echo $(CFLAGS))" ##-- works
CONFIGURE_ARGS=\
CFLAGS="$(CFLAGS) -I/sw/include" \
- LDFLAGS="$(LDFLAGS) -L$(pd_src)/src -L$(pd_src)/bin -L$(pd_src)/obj -L/sw/lib" \
+ LDFLAGS="-L$(pd_src)/src -L$(pd_src)/bin -L$(pd_src)/obj -L/sw/lib" \
--with-pd-include="$(pd_src)/src" \
--with-pd-dir="$(MOOCOW_BUILD)" \
--disable-dependency-tracking
diff --git a/pd/src/s_file.c b/pd/src/s_file.c
index 32f54c31..304524d5 100644
--- a/pd/src/s_file.c
+++ b/pd/src/s_file.c
@@ -46,7 +46,7 @@ void sys_doflags( void);
#ifdef UNIX
-#define USER_CONFIG_DIR ".pd-l2ork"
+#define USER_CONFIG_DIR ".purr-data"
static char *sys_prefbuf;
......@@ -129,7 +129,13 @@ CXXFLAGS = $(CFLAGS)
#
# WARNING! this MUST be all on one line because the automatic package
# building scripts rely on it being that way.
ifeq ($(LIGHT),yes)
# minimal set of extensions for the "light" build
LIB_TARGETS = loaders-libdir pddp
INCREMENTAL = yes
else
LIB_TARGETS = adaptive arraysize autotune bassemu boids bsaylor comport creb cxc cyclone disis earplug ekext ext13 fftease fluid freeverb ggee hcs iem_ambi iem_bin_ambi iemlib iemgui iemguts iem_adaptfilt iemmatrix iemxmlrpc iem_delay iem_roomsim iem_spec2 iem_tab jasch_lib loaders-libdir lyonpotpourri mapping markex maxlib mjlib moocow moonlib motex mrpeach oscx pan pdcontainer pddp pdogg plugin pmpd rjlib sigpack smlib tof unauthorized vbap windowing zexy
endif
# DISABLED: flatgui
......@@ -137,7 +143,9 @@ LIB_TARGETS = adaptive arraysize autotune bassemu boids bsaylor comport creb cxc
# this is for libraries that don't compile (yet) on all platforms
ifeq ($(OS_NAME),windows)
LIB_TARGETS += gem
ifneq ($(INCREMENTAL),yes)
LIB_TARGETS += gem
endif
else
ifeq ($(OS_NAME),darwin)
# on Mac OS X 10.6/Snow Leopard don't build hid since it needs Carbon
......@@ -145,8 +153,9 @@ else
ifneq ($(shell uname -r | sed 's|10\.[0-9][0-9]*\.[0-9][0-9]*|10|'),10)
LIB_TARGETS +=
endif
else
# GNU/Linux, BSD, IRIX, etc. (we use exported variable INCREMENTAL to avoid rebuilding entire Gem lib that takes a long time to compile)
else ifneq ($(LIGHT),yes)
# GNU/Linux, BSD, IRIX, etc. (we use exported variable INCREMENTAL to
# avoid rebuilding entire Gem lib that takes a long time to compile)
ifeq ($(INCREMENTAL),yes)
LIB_TARGETS += hid pdp iem16
else
......
......@@ -2,48 +2,66 @@
# super-simplistic installer for l2ork things by Ivica Ico Bukvic <ico@vt.edu>
# for info on L2Ork visit http://l2ork.music.vt.edu
cleanup() {
# maybe we'd want to do some actual cleanup here
test $2 -ne 0 && echo "$0: $1: command failed with exit code $2, exiting now." && echo "$0: $1: $BASH_COMMAND"
exit $2
}
trap 'cleanup $LINENO $?' ERR
if [ $# -eq 0 ] # should check for no arguments
then
echo
echo " Usage: ./tar_em_up.sh -option1 -option2 ..."
echo " Options:"
echo " -a l2ork addon to the dev package"
echo " -b build a deb (incremental, all platforms)"
echo " -B build a deb (complete recompile)"
echo " -b build a Debian package (incremental)"
echo " -B build a Debian package (complete recompile)"
echo " -c core Pd source tarball"
echo " -e everything"
echo " -f full installer (incremental)"
echo " -F full installer (complete recompile)"
echo " -f full tarball installer (incremental)"
echo " -F full tarball installer (complete recompile)"
echo " -k keep previous build products"
echo " -l do a light build (only essential externals)"
echo " -n skip package creation (-bB, -fF)"
echo " -R build a Raspberry Pi deb (complete recompile)"
echo " -r build a Raspberry Pi deb (incremental)"
echo " -w install custom version of cwiid system-wide"
echo " -R build a Raspberry Pi deb (complete recompile)"
echo " -t auto-detect target (incremental)"
echo " -T auto-detect target (complete recompile)"
echo " -X build an OSX installer (dmg)"
echo " -z build a Windows installer (incremental)"
echo " -Z build a Windows installer (complete recompile)"
echo
echo " For custom install locations do the following before"
echo " running this script:"
echo " The incremental options bypass Gem compilation. This saves"
echo " (lots of) time, but the generated package will lack Gem"
echo " unless it has already been built previously. NOTE: Building"
echo " Gem is NOT supported on OSX right now."
echo
echo " The -k (keep) option doesn't clean before compilation,"
echo " preserving the build products from a previous run. This"
echo " also saves time if the script has been run previously."
echo " Not using this option forces a full recompile."
echo
echo " For custom install locations and staged installations"
echo " set the inst_dir environment variable as follows:"
echo
echo " export inst_dir=/some/custom/location"
echo
exit 1
fi
addon=0
deb=0
core=0
full=0
sys_cwiid=0
rpi=0
pkg=1
inno=0
dmg=0
any=0
clean=1
light=0
while getopts ":abBcdefFnRruwXzZ" Option
while getopts ":bBcfFklnRrTtXzZ" Option
do case $Option in
a) addon=1;;
b) deb=1
inst_dir=${inst_dir:-/usr};;
......@@ -52,14 +70,14 @@ do case $Option in
c) core=1;;
e) addon=1
core=1
full=1;;
f) full=1;;
F) full=2;;
k) clean=0;;
l) light=1;;
n) pkg=0;;
R) deb=2
......@@ -70,8 +88,9 @@ do case $Option in
inst_dir=/usr
rpi=1;;
w) sys_cwiid=1
;;
t) any=1;;
T) any=2;;
X) dmg=1
inst_dir=/usr;;
......@@ -88,6 +107,13 @@ done
inst_dir=${inst_dir:-/usr/local}
# configure a light build if requested
if [ $light -gt 0 ]; then
export LIGHT=yes
else
export LIGHT=
fi
export TAR_EM_UP_PREFIX=$inst_dir
# Get the OS we're running under, normalized to names that can be used
......@@ -96,14 +122,46 @@ export TAR_EM_UP_PREFIX=$inst_dir
os=`uname | tr '[:upper:]' '[:lower:]'`
if [[ $os == *"mingw32"* ]]; then
os=win
fi
if [[ $os == "darwin" ]]; then
elif [[ $os == "darwin" ]]; then
os=osx
fi
# Auto-detect the platform and pick an appropriate build target.
if [ $any -gt 0 ]; then
if [[ $os == "osx" ]]; then
dmg=1
elif [[ $os == "win" ]]; then
inno=$any
else
deb=$any
inst_dir=${inst_dir:-/usr}
fi
fi
# Make sure that we don't try to build a tarball on Mac or Windows (that's
# part of packages/linux_make and hence only works on Linux), build a regular
# package for the platform instead.
if [ $full -gt 0 ]; then
if [[ $os == "osx" ]]; then
dmg=1
echo "Warning: tarball installer not supported on Mac, building a dmg installer instead."
elif [[ $os == "win" ]]; then
inno=$full
echo "Warning: tarball installer not supported on Windows, building a Windows installer instead."
fi
full=0
fi
# Automagically disable Debian packaging when the Debian packaging tools are
# not available.
if test $deb -gt 0 && test $pkg -gt 0 && ! test -x /usr/bin/dpkg-deb; then
pkg=0;
echo "Debian toolchain unavailable, Debian packaging disabled"
fi
# Fetch the nw.js binary if we haven't already. We want to fetch it even
# for building with no libs, so we do it regardless of the options
echo nwjs-sdk-v0.16.0-`uname | tr '[:upper:]' '[:lower:]'`
#echo nwjs-sdk-v0.16.0-`uname | tr '[:upper:]' '[:lower:]'`
if [ ! -d "../pd/nw/nw" ]; then
if [ `getconf LONG_BIT` -eq 32 ]; then
arch="ia32"
......@@ -142,7 +200,7 @@ if [ ! -d "../pd/nw/nw" ]; then
nwjs_url=${nwjs_url}/$nwjs_filename
echo "Fetching the nwjs binary from"
echo "$nwjs_url"
wget -nv $nwjs_url || exit 1
wget -nv $nwjs_url
if [[ $os == "win" || $os == "osx" ]]; then
unzip $nwjs_filename
else
......@@ -178,6 +236,8 @@ then
echo "core Pd..."
rm -f ../Pd-l2ork-`date +%Y%m%d`.tar.bz2 2> /dev/null
cd pd/src/
# make sure that Pd is configured before trying to package it
test -f config.h || (aclocal && autoconf && make -C ../../packages pd)
make clean
cd ../../
tar -jcf ./Pd-l2ork-`date +%Y%m%d`.tar.bz2 pd
......@@ -203,23 +263,26 @@ then
if [ $full -eq 2 -o $deb -eq 2 -o $inno -eq 2 -o $dmg -eq 2 ]
then
# echo "Since we are doing a complete recompile we are assuming we will need to install l2ork version of the cwiid library. You will need to remove any existing cwiid libraries manually as they will clash with this one. L2Ork version is fully backwards compatible while also offering unique features like full extension support including the passthrough mode. YOU SHOULD REMOVE EXISTING CWIID LIBRARIES PRIOR TO RUNNING THIS INSTALL... You will also have to enter sudo password to install these... Press any key to continue or CTRL+C to cancel install..."
# read dummy
if [ $clean -eq 0 ]; then
cd externals
else
# clean files that may remain stuck even after doing global make clean (if any)
test $os == "osx" && make -C packages/darwin_app clean || true
cd externals/miXed
make clean
make clean || true # this may fail on 1st attempt
cd ../
make gem_clean
make gem_clean || true # this may fail on 1st attempt
cd ../Gem/src/
make distclean
make distclean || true # this may fail on 1st attempt
rm -rf ./.libs
rm -rf ./*/.libs
cd ../
make distclean