3636 inherit pname version ;
3737 buildInputs = [ postgresql ] ;
3838 src = fetchFromGitHub {
39- owner = "tembo-io" ;
39+ owner = "pgmq" ;
4040 repo = pname ;
4141 rev = "v${ version } " ;
4242 inherit hash ;
4343 } ;
4444
45+ # Only apply patches to versions that still need them
46+ # Check if the drop_queue patch is still needed for your versions
4547 patches = lib . optionals ( version == latestVersion ) [
4648 ./0001-fix-replace-drop_queue-function-if-exists.patch
4749 ] ;
6365 -e "s|^module_pathname = .*|module_pathname = '\$libdir/${ pname } '|" \
6466 ${ pname } .control > $out/share/postgresql/extension/${ pname } --${ version } .control
6567
66- # For the latest version, create default control file and symlink and copy SQL upgrade scripts
68+ # For the latest version, create default control file and copy SQL upgrade scripts
6769 if [[ "${ version } " == "${ latestVersion } " ]]; then
6870 {
6971 echo "default_version = '${ version } '"
7072 cat $out/share/postgresql/extension/${ pname } --${ version } .control
7173 } > $out/share/postgresql/extension/${ pname } .control
72- cat >> sql/pgmq--1.5.0--1.5.1.sql <<EOF
73-
74- CREATE FUNCTION pgmq._extension_exists(extension_name TEXT)
75- RETURNS BOOLEAN
76- LANGUAGE SQL
77- AS \$\$
78- SELECT EXISTS (
79- SELECT 1
80- FROM pg_extension
81- WHERE extname = extension_name
82- )
83- \$\$;
84- EOF
74+
75+ # Copy all SQL upgrade scripts
8576 cp sql/*.sql $out/share/postgresql/extension
8677 fi
8778
9081
9182 meta = with lib ; {
9283 description = "A lightweight message queue. Like AWS SQS and RSMQ but on Postgres." ;
93- homepage = "https://github.com/tembo-io/pgmq" ;
94- maintainers = with maintainers ; [ olirice ] ;
84+ homepage = "https://pgmq.github.io/pgmq/" ;
9585 inherit ( postgresql . meta ) platforms ;
9686 license = licenses . postgresql ;
9787 } ;
@@ -116,4 +106,4 @@ buildEnv {
116106 else
117107 "multi-" + lib . concatStringsSep "-" ( map ( v : lib . replaceStrings [ "." ] [ "-" ] v ) versions ) ;
118108 } ;
119- }
109+ }
0 commit comments