Skip to content

Commit

Permalink
FeedReader: fix build
Browse files Browse the repository at this point in the history
Also fix musl by not trying to temporarily disable stdout by
replacing it with a file handle for /dev/null.
  • Loading branch information
pullmoll committed Apr 14, 2020
1 parent 7c11374 commit 41d74a1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
23 changes: 23 additions & 0 deletions srcpkgs/FeedReader/files/fix-FeedServerMain_vala.patch
Original file line number Diff line number Diff line change
@@ -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;
}
11 changes: 11 additions & 0 deletions srcpkgs/FeedReader/patches/fix-FeedServer_vala-flags.patch
Original file line number Diff line number Diff line change
@@ -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?
14 changes: 10 additions & 4 deletions srcpkgs/FeedReader/template
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 41d74a1

Please sign in to comment.