The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python-pygame / python-pygame.mk
1 ################################################################################
2 #
3 # python-pygame
4 #
5 ################################################################################
6
7 # stable 1.9.1 release requires V4L which has been wiped out of recent Linux
8 # kernels, so use latest mercurial revision until next stable release is out.
9 PYTHON_PYGAME_VERSION = f0bb4a4b365d
10 PYTHON_PYGAME_SOURCE = pygame-$(PYTHON_PYGAME_VERSION).tar.gz
11 PYTHON_PYGAME_SITE = https://bitbucket.org/pygame/pygame
12 PYTHON_PYGAME_SITE_METHOD = hg
13 PYTHON_PYGAME_SETUP_TYPE = distutils
14 PYTHON_PYGAME_LICENSE = LGPLv2.1+
15 PYTHON_PYGAME_LICENSE_FILES = LGPL
16
17 ifeq ($(BR2_PACKAGE_PYTHON_PYGAME_IMAGE),y)
18 PYTHON_PYGAME_OPT_DEPENDS += sdl_image
19 endif
20
21 ifeq ($(BR2_PACKAGE_PYTHON_PYGAME_FONT),y)
22 PYTHON_PYGAME_OPT_DEPENDS += sdl_ttf
23 endif
24
25 ifeq ($(BR2_PACKAGE_PYTHON_PYGAME_MIXER),y)
26 PYTHON_PYGAME_OPT_DEPENDS += sdl_mixer
27 endif
28
29 PYTHON_PYGAME_DEPENDENCIES = sdl $(PYTHON_PYGAME_OPT_DEPENDS)
30
31 ifneq ($(BR2_PACKAGE_PYTHON_PYGAME_IMAGE),y)
32 define PYTHON_PYGAME_UNCONFIGURE_IMAGE
33         $(SED) 's/^imageext/#imageext/' $(@D)/Setup
34 endef
35 endif
36
37 ifneq ($(BR2_PACKAGE_PYTHON_PYGAME_FONT),y)
38 define PYTHON_PYGAME_UNCONFIGURE_FONT
39         $(SED) 's/^font/#font/' $(@D)/Setup
40 endef
41 endif
42
43 ifneq ($(BR2_PACKAGE_PYTHON_PYGAME_MIXER),y)
44 define PYTHON_PYGAME_UNCONFIGURE_MIXER
45         $(SED) 's/^mixer/#mixer/g' $(@D)/Setup
46 endef
47 endif
48
49 # Both require numpy or numeric python module
50 define PYTHON_PYGAME_UNCONFIGURE_SNDARRAY
51         $(SED) 's/^_numericsndarray/#_numericsndarray/' $(@D)/Setup
52 endef
53
54 define PYTHON_PYGAME_UNCONFIGURE_SURFARRAY
55         $(SED) 's/^_numericsurfarray/#_numericsurfarray/' $(@D)/Setup
56 endef
57
58 # Requires smpeg
59 define PYTHON_PYGAME_UNCONFIGURE_MOVIE
60         $(SED) 's/^movie/#movie/' $(@D)/Setup
61 endef
62
63 ifneq ($(BR2_PACKAGE_PYTHON_PYGAME_SCRAP),y)
64 define PYTHON_PYGAME_UNCONFIGURE_SCRAP
65         $(SED) 's/^scrap/#scrap/' $(@D)/Setup
66 endef
67 endif
68
69 PYTHON_PYGAME_SDL_FLAGS = $(shell $(STAGING_DIR)/usr/bin/sdl-config --cflags)
70 PYTHON_PYGAME_SDL_FLAGS += $(shell $(STAGING_DIR)/usr/bin/sdl-config --libs)
71
72 # Pygame needs a Setup file where options should be commented out if
73 # dependencies are not available
74 define PYTHON_PYGAME_CONFIGURE_CMDS
75         cp -f $(@D)/Setup.in $(@D)/Setup
76         $(SED) 's~^SDL = ~SDL = $(PYTHON_PYGAME_SDL_FLAGS) \n#~' $(@D)/Setup
77         $(SED) 's/^pypm/#pypm/' $(@D)/Setup
78         $(PYTHON_PYGAME_UNCONFIGURE_IMAGE)
79         $(PYTHON_PYGAME_UNCONFIGURE_FONT)
80         $(PYTHON_PYGAME_UNCONFIGURE_MIXER)
81         $(PYTHON_PYGAME_UNCONFIGURE_SNDARRAY)
82         $(PYTHON_PYGAME_UNCONFIGURE_SURFARRAY)
83         $(PYTHON_PYGAME_UNCONFIGURE_MOVIE)
84         $(PYTHON_PYGAME_UNCONFIGURE_SCRAP)
85 endef
86
87 define PYTHON_PYGAME_REMOVE_DOC
88         rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/pygame/docs
89 endef
90
91 PYTHON_PYGAME_POST_INSTALL_TARGET_HOOKS += PYTHON_PYGAME_REMOVE_DOC
92
93 define PYTHON_PYGAME_REMOVE_TESTS
94         rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/pygame/tests
95 endef
96
97 PYTHON_PYGAME_POST_INSTALL_TARGET_HOOKS += PYTHON_PYGAME_REMOVE_TESTS
98
99 ifneq ($(BR2_PACKAGE_PYTHON_PYGAME_EXAMPLES),y)
100 define PYTHON_PYGAME_REMOVE_EXAMPLES
101         rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/pygame/examples
102 endef
103 PYTHON_PYGAME_POST_INSTALL_TARGET_HOOKS += PYTHON_PYGAME_REMOVE_EXAMPLES
104 endif
105
106 $(eval $(python-package))