Browse Source

Continue work on linux build scripts, now something that works

tags/v2.1-rc1
falkTX 5 years ago
parent
commit
67d63447b5
7 changed files with 247 additions and 112 deletions
  1. +2
    -2
      data/linux/README
  2. +36
    -0
      data/linux/app-carla-control.py
  3. +36
    -0
      data/linux/app-carla.py
  4. +39
    -0
      data/linux/app-plugin.py
  5. +115
    -90
      data/linux/build-all.sh
  6. +18
    -19
      data/linux/build-pyqt.sh
  7. +1
    -1
      data/linux/common.env

+ 2
- 2
data/linux/README View File

@@ -23,7 +23,7 @@ In experimental phase / work in progress:
* Plugin bridge support (such as running 32bit plugins on a 64bit Carla, or Windows plugins on Linux)
* Run JACK applications as audio plugins

Carla is also available as an LV2 and VST plugin for Linux.
Carla is also available as an LV2 and VST2 plugin for Linux.

For a complete and updated description of Carla, please check:
http://kxstudio.linuxaudio.org/carla
https://kx.studio/carla

+ 36
- 0
data/linux/app-carla-control.py View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ------------------------------------------------------------------------------------------------------------
# Imports (cx_Freeze)

from cx_Freeze import setup, Executable

# ------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)

from carla_host import VERSION

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

options = {
"zip_include_packages": ["*"],
"zip_exclude_packages": ["PyQt5"],
"replace_paths": [["*","./lib/"]],
"build_exe": "./build-carla-control",
"optimize": True,
}

exe_options = {
"script": "./source/frontend/carla-control",
"targetName": "carla-control",
}

setup(name = "CarlaControl",
version = VERSION,
description = "Carla Plugin Host",
options = {"build_exe": options},
executables = [Executable(**exe_options)])

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


+ 36
- 0
data/linux/app-carla.py View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ------------------------------------------------------------------------------------------------------------
# Imports (cx_Freeze)

from cx_Freeze import setup, Executable

# ------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)

from carla_host import VERSION

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

options = {
"zip_include_packages": ["*"],
"zip_exclude_packages": ["PyQt5"],
"replace_paths": [["*","./lib/"]],
"build_exe": "./build-carla",
"optimize": True,
}

exe_options = {
"script": "./source/frontend/carla",
"targetName": "carla",
}

setup(name = "Carla",
version = VERSION,
description = "Carla Plugin Host",
options = {"build_exe": options},
executables = [Executable(**exe_options)])

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


+ 39
- 0
data/linux/app-plugin.py View File

@@ -0,0 +1,39 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# ------------------------------------------------------------------------------------------------------------
# Imports (cx_Freeze)

from cx_Freeze import setup, Executable

# ------------------------------------------------------------------------------------------------------------
# Imports (Custom Stuff)

from carla_host import VERSION
from os import getenv

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

name = getenv("TARGET_NAME")

options = {
"zip_include_packages": ["*"],
"zip_exclude_packages": ["PyQt5"],
"replace_paths": [["*","./lib/"]],
"build_exe": "./build-carla",
"optimize": True,
}

exe_options = {
"script": "./bin/resources/{}".format(name),
"targetName": name,
}

setup(name = "Carla",
version = VERSION,
description = name,
options = {"build_exe": options},
executables = [Executable(**exe_options)])

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


+ 115
- 90
data/linux/build-all.sh View File

@@ -136,9 +136,9 @@ if [ ! -f ${CHROOT_CARLA_DIR}/source/native-plugins/external/README.md ]; then
fi

cd ${CHROOT_CARLA_DIR}
# git checkout .
# git pull
# git submodule update
git checkout .
git pull
git submodule update

# might be updated by git pull
touch data/linux/build-pyqt.sh
@@ -182,15 +182,15 @@ update-ca-certificates

${CHROOT_CARLA_DIR}/data/linux/build-deps.sh ${ARCH}

# if [ ! -f /tmp/setup-repo-packages-extra2 ]; then
if [ ! -f /tmp/setup-repo-packages-extra2 ]; then
apt-get install -y --no-install-recommends libdbus-1-dev libx11-dev libffi-static
# apt-get clean
# touch /tmp/setup-repo-packages-extra2
# fi
apt-get clean
touch /tmp/setup-repo-packages-extra2
fi

${CHROOT_CARLA_DIR}/data/linux/build-pyqt.sh ${ARCH}

