[Reproducible-commits] [cdbs] 24/41: Support building python modules for pypy

Mattia Rizzolo mattia at debian.org
Tue May 10 14:42:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch reproducible
in repository cdbs.

commit e1444e4af6010bf1bc8994402a803d3f44727f5f
Author: Vasudev Kamath <kamathvasudev at gmail.com>
Date:   Sun Jan 12 23:19:28 2014 +0530

    Support building python modules for pypy
    
    CDBS will trigger build of python module for pypy, if it finds pypy-
    prefix in binary package name. This patch tries to be compatible with
    existing tasks done by CDBS for python and python3 variants where ever
    it is possible.
---
 1/class/python-module.mk.in |  1 +
 1/class/python-vars.mk.in   |  8 +++-
 debian/control.in           |  2 +
 test/Makefile.am            |  2 +
 test/distutils-12.sh        | 47 ++++++++++++++++++++++++
 test/distutils-13.sh        | 89 +++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 147 insertions(+), 2 deletions(-)

diff --git a/1/class/python-module.mk.in b/1/class/python-module.mk.in
index 676c7fa..a45b533 100644
--- a/1/class/python-module.mk.in
+++ b/1/class/python-module.mk.in
@@ -34,6 +34,7 @@ CDBS_BUILD_DEPENDS_class_python-module_pycentral ?= python-central
 # dh_python2 comes from python package
 CDBS_BUILD_DEPENDS_class_python-module_python2 ?= python
 CDBS_BUILD_DEPENDS_class_python-module_python3 ?= python3
+CDBS_BUILD_DEPENDS_class_python-module_pypy ?= pypy, dh-python
 CDBS_BUILD_DEPENDS += $(strip \
 	$(foreach s,$(cdbs_python_systems),\
 		$(comma) $(CDBS_BUILD_DEPENDS_class_python-module_$s)))
diff --git a/1/class/python-vars.mk.in b/1/class/python-vars.mk.in
index bd128b1..39f416a 100644
--- a/1/class/python-vars.mk.in
+++ b/1/class/python-vars.mk.in
@@ -34,6 +34,7 @@ include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
 # NB! override needs to be done _before_ including this file!
 #DEB_PYTHON2_MODULE_PACKAGES =
 #DEB_PYTHON3_MODULE_PACKAGES =
+#DEB_PYPY_MODULE_PACKAGES =
 
 # Legacy systems "pysupport" and "pycentral" use first likely package in
 # debian/control by default.
@@ -46,7 +47,7 @@ include $(_cdbs_class_path)/langcore.mk$(_cdbs_makefile_suffix)
 #DEB_PYTHON_DESTDIR = $(DEB_DESTDIR)
 
 # implementations of Python itself
-_CDBS_PYTHONS = python2 python3
+_CDBS_PYTHONS = python2 python3 pypy
 #  * uppercase implementation names
 $(foreach p,$(_CDBS_PYTHONS),$(eval _cdbs_$p_uc := $(call cdbs_uc,$p)))
 
@@ -228,6 +229,7 @@ cdbs_python_builddeps_python3 = $(if $(_cdbs_python3_arch_packages),\
 	python3-all-dev (>= 3.1),\
 	python3-dev\
 		$(_cdbs_python3_altflavor:%=, %-dev))
+cdbs_python_builddeps_pypy = pypy-dev
 cdbs_python_builddeps = \
 	$(foreach s,$(cdbs_python_systems),\
 		$(comma) $(cdbs_python_builddeps_$s))
