Skip to content

Commit fcee584

Browse files
committed
Packages: added wasm module packaging for deb-based distros.
1 parent d5c2ed1 commit fcee584

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

pkg/deb/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ include Makefile.jsc17
3232
include Makefile.jsc18
3333
include Makefile.jsc19
3434
include Makefile.jsc20
35+
include Makefile.wasm
3536
endif
3637

3738
# Ubuntu 22.10
@@ -47,6 +48,7 @@ include Makefile.jsc11
4748
include Makefile.jsc17
4849
include Makefile.jsc18
4950
include Makefile.jsc19
51+
include Makefile.wasm
5052
endif
5153

5254
# Ubuntu 22.04
@@ -61,6 +63,7 @@ include Makefile.jsc-common
6163
include Makefile.jsc11
6264
include Makefile.jsc17
6365
include Makefile.jsc18
66+
include Makefile.wasm
6467
endif
6568

6669
# Ubuntu 21.10
@@ -77,6 +80,7 @@ include Makefile.jsc11
7780
include Makefile.jsc16
7881
include Makefile.jsc17
7982
include Makefile.jsc18
83+
include Makefile.wasm
8084
endif
8185

8286
# Ubuntu 20.04
@@ -89,6 +93,7 @@ include Makefile.perl
8993
include Makefile.ruby
9094
include Makefile.jsc-common
9195
include Makefile.jsc11
96+
include Makefile.wasm
9297
endif
9398

9499
# Ubuntu 18.04
@@ -104,6 +109,7 @@ include Makefile.ruby
104109
include Makefile.jsc-common
105110
include Makefile.jsc8
106111
include Makefile.jsc11
112+
include Makefile.wasm
107113
endif
108114

109115
# Debian 12
@@ -115,6 +121,7 @@ include Makefile.perl
115121
include Makefile.ruby
116122
include Makefile.jsc-common
117123
include Makefile.jsc17
124+
include Makefile.wasm
118125
endif
119126

120127
# Debian 11
@@ -127,6 +134,7 @@ include Makefile.perl
127134
include Makefile.ruby
128135
include Makefile.jsc-common
129136
include Makefile.jsc11
137+
include Makefile.wasm
130138
endif
131139

132140
# Debian 10
@@ -139,6 +147,7 @@ include Makefile.perl
139147
include Makefile.ruby
140148
include Makefile.jsc-common
141149
include Makefile.jsc11
150+
include Makefile.wasm
142151
endif
143152

144153
CONFIGURE_ARGS_COMMON=\

pkg/deb/Makefile.wasm

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
MODULES+= wasm
2+
MODULE_SUFFIX_wasm= wasm
3+
4+
MODULE_SUMMARY_wasm= WASM module for NGINX Unit
5+
6+
MODULE_VERSION_wasm= $(VERSION)
7+
MODULE_RELEASE_wasm= 1
8+
9+
MODULE_CONFARGS_wasm= wasm --include-path=\$$(CURDIR)/pkg/contrib/wasmtime/crates/c-api/include --lib-path=\$$(CURDIR)/pkg/contrib/wasmtime/target/release
10+
MODULE_MAKEARGS_wasm= wasm
11+
MODULE_INSTARGS_wasm= wasm-install
12+
13+
MODULE_SOURCES_wasm=
14+
15+
BUILD_DEPENDS_wasm=
16+
MODULE_BUILD_DEPENDS_wasm=
17+
MODULE_DEPENDS_wasm=
18+
19+
BUILD_DEPENDS+= $(BUILD_DEPENDS_wasm)
20+
21+
define MODULE_PREBUILD_wasm
22+
\$$(MAKE) -C pkg/contrib .wasmtime
23+
endef
24+
export MODULE_PREBUILD_wasm
25+
26+
define MODULE_PREINSTALL_wasm
27+
endef
28+
export MODULE_PREINSTALL_wasm
29+
30+
define MODULE_POSTINSTALL_wasm
31+
mkdir -p debian/unit-wasm/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/
32+
install -m 755 -p pkg/contrib/wasmtime/target/release/libwasmtime.so debian/unit-wasm/usr/lib/\$$(dpkg-architecture -q DEB_HOST_MULTIARCH)/
33+
endef
34+
export MODULE_POSTINSTALL_wasm
35+
36+
define MODULE_POST_wasm
37+
cat <<BANNER
38+
----------------------------------------------------------------------
39+
40+
The $(MODULE_SUMMARY_wasm) has been installed.
41+
42+
Online documentation is available at https://unit.nginx.org
43+
44+
----------------------------------------------------------------------
45+
BANNER
46+
endef
47+
export MODULE_POST_wasm

pkg/deb/debian.module/rules.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ BASEDIR = $(CURDIR)
1717

1818
config.env.%:
1919
dh_testdir
20+
%%MODULE_PREBUILD%%
2021
mkdir -p $(BUILDDIR_$*)
2122
cp -Pa $(CURDIR)/auto $(BUILDDIR_$*)/
2223
cp -Pa $(CURDIR)/configure $(BUILDDIR_$*)/

0 commit comments

Comments
 (0)