FeedReader: fix build

Also fix musl by not trying to temporarily disable stdout by
replacing it with a file handle for /dev/null.
This commit is contained in:
Jürgen Buchmüller 2020-04-14 11:34:04 +02:00
parent 7c1137465c
commit 41d74a1966
3 changed files with 44 additions and 4 deletions

View file

@ -0,0 +1,23 @@
Source: @pullmoll
Upstream: no
Reason: In musl libc stdin, stdout, and stderr are FILE const*
The unreadCount option may print intialization messages before the
number of unread articles. This _may_ break existing apps relying
on the output being just one number, while I know of no such app.
If someone knows how to temporarily disable stdout with musl libc
please modify this patch and move it to ../patches.
--- src/FeedReaderMain.vala 2019-07-13 21:09:05.000000000 +0200
+++ src/FeedReaderMain.vala 2020-04-14 01:26:11.436124423 +0200
@@ -98,10 +98,7 @@
if(unreadCount)
{
- var old_stdout =(owned)stdout;
- stdout = FileStream.open("/dev/null", "w");
Logger.init(verbose);
- stdout =(owned)old_stdout;
stdout.printf("%u\n", DataBase.readOnly().get_unread_total());
return 0;
}

View file

@ -0,0 +1,11 @@
--- src/Backend/FeedServer.vala 2019-07-13 21:09:05.000000000 +0200
+++ src/Backend/FeedServer.vala 2020-04-13 21:47:59.911904739 +0200
@@ -57,7 +57,7 @@
var secrets = Secret.Collection.for_alias_sync(secret_service, Secret.COLLECTION_DEFAULT, Secret.CollectionFlags.NONE);
if(secrets == null)
{
- secrets = Secret.Collection.create_sync(secret_service, "Login", Secret.COLLECTION_DEFAULT, Secret.CollectionCreateFlags.COLLECTION_CREATE_NONE);
+ secrets = Secret.Collection.create_sync(secret_service, "Login", Secret.COLLECTION_DEFAULT, Secret.CollectionCreateFlags.NONE);
}
var settings_backend = null; // FIXME: Why does SettingsBackend.get_default() crash on Arch Linux?

View file

@ -15,7 +15,13 @@ distfiles="https://github.com/jangernert/${pkgname}/archive/v${version}.tar.gz"
checksum=fd10d2d2dc9c20c259d672634e5e100d10f0fb730e0687e1b3c2423224901a2c
nocross="SQLite.vala:131.12-131.36: error: The name copy does not exist in the context of Sqlite.Value"
case "$XBPS_TARGET_MACHINE" in
x86_64-musl) broken="https://build.voidlinux.org/builders/x86_64-musl_builder/builds/2615/steps/shell_3/logs/stdio";;
*-musl) broken="needs execinfo.h";;
esac
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
makedepends+=" libexecinfo-devel"
LDFLAGS+=" -lexecinfo"
fi
pre_configure() {
if [ "$XBPS_TARGET_LIBC" = "musl" ]; then
patch -Np0 -i ${FILESDIR}/fix-FeedServerMain_vala.patch
fi
}