Skip to content

make: easier installation with git submodule #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ jobs:
pg-version: ['12', '13', '14', '15', '16']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
*.lex.c
results/
.history
*.so
*.bc
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "mustach"]
path = mustach
url = https://gitlab.com/jobol/mustach.git
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ PGXS := $(shell $(PG_CONFIG) --pgxs)

all: sql/$(EXTENSION)--$(EXTVERSION).sql $(EXTENSION).control

.PHONY: clean_generated
clean_generated:
rm -f $(EXTENSION).control
rm -f sql/$(EXTENSION)--$(EXTVERSION).sql

# extra dep for clean target in pgxs.mk
clean: clean_generated

sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql
cp $< $@

Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,35 @@ select show_cat('Mr. Sleepy', false);

## Installation

Install https://gitlab.com/jobol/mustach, then on this repo:
Clone the repo and submodules:

```
$ make && make install
git clone --recurse-submodules https://github.com/PostgREST/plmustache
```

Tested on Postgres 12, 13, 14, 15, 16.
Build mustach:

```
cd mustach
make && sudo make install
sudo ldconfig
Copy link
Member Author

@steve-chavez steve-chavez Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required on Pop!_OS 22.04 LTS, likely ubuntu/debian as well. But it wasn't required when building with Nix.

Maybe there's a way to avoid it...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I got the ldconfig hint from laurenz/oracle_fdw#440 (comment)

```

Build plmustache:

```
cd ..

make && sudo make install
```

Then on SQL you can do:

```sql
CREATE EXTENSION plmustache;
```

plmustache is tested on Postgres 12, 13, 14, 15, 16.

## Development

Expand Down
1 change: 1 addition & 0 deletions mustach
Submodule mustach added at bd8a41
9 changes: 2 additions & 7 deletions nix/mustach.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitLab, pkg-config }:
{ lib, stdenv, pkg-config }:

stdenv.mkDerivation rec {
pname = "mustach";
Expand All @@ -8,10 +8,5 @@ stdenv.mkDerivation rec {

makeFlags = [ "PREFIX=$(out)" "VERSION=${version}"];

src = fetchFromGitLab {
owner = "jobol";
repo = pname;
rev = "bd8a41030099c079aff57fcdfb1f5c0aa08cdbaf";
sha256 = "sha256-3kdXLp40QZo1+JoQUQNHOxuh/9cHhWvpz/ZFQ2MFXW8=";
};
src = ../mustach;
}