-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
83 lines (66 loc) · 2.3 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
PORTNAME= photoprism
DISTVERSION= g20240915
CATEGORIES= www
MAINTAINER= huoju@devep.net
COMMENT= Personal Photo Management Web Service
WWW= https://photoprism.app
LICENSE= AGPLv3
RUN_DEPENDS= ffmpeg:multimedia/ffmpeg \
exiftool:graphics/p5-Image-ExifTool \
libheif>=1.14.2:graphics/libheif \
vips>=8.10:graphics/vips
LIB_DEPENDS= libtensorflow.so.1:science/libtensorflow1
EXTRACT_DEPENDS= \
${RUN_DEPENDS} \
bash:shells/bash \
git:devel/git \
gmake:devel/gmake \
npm:www/npm-node18 \
wget:ftp/wget:1.21+ \
pkg-config:devel/pkgconf
BUILD_DEPENDS= ${EXTRACT_DEPENDS}
USES= gmake go:1.22,modules python:3.6+,build
USE_GITHUB= yes
GH_ACCOUNT= photoprism
GH_PROJECT= photoprism
GH_TAGNAME= 240915-e1280b2fb
USE_RC_SUBR= photoprism
PHOTOPRISM_DATA_DIR= /var/db/photoprism
SUB_LIST+= PHOTOPRISM_DATA_DIR=${PHOTOPRISM_DATA_DIR}
SUB_FILES+= pkg-install pkg-message
BUILD_OS!=uname -s
BUILD_DATE!=date -u +%y%m%d
BUILD_ARCH!=uname -m
post-extract:
@${REINPLACE_CMD} -e 's|sha1sum|shasum|g' ${WRKSRC}/scripts/download-facenet.sh
@${REINPLACE_CMD} -e 's|sha1sum|shasum|g' ${WRKSRC}/scripts/download-nasnet.sh
@${REINPLACE_CMD} -e 's|sha1sum|shasum|g' ${WRKSRC}/scripts/download-nsfw.sh
@${REINPLACE_CMD} -e 's|--node-env=production||g' ${WRKSRC}/frontend/package.json
@${REINPLACE_CMD} -e 's| sudo npm install -g npm| cd frontend \&\& env NODE_ENV=production npm install -D webpack-cli|g' ${WRKSRC}/Makefile
@(cd ${WRKSRC} ; \
./scripts/download-facenet.sh ; \
./scripts/download-nasnet.sh ; \
./scripts/download-nsfw.sh ; \
)
pre-build:
${MKDIR} ${WRKSRC}/build
${MKDIR} ${WRKSRC}/assets/static/build
@( cd ${WRKSRC}/frontend; \
npm install --yes -D webpack-cli@^4.10.0 ; \
)
do-build:
@( cd ${WRKSRC}/frontend; \
env NODE_ENV=production npm run build ; \
)
@( cd ${WRKSRC} ; \
${SETENV} ${MAKE_ENV} ${GO_ENV} ${GO_CMD} build -v -ldflags \
"-X main.version=${DISTVERSION:C/^...//}-${GH_TAGNAME:C/([0-9a-f]{7}).*/\1/}-${BUILD_OS}-${BUILD_ARCH}-DEBUG-build-${BUILD_DATE}" \
-o ${WRKSRC}/photoprism ./cmd/photoprism/photoprism.go ; \
)
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/photoprism ${STAGEDIR}${PREFIX}/bin
${MKDIR} ${STAGEDIR}${PHOTOPRISM_DATA_DIR}
${CP} -r ${WRKSRC}/assets ${STAGEDIR}${PHOTOPRISM_DATA_DIR}/assets
pre-install:
${MKDIR} ${STAGEDIR}${PHOTOPRISM_DATA_DIR}
.include <bsd.port.mk>