Netsurf: get rid of xxd

classic Classic list List threaded Threaded
3 messages Options
adr
Reply | Threaded
Open this post in threaded view
|

Netsurf: get rid of xxd

adr
Hello,

I found a little annoying having to install vim to compile
netsurf.  If you like you can try this patch, and maybe make it
less ugly, I'm not a make expert.

By the way, I've compiled netsurf on armv7. It works good.

Regards,
adr
============================================
$OpenBSD$

Index: content/handlers/javascript/duktape/Makefile
--- content/handlers/javascript/duktape/Makefile.orig
+++ content/handlers/javascript/duktape/Makefile
@@ -9,11 +9,18 @@ content/handlers/javascript/duktape/dukky.c: $(OBJROOT
  BINDINGS := $(wildcard content/handlers/javascript/duktape/*.bnd)

  # Generator for the C include representing the generics.js
-$(OBJROOT)/duktape/generics.js.inc: content/handlers/javascript/duktape/generics.js
+GENERICJS := content/handlers/javascript/duktape/generics.js
+NAME != echo $(GENERICJS) | sed s';[/.];_;g'
+ARRAY != hexdump -v -e '/1 "%d,"' $(GENERICJS)
+LEN != echo $(ARRAY) | awk -F"," '{print NF-1}'
+$(OBJROOT)/duktape/generics.js.inc: $(GENERICJS)
         $(Q)$(MKDIR) -p $(OBJROOT)/duktape
         $(VQ)echo "     XXD: $<"
-       $(Q)xxd -i $< $@.tmp
+#      $(Q)xxd -i $< $@.tmp
+       $(Q)echo "unsigned char $(NAME)[] = { $(ARRAY) };" > $@.tmp
+       $(Q)echo "unsigned int $(NAME)_len = $(LEN);" >> $@.tmp
         $(Q)sed -e 's/content_handlers_javascript_duktape_generics_js/generics_js/' $@.tmp > $@

  # ensure genbind generates debugging files
  GBFLAGS+=-D
~

Reply | Threaded
Open this post in threaded view
|

Re: Netsurf: get rid of xxd

Antoine Jacoutot-7
On Tue, Aug 13, 2019 at 01:42:13AM +0000, adr wrote:
> Hello,
>
> I found a little annoying having to install vim to compile

Not using netsurf so my voice does not really count I suppose.

But 2019... storage price versus developer time to make sure this still works in
the future makes me wonder the usefullness of this diff.
Had it been a RUN_DEPENDS, then OK, let's try and fix this. BUILD_DEPENDS...
who cares??!!! People are supposed to use binary packages.

> netsurf.  If you like you can try this patch, and maybe make it
> less ugly, I'm not a make expert.
>
> By the way, I've compiled netsurf on armv7. It works good.
>
> Regards,
> adr
> ============================================
> $OpenBSD$
>
> Index: content/handlers/javascript/duktape/Makefile
> --- content/handlers/javascript/duktape/Makefile.orig
> +++ content/handlers/javascript/duktape/Makefile
> @@ -9,11 +9,18 @@ content/handlers/javascript/duktape/dukky.c: $(OBJROOT
>  BINDINGS := $(wildcard content/handlers/javascript/duktape/*.bnd)
>
>  # Generator for the C include representing the generics.js
> -$(OBJROOT)/duktape/generics.js.inc: content/handlers/javascript/duktape/generics.js
> +GENERICJS := content/handlers/javascript/duktape/generics.js
> +NAME != echo $(GENERICJS) | sed s';[/.];_;g'
> +ARRAY != hexdump -v -e '/1 "%d,"' $(GENERICJS)
> +LEN != echo $(ARRAY) | awk -F"," '{print NF-1}'
> +$(OBJROOT)/duktape/generics.js.inc: $(GENERICJS)
>         $(Q)$(MKDIR) -p $(OBJROOT)/duktape
>         $(VQ)echo "     XXD: $<"
> -       $(Q)xxd -i $< $@.tmp
> +#      $(Q)xxd -i $< $@.tmp
> +       $(Q)echo "unsigned char $(NAME)[] = { $(ARRAY) };" > $@.tmp
> +       $(Q)echo "unsigned int $(NAME)_len = $(LEN);" >> $@.tmp
>         $(Q)sed -e 's/content_handlers_javascript_duktape_generics_js/generics_js/' $@.tmp > $@
>
>  # ensure genbind generates debugging files
>  GBFLAGS+=-D
> ~
>

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: Netsurf: get rid of xxd

Raul Miller
On Tue, Aug 13, 2019 at 5:39 PM Antoine Jacoutot <[hidden email]> wrote:
> On Tue, Aug 13, 2019 at 01:42:13AM +0000, adr wrote:
> > I found a little annoying having to install vim to compile
>
> Not using netsurf so my voice does not really count I suppose.
>
> But 2019... storage price versus developer time to make sure this still works in
> the future makes me wonder the usefullness of this diff.
> Had it been a RUN_DEPENDS, then OK, let's try and fix this. BUILD_DEPENDS...
> who cares??!!! People are supposed to use binary packages.

If it won't compile, what's the point of having the source?

--
Raul