@@ -235,7 +237,9 @@ cdbs_python_builddeps_cdbs = $(strip \
 	$(if $(_cdbs_python3_indep_packages),\
 		$(comma) cdbs (>= 0.4.93~),\
 		$(if $(cdbs_pythonsystem_python2)$(cdbs_pythonsystem_python3),\
-			$(comma) cdbs (>= 0.4.90~))))
+			$(comma) cdbs (>= 0.4.90~)))\
+	$(if $(cdbs_pypy_packages),\
+		$(comma) cdbs (>= 0.5~)))
 
 # check if build is possible
 $(if $(cdbs_pythonsystem_pysupport),\
diff --git a/debian/control.in b/debian/control.in
index a26e51a..56ecbe1 100644
--- a/debian/control.in
+++ b/debian/control.in
@@ -8,6 +8,8 @@ Build-Depends-Indep: @cdbs@,
  python-dev,
  python-all-dev,
  python3-all-dev,
+ pypy-dev,
+ dh-python,
  ant,
  default-jdk,
  sharutils,
diff --git a/test/Makefile.am b/test/Makefile.am
index 4f133fd..00b54f0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -41,6 +41,8 @@ TESTS = autotools-1.sh \
 	distutils-9.sh \
 	distutils-10.sh \
 	distutils-11.sh \
+	distutils-12.sh \
+	distutils-13.sh \
 	ant-1.sh
 
 TARBALLS = tarballs/autotools-test-0.1.tar.gz \
diff --git a/test/distutils-12.sh b/test/distutils-12.sh
new file mode 100755
index 0000000..66d9764
--- /dev/null
+++ b/test/distutils-12.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+# -*- mode: sh; coding: utf-8 -*-
+# Copyright © 2014 Vasudev Kamath <kamathvasudev at gmail.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test distutils indep package w/ dh_pypy
+
+. testsuite_functions
+
+options "$@"
+setup_workdir
+
+cat <<EOF >"$WORKDIR/debian/rules"
+#!/usr/bin/make -f
+include debian/testsuite.mk
+include \$(_cdbs_package_root_dir)/1/rules/debhelper.mk.in
+include \$(_cdbs_package_root_dir)/1/class/python-distutils.mk.in
+EOF
+chmod +x "$WORKDIR/debian/rules"
+
+sed -i \
+    -e 's/Package: cdbs-testsuite/Package: pypy-cdbs-testsuite/' \
+    -e 's/Architecture: any/Architecture: all/' \
+    "$WORKDIR/debian/control"
+
+cp -R distutils/* "$WORKDIR"
+
+build_package
+
+dpkg -c "$WORKDIR"/../pypy-cdbs-testsuite_0.1_*.deb \
+    | grep -q '/usr/lib/pypy/dist-packages/testing/foo.py' \
+	   || return_fail
+
+clean_workdir
+return_pass
diff --git a/test/distutils-13.sh b/test/distutils-13.sh
new file mode 100755
index 0000000..6a65c7a
--- /dev/null
+++ b/test/distutils-13.sh
@@ -0,0 +1,89 @@
+#!/bin/bash
+# -*- mode: sh; coding: utf-8 -*-
+# Copyright © 2014 Vasudev Kamath <kamathvasudev at gmail.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test distutils indep package with all dh_python2, dh_python3, dh_pypy
+
+. testsuite_functions
+
+options "$@"
+setup_workdir
+
+cat <<EOF > "$WORKDIR/debian/rules"
+#!/usr/bin/make -f
+include debian/testsuite.mk
+include \$(_cdbs_package_root_dir)/1/rules/debhelper.mk.in
+include \$(_cdbs_package_root_dir)/1/class/python-distutils.mk.in
+EOF
+
+chmod +x "$WORKDIR/debian/rules"
+
+cat <<EOF > "$WORKDIR/debian/control"
+Source: cdbs-testsuite
+Section: devel
+Priority: optional
+Maintainer: Jeff Bailey <jbailey at debian.org>
+Standards-Version: 3.5.10
+
+Package: python-cdbs-testsuite
+Architecture: all
+Description: common build system test suite
+ This package is part of the testsuite for the CDBS build system.  If you've
+ managed to install this, something has gone horribly wrong.
+
+Package: python3-cdbs-testsuite
+Architecture: all
+Description: common build system test suite
+ This package is part of the testsuite for the CDBS build system.  If you've
+ managed to install this, something has gone horribly wrong.
+
+Package: pypy-cdbs-testsuite
+Architecture: all
+Description: common build system test suite
+ This package is part of the testsuite for the CDBS build system.  If you've
+ managed to install this, something has gone horribly wrong.
+EOF
+
+cat <<EOF > "$WORKDIR/debian/pypy-cdbs-testsuite.install"
+debian/tmp/usr/lib/pypy
+EOF
+
+cat <<EOF > "$WORKDIR/debian/python3-cdbs-testsuite.install"
+debian/tmp/usr/lib/python3*
+EOF
+
+cat <<EOF > "$WORKDIR/debian/python-cdbs-testsuite.install"
+debian/tmp/usr/lib/python2*
+EOF
+
+cp -R distutils/* "$WORKDIR"
+
+build_package
+
+dpkg -c "$WORKDIR"/../python-cdbs-testsuite_0.1_*.deb \
+    | grep -q "/usr/lib/python$(pyversions -vr)/dist-packages/testing/foo.py" \
+           || return_fail
+
+dpkg -c "$WORKDIR"/../python3-cdbs-testsuite_0.1_*.deb \
+    | grep -q '/usr/lib/python3/dist-packages/testing/foo.py' \
+           || return_fail
+
+dpkg -c "$WORKDIR"/../pypy-cdbs-testsuite_0.1_*.deb \
+    | grep -q '/usr/lib/pypy/dist-packages/testing/foo.py' \
+           || return_fail
+
+clean_workdir
+return_pass

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/cdbs.git



More information about the Reproducible-commits mailing list