File: rules

package info (click to toggle)
gotestsum 1.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,060 kB
  • sloc: sh: 89; makefile: 16
file content (32 lines) | stat: -rwxr-xr-x 1,263 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

export DH_GOLANG_EXCLUDES := contrib/notify cmd/internal/signalhandlerdriver

%:
	dh $@ --builddirectory=_build --buildsystem=golang --with=golang

override_dh_auto_configure:
	# We're building `gotest.tools/gotestum`, and we depend on `gotest.tools`.
	# That's a bit problematic, and here's why:
	# - dh_auto_configure first creates symlinks to build dependencies, hence:
	#     _build/src/gotest.tools -> /usr/share/gocode/src/gotest.tools
	# - then dh_auto_configure creates the directory for the sources we build:
	#     _build/src/gotest.tools/gotestsum
	# - hence overriding the initial symlink to gotest.tools...
	# So instead of one symlink to gotest.tools, we need symlinks to every
	# packages that gotest.tools provide.
	mkdir -pv _build/src/gotest.tools
	for file in /usr/share/gocode/src/gotest.tools/*; do \
	    ln -sv $$file _build/src/gotest.tools/; \
	done
	dh_auto_configure

override_dh_auto_test:
	# maybe due to GOPATH mode or Go modules mode.
	find _build/src/gotest.tools/gotestsum/testjson/testdata -type f -exec \
		sed -i -e 's| testjson/internal| internal|g' \
			-e 's| testjson | . |g' -e 's|\[testjson/internal|[internal|g' {} +
	dh_auto_test -- -short

override_dh_auto_install:
	dh_auto_install -- --no-source