Skip to content

Commit

Permalink
Fixed uncompatibility with recent linux distros GrandOrgue#1480
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg68 committed Apr 30, 2023
1 parent 60489e4 commit 6601954
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 17 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ jobs:
prepare: "debian-based"
build_on: linux

- run_on: ubuntu-20.04
for: linux
prepare: "debian-based"
build_on: linux
pkg_suffix: wx30

- run_on: ubuntu-20.04
for: appimage-x86_64
prepare: "debian-based"
Expand All @@ -90,10 +96,22 @@ jobs:
prepare: "debian-based"
build_on: linux

- run_on: ubuntu-20.04
for: linux-armhf
prepare: "debian-based"
build_on: linux
pkg_suffix: wx30

- run_on: ubuntu-20.04
for: linux-aarch64
prepare: "debian-based"
build_on: linux

- run_on: ubuntu-20.04
for: linux-aarch64
prepare: "debian-based"
build_on: linux
pkg_suffix: wx30

- run_on: macos-11
for: osx
Expand All @@ -112,11 +130,11 @@ jobs:
submodules: true

- name: Install Dependencies
run: ${{github.workspace}}/build-scripts/for-${{ matrix.for }}/prepare-${{ matrix.prepare }}.sh
run: ${{github.workspace}}/build-scripts/for-${{ matrix.for }}/prepare-${{ matrix.prepare }}.sh "${{ matrix.pkg_suffix }}"

- name: Build
working-directory: ${{github.workspace}}
run: ${{github.workspace}}/build-scripts/for-${{ matrix.for }}/build-on-${{ matrix.build_on }}.sh ${{needs.calc_ver.outputs.project_ver}} ${{needs.calc_ver.outputs.build_ver}}
run: ${{github.workspace}}/build-scripts/for-${{ matrix.for }}/build-on-${{ matrix.build_on }}.sh ${{needs.calc_ver.outputs.project_ver}} ${{needs.calc_ver.outputs.build_ver}} ${{github.workspace}} "${{ matrix.pkg_suffix }}"

- name: Upload result
uses: nanoufo/action-upload-artifacts-and-release-assets@v1.5
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Fixed uncompatibility with recent linux distros. Use grandorgue-wx32 on new linux distros (where wxWidgets 3.0 is not available) https://github.com/GrandOrgue/grandorgue/issues/1480
- Added support of negative y-axis adjustment of manual keys https://github.com/GrandOrgue/grandorgue/issues/1485
- Fixed opening an organ with more than 50 windchest groups https://github.com/GrandOrgue/grandorgue/issues/1484
# 3.11.0 (2023-04-17)
Expand Down
19 changes: 15 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,17 @@ add_subdirectory(resources)

# packaging

set(CPACK_PACKAGE_NAME "grandorgue")
# deal with possible package names among grandorgue, grandorgue-wx30
set(BASE_PACKAGE_NAME "grandorgue")

if("${CMAKE_PACKAGE_SUFFIX}" STREQUAL "wx30")
set(CPACK_PACKAGE_NAME "${BASE_PACKAGE_NAME}-wx30")
set(OTHER_PACKAGE_NAME "${BASE_PACKAGE_NAME}")
else()
set(CPACK_PACKAGE_NAME "${BASE_PACKAGE_NAME}")
set(OTHER_PACKAGE_NAME "${BASE_PACKAGE_NAME}-wx30")
endif()

set(CPACK_PACKAGE_VENDOR "Our Organ")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GrandOrgue - OpenSource Virtual Pipe Organ Software")
set(
Expand Down Expand Up @@ -330,7 +340,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CPACK_RPM_DEMO_FILE_NAME RPM-DEFAULT)
if(NOT GO_SEPARATE_LINUX_PACKAGES)
# For automatic removal of previously installed suppackages
set(CPACK_RPM_PACKAGE_OBSOLETES "grandorgue-resources grandorgue-demo")
set(CPACK_RPM_PACKAGE_OBSOLETES "grandorgue-resources grandorgue-demo ${OTHER_PACKAGE_NAME}")
endif()

# for source rpms
Expand All @@ -349,12 +359,12 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS ON)
set(CPACK_DEBIAN_PACKAGE_SECTION sound)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_UNSPECIFIED_PACKAGE_RECOMMENDS "grandorgue-demo, wx3.0-i18n")
set(CPACK_DEBIAN_UNSPECIFIED_PACKAGE_RECOMMENDS "grandorgue-demo")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
set(CPACK_DEBIAN_PACKAGE_SOURCE "${CPACK_DEBIAN_UNSPECIFIED_PACKAGE_NAME}")
if(NOT GO_SEPARATE_LINUX_PACKAGES)
# For automatic removal of previously installed suppackages
set(CPACK_DEBIAN_PACKAGE_REPLACES "grandorgue-resources, grandorgue-demo")
set(CPACK_DEBIAN_PACKAGE_REPLACES "grandorgue-resources, grandorgue-demo, ${OTHER_PACKAGE_NAME}")
endif()
endif()

