File: rules

package info (click to toggle)
psychopy 2021.2.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 53,736 kB
  • sloc: python: 453,095; javascript: 3,022; makefile: 148; sh: 132; xml: 9
file content (70 lines) | stat: -rwxr-xr-x 2,599 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
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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

# We will disallow to fail on unstable/sid/UNRELEASED, but let them pass otherwise
# TODO:  return back exit 1 upon failures
include /usr/share/dpkg/default.mk
failed_tests_cmd = $(shell dpkg-parsechangelog --count 1 --format rfc822 | awk '/^Distribution:/{print $$2;}' | grep -q -e '\(sid\|unstable\|UNRELEASED\)' && echo ":" || echo ":")

PYVER = $(shell py3versions -vd)

export DEBPYTHON_SUPPORTED=$(PYVER)
export HOME=$(CURDIR)/build
DEB_DESTDIR=$(CURDIR)/debian/psychopy
XVFB_RUN=xvfb-run -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset"

# Avoid any network interactions
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/


%:
	dh $@ --with python3 --buildsystem pybuild

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	echo "I: The test suite is not compatible with pytest > 4.0"
	echo "   See https://discourse.psychopy.org/t/how-to-run-unit-tests/7315/7"
	find . -name psychopy -type f -executable
	USER=nobody TRAVIS=true \
		$(XVFB_RUN) python3 -m pytest --tb=line -s -v -m "not needs_sound" ../psychopy || { echo "TESTS FAILED"; $(failed_tests_cmd); }
	# nosetest does not change anything
	# LC_ALL=C.UTF-8 PYTHONPATH=$PWD xvfb-run -s "-screen 0 1280x1024x24 -noreset" nosetests -s -v psychopy/tests 2>&1
endif

override_dh_auto_install:
	dh_auto_install
## Fix up permissions on images -- pushed upstream, but left here
## just to make sure everything is ok
	find $(DEB_DESTDIR) -name \*.png -o -name \*.ico -o -name \*.jpg | \
		xargs -r chmod a-x
	find debian -name packaging -type d | xargs rm -rf

## convert and install icon's .xpm manually
	convert psychopy/app/Resources/psychopy.png -geometry 32x32 \
      $(DEB_DESTDIR)/usr/share/pixmaps/psychopy.xpm
## Rename upstream's runner FIXME: runner ended up in /usr/lib
	# mv $(DEB_DESTDIR)/usr/bin/psychopyApp.py $(DEB_DESTDIR)/usr/bin/psychopy

debian/psychopy.1: debian/psychopy.sh
	PYTHONPATH=. $(XVFB_RUN) help2man -N -n "Creating psychology stimuli in Python" $^ > $@
## cleanup
	find debian -name __pycache__ -type d | xargs rm -rf

override_dh_link:
	dh_link -ppsychopy /usr/lib/python3/dist-packages/psychopy/demos usr/share/doc/psychopy/examples/demos
	dh_link

override_dh_installman:  debian/psychopy.1
	dh_installman

override_dh_installchangelogs:
	dh_installchangelogs psychopy/CHANGELOG.txt

override_dh_clean::
	rm -f debian/psychopy.1
	rm -rf build dist PsychoPy.egg-info
	dh_clean

# do not actually install demos -- just symlink to them
#DEB_INSTALL_EXAMPLES_psychopy := psychopy/demos/*