hasura skor 构建安装

hasura skor 前边有介绍过是一个挺不错的event trigger 插件,我们可以用来进行事件通知处理
官方有提供构建的方法,但是有些还是会有点问题,所以结合构建碰到的问题,修改下

clone 代码

 
git clone https://github.com/hasura/skor.git

安装依赖

  • libpg && curl
yum install -y libpqxx-devel libcurl-devel
说明: libpq 的安装也可以通过devel 包,这种一般出现在存在多版本pg 的情况下
  • 配置Makefile

    因为我电脑安装了多个pg 版本,所以通过手工指定pg_config,但是我指定配置使用pg9.6

配置PKG_CONFIG_PATH

export PKG_CONFIG_PATH=/usr/pgsql-9.6/lib/pkgconfig

修改makefile,方便进行libpq 查找

project := skor
current_dir := $(shell pwd)
registry := hasura
CPPFLAGS += $(shell pkg-config --cflags libpq)
CPPLIBS += $(shell pkg-config --libs libpq)
version := 0.2
build_dir := $(current_dir)/build
skor: src/skor.c src/req.c
 mkdir -p build
 c99 $(CPPFLAGS) $(CPPLIBS) -O3 -Wall -Wextra -o build/skor src/skor.c src/log.c -lcurl
clean:
 rm -rf build
image:
 docker build -t $(registry)/$(project):$(version) .

参考资料

https://github.com/hasura/skor
https://people.freedesktop.org/~dbn/pkg-config-guide.html
https://stackoverflow.com/questions/51498447/libpq-library-in-centos
https://serverfault.com/questions/316703/how-to-install-libpq-dev-on-centos-5-5

posted on 2019-06-04 10:47  荣锋亮  阅读(450)  评论(0编辑  收藏  举报

导航