forked from huo-ju/photoprism-freebsd-port
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (63 loc) · 2.28 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
# $FreeBSD$
PORTNAME= photoprism
DISTVERSION= g20230513
CATEGORIES= www
MAINTAINER= [email protected]
COMMENT= Personal Photo Management Web Service
LICENSE= AGPLv3
RUN_DEPENDS= ffmpeg:multimedia/ffmpeg \
exiftool:graphics/p5-Image-ExifTool \
libheif>=1.14.2:graphics/libheif
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+
BUILD_DEPENDS= ${EXTRACT_DEPENDS}
USES= gmake go:1.19,modules python:3.6+,build
USE_GITHUB= yes
GH_ACCOUNT= photoprism
GH_PROJECT= photoprism
GH_TAGNAME= 0b780defbbf998a1f69a438c7a882bc0a5c8bf26
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>