Page MenuHomeFreeBSD

D29362.diff
No OneTemporary

D29362.diff

Index: www/unit-nodejs/Makefile
===================================================================
--- /dev/null
+++ www/unit-nodejs/Makefile
@@ -0,0 +1,123 @@
+# Created by: Sergey Osokin <osa@FreeBSD.org>
+# $FreeBSD$
+
+MASTER_SITES= https://unit.nginx.org/download/:unit
+PKGNAMESUFFIX= -${UNIT_MODNAME}${FLAVOR:S|node||g}
+DISTFILES= unit-${UNIT_VERSION}${EXTRACT_SUFX}:unit \
+ node-gyp-${NODE_GYP_VERSION}${EXTRACT_SUFX}:node_gyp
+
+COMMENT= NodeJS module for NGINX Unit
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+FLAVORS= node node14 node12 node10
+FLAVOR?= ${FLAVORS:[1]}
+
+node10_BUILD_DEPENDS= node:www/node10 \
+ npm:www/npm-node10
+node12_BUILD_DEPENDS= node:www/node12 \
+ npm:www/npm-node12
+node14_BUILD_DEPENDS= node:www/node14 \
+ npm:www/npm-node14
+node_BUILD_DEPENDS= node:www/node \
+ npm:www/npm
+
+node10_RUN_DEPENDS= node:www/node10
+node12_RUN_DEPENDS= node:www/node12
+node14_RUN_DEPENDS= node:www/node14
+node_RUN_DEPENDS= node:www/node
+
+node10_CONFLICTS_INSTALL= unit-${UNIT_MODNAME} unit-${UNIT_MODNAME}14 unit-${UNIT_MODNAME}12
+node12_CONFLICTS_INSTALL= unit-${UNIT_MODNAME} unit-${UNIT_MODNAME}14 unit-${UNIT_MODNAME}10
+node14_CONFLICTS_INSTALL= unit-${UNIT_MODNAME} unit-${UNIT_MODNAME}12 unit-${UNIT_MODNAME}10
+node_CONFLICTS_INSTALL= unit-${UNIT_MODNAME}14 unit-${UNIT_MODNAME}12 unit-${UNIT_MODNAME}10
+
+node10_DESC= Use www/node10 as backend
+node12_DESC= Use www/node12 as backend
+node14_DESC= Use www/node14 as backend
+node_DESC= Use www/node as backend
+
+BUILD_DEPENDS+= ${LOCALBASE}/lib/libunit.a:devel/libunit
+RUN_DEPENDS+= unitd:www/unit
+
+USES= python:build
+
+DISTINFO_FILE= ${.CURDIR}/distinfo
+
+PATCHDIR= ${.CURDIR}/files
+
+UNIT_VERSION= 1.22.0
+NODE_GYP_VERSION= 7.1.2
+
+USE_GITHUB= nodefault
+GH_TUPLE= nodejs:node-gyp:${NODE_GYP_VERSION}
+
+OPTIONS_DEFINE= # reset
+
+UNIT_MODNAME= nodejs
+MAKE_ENV+= DISTDIR="${DISTDIR}" \
+ NODEJS_VERSION="${NODEJS_VERSION}" \
+ PYTHON="${PYTHON_CMD}" \
+ _DEVDIR="${_DEVDIR}"
+
+USE_RC_SUBR?= # reset to empty
+
+MASTERDIR= ${.CURDIR}/../unit
+
+PLIST_FILES= # reset
+PLIST_DIRS= # reset
+PLIST= ${.CURDIR}/pkg-plist
+
+_NODECMD= ${LOCALBASE}/bin/node --version
+_DEVDIR:= ${WRKDIR}/.devdir
+
+post-extract:
+ ${MKDIR} ${_DEVDIR}/bin
+ (cd ${WRKDIR}/node-gyp-${NODE_GYP_VERSION} && \
+ ${COPYTREE_SHARE} . ${_DEVDIR}/lib/node_modules/node-gyp \
+ "! ( -name \.* -or -path *\/\.github\/* -or -name test -or -path *\/test\/* )")
+ ${RLN} ${_DEVDIR}/lib/node_modules/node-gyp/bin/node-gyp.js \
+ ${_DEVDIR}/bin/node-gyp && \
+ ${CHMOD} 0755 ${_DEVDIR}/bin/node-gyp && \
+ ${LN} -s ${LOCALBASE}/lib/node_modules/npm/node_modules \
+ ${_DEVDIR}/lib/node_modules/node-gyp/node_modules
+
+post-patch:
+ ${REINPLACE_CMD} -i "" -e "s|%%PREFIX%%|${PREFIX}|g" \
+ ${WRKSRC}/src/nodejs/unit-http/binding.gyp
+ ${REINPLACE_CMD} -i "" -e "s|%%DEVDIR%%|${_DEVDIR}|g" \
+ ${WRKSRC}/src/nodejs/unit-http/package.json
+
+pre-configure:
+ (_NODEVER=$$(${_NODECMD} | ${SED} -n 's|^v\(.*\)|\1|p') && \
+ ${MKDIR} ${_DEVDIR}/$${_NODEVER}/include && \
+ ${RLN} ${LOCALBASE}/include/node ${_DEVDIR}/$${_NODEVER}/include/node && \
+ ${ECHO} "9" > ${_DEVDIR}/$${_NODEVER}/installVersion \
+ )
+
+post-configure:
+ cd ${CONFIGURE_WRKSRC} && \
+ ${SETENV} ${MAKE_ENV} ${CONFIGURE_CMD} nodejs \
+ --node-gyp=${_DEVDIR}/bin/node-gyp \
+ --local=${STAGEDIR}${PREFIX}/lib/node_modules/unit-http
+
+do-build:
+ cd ${CONFIGURE_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} node
+
+do-install:
+ cd ${CONFIGURE_WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE} node-local-install
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/src/nodejs/unit-http/package.json.orig \
+ ${STAGEDIR}${PREFIX}/lib/node_modules/unit-http/package.json
+ ${RM} -rf ${STAGEDIR}${PREFIX}/lib/node_modules/unit-http/build/Release/.deps \
+ ${STAGEDIR}${PREFIX}/lib/node_modules/unit-http/build/Release/obj.target
+ ${RM} ${STAGEDIR}${PREFIX}/lib/node_modules/unit-http/build/Makefile \
+ ${STAGEDIR}${PREFIX}/lib/node_modules/unit-http/build/Release/binding.Makefile \
+ ${STAGEDIR}${PREFIX}/lib/node_modules/unit-http/build/Release/config.gypi \
+ ${STAGEDIR}${PREFIX}/lib/node_modules/unit-http/build/Release/unit-http.target.mk \
+ ${STAGEDIR}${PREFIX}/lib/package-lock.json
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/node_modules/unit-http/build/Release/unit-http.node
+
+.include "${MASTERDIR}/Makefile"
Index: www/unit-nodejs/distinfo
===================================================================
--- /dev/null
+++ www/unit-nodejs/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1616356110
+SHA256 (unit-1.22.0.tar.gz) = d244e99ab7ff81c2926bdb97dd7d38e54a3361c7b8d3097e7dfbb2d155306b4b
+SIZE (unit-1.22.0.tar.gz) = 824763
+SHA256 (node-gyp-7.1.2.tar.gz) = e9a42f7afa3e5386c1dee094b8751f6924e75d6921166d1cad6ebafc19c54957
+SIZE (node-gyp-7.1.2.tar.gz) = 439880
Index: www/unit-nodejs/files/patch-auto-modules-nodejs
===================================================================
--- /dev/null
+++ www/unit-nodejs/files/patch-auto-modules-nodejs
@@ -0,0 +1,20 @@
+--- auto/modules/nodejs.orig 2021-02-04 10:22:33.000000000 -0500
++++ auto/modules/nodejs 2021-03-17 10:19:41.888060000 -0400
+@@ -147,7 +147,7 @@
+
+ ${NXT_NODE}: ${NXT_NODE}-copy $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC
+ ${NXT_NODE_EXPORTS} && \\
+- cd ${NXT_NODE_TMP} && ${NXT_NODE_GYP} configure build clean
++ cd ${NXT_NODE_TMP} && ${NXT_NODE_GYP} configure build clean --devdir=${_DEVDIR} --offline
+
+ ${NXT_NODE}-copy: ${NXT_NODE_VERSION_FILE}
+ mkdir -p ${NXT_BUILD_DIR}/src/
+@@ -158,7 +158,7 @@
+ $echo '#define NXT_NODE_VERNUM \$(NXT_VERNUM)' > $NXT_NODE_VERSION_FILE
+
+ ${NXT_NODE_TARBALL}: ${NXT_NODE}-copy
+- sed -e 's/"version"\s*:.*/"version": "\$(NXT_VERSION)",/' \
++ sed -e 's/"version"[[:space:]]*:.*/"version": "\$(NXT_VERSION)",/' \
+ ${NXT_NODE_TMP}/package.json > ${NXT_NODE_TMP}/package.json.tmp
+ mv ${NXT_NODE_TMP}/package.json.tmp ${NXT_NODE_TMP}/package.json
+ tar -zcvf ${NXT_NODE_TARBALL} -C ${NXT_NODE_TMP} .
Index: www/unit-nodejs/files/patch-src-nodejs-unit--http-binding.gyp
===================================================================
--- /dev/null
+++ www/unit-nodejs/files/patch-src-nodejs-unit--http-binding.gyp
@@ -0,0 +1,15 @@
+--- src/nodejs/unit-http/binding.gyp.orig 2021-03-10 13:58:22.190304000 -0500
++++ src/nodejs/unit-http/binding.gyp 2021-03-10 13:59:53.258512000 -0500
+@@ -12,10 +12,10 @@
+ ],
+ 'sources': ["unit.cpp", "addon.cpp"],
+ 'include_dirs': [
+- "<!(echo $UNIT_SRC_PATH)", "<!(echo $UNIT_BUILD_PATH)"
++ "/usr/include", "%%PREFIX%%/include"
+ ],
+ 'libraries': [
+- "<!(echo $UNIT_LIB_STATIC_PATH)"
++ "%%PREFIX%%/lib/libunit.a"
+ ]
+ }]
+ }
Index: www/unit-nodejs/files/patch-src-nodejs-unit--http-package.json
===================================================================
--- /dev/null
+++ www/unit-nodejs/files/patch-src-nodejs-unit--http-package.json
@@ -0,0 +1,15 @@
+--- src/nodejs/unit-http/package.json.orig 2021-03-19 15:58:15.259816000 -0400
++++ src/nodejs/unit-http/package.json 2021-03-19 15:58:52.582214000 -0400
+@@ -25,9 +25,9 @@
+ ],
+ "scripts": {
+ "clean": "node-gyp clean",
+- "configure": "node-gyp configure",
+- "build": "node-gyp build",
+- "install": "node-gyp configure build"
++ "configure": "node-gyp configure --offline --devdir=%%DEVDIR%%",
++ "build": "node-gyp build --offline --devdir=%%DEVDIR%%",
++ "install": "node-gyp configure build --offline --devdir=%%DEVDIR%%"
+ },
+ "author": "Alexander Borisov",
+ "license": "Apache-2.0",
Index: www/unit-nodejs/pkg-plist
===================================================================
--- /dev/null
+++ www/unit-nodejs/pkg-plist
@@ -0,0 +1,24 @@
+lib/node_modules/unit-http/addon.cpp
+lib/node_modules/unit-http/binding_pub.gyp
+lib/node_modules/unit-http/binding.gyp
+lib/node_modules/unit-http/http_server.js
+lib/node_modules/unit-http/http.js
+lib/node_modules/unit-http/nxt_napi.h
+lib/node_modules/unit-http/package.json
+lib/node_modules/unit-http/README.md
+lib/node_modules/unit-http/socket.js
+lib/node_modules/unit-http/unit.cpp
+lib/node_modules/unit-http/unit.h
+lib/node_modules/unit-http/utils.js
+lib/node_modules/unit-http/version.h
+lib/node_modules/unit-http/websocket_connection.js
+lib/node_modules/unit-http/websocket_frame.js
+lib/node_modules/unit-http/websocket_request.js
+lib/node_modules/unit-http/websocket_router_request.js
+lib/node_modules/unit-http/websocket_router.js
+lib/node_modules/unit-http/websocket_server.js
+lib/node_modules/unit-http/websocket.js
+lib/node_modules/unit-http/build/binding.Makefile
+lib/node_modules/unit-http/build/config.gypi
+lib/node_modules/unit-http/build/unit-http.target.mk
+lib/node_modules/unit-http/build/Release/unit-http.node

File Metadata

Mime Type
text/plain
Expires
Tue, Jul 21, 4:45 AM (33 m, 56 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35304175
Default Alt Text
D29362.diff (8 KB)

Event Timeline