From 1479cb454567bcbe19fd91483566b0cc1ab3cbd7 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 20 Dec 2023 22:45:06 -0500 Subject: [PATCH] make: easier installation with git submodule --- .github/workflows/ci.yaml | 4 +++- .gitignore | 2 ++ .gitmodules | 3 +++ README.md | 28 +++++++++++++++++++++++++--- mustach | 1 + nix/mustach.nix | 9 ++------- 6 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 .gitmodules create mode 160000 mustach diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 22f2200..b470d0e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/.gitignore b/.gitignore index 829f09c..515c26d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ *.lex.c results/ .history +*.so +*.bc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5b8558d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "mustach"] + path = mustach + url = git@gitlab.com:jobol/mustach diff --git a/README.md b/README.md index c1c90d4..36918f2 100644 --- a/README.md +++ b/README.md @@ -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 +``` + +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 diff --git a/mustach b/mustach new file mode 160000 index 0000000..bd8a410 --- /dev/null +++ b/mustach @@ -0,0 +1 @@ +Subproject commit bd8a41030099c079aff57fcdfb1f5c0aa08cdbaf diff --git a/nix/mustach.nix b/nix/mustach.nix index 84414cf..aa97f7e 100644 --- a/nix/mustach.nix +++ b/nix/mustach.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitLab, pkg-config }: +{ lib, stdenv, pkg-config }: stdenv.mkDerivation rec { pname = "mustach"; @@ -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; }