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
This commit is contained in:
Pau Espin 2024-04-26 18:04:20 +02:00
parent 3b535cbafa
commit fdef271404
2 changed files with 17 additions and 0 deletions

View File

@ -36,6 +36,17 @@ RUN useradd -m ${username} && \
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 git clone $ASTERISK_REMOTE
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 && \

View File

@ -42,6 +42,7 @@ OSMO_SIP_BRANCH?=master
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 @@ docker-build: .release
--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) ; \