summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-05-22 10:32:51 +0200
committerOliver Smith <osmith@sysmocom.de>2020-05-25 11:47:11 +0200
commit7cb8e2d05cbcac4f414bc920a153d3545133be81 (patch)
tree790bdf698a4b6bd4e3b3b11fce6296daf2dbe5ee
parentb6965f877cbc0d88892f376d991327edceaca000 (diff)
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
-rw-r--r--README.adoc5
-rw-r--r--obs-patches/limesuite/build-for-debian10.patch13
-rw-r--r--scripts/common-obs.sh33
-rw-r--r--scripts/common.sh1
-rwxr-xr-xscripts/osmocom-latest-packages.sh2
-rwxr-xr-xscripts/osmocom-nightly-packages.sh2
6 files changed, 54 insertions, 2 deletions
diff --git a/README.adoc b/README.adoc
index 786be0d..bd4ef2a 100644
--- a/README.adoc
+++ b/README.adoc
@@ -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
diff --git a/obs-patches/limesuite/build-for-debian10.patch b/obs-patches/limesuite/build-for-debian10.patch
new file mode 100644
index 0000000..2387b08
--- /dev/null
+++ b/obs-patches/limesuite/build-for-debian10.patch
@@ -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,
diff --git a/scripts/common-obs.sh b/scripts/common-obs.sh
index 3d86865..137887b 100644
--- a/scripts/common-obs.sh
+++ b/scripts/common-obs.sh
@@ -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 ..
}
diff --git a/scripts/common.sh b/scripts/common.sh
index 917962e..8dd00a1 100644
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -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"
diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh
index 8bf4fb2..d836af2 100755
--- a/scripts/osmocom-latest-packages.sh
+++ b/scripts/osmocom-latest-packages.sh
@@ -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
diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh
index ca4b253..f6bd4e6 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -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