dev-python/pygame: added ~arm64 keyword
[gentoo.git] / dev-python / pygame / pygame-1.9.6-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python3_{6,7,8} )
6
7 inherit flag-o-matic distutils-r1 virtualx
8
9 DESCRIPTION="Python bindings for SDL multimedia library"
10 HOMEPAGE="http://www.pygame.org/"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="LGPL-2.1"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~sparc ~x86"
16 IUSE="doc examples midi X"
17
18 DEPEND="dev-python/numpy[${PYTHON_USEDEP}]
19         >=media-libs/sdl-image-1.2.2[png,jpeg]
20         >=media-libs/sdl-mixer-1.2.4
21         >=media-libs/sdl-ttf-2.0.6
22         >=media-libs/smpeg-0.4.4-r1
23         midi? ( media-libs/portmidi )
24         X? ( >=media-libs/libsdl-1.2.5[X,video] )
25         !X? ( >=media-libs/libsdl-1.2.5 )"
26 RDEPEND="${DEPEND}"
27
28 # various module import and data path issues
29 RESTRICT=test
30
31 python_configure() {
32         PORTMIDI_INC_PORTTIME=1 LOCALBASE="${EPREFIX}/usr" \
33                 "${EPYTHON}" "${S}"/buildconfig/config.py -auto
34
35         if ! use X; then
36                 sed -e "s:^scrap :#&:" -i Setup || die "sed failed"
37         fi
38
39         # Disable automagic dependency on PortMidi.
40         if ! use midi; then
41                 sed -e "s:^pypm :#&:" -i Setup || die "sed failed"
42         fi
43 }
44
45 python_compile() {
46         if [[ ${EPYTHON} == python2* ]]; then
47                 local CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS}
48
49                 append-flags -fno-strict-aliasing
50         fi
51
52         distutils-r1_python_compile
53 }
54
55 python_test() {
56         PYTHONPATH="${BUILD_DIR}/lib" virtx "${EPYTHON}" -m pygame.tests
57 }
58
59 python_install() {
60         distutils-r1_python_install
61
62         # Bug #497720
63         rm -fr "${D}"$(python_get_sitedir)/pygame/{docs,examples,tests}/ || die
64 }
65
66 python_install_all() {
67         distutils-r1_python_install_all
68
69         if use doc; then
70                 docinto html
71                 dodoc -r docs/*
72         fi
73
74         if use examples; then
75                 insinto /usr/share/doc/${PF}/examples
76                 doins -r examples/*
77         fi
78 }