Skip to content

Commit

Permalink
databases/postgresql-promscale: add new port
Browse files Browse the repository at this point in the history
The PostgreSQL Promscale extension provides the required database capability
and PL/pgsql code to support Promscale 0.11.0+

Promscale is API-compatible with Prometheus and stores your metrics in PostgreSQL
in a highly performant storage format with the help of TimescaleDB.
  • Loading branch information
feld committed Nov 2, 2022
1 parent 66fa0dc commit 47853d0
Show file tree
Hide file tree
Showing 7 changed files with 1,225 additions and 0 deletions.
1 change: 1 addition & 0 deletions databases/Makefile
Expand Up @@ -669,6 +669,7 @@
SUBDIR += postgresql-plproxy
SUBDIR += postgresql-plv8js
SUBDIR += postgresql-prefix
SUBDIR += postgresql-promscale
SUBDIR += postgresql-relay
SUBDIR += postgresql-repmgr
SUBDIR += postgresql-rum
Expand Down
50 changes: 50 additions & 0 deletions databases/postgresql-promscale/Makefile
@@ -0,0 +1,50 @@
PORTNAME= promscale
PORTVERSION= 0.7.0
PORTREVISION= 0
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-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 <bsd.port.mk>

0 comments on commit 47853d0

Please sign in to comment.