This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project gfxprim.git.
The branch, master has been updated via f075f1935eff2f786cc3b481d1ec7037f6654a9a (commit) from 80d98abae1846cff3ffcd16edf2b00c87ad19020 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- http://repo.or.cz/w/gfxprim.git/commit/f075f1935eff2f786cc3b481d1ec7037f6654...
commit f075f1935eff2f786cc3b481d1ec7037f6654a9a Author: Cyril Hrubis metan@ucw.cz Date: Fri Apr 19 00:12:12 2013 +0200
build: First attempt for 'make install' for python bindigs.
Signed-off-by: Cyril Hrubis metan@ucw.cz
diff --git a/Makefile b/Makefile index 3da6589..bfd39a6 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,11 @@ include $(TOPDIR)/pre.mk
TOP_MAKE=1
+ifneq ($(MAKECMDGOALS),install) SUBDIRS=include libs tests pylib demos build +else +SUBDIRS=pylib +endif
libs: include build: libs diff --git a/configure b/configure index fed17b4..af9f8fc 100755 --- a/configure +++ b/configure @@ -5,6 +5,7 @@ import os import sys from optparse import OptionParser +from subprocess import check_output
def header_exists(cfg, filename): fpath = cfg['include_path'][0] + '/' + filename @@ -37,6 +38,16 @@ def c_compiler_exists(cfg): "Checking for working compiler (%s) ... " % cfg["CC"][0])
+def python_version(cfg): + sys.stderr.write("Cddhecking for python-config Python version ... ") + + res = str(check_output("%s --ldflags" % cfg['PYTHON_CONFIG'][0], shell=True)) + res = res[res.find('-lpython')+8:] + res = res[:3] + + sys.stderr.write("%sn" % res) + return res + def python_module_installed(cfg, module): sys.stderr.write("Checking for python module %s ... " % module)
@@ -85,6 +96,13 @@ class libraries: # Print summary # def print_summary(self): + sys.stderr.write("Settings and variablesn") + sys.stderr.write("----------------------n") + + for i in cfg: + sys.stderr.write("%14s : %sn" % (i, cfg[i][0])) + sys.stderr.write(" - %snn" % cfg[i][1]) + sys.stderr.write("Libraries to link againstn") sys.stderr.write("-------------------------n")
@@ -96,7 +114,7 @@ class libraries: else: sys.stderr.write(" : Disabledn")
- sys.stderr.write(" - %snn" % i[1]) + sys.stderr.write(" - %snn" % i[1]) # # Enable/Disable library # @@ -184,6 +202,9 @@ def basic_checks(cfg):
check_for_swig(cfg) check_for_python_config(cfg) + + cfg['PYTHON_VER'][0] = python_version(cfg) + sys.stderr.write("n")
# @@ -255,7 +276,9 @@ if __name__ == '__main__': 'PYTHON_BIN' : ['python', 'Path/name of python interpreter'], 'SWIG' : ['swig', 'Simplified Wrapper and Interface Generator'], 'PYTHON_CONFIG' : ['python-config', 'Python config helper'], - 'include_path' : ['/usr/include', 'Path to the system headers']} + 'PYTHON_VER' : ['', 'Python version (derived from python config)'], + 'include_path' : ['/usr/include', 'Path to the system headers'], + 'prefix' : ['/usr', 'Installation prefix']}
# # Library detection/enable disable diff --git a/post.mk b/post.mk index 881a42f..c217f97 100644 --- a/post.mk +++ b/post.mk @@ -5,11 +5,12 @@ ifndef SUBDIRS SUBDIRS= endif
-.PHONY: $(SUBDIRS) all clean rebuild help doc +.PHONY: $(SUBDIRS) all clean rebuild help doc install
all: $(SUBDIRS) clean: $(SUBDIRS) rebuild: $(SUBDIRS) +install: $(SUBDIRS)
help: @echo "*** Available targets ***" diff --git a/pyinst.mk b/pyinst.mk new file mode 100644 index 0000000..cc4484a --- /dev/null +++ b/pyinst.mk @@ -0,0 +1,26 @@ +# +# Install python libraries into right place +# +# Note that LIBNAME is be empty for root gfxprim python package +# +ifdef SWIG +ifdef PYTHON_CONFIG + +PY_INSTALL_PREFIX=$(prefix)/lib/python$(PYTHON_VER)/gfxprim/$(LIBNAME) + +ifdef DESTDIR +PY_INSTALL_PREFIX:=$(DESTDIR)$(PY_INSTALL_PREFIX) +endif + +install: $(INSTALL_FILES) +ifdef VERBOSE + install -d "$(PY_INSTALL_PREFIX)" + for i in $(INSTALL_FILES); do install "$$i" "$(PY_INSTALL_PREFIX)"; done +else + @echo "DEST $(PY_INSTALL_PREFIX)" + @install -d "$(PY_INSTALL_PREFIX)" + @for i in $(INSTALL_FILES); do echo " -> $$i"; install "$$i" "$(PY_INSTALL_PREFIX)"; done +endif + +endif +endif diff --git a/pylib/gfxprim/Makefile b/pylib/gfxprim/Makefile index a2b9700..98d224e 100644 --- a/pylib/gfxprim/Makefile +++ b/pylib/gfxprim/Makefile @@ -1,4 +1,10 @@ TOPDIR=../.. SUBDIRS=core loaders backends gfx filters text input grabbers CLEAN+=*.pyc + +include $(TOPDIR)/pre.mk + +INSTALL_FILES=__init__.py utils.py + +include $(TOPDIR)/pyinst.mk include $(TOPDIR)/post.mk diff --git a/pylib/gfxprim/backends/Makefile b/pylib/gfxprim/backends/Makefile index ac02d2a..fd62f34 100644 --- a/pylib/gfxprim/backends/Makefile +++ b/pylib/gfxprim/backends/Makefile @@ -5,6 +5,9 @@ INCLUDE=core LDFLAGS+=$(shell $(TOPDIR)/gfxprim-config --libs-backends)
include $(TOPDIR)/pre.mk + +INSTALL_FILES+=_extend_backend.py + include $(TOPDIR)/pywrap.mk include $(TOPDIR)/post.mk
diff --git a/pylib/gfxprim/core/Makefile b/pylib/gfxprim/core/Makefile index 3be0466..ada5a6c 100644 --- a/pylib/gfxprim/core/Makefile +++ b/pylib/gfxprim/core/Makefile @@ -6,6 +6,8 @@ include $(TOPDIR)/pywrap.mk
$(SWIG_C): ../common.i
+INSTALL_FILES+=C.py + include $(TOPDIR)/post.mk
include ../silence_swig_warnings.mk diff --git a/pylib/gfxprim/gfx/Makefile b/pylib/gfxprim/gfx/Makefile index 69a74e4..b0e7e60 100644 --- a/pylib/gfxprim/gfx/Makefile +++ b/pylib/gfxprim/gfx/Makefile @@ -3,6 +3,9 @@ LIBNAME=gfx INCLUDE=core
include $(TOPDIR)/pre.mk + +INSTALL_FILES+=C.py + include $(TOPDIR)/pywrap.mk include $(TOPDIR)/post.mk
diff --git a/pylib/gfxprim/text/Makefile b/pylib/gfxprim/text/Makefile index 1f097e6..2ae37f9 100644 --- a/pylib/gfxprim/text/Makefile +++ b/pylib/gfxprim/text/Makefile @@ -3,6 +3,9 @@ LIBNAME=text INCLUDE=core
include $(TOPDIR)/pre.mk + +INSTALL_FILES+=C.py + include $(TOPDIR)/pywrap.mk include $(TOPDIR)/post.mk
diff --git a/pywrap.mk b/pywrap.mk index 3cac52a..1cd89e5 100644 --- a/pywrap.mk +++ b/pywrap.mk @@ -2,15 +2,16 @@ ifndef LIBNAME $(error LIBNAME not defined, fix your library Makefile) endif
-SWIG_SRC=$(LIBNAME).i -SWIG_C=$(LIBNAME)_wrap.c -SWIG_PY=c_$(LIBNAME).py -SWIG_LIB=_c_$(LIBNAME).so - ifdef SWIG ifdef PYTHON_CONFIG
INCLUDES+=$(addprefix -I$(TOPDIR)/include/, $(INCLUDE)) +PY_SUFFIX=$(shell $(PYTHON_CONFIG) --extension-suffix) + +SWIG_SRC=$(LIBNAME).i +SWIG_C=$(LIBNAME)_wrap.c +SWIG_PY=c_$(LIBNAME).py +SWIG_LIB=_c_$(LIBNAME)$(PY_SUFFIX)
ALL+=$(SWIG_LIB) $(SWIG_PY)
@@ -36,7 +37,12 @@ else # VERBOSE @$(CC) $< $(CFLAGS) -D_GNU_SOURCE=1 $(LDFLAGS) $(PYTHON_INCLUDE) --shared -lGP $(LDLIBS) -L$(TOPDIR)/build/ -o $@ endif # VERBOSE
-endif # PYTHON_CONFIG -endif # SWIG +# Install python libraries into right places +INSTALL_FILES+=__init__.py $(SWIG_PY) $(SWIG_LIB) + +include $(TOPDIR)/pyinst.mk
CLEAN+=$(SWIG_C) $(SWIG_PY) $(SWIG_LIB) *.pyc + +endif # PYTHON_CONFIG +endif # SWIG
-----------------------------------------------------------------------
Summary of changes: Makefile | 4 ++++ configure | 27 +++++++++++++++++++++++++-- post.mk | 3 ++- pyinst.mk | 26 ++++++++++++++++++++++++++ pylib/gfxprim/Makefile | 6 ++++++ pylib/gfxprim/backends/Makefile | 3 +++ pylib/gfxprim/core/Makefile | 2 ++ pylib/gfxprim/gfx/Makefile | 3 +++ pylib/gfxprim/text/Makefile | 3 +++ pywrap.mk | 20 +++++++++++++------- 10 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 pyinst.mk
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos@gmail.com if you want to unsubscribe, or site admin admin@repo.or.cz if you receive no reply.