diff --git a/databases/postgresql-promscale/Makefile b/databases/postgresql-promscale/Makefile index 7c65d60943d6..ce226577d5ab 100644 --- a/databases/postgresql-promscale/Makefile +++ b/databases/postgresql-promscale/Makefile @@ -1,50 +1,54 @@ PORTNAME= promscale PORTVERSION= 0.7.0 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= databases PKGNAMEPREFIX= postgresql${PGSQL_VER:S/.//}- MAINTAINER= feld@FreeBSD.org COMMENT= Tables, types and functions supporting Promscale WWW= https://www.timescale.com/promscale LICENSE= PostgreSQL # Depends on an unpublished crate. Can't use cargo.mk to fetch it. PGX_REV= 96ece243 DISTFILES+= pgx-${PGX_REV}.tar.gz SITES.pgx-${PGX_REV}.tar.gz+= ${MASTER_SITE_GITHUB:=timescale/}pgx/archive/${PGX_REV}.tar.gz USES= cargo gmake pgsql:12+ BUILD_DEPENDS= bash>0:shells/bash RUN_DEPENDS= timescaledb>0:databases/timescaledb USE_GITHUB= yes GH_ACCOUNT= timescale timescale:pgx GH_PROJECT= promscale_extension pgx:pgx GH_TAGNAME= ${PORTVERSION} 96ece243:pgx WANT_PGSQL= server MAKE_ARGS+= PG_CONFIG=${LOCALBASE}/bin/pg_config MAKE_ENV+= MAKE=gmake PATH=${PATH}:${WRKDIR}/.cargo/bin .include "${.CURDIR}/crates.mk" post-extract: mv ${WRKDIR}/pgx-* ${WRKDIR}/pgx +pre-configure: + @${PATCH} -d ${WRKDIR} ${PATCH_ARGS} < ${PATCHDIR}/pgx-include-patch + ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKDIR}/pgx/pgx-pg-sys/build.rs + pre-build: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} cargo install --offline --path ../pgx/cargo-pgx cargo-pgx mkdir -p ${WRKDIR}/.pgx ${PRINTF} '[configs]\npg${PGSQL_VERSION}="${LOCALBASE}/bin/pg_config"\n' > ${WRKDIR}/.pgx/config.toml do-build: cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} package do-install: cd ${WRKSRC}/target/release/promscale-pg${PGSQL_VER} && ${PAX} -rw . ${STAGEDIR} .include diff --git a/databases/postgresql-promscale/files/pgx-include-patch b/databases/postgresql-promscale/files/pgx-include-patch new file mode 100644 index 000000000000..90ea9b8be038 --- /dev/null +++ b/databases/postgresql-promscale/files/pgx-include-patch @@ -0,0 +1,10 @@ +--- pgx/pgx-pg-sys/build.rs.orig 2022-11-06 21:01:34.720308000 +0000 ++++ pgx/pgx-pg-sys/build.rs 2022-11-06 21:02:14.469075000 +0000 +@@ -507,6 +507,7 @@ + let bindings = bindgen::Builder::default() + .header(include_h.display().to_string()) + .clang_arg(&format!("-I{}", includedir_server.display())) ++ .clang_arg("-I%%LOCALBASE%%/include") + .parse_callbacks(Box::new(IgnoredMacros::default())) + .blocklist_function("varsize_any") // pgx converts the VARSIZE_ANY macro, so we don't want to also have this function, which is in heaptuple.c + .blocklist_function("query_tree_walker")