Skip to content
Open
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
23 changes: 6 additions & 17 deletions nix/ext/pgmq/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ let
stdenv.mkDerivation rec {
inherit pname version;
buildInputs = [ postgresql ];

src = fetchFromGitHub {
owner = "tembo-io";
owner = "pgmq";
repo = pname;
rev = "v${version}";
inherit hash;
Expand All @@ -63,25 +64,13 @@ let
-e "s|^module_pathname = .*|module_pathname = '\$libdir/${pname}'|" \
${pname}.control > $out/share/postgresql/extension/${pname}--${version}.control

# For the latest version, create default control file and symlink and copy SQL upgrade scripts
# For the latest version, create default control file and symlink + copy upgrade scripts
if [[ "${version}" == "${latestVersion}" ]]; then
{
echo "default_version = '${version}'"
cat $out/share/postgresql/extension/${pname}--${version}.control
} > $out/share/postgresql/extension/${pname}.control
cat >> sql/pgmq--1.5.0--1.5.1.sql <<EOF

CREATE FUNCTION pgmq._extension_exists(extension_name TEXT)
RETURNS BOOLEAN
LANGUAGE SQL
AS \$\$
SELECT EXISTS (
SELECT 1
FROM pg_extension
WHERE extname = extension_name
)
\$\$;
EOF

cp sql/*.sql $out/share/postgresql/extension
fi

Expand All @@ -90,7 +79,7 @@ let

meta = with lib; {
description = "A lightweight message queue. Like AWS SQS and RSMQ but on Postgres.";
homepage = "https://github.com/tembo-io/pgmq";
homepage = "https://github.com/pgmq/pgmq";
maintainers = with maintainers; [ olirice ];
inherit (postgresql.meta) platforms;
license = licenses.postgresql;
Expand All @@ -116,4 +105,4 @@ buildEnv {
else
"multi-" + lib.concatStringsSep "-" (map (v: lib.replaceStrings [ "." ] [ "-" ] v) versions);
};
}
}
43 changes: 26 additions & 17 deletions nix/ext/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
"17"
],
"hash": "sha256-9St/ESPiFq2NiPKqbwHLwkIyATKUkOGxFcUrWgT+Iqo="
}
}
},
"pg_partman": {
"5.3.1": {
Expand All @@ -370,21 +370,31 @@
"hash": "sha256-LK+z/0puUuNLz2ah/SDaxxyLS/On/cmCBhKNwTLa7Pk="
}
},
"pgmq": {
"1.4.4": {
"postgresql": [
"15"
],
"hash": "sha256-z+8/BqIlHwlMnuIzMz6eylmYbSmhtsNt7TJf/CxbdVw="
},
"1.5.1": {
"postgresql": [
"15",
"17"
],
"hash": "sha256-IU+i6ONPwtgsFKdzya6E+222ualR66gkbb0lDr+7Rb8="
}
"pgmq": {
"1.10.0": {
"postgresql": [
"15",
"17"
],
"hash": "sha256-sNOFr3tiZATFBvRBm4pSsn8YR62zqN06VBOBnvdXgts="
},
"1.11.0": {
"postgresql": [
"15",
"17",
"18"
],
"hash": "sha256-fJWINP7Dvc79blpfYbGfTEKZtcA/S8KAjmX5uPhmXBM="
},
"1.11.1": {
"postgresql": [
"15",
"17",
"18"
],
"hash": "sha256-BPOrQ7HcgTaTJIRzWUCG3iJN3mUjwIxa/wPxvJ1l4o4="
}
},
"pgroonga": {
"3.0.7": {
"postgresql": [
Expand All @@ -409,7 +419,6 @@
"hash": "sha256-QC77AnPGpPQGEWi6JtJdiNsB2su5+aV2pKg5ImR2B0k="
}
},

"pgsodium": {
"3.0.4": {
"postgresql": [
Expand Down Expand Up @@ -880,4 +889,4 @@
"hash": "sha256-+QoACPCKiFfuT2lJfSUmgfzC5MXf75KpSoc2PzPxKyM="
}
}
}
}