I wondered if this is strictly needed and it turns out that except from
the postgresql_18 version failing with
pg_net> src/worker.c:20:14: error: no previous extern declaration for non-static variable 'worker_state' [-Werror,-Wmissing-variable-declarations]
pg_net> 20 | WorkerState *worker_state = NULL;
pg_net> | ^
pg_net> src/worker.c:20:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit
pg_net> 20 | WorkerState *worker_state = NULL;
pg_net> | ^
pg_net> 1 error generated.
pg_net> make: *** [<builtin>: src/worker.o] Error 1
the package builds without it.
35 lines
874 B
Nix
35 lines
874 B
Nix
{
|
|
curl,
|
|
fetchFromGitHub,
|
|
lib,
|
|
postgresql,
|
|
postgresqlBuildExtension,
|
|
}:
|
|
|
|
postgresqlBuildExtension (finalAttrs: {
|
|
pname = "pg_net";
|
|
version = "0.18.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "supabase";
|
|
repo = "pg_net";
|
|
tag = "v${finalAttrs.version}";
|
|
hash = "sha256-MXZewz6vb1ZEGMzbk/x0VtBDH2GxnwYWsy3EjJnas2U=";
|
|
};
|
|
|
|
buildInputs = [ curl ];
|
|
|
|
env.NIX_CFLAGS_COMPILE = toString (
|
|
lib.optional (lib.versionAtLeast postgresql.version "18") "-Wno-error=missing-variable-declarations"
|
|
);
|
|
|
|
meta = {
|
|
description = "Async networking for Postgres";
|
|
homepage = "https://github.com/supabase/pg_net";
|
|
changelog = "https://github.com/supabase/pg_net/releases/tag/v${finalAttrs.version}";
|
|
maintainers = with lib.maintainers; [ thoughtpolice ];
|
|
platforms = postgresql.meta.platforms;
|
|
license = lib.licenses.postgresql;
|
|
};
|
|
})
|