libgtk3: remove non-existent configure options
[buildroot-gz.git] / package / python-pygame / python-pygame.mk
blob1ef2bdf62b559ef78f02974890c1cb358b8c268e
1 ################################################################################
3 # python-pygame
5 ################################################################################
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 = d61ea8eabd56
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
17 ifeq ($(BR2_PACKAGE_PYTHON_PYGAME_IMAGE),y)
18 PYTHON_PYGAME_OPT_DEPENDS += sdl_image
19 endif
21 ifeq ($(BR2_PACKAGE_PYTHON_PYGAME_FONT),y)
22 PYTHON_PYGAME_OPT_DEPENDS += sdl_ttf
23 endif
25 ifeq ($(BR2_PACKAGE_PYTHON_PYGAME_MIXER),y)
26 PYTHON_PYGAME_OPT_DEPENDS += sdl_mixer
27 endif
29 PYTHON_PYGAME_DEPENDENCIES = sdl $(PYTHON_PYGAME_OPT_DEPENDS)
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
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
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
49 # Both require numpy or numeric python module
50 define PYTHON_PYGAME_UNCONFIGURE_SNDARRAY
51 $(SED) 's/^_numericsndarray/#_numericsndarray/' $(@D)/Setup
52 endef
54 define PYTHON_PYGAME_UNCONFIGURE_SURFARRAY
55 $(SED) 's/^_numericsurfarray/#_numericsurfarray/' $(@D)/Setup
56 endef
58 # Requires smpeg
59 define PYTHON_PYGAME_UNCONFIGURE_MOVIE
60 $(SED) 's/^movie/#movie/' $(@D)/Setup
61 endef
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
69 define PYTHON_PYGAME_UNCONFIGURE_FREETYPE
70 $(SED) 's/^_freetype/#_freetype/' $(@D)/Setup
71 endef
73 PYTHON_PYGAME_SDL_FLAGS = `$(STAGING_DIR)/usr/bin/sdl-config --cflags`
74 PYTHON_PYGAME_SDL_FLAGS += `$(STAGING_DIR)/usr/bin/sdl-config --libs`
76 # Pygame needs a Setup file where options should be commented out if
77 # dependencies are not available
78 define PYTHON_PYGAME_CONFIGURE_CMDS
79 cp -f $(@D)/Setup.in $(@D)/Setup
80 $(SED) "s~^SDL = ~SDL = $(PYTHON_PYGAME_SDL_FLAGS) \n#~" $(@D)/Setup
81 $(SED) 's/^pypm/#pypm/' $(@D)/Setup
82 $(PYTHON_PYGAME_UNCONFIGURE_IMAGE)
83 $(PYTHON_PYGAME_UNCONFIGURE_FONT)
84 $(PYTHON_PYGAME_UNCONFIGURE_MIXER)
85 $(PYTHON_PYGAME_UNCONFIGURE_SNDARRAY)
86 $(PYTHON_PYGAME_UNCONFIGURE_SURFARRAY)
87 $(PYTHON_PYGAME_UNCONFIGURE_MOVIE)
88 $(PYTHON_PYGAME_UNCONFIGURE_SCRAP)
89 $(PYTHON_PYGAME_UNCONFIGURE_FREETYPE)
90 endef
92 define PYTHON_PYGAME_REMOVE_DOC
93 rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/pygame/docs
94 endef
96 PYTHON_PYGAME_POST_INSTALL_TARGET_HOOKS += PYTHON_PYGAME_REMOVE_DOC
98 define PYTHON_PYGAME_REMOVE_TESTS
99 rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/pygame/tests
100 endef
102 PYTHON_PYGAME_POST_INSTALL_TARGET_HOOKS += PYTHON_PYGAME_REMOVE_TESTS
104 ifneq ($(BR2_PACKAGE_PYTHON_PYGAME_EXAMPLES),y)
105 define PYTHON_PYGAME_REMOVE_EXAMPLES
106 rm -rf $(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages/pygame/examples
107 endef
108 PYTHON_PYGAME_POST_INSTALL_TARGET_HOOKS += PYTHON_PYGAME_REMOVE_EXAMPLES
109 endif
111 $(eval $(python-package))