[PATCH cygport 0/2] Better handling of build depends

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 0/2] Better handling of build depends

Jon TURNEY
Jon Turney (2):
  Rename DEPEND to BUILD_DEPENDS
  Pass BUILD_DEPENDS through to .hint for source package as
    build-depends:

 lib/check_funcs.cygpart | 17 ++++++++++++-----
 lib/pkg_pkg.cygpart     |  5 +++++
 2 files changed, 17 insertions(+), 5 deletions(-)

--
2.14.2
Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 1/2] Rename DEPEND to BUILD_DEPENDS

Jon TURNEY
Somewhat clearer as to it's purposes, and pluralized for consistency with
REQUIRES.

Still support the previous name for backwards compatibility
---
 lib/check_funcs.cygpart | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/lib/check_funcs.cygpart b/lib/check_funcs.cygpart
index 93f3e12..08b1be3 100644
--- a/lib/check_funcs.cygpart
+++ b/lib/check_funcs.cygpart
@@ -543,9 +543,9 @@ check_vala_module() {
  return ${ret};
 }
 
-#****f* Information/DEPEND
+#****f* Information/BUILD_DEPENDS
 #  SYNOPSIS
-#  DEPEND="ATOM [ATOM] ..."
+#  BUILD_DEPENDS="ATOM [ATOM] ..."
 #  DESCRIPTION
 #  A list of build-time (not runtime) dependencies to be checked before calling
 #  src_compile.  Each ATOM can be in one of the following forms:
@@ -565,6 +565,8 @@ check_vala_module() {
 #  * tex(foo.ext): TeX modules
 #  * vala(foo-1.0): Vala bindings
 #  * foo: A Cygwin package (check skipped on non-Cygwin build systems)
+#
+# DEPEND is an obsolete synonym for BUILD_DEPENDS.
 #****
 __check_depends() {
  local atom failed_atoms;
@@ -574,14 +576,19 @@ __check_depends() {
         error "Compiling this package requires $(cross_compiling && echo -n ${CHOST}' ')binutils and gcc"
  fi
 
- if ! defined DEPEND
+ if ! defined BUILD_DEPENDS
  then
- return 0;
+ if defined DEPEND
+ then
+ BUILD_DEPENDS=${DEPEND}
+ else
+ return 0;
+ fi
  fi
 
  __deparenthesize() { echo "$@" | sed -e 's|[a-z]*(\([^)]*\))|\1|' ; }
 
- for atom in ${DEPEND}
+ for atom in ${BUILD_DEPENDS}
  do
  case ${atom} in
  girepository\(*)
--
2.14.2

Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 2/2] Pass BUILD_DEPENDS through to .hint for source package as build-depends:

Jon TURNEY
In reply to this post by Jon TURNEY
Converting a dependency atom to a package name with full generality requires
a database of all the pathnames contained in all packages, so we don't even
try to do that here.

In the fullness of time, calm may have the information needed to perform
that task, at which time it can start emitting build-depends: lines for
source packages into setup.ini.
---
 lib/pkg_pkg.cygpart | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index cfc0770..b3aeb32 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -717,6 +717,10 @@ _EOF
  then
  cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
 external-source: ${PN}
+_EOF
+ else
+ cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
+build-depends: ${BUILD_DEPENDS}
 _EOF
  fi
  if defined ${pkg_message_var}
@@ -818,6 +822,7 @@ _EOF
  cat > ${distdir}/${PN}/${PN}-${PVR}.hint <<-_EOF
 category: ${!pkg_category_var:-${CATEGORY}}
 requires:
+build-depends: ${BUILD_DEPENDS}
 sdesc: "${!pkg_summary_var:-${SUMMARY}}"
 ldesc: "${!pkg_description_var:-${DESCRIPTION:-${!pkg_summary_var:-${SUMMARY}}}}"
 skip:
--
2.14.2

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH cygport 1/2] Rename DEPEND to BUILD_DEPENDS

Andrew Schulman
In reply to this post by Jon TURNEY
> Somewhat clearer as to it's purposes, and pluralized for consistency with
> REQUIRES.

Yes! Thank you!

Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 1/2] Rename DEPEND to BUILD_DEPENDS

