Skip to content

Instantly share code, notes, and snippets.

@earnubs
Last active October 4, 2017 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earnubs/b3c3d234058f54b65fad7c70d97ce2e0 to your computer and use it in GitHub Desktop.
Save earnubs/b3c3d234058f54b65fad7c70d97ce2e0 to your computer and use it in GitHub Desktop.
node6 sunos node-sass pkg
# $NetBSD$
PORTNAME= node-sass
PORTVERSION= 4.5.3
DISTNAME= v${PORTVERSION}
PKGNAME= node6-sass-binding-${DISTNAME}
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}
CATEGORIES= meta-pkgs
MASTER_SITES= ${MASTER_SITE_GITHUB:=sass/}
USE_TOOLS+= gmake
USE_LANGUAGES= c c++
PYTHON_FOR_BUILD_ONLY= yes
MAINTAINER= stephen.stewart@freeagent.com
HOMEPAGE= https://github.com/sass/node-sass
COMMENT= Node-sass smartos bindings
LICENSE= mit
BUILD_DEPENDS= nodejs>6:../../lang/nodejs6
INSTALLATION_DIRS= share/fa-node-sass/
do-build:
cd ${WRKSRC} && \
${MAKE_ENV} PYTHON=${PYTHONBIN} npm_config_directory=${WRKSRC} npm_config_target=6.9.1 npm_config_python=${PYTHONBIN} npm_config_jobs=4 npm install && \
${MAKE_ENV} PYTHON=${PYTHONBIN} npm_config_directory=${WRKSRC} npm_config_target=6.9.1 npm_config_python=${PYTHONBIN} npm_config_jobs=4 node scripts/build --force
do-install:
${INSTALL_LIB} ${WRKSRC}/vendor/sunos-x64-48/binding.node $(DESTDIR)$(PREFIX)/share/fa-node-sass/
.include "../../lang/python/pyversion.mk"
.include "../../mk/bsd.pkg.mk"
@earnubs
Copy link
Author

earnubs commented Oct 2, 2017

  g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/root/.node-gyp/6.9.1/include/node -I/root/.node-gyp/6.9.1/src -I/root/.node-gyp/6.9.1/deps/uv/include -I/root/.node-gyp/6.9.1/deps/v8/include -I../node_modules/nan -I../src/libsass/include  -fPIC -Wall -Wextra -Wno-unused-parameter -m64 -pthreads -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
...
In file included from ../src/binding.cpp:1:0:
../node_modules/nan/nan.h:24:26: fatal error: node_version.h: No such file or directory
 #include <node_version.h>
                          ^
compilation terminated.

@earnubs
Copy link
Author

earnubs commented Oct 2, 2017

CXX=/opt/local/gcc49/bin/g++ npm_config_target=6.9.1 ... fixed it, but pkglint complains about the absolute path :(

... which is also mentioned in https://wiki.smartos.org/display/DOC/Building+node.js+Binary+Addons+on+SmartMachines (hat tip @1stvamp)

@earnubs
Copy link
Author

earnubs commented Oct 4, 2017

#smartos, freenode, 4-OCT-2017

10:14 AM <beowulf> [...] pkglint complains about my hardcoded path in CXX (CXX=/opt/local/gcc49/bin/g++) but without that, g++ is failing to find node headers, any ideas?
10:22 AM <jperkin> beowulf: [...] if you add ${MAKE_ENV} to the call then that should automatically set stuff like CXX=${CXX:Q}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment