I was looking at the same thing recently, and this was the approach that
worked for me (using cgo's pkg-config support).

---
 www/hugo/Makefile                             |  8 ++++++++
 ...m_bep_golibsass_internal_libsass_a__cgo_go | 19 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 
www/hugo/patches/patch-vendor_github_com_bep_golibsass_internal_libsass_a__cgo_go

diff --git a/www/hugo/Makefile b/www/hugo/Makefile
index 03f1bd13440..2da917b5f4a 100644
--- a/www/hugo/Makefile
+++ b/www/hugo/Makefile
@@ -4,6 +4,8 @@ ONLY_FOR_ARCHS =        ${GO_ARCHS}
 COMMENT =      fast and flexible static site generator
 
 DISTNAME =     hugo-0.71.0
+FLAVORS =      extended
+FLAVOR ?=
 
 CATEGORIES =   www
 
@@ -26,6 +28,12 @@ ALL_TARGET = github.com/gohugoio/hugo
 
 SEPARATE_BUILD =       Yes
 
+.if ${FLAVOR} == "extended"
+MODGO_FLAGS += --tags extended
+LIB_DEPENDS += www/libsass
+WANTLIB +=     ${COMPILER_LIBCXX} m sass
+.endif
+
 post-build:
        cd ${MODGO_WORKSPACE}/bin/ && ./hugo gen man
 
diff --git 
a/www/hugo/patches/patch-vendor_github_com_bep_golibsass_internal_libsass_a__cgo_go
 
b/www/hugo/patches/patch-vendor_github_com_bep_golibsass_internal_libsass_a__cgo_go
new file mode 100644
index 00000000000..f47b04f19b9
--- /dev/null
+++ 
b/www/hugo/patches/patch-vendor_github_com_bep_golibsass_internal_libsass_a__cgo_go
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+Link against libsass from ports.
+
+Index: vendor/github.com/bep/golibsass/internal/libsass/a__cgo.go
+--- vendor/github.com/bep/golibsass/internal/libsass/a__cgo.go.orig
++++ vendor/github.com/bep/golibsass/internal/libsass/a__cgo.go
+@@ -5,9 +5,6 @@
+ //
+ package libsass
+ 
+-// #cgo CFLAGS: -O2 -fPIC
+-// #cgo CPPFLAGS: -I../../libsass_src/include
+-// #cgo CXXFLAGS: -g -std=c++0x -O2 -fPIC
+-// #cgo LDFLAGS: -lstdc++ -lm
+-// #cgo darwin linux LDFLAGS: -ldl
++// #cgo pkg-config: libsass
++// #cgo CPPFLAGS: -DUSE_LIBSASS_SRC
+ import "C"
-- 
2.26.2

Reply via email to