-
Notifications
You must be signed in to change notification settings - Fork 307
Expand file tree
/
Copy pathrules
More file actions
executable file
·48 lines (42 loc) · 2.02 KB
/
Copy pathrules
File metadata and controls
executable file
·48 lines (42 loc) · 2.02 KB
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
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
# where Debian's node looks for arch-specific (native) modules
NODE_MODULE_DIR = usr/lib/$(DEB_HOST_MULTIARCH)/nodejs/libcec
%:
dh $@ --with python3
override_dh_auto_configure:
dh_auto_configure -- -DENABLE_DOTNET_LIB=1 \
-DENABLE_RUST_LIB=1 \
-DDISABLE_BUILDINFO=1 \
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ON \
-DHAVE_LINUX_API=1 \
-DHAVE_EXYNOS_API=1 \
-DHAVE_AOCEC_API=1
# The Rust binding needs no step of its own: it has no crate dependencies, so
# cmake's ENABLE_RUST_LIB builds it --offline against the library in the build
# tree and installs the crate sources under /usr/share/cargo/registry. That is
# why it can use the cmake option where the Node binding cannot - npm would want
# the network.
override_dh_auto_install:
dh_auto_install
# Build the Node.js binding against the just-staged libCEC. node-gyp builds
# it (not cmake's ENABLE_NODE_LIB, which uses npm and would need network);
# PKG_CONFIG_SYSROOT_DIR makes pkg-config resolve the freshly-installed
# headers/lib under debian/tmp, and the addon links the SONAME (libcec.so.8)
# with no staging path baked in, so it resolves from /usr/lib at runtime.
cd src/nodejs && \
HOME=$(CURDIR)/debian/nodejs-home \
PKG_CONFIG_SYSROOT_DIR=$(CURDIR)/debian/tmp \
PKG_CONFIG_PATH=$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \
node-gyp rebuild --nodedir=/usr/include/nodejs
# stage the module tree where Debian's node resolves it
mkdir -p debian/tmp/$(NODE_MODULE_DIR)/lib \
debian/tmp/$(NODE_MODULE_DIR)/build/Release
cp -a src/nodejs/lib/*.js debian/tmp/$(NODE_MODULE_DIR)/lib/
cp -a src/nodejs/package.json debian/tmp/$(NODE_MODULE_DIR)/
cp -a src/nodejs/README.md debian/tmp/$(NODE_MODULE_DIR)/
cp -a src/nodejs/build/Release/cec_native.node \
debian/tmp/$(NODE_MODULE_DIR)/build/Release/