File: rules

package info (click to toggle)
neovim 0.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 45,972 kB
  • sloc: ansic: 207,110; python: 3,135; sh: 1,992; awk: 704; perl: 374; makefile: 360; xml: 42; ruby: 6
file content (91 lines) | stat: -rwxr-xr-x 3,125 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/make -f

DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk

# _FORTIFY_SOURCE=2 doesn't work with Neovim due to some old style variable
# length arrays
CPPFLAGS := $(subst _FORTIFY_SOURCE=2,_FORTIFY_SOURCE=1,$(CPPFLAGS))
# cmake doesn't honor CPPFLAGS
CFLAGS += $(CPPFLAGS) -DDISABLE_LOG
CXXFLAGS += $(CPPFLAGS)

export CFLAGS CXXFLAGS LDFLAGS

BITOP_DEPENDS = lua-bitop
PREFER_LUA = ON
FUNCTIONALTEST =
UNITTEST =
ifneq (,$(findstring ok installed,$(shell dpkg-query -W -f '$${Status}' lua-nvim 2>&1)))
  FUNCTIONALTEST = functionaltest
endif

ifneq (,$(findstring ok installed,$(shell dpkg-query -W -f '$${Status}' luajit 2>&1)))
  BITOP_DEPENDS =
  PREFER_LUA = OFF
  UNITTEST = unittest
endif

export USERNAME = team+vim
export HOSTNAME = tracker.debian.org

USER = $(shell id -un)
ID = $(shell id -u)
GID = $(shell id -g)

ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
  BUILD = ninja -v -C build
else
  BUILD = ninja -C build
endif

%:
	dh $@ --buildsystem=cmake --builddirectory=build

override_dh_auto_configure:
	dh_auto_configure -- -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUSTED_OUTPUT_TYPE=nvim -DPREFER_LUA=$(PREFER_LUA) -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(DEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1

override_dh_auto_build:
	$(BUILD)

override_dh_auto_install:
	env DESTDIR=$(CURDIR)/debian/tmp $(BUILD) install

override_dh_install:
	dh_install --fail-missing

override_dh_auto_clean:
	$(MAKE) clean
	dh_auto_clean

override_dh_gencontrol:
	dh_gencontrol -- -Vneovim:Depends=$(BITOP_DEPENDS)

debian/passwd:
	printf -- "$(USER):x:$(ID):$(GID):nvim test:$(CURDIR)/debian/fakehome:/bin/false\n" > debian/passwd
	printf -- "users:x:$(GID):\n" > debian/group

debian/fakehome:
	mkdir -p debian/fakehome

debian/fakehome/locale-stamp:
	mkdir -p debian/fakehome/locale
	localedef -f UTF-8 -i en_US debian/fakehome/locale/en_US.UTF-8
	touch $@

override_dh_auto_test-indep:

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# Force SHELL=/bin/bash so we have a printf that understands \x07
override_dh_auto_test-arch: export SHELL=/bin/bash
override_dh_auto_test-arch: debian/passwd debian/fakehome debian/fakehome/locale-stamp
	env "LOCPATH=$(CURDIR)/debian/fakehome/locale" "HOME=$(CURDIR)/debian/fakehome" $(MAKE) -C src/nvim/testdir clean
	env "LOCPATH=$(CURDIR)/debian/fakehome/locale" "HOME=$(CURDIR)/debian/fakehome" TERM=xterm $(MAKE) -C src/nvim/testdir "NVIM_PRG=$(CURDIR)/build/bin/nvim"
ifneq (,$(FUNCTIONALTEST))
	env "LOCPATH=$(CURDIR)/debian/fakehome/locale" BUSTED_ARGS="--lua=lua5.1" TEST_SKIP_FRAGILE=1 "HOME=$(CURDIR)/debian/fakehome" LD_PRELOAD=libnss_wrapper.so "NSS_WRAPPER_PASSWD=$(CURDIR)/debian/passwd" "NSS_WRAPPER_GROUP=$(CURDIR)/debian/group" $(BUILD) $(FUNCTIONALTEST)
endif
ifneq (,$(UNITTEST))
	env "LOCPATH=$(CURDIR)/debian/fakehome/locale" BUSTED_ARGS="--lua=luajit" TEST_SKIP_FRAGILE=1 "HOME=$(CURDIR)/debian/fakehome" LD_PRELOAD=libnss_wrapper.so "NSS_WRAPPER_PASSWD=$(CURDIR)/debian/passwd" "NSS_WRAPPER_GROUP=$(CURDIR)/debian/group" $(BUILD) $(UNITTEST)
endif
endif