Skip to content

Commit

Permalink
Fixed build for latest ubuntu GrandOrgue#1673
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Oct 21, 2023
1 parent 4828535 commit bd5ac50
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You can download the source code archive from GitHub
- Or run the prepared scripts for certain linux distributions by a sudoer user:
- on Fedora run ``<GO source tree>/build-scripts/for-linux/prepare-fedora.sh``
- on OpenSuse run ``<GO source tree>/build-scripts/for-linux/prepare-opensuse.sh``
- on Debian 9+ or on Ubuntu 18+ run ``<GO source tree>/build-scripts/for-linux/prepare-debian-ubuntu.sh``
- on Debian 9+ or on Ubuntu 18+ run ``<GO source tree>/build-scripts/for-linux/prepare-debian-based.sh``
3. Build
- Manually
1. Create an empty build directory, eg:
Expand Down
14 changes: 10 additions & 4 deletions build-scripts/for-appimage-x86_64/build-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@

set -e

source $(dirname $0)/../set-ver-prms.sh "$1" "$2"
DIR=$(readlink -f $(dirname $0))
source $DIR/../set-ver-prms.sh "$1" "$2"

if [[ -n "$3" ]]; then
SRC_DIR=$3
SRC_DIR=$(readlink -f $3)
else
SRC_DIR=$(readlink -f $(dirname $0)/../..)
SRC_DIR=$(readlink -f $DIR/../..)
fi

PARALLEL_PRMS="-j$(nproc)"
Expand All @@ -22,7 +23,12 @@ pushd build/appimage-x86_64
rm -rf *
export LANG=C

GO_PRMS="-DCMAKE_INSTALL_PREFIX=/usr -DRTAUDIO_USE_JACK=OFF -DRTMIDI_USE_JACK=OFF -DGO_USE_JACK=OFF -DCMAKE_BUILD_TYPE=Release $CMAKE_VERSION_PRMS"
GO_PRMS="-DCMAKE_INSTALL_PREFIX=/usr \
-DRTAUDIO_USE_JACK=OFF \
-DRTMIDI_USE_JACK=OFF \
-DGO_USE_JACK=OFF \
-DCMAKE_BUILD_TYPE=Release \
$CMAKE_VERSION_PRMS"
echo "cmake -G \"Unix Makefiles\" $GO_PRMS . $SRC_DIR"
cmake -G "Unix Makefiles" $GO_PRMS . $SRC_DIR
make -k $PARALLEL_PRMS
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/for-linux-aarch64/build-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -e

DIR=$(dirname $0)
DIR=$(readlink -f $(dirname $0))
source $DIR/../set-ver-prms.sh "$1" "$2"

if [[ -n "$3" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/for-linux-armhf/build-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -e

DIR=$(dirname $0)
DIR=$(readlink -f $(dirname $0))
source $DIR/../set-ver-prms.sh "$1" "$2"

if [[ -n "$3" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions build-scripts/for-linux/build-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
# $1 - Version
# $2 - Build version
# $3 - Go source Dir. If not set then relative to the script dir
# $4 - package suffix: empty or wx30
# $4 - package suffix: empty or wx30 or wx32
# $5 - target deb architecture. Default - current

set -e

DIR=$(dirname $0)
DIR=$(readlink -f $(dirname $0))
source $DIR/../set-ver-prms.sh "$1" "$2"

if [[ -n "$3" ]]; then
Expand Down
19 changes: 16 additions & 3 deletions build-scripts/for-linux/prepare-debian-based.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# $1 - wxWidgets package version: empty - libwxgtk3.0-gtk3-dev or wx32 - libwxgtk3.2-dev
# $1 - wxWidgets package version: empty - autoselect, wx30 - libwxgtk3.0-gtk3-dev or wx32 - libwxgtk3.2-dev
# $2 - target architecture: ex arm64, amd64, armhf

set -e
Expand All @@ -16,9 +16,22 @@ wx30)
WX_PKG_NAME=libwxgtk3.0-gtk3-dev
;;
*)
WX_PKG_NAME=libwxgtk3.0-gtk3-dev
sudo apt-get update
# search for the last available version of libwxgtk
WX_PKG_NAME=$(
apt-cache pkgnames libwxgtk \
| grep -e 'libwxgtk3.0-gtk3-dev\|libwxgtk[0-9].[0-9]-dev' \
| sort \
| tail -n 1 \
)
if [[ -z "$WX_PKG_NAME" ]]; then
echo >&2 "No libwxgtk*-dev package available for this linux distribution"
return 1 2>/dev/null || exit 1
fi
esac

echo "wx package: $WX_PKG_NAME"

CURRENT_ARCH=$(dpkg --print-architecture)
TARGET_ARCH="${2:-$CURRENT_ARCH}"

Expand Down Expand Up @@ -89,6 +102,6 @@ fi

# some ppas for wxWidgets give very high dependency version that prevents
# installing on other systems. Remove the version
if dpkg -s libwxgtk3.2-dev && ! grep -q libwx /etc/dpkg/shlibs.override; then
if dpkg -s libwxgtk3.2-dev 2>/dev/null && ! grep -q libwx /etc/dpkg/shlibs.override; then
cut -d " " -f 1-3 /var/lib/dpkg/info/libwx*3.2*.shlibs | sudo sh -c "cat >>/etc/dpkg/shlibs.override"
fi
2 changes: 1 addition & 1 deletion build-scripts/for-linux/prepare-ubuntu-wx-repo.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -e
WX_PACKAGE_NAME=$1

sudo apt-get update
if ! apt-cache show $WX_PACKAGE_NAME; then
if ! apt-cache show $WX_PACKAGE_NAME 2>/dev/null; then
# the wx package is not found
if [[ "$WX_PACKAGE_NAME" == "libwxgtk3.2-dev" ]]; then
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common
Expand Down

0 comments on commit bd5ac50

Please sign in to comment.