aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2022-06-13 02:59:55 +0200
committerJakub Jirutka <jakub@jirutka.cz>2022-06-13 03:09:02 +0200
commit673a90967152d023d0dc1384aafd63ff84cd1718 (patch)
treebb19cfe591eaca3726e1ca64e804f54db641a265
parent71025c08db4d8df53ee4c4fb5a8a3864720aa49b (diff)
downloadaports-673a90967152d023d0dc1384aafd63ff84cd1718.tar.gz
aports-673a90967152d023d0dc1384aafd63ff84cd1718.tar.bz2
aports-673a90967152d023d0dc1384aafd63ff84cd1718.tar.xz
main/abuild: backport a few MRs for newapkbuild
These three patches introduce changes to policies that have been in use in ports for many months and are widely accepted. newapkbuild is long behind the current practice which just makes life harder for everyone.
-rw-r--r--main/abuild/APKBUILD8
-rw-r--r--main/abuild/mr128-newapkbuild-fetch-rust-deps-in-prepare.patch110
-rw-r--r--main/abuild/mr131-newapkbuild-change-cmake-build-type.patch33
-rw-r--r--main/abuild/mr60-newapkbuild-use-abuild-meson.patch34
4 files changed, 184 insertions, 1 deletions
diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index 38663e269b..b3338740c0 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -2,7 +2,7 @@
pkgname=abuild
pkgver=3.9.0
_ver=${pkgver%_git*}
-pkgrel=0
+pkgrel=1
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
@@ -27,6 +27,9 @@ subpackages="
options="suid"
pkggroups="abuild"
source="https://gitlab.alpinelinux.org/alpine/abuild/-/archive/$pkgver/abuild-$pkgver.tar.gz
+ mr60-newapkbuild-use-abuild-meson.patch
+ mr128-newapkbuild-fetch-rust-deps-in-prepare.patch
+ mr131-newapkbuild-change-cmake-build-type.patch
"
builddir="$srcdir"/abuild-$pkgver
@@ -85,4 +88,7 @@ _rootbld() {
sha512sums="
a3075b18d4a085ca796d1c2df703c3e7c80e682623175eb0822479f3a6d96ffba571f283bdec8ae3db832e296f9e58bdd0f58097b86b503a91fbb40148084a68 abuild-3.9.0.tar.gz
+a52fa7978d61f1636dbe3d120fee4e3fab6fae018a91f662c082f4eab37e6fd63d74c55124fd50fa3a676a8af71ba858cebf93f3ca21f95b03d3478fa1e55e6b mr60-newapkbuild-use-abuild-meson.patch
+f8d5c131cefb1c10d34962994ee3158fd8155acf68616fe471a7d07ce15e04d184bdfa3c181ec19bd1ca95e0f5acf1664f14a52b29451b2760aa580222e75f73 mr128-newapkbuild-fetch-rust-deps-in-prepare.patch
+56b71c3feff5a17d9550e1947fe316b7c7aa397f9e365532410e492ea992b8bfcfbb97041ddc2128c7bb9772e9e03584a9f5d5f5bcced00a1082e7374f02801a mr131-newapkbuild-change-cmake-build-type.patch
"
diff --git a/main/abuild/mr128-newapkbuild-fetch-rust-deps-in-prepare.patch b/main/abuild/mr128-newapkbuild-fetch-rust-deps-in-prepare.patch
new file mode 100644
index 0000000000..298f717e3b
--- /dev/null
+++ b/main/abuild/mr128-newapkbuild-fetch-rust-deps-in-prepare.patch
@@ -0,0 +1,110 @@
+Patch-Source: https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/128
+--
+From 29611f3a6929b4edecd89506e666f963fa25ae52 Mon Sep 17 00:00:00 2001
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Thu, 16 Dec 2021 00:19:07 +0100
+Subject: [PATCH 1/2] newapkbuild: fetch rust dependencies in prepare phase
+
+Fetch all dependencies in the prepare phase and do not access network
+in the following phases.
+---
+ newapkbuild.in | 27 ++++++++++++++++++++++++---
+ 1 file changed, 24 insertions(+), 3 deletions(-)
+
+diff --git a/newapkbuild.in b/newapkbuild.in
+index c58d519..0182ad2 100644
+--- a/newapkbuild.in
++++ b/newapkbuild.in
+@@ -30,6 +30,12 @@ is_github_url() {
+ return 1
+ }
+
++prepare_rust() {
++ cat >>APKBUILD<<__EOF__
++ cargo fetch --locked
++__EOF__
++}
++
+ # Build sections
+ build_make() {
+ cat >>APKBUILD<<__EOF__
+@@ -104,7 +110,7 @@ __EOF__
+
+ build_rust() {
+ cat >>APKBUILD<<__EOF__
+- cargo build --release --locked
++ cargo build --frozen --release
+ __EOF__
+ }
+
+@@ -150,7 +156,7 @@ __EOF__
+
+ check_rust() {
+ cat >>APKBUILD<<__EOF__
+- cargo test --release --locked
++ cargo test --frozen --release
+ __EOF__
+ }
+
+@@ -199,7 +205,7 @@ __EOF__
+
+ package_rust() {
+ cat >>APKBUILD<<__EOF__
+- cargo install --locked --path . --root="\$pkgdir/usr"
++ cargo install --frozen --offline --path . --root="\$pkgdir/usr"
+ rm "\$pkgdir"/usr/.crates*
+ __EOF__
+ }
+@@ -333,6 +339,21 @@ __EOF__
+ fi
+ fi
+
++ case "$buildtype" in
++ rust)
++ cat >>APKBUILD<<__EOF__
++prepare() {
++ default_prepare
++
++__EOF__
++ prepare_rust
++ cat >>APKBUILD<<__EOF__
++}
++
++__EOF__
++ ;;
++ esac
++
+ # Create build() function
+ cat >>APKBUILD<<__EOF__
+ build() {
+--
+GitLab
+
+
+From 0a9374e4ffa8202ba011497ea39fb5443d7ef9a5 Mon Sep 17 00:00:00 2001
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Thu, 16 Dec 2021 00:23:48 +0100
+Subject: [PATCH 2/2] newapkbuild: do not run cargo test with --release
+
+It takes a longer time to compile and, most importantly, it may cause
+unnecessary rebuild of everything in the package phase (installation).
+---
+ newapkbuild.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/newapkbuild.in b/newapkbuild.in
+index 0182ad2..9e8643d 100644
+--- a/newapkbuild.in
++++ b/newapkbuild.in
+@@ -156,7 +156,7 @@ __EOF__
+
+ check_rust() {
+ cat >>APKBUILD<<__EOF__
+- cargo test --frozen --release
++ cargo test --frozen
+ __EOF__
+ }
+
+--
+GitLab
+
diff --git a/main/abuild/mr131-newapkbuild-change-cmake-build-type.patch b/main/abuild/mr131-newapkbuild-change-cmake-build-type.patch
new file mode 100644
index 0000000000..5b98b499a4
--- /dev/null
+++ b/main/abuild/mr131-newapkbuild-change-cmake-build-type.patch
@@ -0,0 +1,33 @@
+Patch-Source: https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/131
+--
+From 6c43d67a053be0476384fcf8252c07fa2a235a87 Mon Sep 17 00:00:00 2001
+From: psykose <alice@ayaya.dev>
+Date: Thu, 30 Dec 2021 21:48:50 +0000
+Subject: [PATCH] newapkbuild: refine default cmake format
+
+MinSizeRel is a better recommended default- of course it can still be
+overriden.
+the dot is redundant- we already specify -B and so the dot is implicitly
+cwd.
+---
+ newapkbuild.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/newapkbuild.in b/newapkbuild.in
+index c58d519..63b387d 100644
+--- a/newapkbuild.in
++++ b/newapkbuild.in
+@@ -65,8 +65,8 @@ build_cmake() {
+ -DCMAKE_INSTALL_PREFIX=/usr \\
+ -DCMAKE_INSTALL_LIBDIR=lib \\
+ -DBUILD_SHARED_LIBS=True \\
+- -DCMAKE_BUILD_TYPE=None \\
+- \$CMAKE_CROSSOPTS .
++ -DCMAKE_BUILD_TYPE=MinSizeRel \\
++ \$CMAKE_CROSSOPTS
+ cmake --build build
+ __EOF__
+ }
+--
+GitLab
+
diff --git a/main/abuild/mr60-newapkbuild-use-abuild-meson.patch b/main/abuild/mr60-newapkbuild-use-abuild-meson.patch
new file mode 100644
index 0000000000..44aefd46bf
--- /dev/null
+++ b/main/abuild/mr60-newapkbuild-use-abuild-meson.patch
@@ -0,0 +1,34 @@
+Patch-Source: https://gitlab.alpinelinux.org/alpine/abuild/-/merge_requests/60
+--
+From 55b66b3ad702ba673384126d98026043cdf949ef Mon Sep 17 00:00:00 2001
+From: Leo <thinkabit.ukim@gmail.com>
+Date: Tue, 7 Jul 2020 13:37:31 -0300
+Subject: [PATCH] newapkbuild: use meson-abuild helper instead of meson
+
+abuild-meson is a shellscript that wraps around meson and passes options
+meant for packaging software that uses meson, for Alpine Linux.
+---
+ newapkbuild.in | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/newapkbuild.in b/newapkbuild.in
+index c58d519..d7a2eb5 100644
+--- a/newapkbuild.in
++++ b/newapkbuild.in
+@@ -78,12 +78,7 @@ build_meson() {
+ # TODO For cross compilation a cross_file needs to be created.
+
+ cat >>APKBUILD<<__EOF__
+- meson \\
+- --prefix=/usr \\
+- --sysconfdir=/etc \\
+- --mandir=/usr/share/man \\
+- --localstatedir=/var \\
+- --buildtype=plain \\
++ abuild-meson \\
+ . output
+ meson compile \${JOBS:+-j \${JOBS}} -C output
+ __EOF__
+--
+GitLab
+