From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CE4DB138334 for ; Wed, 25 Sep 2019 18:47:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 65F3AE08F2; Wed, 25 Sep 2019 18:47:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1262DE08EB for ; Wed, 25 Sep 2019 18:47:14 +0000 (UTC) Received: from [10.12.14.180] (tor-exit.talyn.se [79.137.79.167]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: fordfrog@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id AA1D634B599 for ; Wed, 25 Sep 2019 18:47:12 +0000 (UTC) To: "gentoo-dev@lists.gentoo.org" From: =?UTF-8?Q?Miroslav_=c5=a0ulc?= Subject: [gentoo-dev] RFC: ant-tasks.eclass patch Message-ID: Date: Wed, 25 Sep 2019 20:47:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------DA445CFC9D5E8132EC3BB44D" Content-Language: en-US X-Archives-Salt: 6f90aa71-ba97-41fd-a203-f112d21e0184 X-Archives-Hash: 243d90b4ed2ee1d3aba7db6292cf72a5 This is a multi-part message in MIME format. --------------DA445CFC9D5E8132EC3BB44D Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Transfer-Encoding: 7bit hi, as per bug https://bugs.gentoo.org/693022 we need to add dependency on dev-java/gnu-jaf (or dev-java/sun-jaf) to the package. unfortunately ant-tasks.eclass variable ANT_TASK_DEPNAME supports only single dependency (it was sufficient till now), but we need one more in this case. the introduced patch adds support for alternatively specifying ANT_TASK_DEPNAME as an array and handle it correctly. i've tested the patch and all seems to work fine. please let me know if something can/should be improved. thanks. miroslav --------------DA445CFC9D5E8132EC3BB44D Content-Type: text/x-patch; charset=UTF-8; name="ant-tasks.eclass.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ant-tasks.eclass.patch" diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass index 309df084d156..26df9de26f1a 100644 --- a/eclass/ant-tasks.eclass +++ b/eclass/ant-tasks.eclass @@ -54,7 +54,9 @@ ANT_TASK_NAME="${PN#ant-}" # @DESCRIPTION: # Specifies JAVA_PKG_NAME (PN{-SLOT} used with java-pkg_jar-from) of the package # that this one depends on. Defaults to the name of ant task, ebuild can -# override it before inheriting this eclass. +# override it before inheriting this eclass. In case there is more than one +# dependency, the variable can be specified as bash array with multiple strings, +# one for each dependency. ANT_TASK_DEPNAME=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}} # @ECLASS-VARIABLE: ANT_TASK_DISABLE_VM_DEPS @@ -105,7 +107,7 @@ S="${WORKDIR}/${MY_P}" # base: performs the unpack, build.xml replacement and symlinks ant.jar from # ant-core # -# jar-dep: symlinks the jar file(s) from dependency package +# jar-dep: symlinks the jar file(s) from dependency package(s) ant-tasks_src_unpack() { [[ -z "${1}" ]] && ant-tasks_src_unpack all @@ -129,9 +131,17 @@ ant-tasks_src_unpack() { # ant.jar to build against java-pkg_jar-from --build-only ant-core ant.jar;; jar-dep) - # get jar from the dependency package + # get jar from the dependency package(s) if [[ -n "${ANT_TASK_DEPNAME}" ]]; then - java-pkg_jar-from ${ANT_TASK_DEPNAME} + local array=$(declare -p ANT_TASK_DEPNAME | grep "^declare \-a") + + if [[ -n "${array}" ]]; then + for depname in "${ANT_TASK_DEPNAME[@]}"; do + java-pkg_jar-from ${depname} + done + else + java-pkg_jar-from ${ANT_TASK_DEPNAME} + fi fi;; all) ant-tasks_src_unpack base jar-dep;; --------------DA445CFC9D5E8132EC3BB44D--