Root/alpy/Makefile

1#
2# Copyright (C) 2012 David Kuehling <dvdkhlng TA gmx TOD de>
3#
4# License GPLv2 or later. NO WARRANTY.
5#
6# OpenWRT package for Alpy: Allegro Game Library bindings for Python
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=alpy
11PKG_VERSION:=0.1.5
12PKG_RELEASE:=2
13PKG_SOURCE:=Alpy-$(PKG_VERSION).tar.gz
14PKG_SOURCE_URL:=@SF/project/pyallegro/alpy/alpy-$(PKG_VERSION)
15PKG_MD5SUM:=862925d97931fc81d1e4c3b9159fe2b1
16PKG_BUILD_DIR:=$(BUILD_DIR)/Alpy-$(PKG_VERSION)
17PKG_INSTALL:=1
18
19include $(INCLUDE_DIR)/package.mk
20$(call include_mk, python-package.mk)
21
22define Package/alpy/Default
23  SECTION:=libs
24  CATEGORY:=Languages
25  TITLE:=Alpy (Allegro bindings for Python)
26  URL:=http://pyallegro.sourceforge.net/alpy.php
27  DEPENDS:=+python-mini +liballegro +liballegro-png +liballegro-jpeg
28  MAINTAINER:="David Kuehling" <dvdkhlng TA gmx TOD de>
29endef
30
31define Package/alpy/Default/description
32Python bindings for the Allegro Game and Graphics Library
33endef
34
35# note: needs thee the data-files from liballegro-demo for demo.py and others.
36define Package/alpy
37$(call Package/alpy/Default)
38endef
39
40define Package/alpy/description
41$(call Package/alpy/Default/description)
42endef
43
44define Package/alpy-examples
45$(call Package/alpy/Default)
46  TITLE:=Alpy Example Python Scripts
47  DEPENDS:=+alpy +liballegro-demo
48endef
49
50define Package/alpy-examples/description
51$(call Package/alpy/Default/description)
52This package contains the example python scripts, installed to /usr/share/alpy.
53First cd to the directory before running the scripts!
54endef
55
56define Build/Compile
57    $(call Build/Compile/PyMod,,build)
58endef
59# --prefix="$(PKG_INSTALL_DIR)/usr" , \
60# LOCALBASE="$(STAGING_DIR)/usr" \
61# NO_SCRAP=1 \
62# )
63
64# define Build/Configure
65# # $(call Build/Configure/Default)
66# endef
67
68# define Build/Compile
69# CC="$(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CFLAGS) $(TARGET_LDFLAGS)" \
70# $(PKG_BUILD_DIR)/setup.py build
71# endef
72
73# Note: this linking command will not work correctly when jpgalleg or loadpng
74# are linked statically (Note how we patched allegro to make sure these are
75# always compiled as dynamic libraries). The problem probably is, that
76# Build/Compile adds these linking options to early in the command line, and
77# static libraries won't resolve symbols of objects added later on.
78#
79# You won't even see a compiler error; the resulting _alpy.so would be going
80# to segfault due to an unresolved (0-pointer) symbol.
81TARGET_LDFLAGS += -ljpgalleg -lloadpng -lalleg -lpng -lz -lm -lpthread -ldl -lrt
82
83define Build/Install
84    $(call Build/Compile/PyMod,, \
85        install --root $(PKG_INSTALL_DIR) --prefix=/usr)
86endef
87
88# define Package/alpy/install
89# $(INSTALL_DIR) $(1)/usr
90# $(CP) $(PKG_INSTALL_DIR)/usr/* $(1)/usr/
91# endef
92
93define PyPackage/alpy/filespec
94+|$(PYTHON_PKG_DIR)/alpy.py
95+|$(PYTHON_PKG_DIR)/_alpy.so
96endef
97
98define Package/alpy-examples/install
99    $(INSTALL_DIR) $(1)/usr/share/alpy/examples
100    $(CP) $(PKG_BUILD_DIR)/examples/* $(1)/usr/share/alpy/examples/
101endef
102
103$(eval $(call PyPackage,alpy))
104$(eval $(call BuildPackage,alpy))
105$(eval $(call BuildPackage,alpy-examples))
106
107# The following comments configure the Emacs editor. Just ignore them.
108# Local Variables:
109# compile-command: "cd ~/src/nanonote/Alpy-0.1.5 && ~/bin/quilt-export target && make -C ~/h/src/qi/openwrt-xburst package/alpy/compile -j2 V=99"
110# End:
111

Archive Download this file



interactive