OBS: add debian10 specific patch for limesuite

Add a patch to replace libwxgtk3.0-dev with libwxgtk3.0-gtk3-dev in
debian/control. Adjust OBS scripts to apply such patches from this
repository if they exist here, and fall back to the project's
repository (osmo-trx, osmo-gsm-manuals patches are there).

Related: OS#4562
Change-Id: I8dfb60e999bf9f61e6cd11983dba033a4c6107ad
This commit is contained in:
Oliver Smith 2020-05-22 10:32:51 +02:00
parent b6965f877c
commit 7cb8e2d05c
6 changed files with 54 additions and 2 deletions

View File

@ -13,6 +13,11 @@ scripts: used by jenkins jobs. Various osmo*/contrib/jenkins.sh scripts assume
osmo-ci to be checked out in the build slave user's home, i.e. using a PATH of
$HOME/osmo-ci/scripts.
obs-patches: patches to build projects for various debian distributions, e.g.
a patch for limesuite that fixes the libwxgtk3.0-dev => libwxgtk3.0-gtk3-dev
rename in control/debian for debian10. Used by osmo_obs_distro_specific_patch()
in scripts/common-obs.sh.
_docker_playground: Clone of docker-playground.git, so the scripts can build
required docker images. This dir gets created on demand by scripts/common.sh,
and automatically fetched and reset to "origin/master" (override with

View File

@ -0,0 +1,13 @@
diff --git a/debian/control b/debian/control
index c25b7c97..375ab95b 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@ Build-Depends:
debhelper (>= 9.0.0),
cmake (>= 3.1.3),
libusb-1.0-0-dev,
- libwxgtk3.0-dev,
+ libwxgtk3.0-gtk3-dev,
libsoapysdr-dev,
freeglut3-dev,
libfltk1.3-dev,

View File

@ -121,13 +121,36 @@ osmo_obs_add_rpm_spec() {
osc add "$name.spec"
}
# Get the path to a distribution specific patch, either from osmo-ci.git or from the project repository.
# $PWD must be the project repository dir.
# $1: distribution name (e.g. "debian8")
# $2: project repository (e.g. "osmo-trx", "limesuite")
osmo_obs_distro_specific_patch() {
local distro="$1"
local repo="$2"
local ret
ret="$OSMO_CI_DIR/obs-patches/$repo/build-for-$distro.patch"
if [ -f "$ret" ]; then
echo "$ret"
return
fi
ret="debian/patches/build-for-$distro.patch"
if [ -f "$ret" ]; then
echo "$ret"
return
fi
}
# Copy an already checked out repository dir and apply a distribution specific patch.
# $PWD must be where all repositories are checked out in subdirs.
# $1: distribution name (e.g. "debian8")
# $2: Osmocom repository (e.g. "osmo-trx")
# $2: project repository (e.g. "osmo-trx", "limesuite")
osmo_obs_checkout_copy() {
local distro="$1"
local repo="$2"
local patch
echo
echo "====> Checking out $repo-$distro"
@ -135,6 +158,7 @@ osmo_obs_checkout_copy() {
# Verify distro name for consistency
local distros="
debian8
debian10
"
local found=0
local distro_i
@ -157,7 +181,12 @@ osmo_obs_checkout_copy() {
cd "$repo-$distro"
# Commit patch
patch -p1 < "debian/patches/build-for-$distro.patch"
patch="$(osmo_obs_distro_specific_patch "$distro" "$repo")"
if [ -z "$patch" ]; then
echo "ERROR: no patch found for distro=$distro, repo=$repo"
exit 1
fi
patch -p1 < "$patch"
git commit --amend --no-edit debian/
cd ..
}

View File

@ -1,5 +1,6 @@
#!/bin/sh
# Various functions and variables used in multiple osmo-ci shell scripts
OSMO_CI_DIR="$(realpath "$(dirname "$0")/..")"
OSMO_GIT_URL="https://git.osmocom.org"
OSMO_GIT_URL_GERRIT="https://gerrit.osmocom.org"

View File

@ -156,9 +156,11 @@ build_osmocom() {
cd "$TOP"
osmo_obs_checkout_copy debian8 osmo-gsm-manuals
osmo_obs_checkout_copy debian10 limesuite
build osmocom-latest
build limesuite --git-upstream-tree="$(get_last_tag limesuite)"
build limesuite-debian10 --git-upstream-tree="$(get_last_tag limesuite)"
build osmo-gsm-manuals
build osmo-gsm-manuals-debian8
build libosmocore

View File

@ -214,9 +214,11 @@ build_osmocom() {
cd "$REPO"
osmo_obs_checkout_copy debian8 osmo-gsm-manuals
osmo_obs_checkout_copy debian8 osmo-trx
osmo_obs_checkout_copy debian10 limesuite
build osmocom-nightly
build limesuite no_commit --git-upstream-tree="$(get_last_tag limesuite)"
build limesuite-debian10 no_commit --git-upstream-tree="$(get_last_tag limesuite)"
build osmo-gsm-manuals
build osmo-gsm-manuals-debian8
build libosmocore