Expand All @@ -366,5 +376,6 @@ message(STATUS " Project : ${PROJECT_NAME}")
message(STATUS " Description : ${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
message(STATUS " Version : ${VERSION}")
message(STATUS " Build : ${CPACK_PACKAGE_RELEASE}")
message(STATUS " Package name : ${CPACK_PACKAGE_NAME}")
message(STATUS "============================================================================")
message(STATUS " ")
2 changes: 1 addition & 1 deletion build-scripts/for-appimage-x86_64/prepare-debian-based.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

DIR=`dirname $0`
$DIR/../for-linux/prepare-debian-based.sh
$DIR/../for-linux/prepare-debian-based.sh "" amd64

# linuxdeploy, linuxdeploy-plugin-gtk and appimagetool must be downloaded
sudo wget -P /usr/local/bin https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh
Expand Down
5 changes: 4 additions & 1 deletion build-scripts/for-linux-aarch64/build-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# $1 - Version
# $2 - Build version
# $3 - Go source Dir. If not set then relative to the script dir
# $4 - package suffix: empty or wx30

set -e

Expand All @@ -13,6 +14,8 @@ if [[ -n "$3" ]]; then
else
SRC_DIR=$(readlink -f $(dirname $0)/../..)
fi
PACKAGE_SUFFIX=$4


PARALLEL_PRMS="-j$(nproc)"

Expand All @@ -38,7 +41,7 @@ GO_ARM_PRMS="-DCMAKE_SYSTEM_NAME=Linux \
-DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=arm64 \
-DCPACK_RPM_PACKAGE_ARCHITECTURE=aarch64 \
-DIMPORT_EXECUTABLES=../build-tools/ImportExecutables.cmake"
GO_PRMS="-DCMAKE_BUILD_TYPE=Release $CMAKE_VERSION_PRMS"
GO_PRMS="-DCMAKE_BUILD_TYPE=Release $CMAKE_VERSION_PRMS -DCMAKE_PACKAGE_SUFFIX=$PACKAGE_SUFFIX"
echo "cmake -G \"Unix Makefiles\" $GO_PRMS . $SRC_DIR"
cmake -G "Unix Makefiles" $GO_PRMS $GO_ARM_PRMS . $SRC_DIR
make -k $PARALLEL_PRMS VERBOSE=1 package
Expand Down
4 changes: 3 additions & 1 deletion build-scripts/for-linux-aarch64/prepare-debian-based.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

# $1 - wxWidgets package version: empty - libwxgtk3.2-dev or wx30 - libwxgtk3.0-gtk3-dev

set -e

DIR=`dirname $0`
$DIR/../for-linux/prepare-debian-based.sh arm64
$DIR/../for-linux/prepare-debian-based.sh "$1" arm64
4 changes: 3 additions & 1 deletion build-scripts/for-linux-armhf/build-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# $1 - Version
# $2 - Build version
# $3 - Go source Dir. If not set then relative to the script dir
# $4 - package suffix: empty or wx30

set -e

Expand All @@ -13,6 +14,7 @@ if [[ -n "$3" ]]; then
else
SRC_DIR=$(readlink -f $(dirname $0)/../..)
fi
PACKAGE_SUFFIX=$4

PARALLEL_PRMS="-j$(nproc)"

Expand All @@ -38,7 +40,7 @@ GO_ARM_PRMS="-DCMAKE_SYSTEM_NAME=Linux \
-DCPACK_DEBIAN_PACKAGE_ARCHITECTURE=armhf \
-DCPACK_RPM_PACKAGE_ARCHITECTURE=armhf \
-DIMPORT_EXECUTABLES=../build-tools/ImportExecutables.cmake"
GO_PRMS="-DCMAKE_BUILD_TYPE=Release $CMAKE_VERSION_PRMS"
GO_PRMS="-DCMAKE_BUILD_TYPE=Release $CMAKE_VERSION_PRMS -DCMAKE_PACKAGE_SUFFIX=$PACKAGE_SUFFIX"
echo "cmake -G \"Unix Makefiles\" $GO_PRMS . $SRC_DIR"
cmake -G "Unix Makefiles" $GO_PRMS $GO_ARM_PRMS . $SRC_DIR
make -k $PARALLEL_PRMS VERBOSE=1 package
Expand Down
4 changes: 3 additions & 1 deletion build-scripts/for-linux-armhf/prepare-debian-based.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash

# $1 - wxWidgets package version: empty - libwxgtk3.2-dev or wx30 - libwxgtk3.0-gtk3-dev

set -e

DIR=`dirname $0`
$DIR/../for-linux/prepare-debian-based.sh armhf
$DIR/../for-linux/prepare-debian-based.sh "$1" armhf
5 changes: 4 additions & 1 deletion build-scripts/for-linux/build-on-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# $1 - Version
# $2 - Build version
# $3 - Go source Dir. If not set then relative to the script dir
# $4 - package suffix: empty or wx30

set -e

Expand All @@ -14,6 +15,8 @@ else
SRC_DIR=$(readlink -f $(dirname $0)/../..)
fi

PACKAGE_SUFFIX=$4

PARALLEL_PRMS="-j$(nproc)"

mkdir -p build/linux
Expand All @@ -22,7 +25,7 @@ pushd build/linux
rm -rf *
export LANG=C

GO_PRMS="-DCMAKE_BUILD_TYPE=Release $CMAKE_VERSION_PRMS"
GO_PRMS="-DCMAKE_BUILD_TYPE=Release $CMAKE_VERSION_PRMS -DCMAKE_PACKAGE_SUFFIX=$PACKAGE_SUFFIX"
echo "cmake -G \"Unix Makefiles\" $GO_PRMS . $SRC_DIR"
cmake -G "Unix Makefiles" $GO_PRMS . $SRC_DIR
make -k $PARALLEL_PRMS VERBOSE=1 package
Expand Down
15 changes: 11 additions & 4 deletions build-scripts/for-linux/prepare-debian-based.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
#!/bin/bash

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

set -e

DIR=`dirname $0`

WX_PKG_NAME=libwxgtk3.2-dev
[[ "$1" == "wx30" ]] && WX_PKG_NAME=libwxgtk3.0-gtk3-dev

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

OS_DISTR=$(awk -F= '$1=="ID" {print $2;}' /etc/os-release)
[[ "$OS_DISTR" == "ubuntu" ]] && $DIR/prepare-ubuntu-wx-repo.bash $WX_PKG_NAME

if [[ "$TARGET_ARCH" == "$CURRENT_ARCH" ]]; then
GCC_SUFFIX=""
sudo apt update
else
sudo dpkg --add-architecture "$TARGET_ARCH"

OS_DISTR=$(awk -F= '$1=="ID" {print $2;}' /etc/os-release)
# ubuntu has different urls for different architectures
[[ "$OS_DISTR" == "ubuntu" ]] && $DIR/prepare-ubuntu-multiarch-repos.sh
sudo apt update
Expand All @@ -30,6 +36,7 @@ fi
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
cmake \
docbook-xsl \
dpkg-dev \
file \
gettext \
imagemagick \
Expand All @@ -44,7 +51,7 @@ sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
libjack-dev:$TARGET_ARCH \
libudev-dev:$TARGET_ARCH \
libwavpack-dev:$TARGET_ARCH \
libwxgtk3.0-gtk3-dev:$TARGET_ARCH \
${WX_PKG_NAME}:$TARGET_ARCH \
libyaml-cpp-dev:$TARGET_ARCH \
zlib1g-dev:$TARGET_ARCH

Expand Down
8 changes: 7 additions & 1 deletion build-scripts/for-linux/prepare-fedora.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/sh

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

WX_PKG_NAME=wxGTK-devel
[[ "$1" == "wx30" ]] && WX_PKG_NAME=wxGTK3-devel

set -e
sudo dnf install -y \
cmake gcc-c++ make gettext docbook-style-xsl zip po4a ImageMagick rpm-build \
pipewire-jack-audio-connection-kit-devel fftw-devel zlib-devel wavpack-devel \
wxGTK3-devel alsa-lib-devel systemd-devel yaml-cpp-static
$WX_PKG_NAME alsa-lib-devel systemd-devel yaml-cpp-static
18 changes: 18 additions & 0 deletions build-scripts/for-linux/prepare-ubuntu-wx-repo.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# add an ppa repository for wxWidgets

# $1 - wx package name

set -e

WX_PACKAGE_NAME=$1

sudo apt-get update
if ! apt-cache show $WX_PACKAGE_NAME; 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
echo "" | sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:sjr/wx32
fi
fi

0 comments on commit 6601954

Please sign in to comment.