pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/docker-playground/+/36649?usp=email )


Change subject: asterisk-master: Use pjproject from external git repo
......................................................................

asterisk-master: Use pjproject from external git repo

By default, asterisk.git build system will fetch pjproject tarball from
https://raw.githubusercontent.com/asterisk/third-party/master/pjproject/$(PJPROJECT_VERSION),
where PJPROJECT_VERSION is defined in asterisk/third-party/versions.mak:
PJPROJECT_VERSION=2.14
On top of that, it applies some patches adapting build system, found in
asterisk/third-party/pjproject/patches/.

The build system also allows to use an out-of-tree pjproject (eg from a
git repo) by symlinking the directory to
asterisk/third-party/pjprojec/source/.

This is all documented in asterisk/third-party/pjproject/README-hacking.md.

Since we want to develop on pjproject too, fetch our own pjproject.git
repo, where we can push changes, and build asterisk using that repo.

Bear in mind that, when asterisk.git builds with out-of-tree pjproject,
it wont apply pjproject patches under 
asterisk.git/third-party/pjproject/patches.
Hence, I created an "asterisk/2.14" branch in our pjproject.git repo which 
points
to tag "2.14" (the one used by asterisk 20.7.0, which we use), and has the 2 
patches
applied on top.
Then, we have our own "sysmocom/2.14" branch on top of that "asterisk/2.14"
branch, where we put our development. WIP development can also be done  in 
whatever
branch  on top of "asterisk/2.14" branch.

Change-Id: I73f3323db1b6897fc43215578b0a011fdb6909c5
---
M asterisk-master/Dockerfile
M make/Makefile
2 files changed, 51 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/docker-playground 
refs/changes/49/36649/1

diff --git a/asterisk-master/Dockerfile b/asterisk-master/Dockerfile
index cd64b2f..789aeb5 100644
--- a/asterisk-master/Dockerfile
+++ b/asterisk-master/Dockerfile
@@ -36,6 +36,17 @@

 WORKDIR        /home/${username}

+# clone pjproject
+ARG    PJPROJECT_REMOTE=https://gitea.sysmocom.de/sysmocom/pjproject.git
+ARG    PJPROJECT_BRANCH=sysmocom/2.14
+
+RUN    git clone $PJPROJECT_REMOTE
+ADD    
https://gitea.sysmocom.de/api/v1/repos/sysmocom/pjproject/git/refs/heads/$PJPROJECT_BRANCH
 /tmp/pjproject-ver
+
+RUN    cd pjproject && \
+       git fetch && git checkout $PJPROJECT_BRANCH && \
+       (git symbolic-ref -q HEAD && git reset --hard origin/$PJPROJECT_BRANCH 
|| exit 1); \
+       git rev-parse --abbrev-ref HEAD && git rev-parse HEAD

 # clone asterisk
 ARG    ASTERISK_REMOTE=https://gitea.sysmocom.de/sysmocom/asterisk.git
@@ -44,6 +55,10 @@
 RUN    cd asterisk && \
        git fetch && git checkout -f -B sysmocom/master origin/sysmocom/master

+# Use pjproject from git repo above instead of downloading tar.gz:
+RUN    cd asterisk/third-party/pjproject && \
+       ln -s ../../../pjproject/ source
+
 RUN    cd asterisk && \
        ./bootstrap.sh && \
        ./configure && \
diff --git a/make/Makefile b/make/Makefile
index 74efbff..24308e5 100644
--- a/make/Makefile
+++ b/make/Makefile
@@ -42,6 +42,7 @@
 OSMO_STP_BRANCH?=master
 OSMO_UECUPS_BRANCH?=master
 OPEN5GS_BRANCH?=main
+PJPROJECT_BRANCH?=sysmocom/2.14
 BUILD_ARGS?=
 RUN_ARGS?=-it
 UPSTREAM_DISTRO?=debian:bookworm
@@ -125,6 +126,7 @@
                --build-arg OSMO_STP_BRANCH=$(OSMO_STP_BRANCH) \
                --build-arg OSMO_UECUPS_BRANCH=$(OSMO_UECUPS_BRANCH) \
                --build-arg OPEN5GS_BRANCH=$(OPEN5GS_BRANCH) \
+               --build-arg PJPROJECT_BRANCH=$(PJPROJECT_BRANCH) \
                $(BUILD_ARGS) -t $(IMAGE):latest .
        @DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' 
| cut -d\. -f1) ; \
        DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | 
cut -d\. -f2) ; \

--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/36649?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I73f3323db1b6897fc43215578b0a011fdb6909c5
Gerrit-Change-Number: 36649
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-MessageType: newchange

Reply via email to