From 1a93ca87660f73f054c629f072ca568d98af9420 Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Sat, 11 Jun 2016 02:06:50 +0200 Subject: [PATCH] dwb: unbreak build --- srcpkgs/dwb/patches/dwb-isnan.patch | 43 +++++++++++++++++++++++++++++ srcpkgs/dwb/template | 7 +++-- 2 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/dwb/patches/dwb-isnan.patch diff --git a/srcpkgs/dwb/patches/dwb-isnan.patch b/srcpkgs/dwb/patches/dwb-isnan.patch new file mode 100644 index 00000000000..6d0611100b6 --- /dev/null +++ b/srcpkgs/dwb/patches/dwb-isnan.patch @@ -0,0 +1,43 @@ +diff --git src/scripts.c src/scripts.c +index 16784fc..71efc50 100644 +--- src/scripts.c ++++ src/scripts.c +@@ -3231,16 +3231,17 @@ sutil_checksum(JSContextRef ctx, JSObjectRef function, JSObjectRef thisObject, s + if (original == NULL) + return NIL; + ++ double dtype; + GChecksumType type = G_CHECKSUM_SHA256; + if (argc > 1) + { +- type = JSValueToNumber(ctx, argv[1], exc); +- if (isnan(type)) ++ dtype = JSValueToNumber(ctx, argv[1], exc); ++ if (isnan(dtype)) + { + ret = NIL; + goto error_out; + } +- type = MIN(MAX(type, G_CHECKSUM_MD5), G_CHECKSUM_SHA256); ++ type = MIN(MAX((GChecksumType)dtype, G_CHECKSUM_MD5), G_CHECKSUM_SHA256); + } + checksum = g_compute_checksum_for_data(type, original, -1); + +@@ -6247,11 +6248,14 @@ gobject_unblock_signal(JSContextRef ctx, JSObjectRef function, JSObjectRef this, + static JSValueRef + gobject_disconnect(JSContextRef ctx, JSObjectRef function, JSObjectRef this, size_t argc, const JSValueRef argv[], JSValueRef* exc) + { +- int id; +- if (argc > 0 && JSValueIsNumber(ctx, argv[0]) && !isnan(id = JSValueToNumber(ctx, argv[0], exc))) ++ if (argc == 0) { ++ return JSValueMakeBoolean(ctx, false); ++ } ++ double id = JSValueToNumber(ctx, argv[0], exc); ++ if (!isnan(id)) + { + GObject *o = JSObjectGetPrivate(this); +- if (o != NULL && g_signal_handler_is_connected(o, id)) ++ if (o != NULL && g_signal_handler_is_connected(o, (int)id)) + { + sigdata_remove(id, o); + g_signal_handler_disconnect(o, id); diff --git a/srcpkgs/dwb/template b/srcpkgs/dwb/template index 78d43669f57..720eb7ee8ac 100644 --- a/srcpkgs/dwb/template +++ b/srcpkgs/dwb/template @@ -1,16 +1,17 @@ # Template file for 'dwb' pkgname=dwb version=2014.03.07 -revision=2 +revision=3 build_style=gnu-makefile hostmakedepends="pkg-config m4" makedepends="gnutls-devel libsoup-devel webkitgtk-devel json-c-devel" -short_desc="lightweight web browser based on webkit and gtk" +short_desc="Lightweight web browser based on WebKit and GTK+" maintainer="Enno Boland " license="GPL-3" homepage="http://portix.bitbucket.org/dwb/" -distfiles="https://bitbucket.org/portix/dwb/downloads/dwb-$version.tar.gz" +distfiles="https://bitbucket.org/portix/dwb/downloads/dwb-${version}.tar.gz" checksum=bfbe3e366b27c969876f9ee7954f138b1d49a270aa84a14ce43e01591ab69b62 +CFLAGS="-D_DEFAULT_SOURCE" do_build() { sed -i '/^CFLAGS += -Werror=/d' config.mk