Skip to content

Commit

Permalink
feat: update build scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Arndt <[email protected]>
  • Loading branch information
SpotlightKid committed Nov 19, 2024
1 parent bb5bcda commit 07a7810
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 9 deletions.
26 changes: 25 additions & 1 deletion scripts/build-win32.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/bash
#
# Build win32 binaries of CLAP, LV2 and VST2/3 plugin format
#

PROJECT_VERSION="$(git describe --abbrev=0 2>/dev/null)"

if [[ -z "$PROJECT_VERSION" ]]; then
echo "WARNING: No git tags found. Can't create binary distribution archive"
echo "Hint: Use 'git tag -a <version>' to create a project version."
echo
fi

set -e

Expand All @@ -23,5 +34,18 @@ make -C dpf clean > /dev/null
rm -rf bin-w32

# Build now
make HAVE_CAIRO=false HAVE_JACK=false
make HAVE_CAIRO=false HAVE_JACK=false BUILD_VST2=true BUILD_LADSPA=false
mv bin bin-w32

set +e

# Make Zip archive of binaries
if [[ -n "$PROJECT_VERSION" ]]; then
CHECKOUT="$(pwd)"
REPO_URL="$(git remote get-url origin)"
PROJECT_NAME="${REPO_URL##*/}"
SRCDIR="$PROJECT_NAME-${PROJECT_VERSION#v}"
ZIP_NAME="$SRCDIR-win32.zip"
mkdir -p dist
rm -f dist/$ZIP_NAME && zip -r dist/$ZIP_NAME bin-w32
fi
24 changes: 23 additions & 1 deletion scripts/build-win64.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/bin/bash
#
# Build win32 binaries of CLAP, LV2 and VST2/3 plugin format
#

PROJECT_VERSION="$(git describe --abbrev=0 2>/dev/null)"

if [[ -z "$PROJECT_VERSION" ]]; then
echo "WARNING: No git tags found. Can't create binary distribution archive"
echo "Hint: Use 'git tag -a <version>' to create a project version."
echo
fi

set -e

Expand All @@ -24,5 +35,16 @@ make -C dpf clean > /dev/null
rm -rf bin-w64

# Build now
make HAVE_CAIRO=false HAVE_JACK=false
make HAVE_CAIRO=false HAVE_JACK=false BUILD_VST2=true BUILD_LADSPA=false
mv bin bin-w64

# Make Zip archive of binaries
if [[ -n "$PROJECT_VERSION" ]]; then
CHECKOUT="$(pwd)"
REPO_URL="$(git remote get-url origin)"
PROJECT_NAME="${REPO_URL##*/}"
SRCDIR="$PROJECT_NAME-${PROJECT_VERSION#v}"
ZIP_NAME="$SRCDIR-win64.zip"
mkdir -p dist
rm -f dist/$ZIP_NAME && zip -r dist/$ZIP_NAME bin-w64
fi
19 changes: 12 additions & 7 deletions scripts/bundle-source.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#!/bin/bash
#
# Build source distribution archive with all git sub-modules included
#

PROJECT_VERSION="$(git describe --abbrev=0 2>/dev/null)"

if [[ -z "$PROJECT_VERSION" ]]; then
echo "No git tags found. Use 'git tag -a <version>' to create a project version."
echo "ERROR: No git tags found. Can't create source distribution archve."
echo "Hint: Use 'git tag -a <version>' to create a project version."
exit 1
fi

Expand All @@ -15,9 +19,10 @@ PROJECT_NAME="${REPO_URL##*/}"
PROJECT_NAME="${PROJECT_NAME%.git}"
SRCDIR="$PROJECT_NAME-${PROJECT_VERSION#v}"
TARBALL_NAME="$SRCDIR-source.tar.gz"
BUILDDIR="build/${PROJECT_VERSION#v}"

mkdir -p build dist
cd build
mkdir -p "$BUILDDIR" dist
cd "$BUILDDIR"
rm -rf "$SRCDIR"
git clone --recursive --branch "$PROJECT_VERSION" --single-branch "$CHECKOUT" "$SRCDIR"
cd "$SRCDIR"
Expand All @@ -26,9 +31,9 @@ for fn in .git .gitmodules .gitignore; do
done
rm -rf .git
cd ..
tar -zcvf "../dist/$TARBALL_NAME" "$SRCDIR"
rm -rf "$SRCDIR"
tar -zcvf "$CHECKOUT/dist/$TARBALL_NAME" "$SRCDIR"

gpg --armor --detach-sign --yes "../dist/$TARBALL_NAME"
cd ..
gpg --armor --detach-sign --yes "$CHECKOUT/dist/$TARBALL_NAME"
cd "$CHECKOUT"
rm -rf "$BUILDDIR"
ls -l dist

0 comments on commit 07a7810

Please sign in to comment.