aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-03-24 11:36:21 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-03-24 11:36:42 +0000
commitae2275f8513c845157e54f36592a3592a56c7a3c (patch)
tree719d1570fa97e83fdcd3d5786bb0b73a2d620fac /main/abuild
parente1e22e474e12adc1d27d852e3b88a92fa930cf98 (diff)
downloadaports-ae2275f8513c845157e54f36592a3592a56c7a3c.tar.bz2
aports-ae2275f8513c845157e54f36592a3592a56c7a3c.tar.xz
main/abuild: upgrade to 3.0.0_rc2
Diffstat (limited to 'main/abuild')
-rw-r--r--main/abuild/0001-abuild-fix-runpart.patch62
-rw-r--r--main/abuild/0001-functions-fix-abuild-A.patch28
-rw-r--r--main/abuild/APKBUILD10
-rw-r--r--main/abuild/abuild-check.patch376
4 files changed, 3 insertions, 473 deletions
diff --git a/main/abuild/0001-abuild-fix-runpart.patch b/main/abuild/0001-abuild-fix-runpart.patch
deleted file mode 100644
index 6f6c3eae22..0000000000
--- a/main/abuild/0001-abuild-fix-runpart.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 3b61bfb6445a71208e218828296b8ca3bb65932e Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Tue, 21 Mar 2017 08:05:44 +0000
-Subject: [PATCH] abuild: fix runpart
-
-we need to run the function for runpart in the same shell, otherwise we
-will lose the global variables set in the split functions.
----
- abuild.in | 29 +++++++++++------------------
- 1 file changed, 11 insertions(+), 18 deletions(-)
-
-diff --git a/abuild.in b/abuild.in
-index 1eede20..903da3a 100644
---- a/abuild.in
-+++ b/abuild.in
-@@ -566,9 +566,9 @@ update_config_guess() {
- runpart() {
- local part=$1
- [ -n "$DEBUG" ] && msg "$part"
-- abuild_function=$part "$abuild_path" \
-- $color_opt $nodeps $force $forceroot $keep $quiet \
-- $install_deps $recursive $upgrade || die "$part failed"
-+ trap "die '$part failed'" EXIT
-+ $part
-+ trap - EXIT
- }
-
- # override those in your build script
-@@ -2340,22 +2340,15 @@ controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
-
- trap 'die "Aborted by user"' INT
-
--if [ "$abuild_function" ]; then
-- _function=$abuild_function
-- abuild_function=
-- $_function
-+[ -z "$subpkgdir" ] && set_xterm_title "abuild${CROSS_COMPILE+-$CARCH}: $pkgname"
-
--else
-- [ -z "$subpkgdir" ] && set_xterm_title "abuild${CROSS_COMPILE+-$CARCH}: $pkgname"
--
-- if [ -z "$1" ]; then
-- set all
-- fi
--
-- while [ $# -gt 0 ]; do
-- runpart $1
-- shift
-- done
-+if [ -z "$1" ]; then
-+ set all
- fi
-
-+while [ $# -gt 0 ]; do
-+ runpart $1
-+ shift
-+done
-+
- cleanup
---
-2.11.1
-
diff --git a/main/abuild/0001-functions-fix-abuild-A.patch b/main/abuild/0001-functions-fix-abuild-A.patch
deleted file mode 100644
index 77245901e4..0000000000
--- a/main/abuild/0001-functions-fix-abuild-A.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 9c1595dc423970cf86ef371dd15df9b27d9baf81 Mon Sep 17 00:00:00 2001
-From: Natanael Copa <ncopa@alpinelinux.org>
-Date: Mon, 20 Mar 2017 16:13:07 +0000
-Subject: [PATCH] functions: fix abuild -A
-
-fix so abuild -A does not exit with error if gitbase fails
-
-this was introduced with the set -e
----
- functions.sh.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/functions.sh.in b/functions.sh.in
-index 3e1840c..925dc43 100644
---- a/functions.sh.in
-+++ b/functions.sh.in
-@@ -71,7 +71,7 @@ readconfig() {
- [ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
- [ -f "$ABUILD_USERCONF" ] && . "$ABUILD_USERCONF"
- APORTSDIR=${_APORTSDIR-$APORTSDIR}
-- gitbase=$(git rev-parse --show-toplevel 2>/dev/null) # already is -P
-+ gitbase=$(git rev-parse --show-toplevel 2>/dev/null) || true # already is -P
- if [ -d "$APORTSDIR" ]; then
- APORTSDIR=$(cd "$APORTSDIR"; pwd -P)
- elif [ -z "$APORTSDIR" ] && [ -d "$HOME/aports" ]; then
---
-2.11.1
-
diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index 2b1bc9a9ef..e9d4534946 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -1,8 +1,8 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
-pkgver=3.0.0_rc1
+pkgver=3.0.0_rc2
_ver=${pkgver%_git*}
-pkgrel=3
+pkgrel=0
pkgdesc="Script to build Alpine Packages"
url="http://git.alpinelinux.org/cgit/abuild/"
arch="all"
@@ -20,8 +20,6 @@ subpackages="apkbuild-cpan:cpan:noarch apkbuild-gem-resolver:gems:noarch"
options="suid"
pkggroups="abuild"
source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
- 0001-functions-fix-abuild-A.patch
- 0001-abuild-fix-runpart.patch
"
builddir="$srcdir/$pkgname-$_ver"
@@ -64,6 +62,4 @@ gems() {
mv "$pkgdir"/usr/bin/apkbuild-gem-resolver "$subpkgdir"/usr/bin/
}
-sha512sums="48f33e791805d9ec0f1fcfc28d9d2e58c84dc168b1a64e52733eefdc9daf2450c0cea20f9cdf3a61755d7344cc24f801ef0e9954b30881a713885d935a59dc36 abuild-3.0.0_rc1.tar.xz
-eaec95123f4c67fce84ccd190d1de47f27406acd1f600495100bf553b48eb9bf2a91b833a2c0d37c15306014e6972ea5a25134c35fd29be7a8f8574168cbb5a9 0001-functions-fix-abuild-A.patch
-1a8094ade46455caf5de84c3e465af492ee3e018e98767cb93e6eea2f83d91feea846b77ee06b70e17395519ebe11ba5cb6add73d49c548b1daca361a4258997 0001-abuild-fix-runpart.patch"
+sha512sums="bb6fa7af3144db99839c24db63e17179d73f659a76c86d530923158b37fad3fcd73ea992f9d5f4ac3c48c13ccebb62ffbe461b3871dcb4b7b1ca6efd934e4be2 abuild-3.0.0_rc2.tar.xz"
diff --git a/main/abuild/abuild-check.patch b/main/abuild/abuild-check.patch
deleted file mode 100644
index 2df7f5809e..0000000000
--- a/main/abuild/abuild-check.patch
+++ /dev/null
@@ -1,376 +0,0 @@
-From ea1db36f1f62889ddcf4dbf8ca85409619d4424c Mon Sep 17 00:00:00 2001
-From: William Pitcock <nenolod@dereferenced.org>
-Date: Sun, 29 Jan 2017 09:47:25 +0000
-Subject: [PATCH 1/3] abuild: implement check and $checkdepends support.
-
-The check() function is an APKBUILD overridable function which runs a testsuite. The packages listed in
-$checkdepends are packages which will be installed at build time only if check() will be run.
----
- abuild.in | 32 ++++++++++++++++++++++++++++----
- 1 file changed, 28 insertions(+), 4 deletions(-)
-
-diff --git a/abuild.in b/abuild.in
-index 2b2d23b..aa1fe09 100644
---- a/abuild.in
-+++ b/abuild.in
-@@ -66,6 +66,12 @@ cross_compiling() {
- test "$CBUILD" != "$CHOST" -a -n "$CBUILDROOT"
- }
-
-+want_check() {
-+ cross_compiling && return 1
-+ options_has "!check" && return 1
-+ return 0
-+}
-+
- cleanup() {
- local i=
- [ -z "$subpkgdir" ] && set_xterm_title ""
-@@ -199,6 +205,7 @@ default_sanitycheck() {
- [ -n "$pkguser" ] && spell_error pkguser pkgusers
- [ -n "$pkggroup" ] && spell_error pkggroup pkggroups
- [ -n "$subpackage" ] && spell_error subpackage subpackages
-+ [ -n "$checkdepend" ] && spell_error checkdepend checkdepends
-
- check_maintainer || die "Provide a valid RFC822 maintainer address"
-
-@@ -1365,18 +1372,21 @@ create_apks() {
- }
-
- build_abuildrepo() {
-- local d apk _build=build
-+ local d apk _build=build _check=check
- if ! is_function package; then
- # if package() is missing then build is called from rootpkg
- _build=true
- fi
-+ if ! want_check; then
-+ _check=true
-+ fi
- if ! apk_up2date || [ -n "$force" ]; then
- # check early if we have abuild key
- abuild-sign --installed || return 1
- logcmd "building $repo/$pkgname-$pkgver-r$pkgrel"
- sanitycheck && builddeps && clean && fetch && unpack \
-- && prepare && mkusers && $_build && rootpkg \
-- && cleanup $CLEANUP \
-+ && prepare && mkusers && $_build && $_check \
-+ && rootpkg && cleanup $CLEANUP \
- || return 1
- fi
- update_abuildrepo_index
-@@ -1417,6 +1427,15 @@ update_abuildrepo_index() {
- done
- }
-
-+# predefined function check
-+default_check() {
-+ warning "APKBUILD does not run any tests - define a check() function!"
-+}
-+
-+check() {
-+ default_check
-+}
-+
- # predefined splitfunc doc
- default_doc() {
- depends="$depends_doc"
-@@ -1715,11 +1734,14 @@ parse_aports_makedepends() {
- subpackages=
- depends=
- makedepends=
-+ checkdepends=
- . $i
- dir=${i%/APKBUILD}
- deps=
- # filter out conflicts from deps and version info
-- for j in $depends $makedepends; do
-+ wantdepends="$depends $makedepends"
-+ want_check && wantdepends="$wantdepends $checkdepends"
-+ for j in $wantdepends; do
- case "$j" in
- !*) continue;;
- esac
-@@ -1792,6 +1814,7 @@ calcdeps() {
- done
- else
- [ -z "$makedepends" ] && makedepends="$makedepends_build $makedepends_host"
-+ want_check && makedepends="$makedepends $checkdepends"
- for i in $1 $depends $makedepends; do
- [ "$pkgname" = "${i%%[<>=]*}" ] && continue
- list_has $i $builddeps && continue
-@@ -2147,6 +2170,7 @@ usage() {
-
- Commands:
- build Compile and install package into \$pkgdir
-+ check Run any defined tests concerning the package
- checksum Generate checksum to be included in APKBUILD
- clean Remove temp build and install dirs
- cleancache Remove downloaded files from \$SRCDEST
---
-2.11.1
-
-From 7c1609b1bb4b6b7219b21b0d2750fcfaf02d63bc Mon Sep 17 00:00:00 2001
-From: William Pitcock <nenolod@dereferenced.org>
-Date: Sun, 29 Jan 2017 09:50:29 +0000
-Subject: [PATCH 2/3] sample apkbuild: document check() function usage
-
----
- sample.APKBUILD | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/sample.APKBUILD b/sample.APKBUILD
-index a95fec2..30184c5 100644
---- a/sample.APKBUILD
-+++ b/sample.APKBUILD
-@@ -43,4 +43,11 @@ package() {
- # install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname
- }
-
-+check() {
-+ # uncomment the 2 lines below if there is a testsuite. we assume the testsuite
-+ # is run using "make check", which is the default for autotools-based build systems.
-+ # cd "$builddir"
-+ # make check || return 1
-+}
-+
- md5sums="" #generate with 'abuild checksum'
---
-2.11.1
-
-From 14f8fcfb372f9f9ab877c33f309431aa2043c097 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
-Date: Tue, 31 Jan 2017 10:20:14 +0200
-Subject: [PATCH 3/3] apkbuild-cpan: fix warnings, improve recreate, add check
- support
-
----
- apkbuild-cpan.in | 62 ++++++++++++++++++++++++++++++++++++++++++--------------
- 1 file changed, 47 insertions(+), 15 deletions(-)
-
-diff --git a/apkbuild-cpan.in b/apkbuild-cpan.in
-index 5566f8e..688df6e 100644
---- a/apkbuild-cpan.in
-+++ b/apkbuild-cpan.in
-@@ -3,7 +3,10 @@
-
- use strict;
- use warnings;
--use feature qw(:5.10);
-+use 5.016;
-+use feature "switch";
-+no if $] >= 5.018, warnings => "experimental::smartmatch";
-+
- use LWP::UserAgent;
- use LWP::ConnCache;
- use CPAN::Meta;
-@@ -21,9 +24,8 @@ my $package_mappings = {
- };
- our $packager = "";
- my $template = <<'EOF';
--# Automatically generated by apkbuild-cpan, template 1
--# Contributor: [% packager %]
--# Maintainer: [% packager %]
-+# Automatically generated by apkbuild-cpan, template 2
-+[% authors %]
- pkgname=[% pkgname %]
- _pkgreal=[% pkgreal %]
- pkgver=[% pkgver %]
-@@ -34,8 +36,10 @@ arch="noarch"
- license="GPL PerlArtistic"
- cpandepends=""
- cpanmakedepends=""
-+cpancheckdepends=""
- depends="$cpandepends"
- makedepends="perl-dev $cpanmakedepends"
-+checkdepends="$cpancheckdepends"
- subpackages="$pkgname-doc"
- source="[% source %]"
- builddir="$srcdir/$_pkgreal-$pkgver"
-@@ -59,6 +63,10 @@ package() {
- :
- }
-
-+check() {
-+ :
-+}
-+
- EOF
-
- our $ua = LWP::UserAgent->new();
-@@ -66,8 +74,7 @@ our $json = JSON->new;
- $ua->env_proxy;
- $ua->conn_cache(LWP::ConnCache->new());
-
--sub read_file
--{
-+sub read_file {
- my ($filename) = @_;
- local $/;
- open my $fh, "<", $filename or die "could not open $filename: $!";
-@@ -76,10 +83,15 @@ sub read_file
-
- sub read_assignments_from_file {
- my ($filename) = @_;
-+ return () if ( ! -e $filename );
- my $text = read_file($filename);
- my %sline = $text =~ /^(\w+)\s*=\s*([^\"\n]*)$/mg;
- my %mline = $text =~ /^(\w+)\s*=\s*\"([^\"]*)\"$/mg;
- my %hash = ( %sline, %mline );
-+
-+ my $authors = join("\n", $text =~ /^# Contributor: .*$/mg, $text =~ /^# Maintainer: .*$/mg);
-+ $hash{'authors'} = $authors if length($authors) > 1;
-+
- return \%hash;
- }
-
-@@ -96,12 +108,13 @@ sub read_apkbuild {
- }
-
- sub write_apkbuild {
-- my ($distdata) = @_;
-+ my ($distdata, $authors) = @_;
-
- my $cpanid = $distdata->{releases}[0]->{cpanid};
- $cpanid = substr($cpanid, 0, 1) . "/" . substr($cpanid, 0, 2) . "/$cpanid";
-+
- my %repl = (
-- packager => $packager,
-+ authors => ($authors or "# Contributor: $packager\n# Maintainer: $packager"),
- pkgname => map_cpan_to_apk($distdata->{name}),
- pkgreal => $distdata->{name},
- pkgver => $distdata->{releases}[0]->{version},
-@@ -147,7 +160,8 @@ sub parse_deps {
- my $pkgname = map_cpan_to_apk($distdata->{name});
- $deps .= "$pkgname ";
- }
-- $deps =~ s/\s+$//;
-+ $deps =~ s/\h+/ /g;
-+ $deps =~ s/ $//;
- return $deps;
-
- }
-@@ -162,6 +176,7 @@ sub update_functions {
- my $metaprefix = "src/" . $apkbuild->{'_pkgreal'} . "-" . $apkbuild->{'pkgver'} . "/";
- my $prepare_func;
- my $build_func;
-+ my $check_func;
- my $package_func;
-
- my $text = read_file "APKBUILD";
-@@ -203,7 +218,7 @@ EOF
- build() {
- cd "$builddir"
- export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
-- make && make test
-+ make
- }
- EOF
- $package_func = <<'EOF';
-@@ -213,6 +228,13 @@ package() {
- find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
- }
- EOF
-+ $check_func = <<'EOF';
-+check() {
-+ cd "$builddir"
-+ export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
-+ make test
-+}
-+EOF
- }
-
- $text =~ s/^prepare\(\) \{.*?^\}\n/$prepare_func/smg or
-@@ -221,6 +243,8 @@ EOF
- die "Can't replace build function APKBUILD";
- $text =~ s/^package\(\) \{.*?^\}\n/$package_func/smg or
- die "Can't replace package function APKBUILD";
-+ $text =~ s/^check\(\) \{.*?^\}\n/$check_func/smg or
-+ die "Can't replace check function APKBUILD";
-
- open my $fh, '>', "APKBUILD" or die;
- print $fh $text;
-@@ -251,11 +275,13 @@ sub do_depends {
- say "CPAN deps: $deps";
- say "Recommend: " . parse_deps $meta->effective_prereqs->requirements_for('runtime', 'recommends');
-
-- my $makedeps = parse_deps $meta->effective_prereqs->requirements_for('build', 'requires');
-- $makedeps .= ' ' . parse_deps $meta->effective_prereqs->requirements_for('build', 'recommends');
-- $makedeps .= ' ' . parse_deps $meta->effective_prereqs->requirements_for('test', 'requires');
-- $makedeps .= ' ' . parse_deps $meta->effective_prereqs->requirements_for('test', 'recommends');
-+ my $makedeps = parse_deps($meta->effective_prereqs->requirements_for('build', 'requires'), $meta->effective_prereqs->requirements_for('build', 'recommends'));
- say "CPAN build deps: $makedeps";
-+ say "CPAN requires: " . parse_deps($meta->effective_prereqs->requirements_for('build', 'requires'));
-+ say "CPAN recommds: " . parse_deps($meta->effective_prereqs->requirements_for('build', 'recommends'));
-+
-+ my $checkdeps = parse_deps($meta->effective_prereqs->requirements_for('test', 'requires'), $meta->effective_prereqs->requirements_for('test', 'recommends'));
-+ say "CPAN check deps: $makedeps";
-
- my $text = read_file "APKBUILD";
- if ($abstract) {
-@@ -274,6 +300,8 @@ sub do_depends {
- die "Can't find cpandepends line in APKBUILD";
- $text =~ s/^cpanmakedepends=\"([^\"]*)\"$/cpanmakedepends=\"$makedeps\"/mg or
- die "Can't find cpanmakedepends line in APKBUILD";
-+ $text =~ s/^cpancheckdepends=\"([^\"]*)\"$/cpancheckdepends=\"$checkdeps\"/mg or
-+ die "Can't find cpancheckdepends line in APKBUILD";
-
- open my $fh, '>', "APKBUILD" or die;
- print $fh $text;
-@@ -282,6 +310,7 @@ sub do_depends {
-
- sub get_data {
- my $apkbuild = read_apkbuild;
-+ $apkbuild->{_pkgreal} or die "Not apkbuild-cpan generated APKBUILD";
- my $response = $ua->get("http://search.cpan.org/api/dist/$apkbuild->{_pkgreal}");
- $response->is_success or die $response->status_line;
- my $distdata = $json->decode($response->decoded_content);
-@@ -293,6 +322,9 @@ sub get_data {
- my $abuild_conf = read_assignments_from_file("/etc/abuild.conf");
- $packager = $abuild_conf->{PACKAGER} if $abuild_conf->{PACKAGER};
-
-+my $user_abuild_conf = read_assignments_from_file($ENV{"HOME"} . "/.abuild/abuild.conf");
-+$packager = $user_abuild_conf->{PACKAGER} if $user_abuild_conf->{PACKAGER};
-+
- given ( $ARGV[0] ) {
- when ("create") {
- my $module = $ARGV[1];
-@@ -319,7 +351,7 @@ given ( $ARGV[0] ) {
- }
- when ("recreate") {
- my ($apkbuild, $distdata) = get_data;
-- write_apkbuild($distdata);
-+ write_apkbuild($distdata, $apkbuild->{authors});
- prepare_tree;
- update_functions;
- do_depends;
---
-2.11.1
-
-From c909c82ac22563b1235082a73ee1d35fdf1c4b86 Mon Sep 17 00:00:00 2001
-From: William Pitcock <nenolod@dereferenced.org>
-Date: Tue, 28 Feb 2017 08:22:36 +0000
-Subject: [PATCH] abuild: expand on APKBUILD check() warning message
-
----
- abuild.in | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/abuild.in b/abuild.in
-index b9ab5d6..22bd454 100644
---- a/abuild.in
-+++ b/abuild.in
-@@ -1456,7 +1456,9 @@ update_abuildrepo_index() {
-
- # predefined function check
- default_check() {
-- warning "APKBUILD does not run any tests - define a check() function!"
-+ warning "APKBUILD does not run any tests!"
-+ msg2 "Alpine policy will soon require that packages have any relevant testsuites run during the build process."
-+ msg2 "To fix, either define a check() function, or declare !check in \$options to indicate the package does not have a testsuite."
- }
-
- check() {
---
-2.11.1
-