pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/44695: Please add build setting for multi-packages to _BUILD_DEFS [patch]
>Number: 44695
>Category: pkg
>Synopsis: Please add build setting for multi-packages to _BUILD_DEFS
>[patch]
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Mar 07 22:40:00 +0000 2011
>Originator: Aleksey Cheusov
>Release: NetBSD 5.1
>Organization:
>Environment:
System: NetBSD asrock.chizhovka.net 5.1 NetBSD 5.1 (GENERIC) #0: Mon Jan 31
23:53:52 EET 2011
cheusov%asrock.chizhovka.net@localhost:/srv/obj/sys/arch/amd64/compile/GENERIC
amd64
Architecture: x86_64
Machine: amd64
>Description:
Following mk/pbulk/pbulk-index.mk I'll call packages that can be built
with different versions of apache, python, ruby and PHP "multi-packages".
Let's suppose we have the following task. We have a binary file for a
multi-package for which update is available in pkgsrc tree and we want
to build new version of the package. This package is not installed on
the system, therefore we cannot detect installed version of
ruby/python/php/apache (in case it is checked in
lang/*/{apache,{py,php,ruby}version}.mk files).
Patch below provides a way to do this by adding new field "MULTI" to
"Build information" in the binary file and pkgdb (pkg_info -B). At
build time the variable MULTI is modified in
lang/*/{apache,{py,php,ruby}version}.mk files and then (if defined) is
added to _BUILD_DEFS.
Commands useful for testing:
pkg_add pkg_summary-utils
pkg_src_summary -m -f PKGPATH,PKGNAME,MULTI www/ap2-python www/ap-{ruby,php}
>Fix:
Index: mk/apache.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/apache.mk,v
retrieving revision 1.25
diff -u -r1.25 apache.mk
--- mk/apache.mk 17 Dec 2007 22:09:58 -0000 1.25
+++ mk/apache.mk 7 Mar 2011 20:46:38 -0000
@@ -135,4 +135,8 @@
. include "../../devel/apr-util/buildlink3.mk"
.endif
+#
+# Variable assignment for multi-apache packages
+MULTI+= PKG_APACHE=${PKG_APACHE}
+
.endif # APACHE_MK
Index: mk/bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1976
diff -u -r1.1976 bsd.pkg.mk
--- mk/bsd.pkg.mk 7 Feb 2011 10:32:32 -0000 1.1976
+++ mk/bsd.pkg.mk 7 Mar 2011 20:46:38 -0000
@@ -205,6 +205,13 @@
PKG_FAIL_REASON+= "DEPOT_SUBDIR may not be empty."
.endif
+# Store the build options for multi-packages, i.e. packages that can
+# be built with multiple versions of Apache, Python, Ruby, PHP etc.
+#
+.if defined(MULTI)
+_BUILD_DEFS+= MULTI
+.endif
+
# ZERO_FILESIZE_P exits with a successful return code if the given file
# has zero length.
# NONZERO_FILESIZE_P exits with a successful return code if the given file
Index: lang/python/pyversion.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/python/pyversion.mk,v
retrieving revision 1.86
diff -u -r1.86 pyversion.mk
--- lang/python/pyversion.mk 25 Feb 2011 09:47:24 -0000 1.86
+++ lang/python/pyversion.mk 7 Mar 2011 20:46:38 -0000
@@ -112,6 +112,10 @@
. endif
.endif
+#
+# Variable assignment for multi-python packages
+MULTI+= PYTHON_VERSION_REQD=${_PYTHON_VERSION}
+
# No supported version found, annotate to simplify statements below.
.if !defined(_PYTHON_VERSION)
_PYTHON_VERSION= none
Index: lang/php/phpversion.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/php/phpversion.mk,v
retrieving revision 1.13
diff -u -r1.13 phpversion.mk
--- lang/php/phpversion.mk 23 Sep 2010 07:38:05 -0000 1.13
+++ lang/php/phpversion.mk 7 Mar 2011 20:46:38 -0000
@@ -136,6 +136,10 @@
_PHP_VERSION= ${_PHP_VERSION_FIRSTACCEPTED}
.endif
+#
+# Variable assignment for multi-PHP packages
+MULTI+= PHP_VERSION_REQD=${_PHP_VERSION}
+
# export some of internal variables
PKG_PHP_VERSION:= ${_PHP_VERSION:C/\.[0-9]//}
PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([0-9])/\1.\2/}
Index: lang/ruby/rubyversion.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/ruby/rubyversion.mk,v
retrieving revision 1.59
diff -u -r1.59 rubyversion.mk
--- lang/ruby/rubyversion.mk 21 Feb 2011 15:00:34 -0000 1.59
+++ lang/ruby/rubyversion.mk 7 Mar 2011 20:46:38 -0000
@@ -61,6 +61,10 @@
RUBY_ABI_VERSION= ${RUBY19_API_VERSION}
.endif
+#
+# Variable assignment for multi-ruby packages
+MULTI+= RUBY_VERSION_REQD=${RUBY_VERSION_REQD:U${_RUBY_VERSION_DEFAULT}}
+
# RUBY_VERSION_SUPPORTED defines the list of ${RUBY_VER} which is
# supported by the package. It should be defined by the packages
# for specific Ruby versions.
Home |
Main Index |
Thread Index |
Old Index