summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2017-01-21 22:09:53 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-01-24 07:23:25 +0700
commit023ef991d2dacc69747d7335db1299edaa16d201 (patch)
treef58e39dd03d0bb58857d37ad382c154e4197fad6
parentdf6bba04a4e329f85d0f0ea1b035bf5114fa7efe (diff)
downloadslackbuilds-023ef991d2dacc69747d7335db1299edaa16d201.tar.gz
network/surf: Updated for version 0.7.
-rw-r--r--network/surf/patches.txt3
-rw-r--r--network/surf/patches/homepage.diff12
-rw-r--r--network/surf/patches/searchengines.diff79
-rw-r--r--network/surf/patches/startfullscreen.diff70
-rw-r--r--network/surf/surf.SlackBuild7
-rw-r--r--network/surf/surf.info6
6 files changed, 57 insertions, 120 deletions
diff --git a/network/surf/patches.txt b/network/surf/patches.txt
index 4b0f9bae03..957465989a 100644
--- a/network/surf/patches.txt
+++ b/network/surf/patches.txt
@@ -13,6 +13,3 @@ google for foo and bar. Supported engines:
homepage - The browser will start at your home page if called with no
arguments (normally it starts with a blank window).
-
-startfullscreen - Adds -f option to start the browser in fullscreen
-mode. Can still use F11 to toggle fullscreen.
diff --git a/network/surf/patches/homepage.diff b/network/surf/patches/homepage.diff
index cd74dc18e9..f31b8fe89d 100644
--- a/network/surf/patches/homepage.diff
+++ b/network/surf/patches/homepage.diff
@@ -1,15 +1,15 @@
-diff -Naur surf-0.6/surf.c surf-0.6.patched/surf.c
---- surf-0.6/surf.c 2013-02-10 13:40:14.000000000 -0500
-+++ surf-0.6.patched/surf.c 2013-07-03 16:48:40.000000000 -0400
-@@ -1218,8 +1218,11 @@
+diff -Naur surf-0.7/surf.c surf-0.7.patched/surf.c
+--- surf-0.7/surf.c 2015-12-19 09:59:30.000000000 -0500
++++ surf-0.7.patched/surf.c 2017-01-21 22:00:00.856364467 -0500
+@@ -1759,8 +1759,11 @@
default:
usage();
} ARGEND;
+#define HOMEPAGE "@HOMEPAGE@"
- if(argc > 0)
+ if (argc > 0)
arg.v = argv[0];
+ else
+ arg.v = HOMEPAGE;
setup();
- newclient();
+ c = newclient();
diff --git a/network/surf/patches/searchengines.diff b/network/surf/patches/searchengines.diff
index 97aa6a4922..77ad9deb80 100644
--- a/network/surf/patches/searchengines.diff
+++ b/network/surf/patches/searchengines.diff
@@ -1,8 +1,8 @@
-diff -Naur surf-0.6/config.def.h surf-0.6.patched/config.def.h
---- surf-0.6/config.def.h 2013-02-10 13:40:14.000000000 -0500
-+++ surf-0.6.patched/config.def.h 2013-07-03 16:40:14.000000000 -0400
-@@ -93,3 +93,10 @@
- { MODKEY|GDK_SHIFT_MASK,GDK_v, toggle, { .v = "enable-plugins" } },
+diff -Naur surf-0.7/config.def.h surf-0.7.patched/config.def.h
+--- surf-0.7/config.def.h 2015-12-19 09:59:30.000000000 -0500
++++ surf-0.7.patched/config.def.h 2017-01-21 22:05:50.709360322 -0500
+@@ -129,6 +129,14 @@
+ { MODKEY|GDK_SHIFT_MASK,GDK_g, togglegeolocation, { 0 } },
};
+static SearchEngine searchengines[] = {
@@ -12,58 +12,63 @@ diff -Naur surf-0.6/config.def.h surf-0.6.patched/config.def.h
+ { "sb", "http://slackbuilds.org/result/?search=%s&sv=@SLACKVER@" },
+ { "sw", "http://search.slackware.eu/cgi-bin/search.cgi?rm=search&needle=%s&haystack=2&sver=@SVER@&button-search=Search" },
+};
-diff -Naur surf-0.6/surf.c surf-0.6.patched/surf.c
---- surf-0.6/surf.c 2013-02-10 13:40:14.000000000 -0500
-+++ surf-0.6.patched/surf.c 2013-07-03 15:25:44.000000000 -0400
-@@ -76,6 +76,11 @@
-
++
+ /* button definitions */
+ /* click can be ClkDoc, ClkLink, ClkImg, ClkMedia, ClkSel, ClkEdit, ClkAny */
+ static Button buttons[] = {
+diff -Naur surf-0.7/surf.c surf-0.7.patched/surf.c
+--- surf-0.7/surf.c 2015-12-19 09:59:30.000000000 -0500
++++ surf-0.7.patched/surf.c 2017-01-21 22:05:12.304360777 -0500
+@@ -91,6 +91,12 @@
G_DEFINE_TYPE(CookieJar, cookiejar, SOUP_TYPE_COOKIE_JAR_TEXT)
-+typedef struct {
-+ char *token;
-+ char *uri;
+ typedef struct {
++ char *token;
++ char *uri;
+} SearchEngine;
+
- static Display *dpy;
- static Atom atoms[AtomLast];
- static Client *clients = NULL;
-@@ -139,6 +144,7 @@
++
++typedef struct {
+ char *regex;
+ char *style;
+ regex_t re;
+@@ -178,6 +184,7 @@
static void navigate(Client *c, const Arg *arg);
static Client *newclient(void);
static void newwindow(Client *c, const Arg *arg, gboolean noembed);
+static gchar *parseuri(const gchar *uri);
static void pasteuri(GtkClipboard *clipboard, const char *text, gpointer d);
- static void populatepopup(WebKitWebView *web, GtkMenu *menu, Client *c);
- static void popupactivate(GtkMenuItem *menu, Client *);
-@@ -627,8 +633,8 @@
+ static gboolean contextmenu(WebKitWebView *view, GtkWidget *menu,
+ WebKitHitTestResult *target, gboolean keyboard,
+@@ -838,8 +845,7 @@
u = g_strdup_printf("file://%s", rp);
free(rp);
} else {
- u = g_strrstr(uri, "://") ? g_strdup(uri)
-- : g_strdup_printf("http://%s", uri);
-+ u = parseuri(uri);
-+
+- : g_strdup_printf("http://%s", uri);
++ u = parseuri(uri);
}
- /* prevents endless loop */
-@@ -893,6 +899,20 @@
+ setatom(c, AtomUri, uri);
+@@ -1172,6 +1178,21 @@
}
}
-+gchar *
++static gchar *
+parseuri(const gchar *uri) {
-+ guint i;
++ guint i;
+
-+ for (i = 0; i < LENGTH(searchengines); i++) {
-+ if (searchengines[i].token == NULL || searchengines[i].uri == NULL || *(uri + strlen(searchengines[i].token)) != ' ')
-+ continue;
-+ if (g_str_has_prefix(uri, searchengines[i].token))
-+ return g_strdup_printf(searchengines[i].uri, uri + strlen(searchengines[i].token) + 1);
-+ }
++ for (i = 0; i < LENGTH(searchengines); i++) {
++ if (searchengines[i].token == NULL || searchengines[i].uri == NULL || \
++ *(uri + strlen(searchengines[i].token)) != ' ')
++ continue;
++ if (g_str_has_prefix(uri, searchengines[i].token))
++ return g_strdup_printf(searchengines[i].uri, uri + strlen(searchengines[i].token) + 1);
++ }
+
-+ return g_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s", uri);
++ return g_strrstr(uri, "://") ? g_strdup(uri) : g_strdup_printf("http://%s", uri);
+}
+
- static void
- pasteuri(GtkClipboard *clipboard, const char *text, gpointer d) {
- Arg arg = {.v = text };
+ void
+ pasteuri(GtkClipboard *clipboard, const char *text, gpointer d)
+ {
diff --git a/network/surf/patches/startfullscreen.diff b/network/surf/patches/startfullscreen.diff
deleted file mode 100644
index 45e1f87f53..0000000000
--- a/network/surf/patches/startfullscreen.diff
+++ /dev/null
@@ -1,70 +0,0 @@
-diff -Naur surf-0.6/surf.1 surf-0.6.patched/surf.1
---- surf-0.6/surf.1 2013-02-10 13:40:14.000000000 -0500
-+++ surf-0.6.patched/surf.1 2013-07-03 18:41:35.000000000 -0400
-@@ -50,6 +50,8 @@
- .B \-x
- Prints xid to standard output. This can be used to script the browser by using
- .BR xprop(1).
-+.B \-f
-+Start in fullscreen mode.
- .SH USAGE
- .B Escape
- Stops loading current page or stops download.
-diff -Naur surf-0.6/surf.c surf-0.6.patched/surf.c
---- surf-0.6/surf.c 2013-02-10 13:40:14.000000000 -0500
-+++ surf-0.6.patched/surf.c 2013-07-03 18:42:07.000000000 -0400
-@@ -81,6 +81,7 @@
- static Client *clients = NULL;
- static GdkNativeWindow embed = 0;
- static gboolean showxid = FALSE;
-+static gboolean startfullscreen = FALSE;
- static char winid[64];
- static gboolean usingproxy = 0;
- static char togglestat[5];
-@@ -463,7 +464,7 @@
- } else {
- gtk_window_fullscreen(GTK_WINDOW(c->win));
- }
-- c->fullscreen = !c->fullscreen;
-+ startfullscreen = c->fullscreen = !c->fullscreen;
- }
-
- static const char *
-@@ -822,6 +823,9 @@
- }
- }
-
-+ if(startfullscreen) {
-+ fullscreen(c, NULL);
-+ }
- return c;
- }
-
-@@ -846,6 +850,8 @@
- cmd[i++] = "-i";
- if(showxid)
- cmd[i++] = "-x";
-+ if(startfullscreen)
-+ cmd[i++] = "-f";
- cmd[i++] = "--";
- uri = arg->v ? (char *)arg->v : c->linkhover;
- if(uri)
-@@ -1148,7 +1154,7 @@
-
- static void
- usage(void) {
-- die("usage: %s [-inpsvx] [-c cookiefile] [-e xid] [-r scriptfile]"
-+ die("usage: %s [-inpsvxf] [-c cookiefile] [-e xid] [-r scriptfile]"
- " [-t stylefile] [-u useragent] [uri]\n", basename(argv0));
- }
-
-@@ -1215,6 +1221,9 @@
- case 'x':
- showxid = TRUE;
- break;
-+ case 'f':
-+ startfullscreen = TRUE;
-+ break;
- default:
- usage();
- } ARGEND;
diff --git a/network/surf/surf.SlackBuild b/network/surf/surf.SlackBuild
index 629a4afbfb..12079a00f1 100644
--- a/network/surf/surf.SlackBuild
+++ b/network/surf/surf.SlackBuild
@@ -6,8 +6,13 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20170121 bkw:
+# - updated for v0.7.
+# - remove patches/startfullscreen.diff as it's integrated into 0.7
+# - update homepage.diff and searchengines.diff for 0.7
+
PRGNAM=surf
-VERSION=${VERSION:-0.6}
+VERSION=${VERSION:-0.7}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
diff --git a/network/surf/surf.info b/network/surf/surf.info
index 299ba1db4d..985a9db95c 100644
--- a/network/surf/surf.info
+++ b/network/surf/surf.info
@@ -1,8 +1,8 @@
PRGNAM="surf"
-VERSION="0.6"
+VERSION="0.7"
HOMEPAGE="http://surf.suckless.org/"
-DOWNLOAD="http://dl.suckless.org/surf/surf-0.6.tar.gz"
-MD5SUM="aeeed723b562a30cc6a2b3ea18f6d99a"
+DOWNLOAD="http://dl.suckless.org/surf/surf-0.7.tar.gz"
+MD5SUM="45899435aeb5ce3af0a62909911b735f"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="webkitgtk dmenu"