PORTNAME= remark42 DISTVERSIONPREFIX= v DISTVERSION= 1.12.1 PORTREVISION= 4 CATEGORIES= www MASTER_SITES= LOCAL/delphij:npmcache DISTFILES= ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX}:npmcache MAINTAINER= delphij@FreeBSD.org COMMENT= Privacy-focused lightweight commenting engine WWW= https://remark42.com/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS+= npm-node20>0:www/npm-node20 USES= cpe go:modules tar:xz GO_BUILDFLAGS= -ldflags "-s -w -X main.revision=${DISTVERSION}" GO_TARGET= app:${PREFIX}/libexec/${PORTNAME} GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME}/backend LD_FLAG_X_PREFIX= -X ${GO_PKGNAME}/version MAKE_ENV+= npm_config_offline=true USE_RC_SUBR= ${PORTNAME} USE_GITHUB= yes GH_ACCOUNT= umputun PLIST_FILES= libexec/${PORTNAME} GH_TUPLE= \ Depado:bfchroma:v2.0.0:depado_bfchroma_v2/vendor/github.com/Depado/bfchroma/v2 \ PuerkitoBio:goquery:v1.8.1:puerkitobio_goquery/vendor/github.com/PuerkitoBio/goquery \ ajg:form:v1.5.1:ajg_form/vendor/github.com/ajg/form \ alecthomas:chroma:v2.8.0:alecthomas_chroma_v2/vendor/github.com/alecthomas/chroma/v2 \ andybalholm:cascadia:v1.3.2:andybalholm_cascadia/vendor/github.com/andybalholm/cascadia \ aymerick:douceur:v0.2.0:aymerick_douceur/vendor/github.com/aymerick/douceur \ cespare:xxhash:v2.2.0:cespare_xxhash_v2/vendor/github.com/cespare/xxhash/v2 \ davecgh:go-spew:v1.1.1:davecgh_go_spew/vendor/github.com/davecgh/go-spew \ dghubble:oauth1:v0.7.2:dghubble_oauth1/vendor/github.com/dghubble/oauth1 \ dgryski:go-rendezvous:9f7001d12a5f:dgryski_go_rendezvous/vendor/github.com/dgryski/go-rendezvous \ didip:tollbooth:v7.0.1:didip_tollbooth_v7/vendor/github.com/didip/tollbooth/v7 \ didip:tollbooth_chi:d662a7f6928f:didip_tollbooth_chi/vendor/github.com/didip/tollbooth_chi \ dlclark:regexp2:v1.10.0:dlclark_regexp2/vendor/github.com/dlclark/regexp2 \ etcd-io:bbolt:v1.3.7:etcd_io_bbolt/vendor/go.etcd.io/bbolt \ go-chi:chi:v5.0.10:go_chi_chi_v5/vendor/github.com/go-chi/chi/v5 \ go-chi:cors:v1.2.1:go_chi_cors/vendor/github.com/go-chi/cors \ go-chi:render:v1.0.3:go_chi_render/vendor/github.com/go-chi/render \ go-oauth2:oauth2:v4.5.2:go_oauth2_oauth2_v4/vendor/github.com/go-oauth2/oauth2/v4 \ go-pkgz:auth:v1.22.0:go_pkgz_auth/vendor/github.com/go-pkgz/auth \ go-pkgz:email:v0.4.1:go_pkgz_email/vendor/github.com/go-pkgz/email \ go-pkgz:expirable-cache:v1.0.0:go_pkgz_expirable_cache/vendor/github.com/go-pkgz/expirable-cache \ go-pkgz:jrpc:v0.3.0:go_pkgz_jrpc/vendor/github.com/go-pkgz/jrpc \ go-pkgz:lcw:v1.0.2:go_pkgz_lcw/vendor/github.com/go-pkgz/lcw \ go-pkgz:lgr:v0.11.0:go_pkgz_lgr/vendor/github.com/go-pkgz/lgr \ go-pkgz:notify:v0.2.0:go_pkgz_notify/vendor/github.com/go-pkgz/notify \ go-pkgz:repeater:v1.1.3:go_pkgz_repeater/vendor/github.com/go-pkgz/repeater \ go-pkgz:rest:v1.17.0:go_pkgz_rest/vendor/github.com/go-pkgz/rest \ go-pkgz:syncs:v1.3.2:go_pkgz_syncs/vendor/github.com/go-pkgz/syncs \ go-redis:redis:v8.11.5:go_redis_redis_v8/vendor/github.com/go-redis/redis/v8 \ go-yaml:yaml:v3.0.1:go_yaml_yaml/vendor/gopkg.in/yaml.v3 \ golang-jwt:jwt:v3.2.2:golang_jwt_jwt/vendor/github.com/golang-jwt/jwt \ golang:appengine:v1.6.7:golang_appengine/vendor/google.golang.org/appengine \ golang:crypto:v0.12.0:golang_crypto/vendor/golang.org/x/crypto \ golang:image:v0.11.0:golang_image/vendor/golang.org/x/image \ golang:net:v0.14.0:golang_net/vendor/golang.org/x/net \ golang:oauth2:v0.11.0:golang_oauth2/vendor/golang.org/x/oauth2 \ golang:protobuf:v1.5.3:golang_protobuf/vendor/github.com/golang/protobuf \ golang:snappy:v0.0.4:golang_snappy/vendor/github.com/golang/snappy \ golang:sync:v0.3.0:golang_sync/vendor/golang.org/x/sync \ golang:sys:v0.11.0:golang_sys/vendor/golang.org/x/sys \ golang:text:v0.12.0:golang_text/vendor/golang.org/x/text \ google:uuid:v1.3.0:google_uuid/vendor/github.com/google/uuid \ googleapis:google-cloud-go:compute/v1.23.0:googleapis_google_cloud_go_compute/vendor/cloud.google.com/go \ googleapis:google-cloud-go:compute/metadata/v0.2.3:googleapis_google_cloud_go/vendor/cloud.google.com/go/compute/metadata \ gorilla:css:v1.0.0:gorilla_css/vendor/github.com/gorilla/css \ gorilla:feeds:v1.1.1:gorilla_feeds/vendor/github.com/gorilla/feeds \ gorilla:websocket:v1.5.0:gorilla_websocket/vendor/github.com/gorilla/websocket \ hashicorp:errwrap:v1.1.0:hashicorp_errwrap/vendor/github.com/hashicorp/errwrap \ hashicorp:go-multierror:v1.1.1:hashicorp_go_multierror/vendor/github.com/hashicorp/go-multierror \ hashicorp:golang-lru:v0.5.4:hashicorp_golang_lru/vendor/github.com/hashicorp/golang-lru \ jessevdk:go-flags:v1.5.0:jessevdk_go_flags/vendor/github.com/jessevdk/go-flags \ klauspost:compress:v1.16.7:klauspost_compress/vendor/github.com/klauspost/compress \ kyokomi:emoji:v2.2.12:kyokomi_emoji_v2/vendor/github.com/kyokomi/emoji/v2 \ microcosm-cc:bluemonday:v1.0.25:microcosm_cc_bluemonday/vendor/github.com/microcosm-cc/bluemonday \ mongodb:mongo-go-driver:v1.12.1:mongodb_mongo_go_driver/vendor/go.mongodb.org/mongo-driver \ montanaflynn:stats:v0.7.1:montanaflynn_stats/vendor/github.com/montanaflynn/stats \ nullrocks:identicon:7875f45b0022:nullrocks_identicon/vendor/github.com/nullrocks/identicon \ pmezard:go-difflib:v1.0.0:pmezard_go_difflib/vendor/github.com/pmezard/go-difflib \ protocolbuffers:protobuf-go:v1.31.0:protocolbuffers_protobuf_go/vendor/google.golang.org/protobuf \ rs:xid:v1.5.0:rs_xid/vendor/github.com/rs/xid \ russross:blackfriday:v2.1.0:russross_blackfriday_v2/vendor/github.com/russross/blackfriday/v2 \ skip2:go-qrcode:da1b6568686e:skip2_go_qrcode/vendor/github.com/skip2/go-qrcode \ slack-go:slack:v0.12.2:slack_go_slack/vendor/github.com/slack-go/slack \ stretchr:testify:v1.8.4:stretchr_testify/vendor/github.com/stretchr/testify \ uber-go:goleak:v1.2.1:uber_go_goleak/vendor/go.uber.org/goleak \ xdg-go:pbkdf2:v1.0.0:xdg_go_pbkdf2/vendor/github.com/xdg-go/pbkdf2 \ xdg-go:scram:v1.1.2:xdg_go_scram/vendor/github.com/xdg-go/scram \ xdg-go:stringprep:v1.0.4:xdg_go_stringprep/vendor/github.com/xdg-go/stringprep \ youmark:pkcs8:1326539a0a0a:youmark_pkcs8/vendor/github.com/youmark/pkcs8 REMARK_PIDDIR= /var/run/${PORTNAME}/ REMARK_USER?= www REMARK_DATADIR?=/var/db/${PORTNAME} REMARK_URL?= http://127.0.0.1:8080 USE_RC_SUBR= remark SUB_LIST+= REMARK_PIDDIR=${REMARK_PIDDIR} \ REMARK_USER=${REMARK_USER} \ REMARK_DATADIR=${REMARK_DATADIR} # (for maintainer) helper target to generate node_modules tarball make-npm-cache: extract @cd ${WRKDIR} && ${RM} -r .npm @cd ${WRKSRC}/frontend/apps/${PORTNAME} \ && ${SETENV} HOME=${WRKDIR} npm install --force @cd ${WRKDIR} \ && ${TAR} -cJf ${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX} .npm \ ${PORTNAME}-${DISTVERSION}/frontend/apps/remark42/package-lock.json \ && ${ECHO} "Please upload the file ${WRKDIR}/${PORTNAME}-npm-cache-${DISTVERSION}${EXTRACT_SUFX}" pre-build: cd ${WRKSRC}/frontend/apps/${PORTNAME} && ${SETENV} HOME=${WRKDIR} npm install --force cd ${WRKSRC}/frontend/apps/${PORTNAME} && ${SETENV} HOME=${WRKDIR} npm run build ${RM} -r ${WRKSRC}/backend/app/cmd/web/ ${MV} ${WRKSRC}/frontend/apps/remark42/public ${WRKSRC}/backend/app/cmd/web ${FIND} ${WRKSRC}/backend/app/cmd/web -type f \( -name '*.html' -or -name '*.js' -or -name '*.mjs' \) \ -print -exec ${REINPLACE_CMD} -e "s|{% REMARK_URL %}|${REMARK_URL}|g" {} + do-build: cd ${WRKSRC}/backend && ${SETENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} build ${GO_BUILDFLAGS} \ -o ${GO_WRKDIR_BIN}/${PORTNAME} ./app .include