Skip to content

Commit

Permalink
Install via Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
postgres-dev committed Jul 27, 2023
1 parent 50831cd commit f358ae7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
image: ghcr.io/postgres-dev/ubuntu-22.04:1.0
env:
PG_BRANCH: REL_14_STABLE
PREFIX: ${{ github.workspace }}/pgsql

steps:
- name: Get Postgres sources
Expand All @@ -33,11 +34,16 @@ jobs:
path: ptrack

- name: Apply ptrack patches
run: |
pwd
ls
ls ..
echo ls ../postgres
ls ../postgres
make patch
run: make patch
working-directory: ptrack

- name: Install Postgres
run: |
if [ "$(TEST_CASE)" = tap -a "$(MODE)" = legacy ]; then
./configure CFLAGS='-DEXEC_BACKEND' --disable-atomics --prefix=$(PREFIX) --enable-debug --enable-cassert --enable-depend --enable-tap-tests --quiet
else
./configure --prefix=$(PREFIX) --enable-debug --enable-cassert --enable-depend --enable-tap-tests
fi &&
make --quiet --jobs=$(nproc) install &&
make --quiet --jobs=$(nproc) --directory=contrib/ install
working-directory: postgres
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,32 @@ include $(top_srcdir)/contrib/contrib-global.mk
endif
endif

ifndef PG_BRANCH
$(error PG_BRANCH is not defined. Set it to the desired PostgreSQL repository branch name (e.g. REL_15_STABLE).)
aaa:
ifneq ($(and, tap), )
echo da
endif

# Assuming make is started in the ptrack directory
patch:
ifndef PG_BRANCH
$(error PG_BRANCH is not defined. Set it to the desired PostgreSQL repository branch name (e.g. REL_15_STABLE).)
endif
@cd $(top_builddir) && \
echo Applying the ptrack patch... && \
git apply --verbose --3way $(CURDIR)/patches/${PG_BRANCH}-ptrack-core.diff
ifeq ($(MODE), paranoia)
@echo Applying turn-off-hint-bits.diff for the paranoia mode... && \
git apply --verbose --3way $(CURDIR)/patches/turn-off-hint-bits.diff
endif

nproc := $(shell nproc)
prefix ?= $(abspath $(top_builddir)/pgsql)
install-postgres:
@cd $(top_builddir) && \
if [ "$(TEST_CASE)" = tap -a "$(MODE)" = legacy ]; then \
./configure CFLAGS='-DEXEC_BACKEND' --disable-atomics --prefix=$(prefix) --enable-debug --enable-cassert --enable-depend --enable-tap-tests --quiet; \
else \
./configure --prefix=$(prefix) --enable-debug --enable-cassert --enable-depend --enable-tap-tests; \
fi && \
make --quiet --jobs=$(nproc) install && \
make --quiet --jobs=$(nproc) --directory=contrib/ install

0 comments on commit f358ae7

Please sign in to comment.