apt-get install -y --no-install-recommends libasound2-dev libpulse-dev libgtk2.0-dev libqt4-dev qt4-dev-tools zip
apt-get install -y --no-install-recommends libasound2-dev libpulse-dev libgtk2.0-dev libqt4-dev qt4-dev-tools zip unzip

# if [ x"${ARCH}" != x"32" ]; then
# wget https://launchpad.net/~ubuntu-security-proposed/+archive/ubuntu/ppa/+build/9003691/+files/libgtk-3-dev_3.4.2-0ubuntu0.9_amd64.deb
@@ -227,7 +227,8 @@ export OLDPATH=\${PATH}
export CFLAGS="-I${CHROOT_TARGET_DIR}/carla${ARCH}/include"
export CXXFLAGS=${CFLAGS}
export LDFLAGS="-L${CHROOT_TARGET_DIR}/carla${ARCH}/lib"
export PKG_CONFIG_PATH=${CHROOT_TARGET_DIR}/carla${ARCH}/lib/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig
export PKG_CONFIG_PATH=${CHROOT_TARGET_DIR}/carla${ARCH}/lib/pkgconfig
#:/usr/lib/i386-linux-gnu/pkgconfig
# export PATH=${CHROOT_TARGET_DIR}/carla${ARCH}/bin:\${PATH}
export LINUX=true
export MOC_QT4=/usr/bin/moc-qt4
@@ -237,7 +238,7 @@ export PYUIC5=${CHROOT_TARGET_DIR}/carla${ARCH}/bin/pyuic5

cd ${CHROOT_CARLA_DIR}

make ${MAKE_ARGS} HAVE_GTK3=false
make ${MAKE_ARGS}

