File: rules

package info (click to toggle)
js-of-ocaml 3.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,892 kB
  • sloc: ml: 67,699; javascript: 7,673; ansic: 309; makefile: 211; sh: 58; lisp: 23; perl: 4
file content (64 lines) | stat: -rwxr-xr-x 2,298 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-

DESTDIR=$(CURDIR)/debian/tmp

include /usr/share/ocaml/ocamlvars.mk

export OCAMLPATH := $(CURDIR)/_tmp$(OCAML_STDLIB_DIR)
export PATH := $(CURDIR)/_tmp/usr/bin:$(PATH)

DUNE_INSTALL := dune install --destdir=$(CURDIR)/_tmp --prefix=/usr --libdir=..$(OCAML_STDLIB_DIR)

%:
	dh $@ --with ocaml

override_dh_auto_clean:
	dh_auto_clean
	rm -rf _tmp

override_dh_auto_build:
	rm -f compiler/tests-jsoo/dune         # makes the build fail on amd64
	rm -f compiler/lib-runtime/tests/dune  # makes the build fail on bytecode architectures
ifeq ($(OCAML_HAVE_OCAMLOPT),no)
	sed -i 's/ native//' compiler/bin-js_of_ocaml/dune
endif
	dune build -p js_of_ocaml-compiler
	$(DUNE_INSTALL) js_of_ocaml-compiler
	dune build -p js_of_ocaml
	$(DUNE_INSTALL) js_of_ocaml
	dune build -p js_of_ocaml-ppx
	$(DUNE_INSTALL) js_of_ocaml-ppx
	dune build -p js_of_ocaml-ppx_deriving_json
	$(DUNE_INSTALL) js_of_ocaml-ppx_deriving_json
	dune build -p js_of_ocaml-lwt
	$(DUNE_INSTALL) js_of_ocaml-lwt
	dune build -p js_of_ocaml-ocamlbuild
	$(DUNE_INSTALL) js_of_ocaml-ocamlbuild
	dune build -p js_of_ocaml-toplevel
	$(DUNE_INSTALL) js_of_ocaml-toplevel
	dune build -p js_of_ocaml-tyxml
	$(DUNE_INSTALL) js_of_ocaml-tyxml
	$(MAKE) doc

override_dh_auto_test:
# Needs ppx-expect

override_dh_auto_install:
	rm -rf debian/tmp
	cp -a _tmp debian/tmp
	for u in js_of_ocaml-compiler js_of_ocaml-ppx js_of_ocaml-ppx_deriving_json js_of_ocaml-lwt js_of_ocaml-ocamlbuild js_of_ocaml-toplevel js_of_ocaml-tyxml; do \
	  rm -rf debian/tmp/usr/doc/$$u; \
	done
	rm -f debian/tmp/usr/doc/js_of_ocaml/LICENSE

override_dh_install:
	dh_install
	mkdir -p debian/libjs-of-ocaml-doc/usr/share/doc/libjs-of-ocaml-doc
	rm -rf debian/libjs-of-ocaml-doc/usr/share/doc/libjs-of-ocaml-doc/api
	rm -rf debian/libjs-of-ocaml-doc/usr/share/doc/libjs-of-ocaml-doc/manual
	cp -a _build/default/_doc/_html debian/libjs-of-ocaml-doc/usr/share/doc/libjs-of-ocaml-doc/api
	cp -a _build/default/manual debian/libjs-of-ocaml-doc/usr/share/doc/libjs-of-ocaml-doc/manual
	sed -i \
	  's@href=".*//maxcdn\.bootstrapcdn\.com/bootstrap.*/bootstrap\.min\.css"@href="file:///usr/share/javascript/bootstrap/css/bootstrap.min.css"@g' \
	  debian/libjs-of-ocaml-doc/usr/share/doc/libjs-of-ocaml-doc/manual/files/toplevel/index.html