forked from Mirror/pmbootstrap
Gracefully handle packages breaking because of soname bumps (#1116)
Fixes #893. Changes: * New action: "pmbootstrap pkgrel_bump" * pmbootstrap detects missing soname depends when trying to install anyting, and suggests "pkgrel_bump --auto" to fix it * Testcase test_soname_bump.py checks the pmOS binary package repo for soname breakage, so we see it when CI runs for new PRs * libsamsung-ipc: bump pkgrel because of soname bump
This commit is contained in:
parent
219aee8ab7
commit
1992f37036
12 changed files with 537 additions and 6 deletions
29
test/testdata/pkgrel_bump/aports/testapp/APKBUILD
vendored
Normal file
29
test/testdata/pkgrel_bump/aports/testapp/APKBUILD
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
pkgname=testapp
|
||||
pkgver=1.0
|
||||
pkgrel=0
|
||||
pkgdesc="program using the testlib (for testing soname bumps)"
|
||||
url="https://postmarketos.org"
|
||||
arch="all"
|
||||
license="MIT"
|
||||
depends="testlib"
|
||||
makedepends=""
|
||||
subpackages=""
|
||||
source="testapp.c"
|
||||
options=""
|
||||
|
||||
build() {
|
||||
cd "$srcdir"
|
||||
$CC testapp.c -o testapp -L/usr/lib/ -ltestlib
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$srcdir"
|
||||
printf 'hello, world from testlib!\n' > expected
|
||||
./testapp > real
|
||||
diff -q expected real
|
||||
}
|
||||
|
||||
package() {
|
||||
install -Dm755 "$srcdir/testapp" "$pkgdir/usr/bin/testapp"
|
||||
}
|
||||
sha512sums="73b167575dc0082a1277b0430f095509885c7aaf55e59bad148825a9879f91fe41c6479bb7f34c0cdd15284b0aadd904a5ba2c1ea85fb8bfb061e1cbf4322d76 testapp.c"
|
7
test/testdata/pkgrel_bump/aports/testapp/testapp.c
vendored
Normal file
7
test/testdata/pkgrel_bump/aports/testapp/testapp.c
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <testlib.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
testlib_hello();
|
||||
return 0;
|
||||
}
|
38
test/testdata/pkgrel_bump/aports/testlib/APKBUILD
vendored
Normal file
38
test/testdata/pkgrel_bump/aports/testlib/APKBUILD
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
pkgname=testlib
|
||||
pkgver=1.0
|
||||
pkgrel=0
|
||||
pkgdesc="testing soname bumps (soname changes with pkgrel!)"
|
||||
url="https://postmarketos.org"
|
||||
arch="all"
|
||||
license="MIT"
|
||||
depends=""
|
||||
makedepends=""
|
||||
subpackages=""
|
||||
source="testlib.c testlib.h"
|
||||
options="!check"
|
||||
|
||||
build() {
|
||||
cd "$srcdir"
|
||||
local major="$pkgrel"
|
||||
local minor="0"
|
||||
local soname="libtestlib.so.$major"
|
||||
local realname="libtestlib.so.$minor.$major"
|
||||
|
||||
$CC -fPIC -c -g -Wall testlib.c -o libtestlib.o
|
||||
$CC -shared -Wl,-soname,$soname -o $realname libtestlib.o
|
||||
ln -sf $realname $soname
|
||||
ln -sf $soname "libtestlib.so"
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir"
|
||||
install -Dm755 testlib.h "$pkgdir/usr/include/testlib.h"
|
||||
|
||||
mkdir -p "$pkgdir/usr/lib/"
|
||||
local i
|
||||
for i in *.so*; do
|
||||
cp -a "$i" "$pkgdir/usr/lib/$i"
|
||||
done
|
||||
}
|
||||
sha512sums="15c671462a2f043e798b2998e8706f3ac119648c3d3ae946a0115c1f1aec567537f44e7e778bc77d3af4cd05a2d684677dabd56bb35799fca5939c6c087b4e27 testlib.c
|
||||
16be61567995052e20f9436c6834c2ca2afcfb04fea15c5d02eb576ecfdc9ef4fed8d977468b2564bbe934d098d111837d96cc323dae3f4dd033aa1d061063ee testlib.h"
|
5
test/testdata/pkgrel_bump/aports/testlib/testlib.c
vendored
Normal file
5
test/testdata/pkgrel_bump/aports/testlib/testlib.c
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include <stdio.h>
|
||||
|
||||
void testlib_hello() {
|
||||
printf("hello, world from testlib!\n");
|
||||
}
|
3
test/testdata/pkgrel_bump/aports/testlib/testlib.h
vendored
Normal file
3
test/testdata/pkgrel_bump/aports/testlib/testlib.h
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
void testlib_hello();
|
Loading…
Add table
Add a link
Reference in a new issue