if [ x"${ARCH}" != x"32" ]; then
export CFLAGS="-I${CHROOT_TARGET_DIR}/carla32/include -m32"
@@ -318,8 +319,7 @@ chroot_pack_carla()
{

CHROOT_DIR=${TARGETDIR}/chroot${ARCH}
# CXFREEZE_FLAGS="--include-modules=re,sip,subprocess,inspect"
CXFREEZE="${CHROOT_TARGET_DIR}/carla${ARCH}/bin/cxfreeze ${CXFREEZE_FLAGS}"
CHROOT_TARGET_DIR=/root/builds

cat <<EOF | sudo chroot ${CHROOT_DIR}
export HOME=/root
@@ -329,8 +329,9 @@ unset LC_TIME

set -e

export PKG_CONFIG_PATH=${CHROOT_TARGET_DIR}/carla${ARCH}/lib/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig
# export PATH=${CHROOT_TARGET_DIR}/carla${ARCH}/bin:\${PATH}
export PKG_CONFIG_PATH=${CHROOT_TARGET_DIR}/carla${ARCH}/lib/pkgconfig
#:/usr/lib/i386-linux-gnu/pkgconfig
export PATH=${CHROOT_TARGET_DIR}/carla${ARCH}/bin:\${PATH}
export LINUX=true
export MOC_QT4=/usr/bin/moc-qt4
export RCC_QT4=/usr/bin/rcc
@@ -338,6 +339,7 @@ export PYRCC5=${CHROOT_TARGET_DIR}/carla${ARCH}/bin/pyrcc5
export PYUIC5=${CHROOT_TARGET_DIR}/carla${ARCH}/bin/pyuic5

cd ${CHROOT_CARLA_DIR}

rm -rf ./tmp-install
make ${MAKE_ARGS} install DESTDIR=./tmp-install PREFIX=/usr

@@ -347,86 +349,104 @@ make -C data/windows/unzipfx-carla-control -f Makefile.linux ${MAKE_ARGS}
# ---------------------------------------------------------------------------------------------------------------------
# Standalone

# rm -rf build-carla build-carla-control build-lv2 build-vst carla *.zip
# mkdir build-carla
# mkdir build-carla/resources
# mkdir build-carla/src
# mkdir build-carla/src/modgui
# mkdir build-carla/src/patchcanvas
# mkdir build-carla/src/widgets
#
# # cp extra-bins${PKGS_NUM}/* build-carla/
# cp -r ./tmp-install/usr/lib/carla/* build-carla/
# cp -LR ./tmp-install/usr/share/carla/resources/* build-carla/resources/
# cp ./tmp-install/usr/share/carla/carla build-carla/src/
# cp ./tmp-install/usr/share/carla/carla-control build-carla/src/
# cp ./tmp-install/usr/share/carla/*.py build-carla/src/
# cp ./tmp-install/usr/share/carla/modgui/*.py build-carla/src/modgui/
# cp ./tmp-install/usr/share/carla/patchcanvas/*.py build-carla/src/patchcanvas/
# cp ./tmp-install/usr/share/carla/widgets/*.py build-carla/src/widgets/

# mv build-carla/resources/carla-plugin build-carla/resources/carla-plugin.py
# mv build-carla/resources/bigmeter-ui build-carla/resources/bigmeter-ui.py
# mv build-carla/resources/midipattern-ui build-carla/resources/midipattern-ui.py
# mv build-carla/resources/notes-ui build-carla/resources/notes-ui.py

${CXFREEZE} build-carla/src/carla --target-dir=build-carla/
# ${CXFREEZE} build-carla/src/carla-control --target-dir=build-carla-control/
# ${CXFREEZE} build-carla/resources/carla-plugin.py --target-dir=build-carla/resources/
# ${CXFREEZE} build-carla/resources/bigmeter-ui.py --target-dir=build-carla/resources/
# ${CXFREEZE} build-carla/resources/midipattern-ui.py --target-dir=build-carla/resources/
# ${CXFREEZE} build-carla/resources/notes-ui.py --target-dir=build-carla/resources/

# cp /usr/lib/libpython3.2mu.so.1.0 build-carla/
# cp /usr/lib/libffi.so.5 build-carla/
# cp /usr/lib/libssl.so.0.9.8 build-carla/
# cp /usr/lib/libcrypto.so.0.9.8 build-carla/
# cp /lib/libbz2.so.1.0 build-carla/
# cp /lib/libselinux.so.1 build-carla/
# cp /root/builds/carla${ARCH}/share/misc/magic.mgc build-carla/
#
# cp /usr/lib/libpython3.2mu.so.1.0 build-carla-control/
# cp /usr/lib/libffi.so.5 build-carla-control/
# cp /usr/lib/libssl.so.0.9.8 build-carla-control/
# cp /usr/lib/libcrypto.so.0.9.8 build-carla-control/
# cp /lib/libbz2.so.1.0 build-carla-control/
# cp /lib/libselinux.so.1 build-carla-control/
# cp build-carla/libcarla_utils.so build-carla-control/
# cp -r build-carla/styles build-carla-control/

# find build-carla -name "*.py" -delete
# find build-carla -name PyQt4.QtAssistant.so -delete
# find build-carla -name PyQt4.QtNetwork.so -delete
# find build-carla -name PyQt4.QtScript.so -delete
# find build-carla -name PyQt4.QtTest.so -delete
# find build-carla -name PyQt4.QtXml.so -delete
# rm -rf build-carla/src
#
# find build-carla-control -name "*.py" -delete
# find build-carla-control -name PyQt4.QtAssistant.so -delete
# find build-carla-control -name PyQt4.QtNetwork.so -delete
# find build-carla-control -name PyQt4.QtScript.so -delete
# find build-carla-control -name PyQt4.QtTest.so -delete
# find build-carla-control -name PyQt4.QtXml.so -delete
# rm -rf build-carla-control/src

cd build-carla/resources/ && \
rm carla-plugin-patchbay && \
ln -s carla-plugin carla-plugin-patchbay && \
cd ../..
# rm *.so*
# ln -s ../*.so* . &&

false
rm -rf build-carla build-carla-control build-lv2 build-vst carla carla-control *.zip

mkdir build-carla
mkdir build-carla/resources
mkdir build-carla/src
mkdir build-carla/src/modgui
mkdir build-carla/src/patchcanvas
mkdir build-carla/src/widgets

# cp extra-bins${PKGS_NUM}/* build-carla/
cp -r ./tmp-install/usr/lib/carla/* build-carla/
cp -LR ./tmp-install/usr/share/carla/resources/* build-carla/resources/
cp ./tmp-install/usr/share/carla/carla build-carla/src/
cp ./tmp-install/usr/share/carla/carla-control build-carla/src/
cp ./tmp-install/usr/share/carla/*.py build-carla/src/
cp ./tmp-install/usr/share/carla/modgui/*.py build-carla/src/modgui/
cp ./tmp-install/usr/share/carla/patchcanvas/*.py build-carla/src/patchcanvas/
cp ./tmp-install/usr/share/carla/widgets/*.py build-carla/src/widgets/

export PYTHONPATH="./build-carla/src"

# standalone
python3 ./data/linux/app-carla.py build_exe
mv build-carla/lib/library.zip build-carla/lib/library-carla.zip

# plugins
TARGET_NAME="bigmeter-ui" python3 ./data/linux/app-plugin.py build_exe
mv build-carla/lib/library.zip build-carla/lib/library-bigmeter.zip

TARGET_NAME="midipattern-ui" python3 ./data/linux/app-plugin.py build_exe
mv build-carla/lib/library.zip build-carla/lib/library-midipattern.zip

TARGET_NAME="notes-ui" python3 ./data/linux/app-plugin.py build_exe
mv build-carla/lib/library.zip build-carla/lib/library-notes.zip

TARGET_NAME="carla-plugin" python3 ./data/linux/app-plugin.py build_exe
mv build-carla/lib/library.zip build-carla/lib/library-carla-p1.zip

TARGET_NAME="carla-plugin-patchbay" python3 ./data/linux/app-plugin.py build_exe
mv build-carla/lib/library.zip build-carla/lib/library-carla-p2.zip

# carla-control, no merge needed
python3 ./data/linux/app-carla-control.py build_exe

# merge library stuff into one
mkdir build-carla/lib/_lib
pushd build-carla/lib/_lib
unzip -o ../library-bigmeter.zip
unzip -o ../library-midipattern.zip
unzip -o ../library-notes.zip
unzip -o ../library-carla-p1.zip
unzip -o ../library-carla-p2.zip
unzip -o ../library-carla.zip
zip -r -9 ../library.zip *
popd
rm -r build-carla/lib/_lib build-carla/lib/library-*.zip

# move resource binaries into right dir
mv build-carla/{bigmeter-ui,midipattern-ui,notes-ui,carla-plugin} build-carla/resources/
rm build-carla/carla-plugin-patchbay

# symlink for carla-plugin-patchbay and libray.zip
pushd build-carla/resources
rm carla-plugin-patchbay
ln -s carla-plugin carla-plugin-patchbay
ln -s ../lib .
ln -s ../styles .
popd

# magic for filetype detection in carla
cp ${CHROOT_TARGET_DIR}/carla${ARCH}/share/misc/magic.mgc build-carla/

# binaries for carla-control
cp build-carla/libcarla_utils.so build-carla-control/
cp -r build-carla/styles build-carla-control/

# delete unneeded stuff
find build-* -name "*.py" -delete
find build-* -name "*.pyi" -delete
find build-* -name "libQt*" -delete
rm -f build-*/lib/PyQt5/{pylupdate,pyrcc}.so
rm -f build-*/lib/PyQt5/{QtDBus,QtNetwork,QtPrintSupport,QtSql,QtTest,QtXml}.so
rm -f build-carla/carla-bridge-lv2-modgui
rm -f build-carla/libcarla_native-plugin.so
rm -rf build-carla/src
rm -rf build-*/lib/PyQt5/uic
rmdir build-carla/resources/{modgui,patchcanvas,widgets}

mkdir build-lv2
cp -LR ./tmp-install/usr/lib/lv2/carla.lv2 build-lv2/
rm -r build-lv2/carla.lv2/resources
cp -LR build-carla/resources build-lv2/carla.lv2/
cp build-carla/magic.mgc build-lv2/carla.lv2/
cp extra-bins${PKGS_NUM}/* build-lv2/carla.lv2/
rm build-lv2/carla.lv2/resources/*carla*.so build-lv2/carla.lv2/resources/carla-plugin-patchbay
# cp extra-bins${PKGS_NUM}/* build-lv2/carla.lv2/
rm build-lv2/carla.lv2/resources/carla-plugin-patchbay
rm -r build-lv2/carla.lv2/resources/styles
ln -s ../libcarla_utils.so build-lv2/carla.lv2/resources/
ln -s ../styles build-lv2/carla.lv2/resources/
ln -s carla-plugin build-lv2/carla.lv2/resources/carla-plugin-patchbay

mkdir build-vst
@@ -434,11 +454,16 @@ cp -LR ./tmp-install/usr/lib/vst/carla.vst build-vst/
rm -r build-vst/carla.vst/resources
cp -LR build-carla/resources build-vst/carla.vst/
cp build-carla/magic.mgc build-vst/carla.vst/
cp extra-bins${PKGS_NUM}/* build-vst/carla.vst/
rm build-vst/carla.vst/resources/*carla*.so build-vst/carla.vst/resources/carla-plugin-patchbay
# cp extra-bins${PKGS_NUM}/* build-vst/carla.vst/
rm build-vst/carla.vst/resources/carla-plugin-patchbay
rm -r build-vst/carla.vst/resources/styles
ln -s ../libcarla_utils.so build-vst/carla.vst/resources/
ln -s ../styles build-vst/carla.vst/resources/
ln -s carla-plugin build-vst/carla.vst/resources/carla-plugin-patchbay

rm build-{lv2,vst}/carla.*/carla-bridge-lv2-modgui
rm build-{lv2,vst}/carla.*/libcarla_native-plugin.so

mv build-carla carla
zip --symlinks -r -9 carla.zip carla
cat data/windows/unzipfx-carla/unzipfx2cat carla.zip > Carla
@@ -455,9 +480,9 @@ rm -rf ${PKG_FOLDER}${ARCH}
mkdir ${PKG_FOLDER}${ARCH}
cp data/linux/README ${PKG_FOLDER}${ARCH}/
mv Carla CarlaControl build-lv2/*.lv2 build-vst/*.vst ${PKG_FOLDER}${ARCH}/
rmdir build-lv2 build-vst
tar cJf ${PKG_FOLDER}${ARCH}.tar.xz ${PKG_FOLDER}${ARCH}
mv ${PKG_FOLDER}${ARCH}.tar.xz /tmp/
rmdir build-lv2 build-vst

EOF



+ 18
- 19
data/linux/build-pyqt.sh View File

@@ -51,8 +51,6 @@ export LDFLAGS="-m${ARCH} -Wl,-O1"

# TODO build libffi statically

cleanup

# ---------------------------------------------------------------------------------------------------------------------
# python

@@ -105,7 +103,23 @@ if [ ! -f PyQt5_gpl-${PYQT5_VERSION}/build-done ]; then
fi

# ---------------------------------------------------------------------------------------------------------------------
# pyliblo
# cxfreeze

if [ ! -d cx_Freeze-${CXFREEZE_VERSION} ]; then
aria2c https://github.com/anthony-tuininga/cx_Freeze/archive/${CXFREEZE_VERSION}.tar.gz
tar -xf cx_Freeze-${CXFREEZE_VERSION}.tar.gz
fi

if [ ! -f cx_Freeze-${CXFREEZE_VERSION}/build-done ]; then
cd cx_Freeze-${CXFREEZE_VERSION}
python3 setup.py build
python3 setup.py install --prefix=${PREFIX}
touch build-done
cd ..
fi

# ---------------------------------------------------------------------------------------------------------------------
# pyliblo (needs to be last as it modifies CFLAGS)

if [ ! -d pyliblo-${PYLIBLO_VERSION} ]; then
aria2c http://das.nasophon.de/download/pyliblo-${PYLIBLO_VERSION}.tar.gz
@@ -119,6 +133,7 @@ if [ ! -f pyliblo-${PYLIBLO_VERSION}/build-done ]; then
patch -p1 -i ../../macos/patches/pyliblo-python3.7.patch
touch patched
fi
export CFLAGS="${CFLAGS} -I${PREFIX}/include -L${PREFIX}/lib"
python3 setup.py build
python3 setup.py install --prefix=${PREFIX}
touch build-done
@@ -127,22 +142,6 @@ fi

}

# ---------------------------------------------------------------------------------------------------------------------
# cxfreeze

if [ ! -d cx_Freeze-${CXFREEZE_VERSION} ]; then
aria2c https://github.com/anthony-tuininga/cx_Freeze/archive/${CXFREEZE_VERSION}.tar.gz
tar -xf cx_Freeze-${CXFREEZE_VERSION}.tar.gz
fi

if [ ! -f cx_Freeze-${CXFREEZE_VERSION}/build-done ]; then
cd cx_Freeze-${CXFREEZE_VERSION}
python3 setup.py build
python3 setup.py install --prefix=${PREFIX}
touch build-done
cd ..
fi

# ---------------------------------------------------------------------------------------------------------------------
# build base libs



+ 1
- 1
data/linux/common.env View File

@@ -19,5 +19,5 @@ PYLIBLO_VERSION=0.9.2
PYQT5_VERSION=5.11.3
CXFREEZE_VERSION=6.0

MAKE_ARGS="-j 8"
MAKE_ARGS="-j 3"
TARGETDIR=$HOME/builds

Loading…
Cancel
Save