FreeBSD Bugzilla – Attachment 223757 Details for
Bug 254702
www/netsurf: fix preferences dialog bug, clean up build warnings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
update netsurf port to 3.10_1
netsurf-3.10_1.diff (text/plain), 11.67 KB, created by
waitman
on 2021-04-01 21:23:40 UTC
(
hide
)
Description:
update netsurf port to 3.10_1
Filename:
MIME Type:
Creator:
waitman
Created:
2021-04-01 21:23:40 UTC
Size:
11.67 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 569609) >+++ Makefile (working copy) >@@ -8,7 +8,7 @@ > MASTER_SITES= http://download.netsurf-browser.org/netsurf/releases/source/ > DISTNAME= ${PORTNAME}-${PORTVERSION}-src > >-MAINTAINER= nc@FreeBSD.org >+MAINTAINER= ports@FreeBSD.org > COMMENT= Lightweight web browser > > LICENSE= GPLv2 MIT >@@ -30,14 +30,15 @@ > libwapcaplet.so:textproc/libwapcaplet \ > libhubbub.so:www/libhubbub \ > libexpat.so:textproc/expat2 \ >- libnspsl.so:dns/libnspsl >+ libnspsl.so:dns/libnspsl \ >+ libwebp.so:graphics/webp > RUN_DEPENDS= duk:lang/duktape \ > ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss > >-USES= bison desktop-file-utils gettext-runtime gmake gnome iconv jpeg \ >- localbase pkgconfig shebangfix ssl >+USES= bison desktop-file-utils gmake gnome jpeg \ >+ localbase pkgconfig shebangfix ssl iconv:translit > ALL_TARGET= #empty >-LDFLAGS+= -L${OPENSSLLIB} -lssl -lcrypto ${ICONV_LIB} >+LDFLAGS+= -L${OPENSSLLIB} -lssl -lcrypto > CFLAGS+= -I${OPENSSLINC} > MAKE_ARGS= HOST_CC="${CC}" CC="${CC}" CCOPT="" HOST="${OPSYS}" \ > TARGET="gtk3" \ >@@ -48,31 +49,19 @@ > WRKSRC= ${WRKDIR}/${DISTNAME:S/-src//} > > SHEBANG_FILES= utils/split-messages.pl >-perl_CMD= ${SETENV} perl >+perl_CMD= ${PERL} > >-OPTIONS_DEFINE= GSTREAMER >-OPTIONS_EXCLUDE= GSTREAMER >-GSTREAMER_USE= GSTREAMER=yes, good >+NLS_USES= gettext >+NLS_CONFIGURE_ENABLE= nls > > post-patch: > @${REINPLACE_CMD} '/CFLAGS/d' \ > ${WRKSRC}//Makefile.defaults >- @${REINPLACE_CMD} 's| -O2||' \ >- ${WRKSRC}/frontends/gtk/Makefile.defaults >- @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \ >- ${WRKSRC}/frontends/gtk/gui.c >+ @${CP} ${FILESDIR}/buildui.pl ${WRKSRC}/utils/ > > do-configure: > @${CP} ${FILESDIR}/Makefile.config ${WRKSRC} >-.if empty(ICONV_LIB) >- @${REINPLACE_CMD} '/NETSURF_USE_LIBICONV_PLUG/ s|NO|YES|' \ >- ${WRKSRC}/Makefile.config >-.endif > >-do-configure-GSTREAMER-on: >- @${REINPLACE_CMD} '/NETSURF_USE_VIDEO/ s|NO|YES|' \ >- ${WRKSRC}/Makefile.config >- > post-install: > cd ${STAGEDIR}${PREFIX}/bin && ${LN} -sf netsurf-gtk3 \ > netsurf-gtk >@@ -79,6 +68,16 @@ > .for d in applications pixmaps > ${MKDIR} ${STAGEDIR}${PREFIX}/share/${d} > .endfor >+ ${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/deoptions.gtk3.ui \ >+ ${STAGEDIR}${PREFIX}/share/netsurf >+ ${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/enoptions.gtk3.ui \ >+ ${STAGEDIR}${PREFIX}/share/netsurf >+ ${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/froptions.gtk3.ui \ >+ ${STAGEDIR}${PREFIX}/share/netsurf >+ ${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/itoptions.gtk3.ui \ >+ ${STAGEDIR}${PREFIX}/share/netsurf >+ ${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/nloptions.gtk3.ui \ >+ ${STAGEDIR}${PREFIX}/share/netsurf > ${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/netsurf-gtk.desktop \ > ${STAGEDIR}${PREFIX}/share/applications > ${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/netsurf.xpm \ >Index: files/Makefile.config >=================================================================== >--- files/Makefile.config (revision 569609) >+++ files/Makefile.config (working copy) >@@ -1,4 +1,4 @@ >-NETSURF_USE_LIBICONV_PLUG=NO >+NETSURF_USE_LIBICONV_PLUG=YES > NETSURF_USE_NSSVG=NO > NETSURF_USE_RSVG=YES > NETSURF_USE_VIDEO=NO >Index: files/buildui.pl >=================================================================== >--- files/buildui.pl (nonexistent) >+++ files/buildui.pl (working copy) >@@ -0,0 +1,82 @@ >+#! >+# >+# Create ui files for each language listed in FatMessages >+ >+my $inputfn = $ARGV[0]; # path to FatMessages >+my $templatefn = $ARGV[1]; # path to UI Template >+my $output = $ARGV[2]; # output path >+my $stub = $ARGV[3]; # filename stub. like options.gtk3.ui will become enoptions.gtk3.ui >+ >+if (length($stub)<3) { >+ print "invalid stub.\n"; >+ exit; >+} >+ >+my $template; >+my %langs = {'en'=>1}; >+my %trans; >+$trans{'en'}{'foo'}='bar'; >+ >+open(my $fh, '<', $templatefn) or die "cannot open template file $templatefn"; >+{ >+ local $/; >+ $template = <$fh>; >+} >+close($fh); >+ >+$template =~ s/translatable="yes"/translatable="no"/g; >+ >+open(my $input, '<', $inputfn) or die "cannot open FatMessages file $inputfn"; >+ >+while (<$input>) >+{ >+ # skip comment and empty lines >+ /^#/ && next; >+ /^\s*$/ && next; >+ >+ # only parsing things that look like message lines: >+ if( /^([a-z]{2}).([^.]+).([^:]+):(.*)/ ) >+ { >+ my( $lang, $plat, $key, $val ) = ( $1, $2, $3, $4 ); >+ if ($plat == 'gtk') >+ { >+ $val =~ s|<.+?>||g; #remove HTML >+ $langs{$lang}=1; >+ $trans{$lang}{$key}=$val; >+ } >+ } >+ >+} >+ >+# load up langs hash with copy of the template for each lang >+ >+foreach $key (keys %langs) >+{ >+ if (length($key)==2) >+ { >+ $langs{$key} = $template >+ } >+} >+ >+# iterate through each and key replace with translated text >+ >+foreach my $tran (keys %trans) >+{ >+ foreach my $key (keys %{$trans{$tran}}) >+ { >+ $langs{$tran} =~ s/\>$key\</\>$trans{$tran}{$key}\</g; >+ } >+} >+ >+# save the ui file for each language >+ >+foreach $key (keys %langs) >+{ >+ if (length($key)==2) >+ { >+ open (OFN, '>', $output.'/'.$key.$stub) or die "cannot open output file ".$output.'/'.$key.$stub; >+ print OFN $langs{$key}; >+ close (OFN); >+ } >+} >+ > >Property changes on: files/buildui.pl >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: files/patch-Makefile >=================================================================== >--- files/patch-Makefile (revision 569609) >+++ files/patch-Makefile (working copy) >@@ -1,6 +1,23 @@ > --- Makefile.orig 2020-05-24 20:55:29 UTC > +++ Makefile >-@@ -547,7 +547,6 @@ ifeq ($(HOST),mint) >+@@ -484,16 +484,6 @@ ifneq ($(CC_MAJOR),2) >+ COMMON_WARNFLAGS += -Wno-unused-parameter >+ endif >+ >+-# deal with lots of unwanted warnings from javascript >+-ifeq ($(call cc_ver_ge,4,6),1) >+- COMMON_WARNFLAGS += -Wno-unused-but-set-variable >+-endif >+- >+-# Implicit fallthrough warnings suppressed by comment >+-ifeq ($(call cc_ver_ge,7,1),1) >+- COMMON_WARNFLAGS += -Wimplicit-fallthrough=3 >+-endif >+- >+ # deal with chaging warning flags for different platforms >+ ifeq ($(HOST),OpenBSD) >+ # OpenBSD headers are not compatible with redundant declaration warning >+@@ -547,7 +537,6 @@ ifeq ($(HOST),mint) > else > $(eval $(call pkg_config_find_and_add_enabled,CURL,libcurl,Curl)) > endif >@@ -8,3 +25,34 @@ > > $(eval $(call pkg_config_find_and_add_enabled,UTF8PROC,libutf8proc,utf8)) > $(eval $(call pkg_config_find_and_add_enabled,WEBP,libwebp,WEBP)) >+@@ -680,14 +669,21 @@ $$(MESSAGES_TARGET)/$(1)/Messages: resources/FatMessag >+ $$(Q)$$(SPLIT_MESSAGES) -l $(1) -p $$(MESSAGES_FILTER) -f messages -o $$@ -z $$< >+ >+ CLEAN_MESSAGES += $$(MESSAGES_TARGET)/$(1)/Messages >++CLEAN_MESSAGES += $$(MESSAGES_TARGET)/$(1)options.gtk3.ui >+ MESSAGES += $$(MESSAGES_TARGET)/$(1)/Messages >+ >+ endef >+ >++buildui: >++ @echo "BUILDUI: options ui for each language in resources/FatMessages" >++ @$(PERL) utils/buildui.pl resources/FatMessages frontends/gtk/res/options.gtk3.ui $(MESSAGES_TARGET) options.gtk3.ui >++ >+ # generate the message file rules >+ $(eval $(foreach LANG,$(MESSAGES_LANGUAGES), \ >+ $(call split_messages,$(LANG)))) >+ >++MESSAGES += buildui >++ >+ clean-messages: >+ $(VQ)echo " CLEAN: $(CLEAN_MESSAGES)" >+ $(Q)$(RM) $(CLEAN_MESSAGES) >+@@ -710,7 +706,7 @@ OBJECTS := $(sort $(addprefix $(OBJROOT)/,$(subst /,_, >+ # Include directory flags >+ IFLAGS = $(addprefix -I,$(INCLUDE_DIRS)) >+ >+-$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES) >++$(EXETARGET): $(OBJECTS) $(RESOURCES) $(MESSAGES) >+ $(VQ)echo " LINK: $(EXETARGET)" >+ ifneq ($(TARGET)$(SUBTARGET),riscos-elf) >+ $(Q)$(CC) -o $(EXETARGET) $(OBJECTS) $(LDFLAGS) >Index: files/patch-frontends_gtk_Makefile.defaults >=================================================================== >--- files/patch-frontends_gtk_Makefile.defaults (revision 569609) >+++ files/patch-frontends_gtk_Makefile.defaults (working copy) >@@ -1,4 +1,4 @@ >---- frontends/gtk/Makefile.defaults.orig 2016-11-19 13:37:41 UTC >+--- frontends/gtk/Makefile.defaults.orig 2020-05-24 20:55:29 UTC > +++ frontends/gtk/Makefile.defaults > @@ -4,7 +4,7 @@ > >@@ -9,3 +9,9 @@ > > # Where to install the netsurf binary > NETSURF_GTK_BIN := $(PREFIX)/bin/ >+@@ -39,4 +39,4 @@ NETSURF_FS_BACKING_STORE := YES >+ NETSURF_GTK_MAJOR ?= 2 >+ >+ # Optimisation levels >+-CFLAGS += -O2 >++CFLAGS += >Index: files/patch-frontends_gtk_preferences.c >=================================================================== >--- files/patch-frontends_gtk_preferences.c (nonexistent) >+++ files/patch-frontends_gtk_preferences.c (working copy) >@@ -0,0 +1,33 @@ >+--- frontends/gtk/preferences.c.orig 2021-04-01 17:51:28 UTC >++++ frontends/gtk/preferences.c >+@@ -962,11 +962,26 @@ GtkWidget* nsgtk_preferences(struct browser_window *bw >+ return GTK_WIDGET(priv->dialog); >+ } >+ >+- res = nsgtk_builder_new_from_resname("options", &preferences_builder); >+- if (res != NSERROR_OK) { >+- NSLOG(netsurf, INFO, "Preferences UI builder init failed"); >+- return NULL; >++ const char *client_lang; >++ char ui_lang[10] = "en"; >++ client_lang = getenv("LANG"); >++ >++ if (strlen(client_lang)>1) >++ { >++ strncpy(ui_lang,client_lang,2); >+ } >++ >++ strcat(ui_lang,"options"); >++ >++ res = nsgtk_builder_new_from_resname(ui_lang, &preferences_builder); >++ if (res != NSERROR_OK) { >++ //LANG not found, so fall back to english i guess >++ res = nsgtk_builder_new_from_resname("enoption", &preferences_builder); >++ } >++ if (res != NSERROR_OK) { >++ NSLOG(netsurf, INFO, "Preferences UI builder init failed"); >++ return NULL; >++ } >+ >+ priv->dialog = gtk_builder_get_object(preferences_builder, >+ "dialogPreferences"); > >Property changes on: files/patch-frontends_gtk_preferences.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: files/patch-frontends_gtk_resources.c >=================================================================== >--- files/patch-frontends_gtk_resources.c (nonexistent) >+++ files/patch-frontends_gtk_resources.c (working copy) >@@ -0,0 +1,22 @@ >+--- frontends/gtk/resources.c.orig 2021-04-01 19:00:43 UTC >++++ frontends/gtk/resources.c >+@@ -82,6 +82,11 @@ static struct nsgtk_resource_s ui_resource[] = { >+ RES_ENTRY("globalhistory"), >+ RES_ENTRY("localhistory"), >+ RES_ENTRY("options"), >++ RES_ENTRY("deoptions"), >++ RES_ENTRY("enoptions"), >++ RES_ENTRY("froptions"), >++ RES_ENTRY("itoptions"), >++ RES_ENTRY("nloptions"), >+ RES_ENTRY("hotlist"), >+ RES_ENTRY("cookies"), >+ RES_ENTRY("viewdata"), >+@@ -552,6 +557,7 @@ nsgtk_builder_new_from_resname(const char *resname, Gt >+ error->message); >+ g_error_free(error); >+ g_object_unref(G_OBJECT(new_builder)); >++ >+ return NSERROR_INIT_FAILED; >+ } >+ } else { > >Property changes on: files/patch-frontends_gtk_resources.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: pkg-plist >=================================================================== >--- pkg-plist (revision 569609) >+++ pkg-plist (working copy) >@@ -47,6 +47,11 @@ > %%DATADIR%%/nl/licence.html > %%DATADIR%%/nl/welcome.html > %%DATADIR%%/options.gtk3.ui >+%%DATADIR%%/deoptions.gtk3.ui >+%%DATADIR%%/enoptions.gtk3.ui >+%%DATADIR%%/froptions.gtk3.ui >+%%DATADIR%%/itoptions.gtk3.ui >+%%DATADIR%%/nloptions.gtk3.ui > %%DATADIR%%/pageinfo.gtk3.ui > %%DATADIR%%/password.gtk3.ui > %%DATADIR%%/quirks.css
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 254702
: 223757