Jon TURNEY
In reply to this post by Jon TURNEY
Somewhat clearer as to it's purposes, and pluralized for consistency with
REQUIRES.

Still support the previous name for backwards compatibility

v2:
Do backwards compatibility correctly so it works when not doing 'all'

Signed-off-by: Jon Turney <[hidden email]>
---
 bin/cygport.in          |  7 +++++++
 lib/check_funcs.cygpart | 10 ++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/bin/cygport.in b/bin/cygport.in
index 31b909d..600d982 100644
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -426,6 +426,13 @@ then
  fi
 fi
 
+if ! defined BUILD_DEPENDS
+then
+ if defined DEPEND
+ then
+ BUILD_DEPENDS=${DEPEND}
+ fi
+fi
 
 for restrict in ${RESTRICT//,/ }
 do
diff --git a/lib/check_funcs.cygpart b/lib/check_funcs.cygpart
index 93f3e12..eea19e9 100644
--- a/lib/check_funcs.cygpart
+++ b/lib/check_funcs.cygpart
@@ -543,9 +543,9 @@ check_vala_module() {
  return ${ret};
 }
 
-#****f* Information/DEPEND
+#****f* Information/BUILD_DEPENDS
 #  SYNOPSIS
-#  DEPEND="ATOM [ATOM] ..."
+#  BUILD_DEPENDS="ATOM [ATOM] ..."
 #  DESCRIPTION
 #  A list of build-time (not runtime) dependencies to be checked before calling
 #  src_compile.  Each ATOM can be in one of the following forms:
@@ -565,6 +565,8 @@ check_vala_module() {
 #  * tex(foo.ext): TeX modules
 #  * vala(foo-1.0): Vala bindings
 #  * foo: A Cygwin package (check skipped on non-Cygwin build systems)
+#
+# DEPEND is an obsolete synonym for BUILD_DEPENDS.
 #****
 __check_depends() {
  local atom failed_atoms;
@@ -574,14 +576,14 @@ __check_depends() {
         error "Compiling this package requires $(cross_compiling && echo -n ${CHOST}' ')binutils and gcc"
  fi
 
- if ! defined DEPEND
+ if ! defined BUILD_DEPENDS
  then
  return 0;
  fi
 
  __deparenthesize() { echo "$@" | sed -e 's|[a-z]*(\([^)]*\))|\1|' ; }
 
- for atom in ${DEPEND}
+ for atom in ${BUILD_DEPENDS}
  do
  case ${atom} in
  girepository\(*)
--
2.15.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH cygport 0/2] Better handling of build depends

Yaakov Selkowitz
In reply to this post by Jon TURNEY
On 2017-10-03 14:53, Jon Turney wrote:
> Jon Turney (2):
>   Rename DEPEND to BUILD_DEPENDS
>   Pass BUILD_DEPENDS through to .hint for source package as
>     build-depends:

Why can't this be BUILD_REQUIRES and build-requires: ?

--
Yaakov


signature.asc (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH cygport 0/2] Better handling of build depends

Jon TURNEY
On 13/02/2018 06:31, Yaakov Selkowitz wrote:
> On 2017-10-03 14:53, Jon Turney wrote:
>> Jon Turney (2):
>>    Rename DEPEND to BUILD_DEPENDS
>>    Pass BUILD_DEPENDS through to .hint for source package as
>>      build-depends:
>
> Why can't this be BUILD_REQUIRES and build-requires: ?

No reason at all.  I didn't think very much about the name, just added
'build' as a prefix.
Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 0/2] Better handling of build requires (v2)

Jon TURNEY
v2: BUILD_REQUIRES

Jon Turney (2):
  Rename DEPEND to BUILD_REQUIRES
  Pass BUILD_REQUIRES through to .hint for source package as
    build-requires:

 bin/cygport.in          |  7 +++++++
 lib/check_funcs.cygpart | 10 ++++++----
 lib/pkg_pkg.cygpart     |  5 +++++
 3 files changed, 18 insertions(+), 4 deletions(-)

--
2.16.1

Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 1/2] Rename DEPEND to BUILD_REQUIRES

Jon TURNEY
Somewhat clearer as to it's purposes, and pluralized for consistency with
REQUIRES.

Still support the previous name for backwards compatibility

v2:
Do backwards compatibility correctly so it works when not doing 'all'
---
 bin/cygport.in          |  7 +++++++
 lib/check_funcs.cygpart | 10 ++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/bin/cygport.in b/bin/cygport.in
index c3370e1..e1c7ff4 100755
--- a/bin/cygport.in
+++ b/bin/cygport.in
@@ -428,6 +428,13 @@ then
  fi
 fi
 
+if ! defined BUILD_REQUIRES
+then
+ if defined DEPEND
+ then
+ BUILD_REQUIRES=${DEPEND}
+ fi
+fi
 
 for restrict in ${RESTRICT//,/ }
 do
diff --git a/lib/check_funcs.cygpart b/lib/check_funcs.cygpart
index 961f263..fd232f4 100644
--- a/lib/check_funcs.cygpart
+++ b/lib/check_funcs.cygpart
@@ -543,9 +543,9 @@ check_vala_module() {
  return ${ret};
 }
 
-#****f* Information/DEPEND
+#****f* Information/BUILD_REQUIRES
 #  SYNOPSIS
-#  DEPEND="ATOM [ATOM] ..."
+#  BUILD_REQUIRES="ATOM [ATOM] ..."
 #  DESCRIPTION
 #  A list of build-time (not runtime) dependencies to be checked before calling
 #  src_compile.  Each ATOM can be in one of the following forms:
@@ -565,6 +565,8 @@ check_vala_module() {
 #  * tex(foo.ext): TeX modules
 #  * vala(foo-1.0): Vala bindings
 #  * foo: A Cygwin package (check skipped on non-Cygwin build systems)
+#
+# DEPEND is an obsolete synonym for BUILD_REQUIRES.
 #****
 __check_depends() {
  local atom failed_atoms;
@@ -574,14 +576,14 @@ __check_depends() {
         error "Compiling this package requires $(cross_compiling && echo -n ${CHOST}' ')binutils and gcc"
  fi
 
- if ! defined DEPEND
+ if ! defined BUILD_REQUIRES
  then
  return 0;
  fi
 
  __deparenthesize() { echo "$@" | sed -e 's|[a-z]*(\([^)]*\))|\1|' ; }
 
- for atom in ${DEPEND}
+ for atom in ${BUILD_REQUIRES}
  do
  case ${atom} in
  girepository\(*)
--
2.16.1

Reply | Threaded
Open this post in threaded view
|

[PATCH cygport 2/2] Pass BUILD_REQUIRES through to .hint for source package as build-requires:

Jon TURNEY
In reply to this post by Jon TURNEY
Converting a dependency atom to a package name with full generality requires
a database of all the pathnames contained in all packages, so we don't even
try to do that here.

In the fullness of time, calm may have the information needed to perform
that task, at which time it can start emitting build-requires: lines for
source packages into setup.ini.
---
 lib/pkg_pkg.cygpart | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 272e2d4..fe56d6d 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -728,6 +728,10 @@ _EOF
  then
  cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
 external-source: ${PN}
+_EOF
+ else
+ cat >> ${distdir}/${PN}/${distsubdir}/${pkg_name[${n}]}-${PVR}.hint <<-_EOF
+build-depends: ${BUILD_REQUIRES}
 _EOF
  fi
  if defined ${pkg_message_var}
@@ -841,6 +845,7 @@ _EOF
  cat > ${distdir}/${PN}/${PN}-${PVR}.hint <<-_EOF
 category: ${!pkg_category_var:-${CATEGORY}}
 requires:
+build-depends: ${BUILD_REQUIRES}
 sdesc: "${!pkg_summary_var:-${SUMMARY}}"
 ldesc: "${!pkg_description_var:-${DESCRIPTION:-${!pkg_summary_var:-${SUMMARY}}}}"
 skip:
--
2.16.1