Improve firefox

Julien LepillerMon Nov 19 23:43:43+0100 2018

c0dbb41

Improve firefox

more/packages/gnuzilla.scm

255255
             (substitute* "servo/components/style/build_gecko.rs"
256256
               (("builder = builder.include")
257257
                (string-append
258-
                  "builder = builder.clang_arg(\"-I" (assoc-ref inputs "clang")
259-
                  "/lib/clang/6.0.1/include\");
258+
                  "builder = builder.clang_arg(\"-cxx-isystem\");
259+
                  builder = builder.clang_arg(\""
260+
                  (assoc-ref inputs "gcc") "/include/c++\");
261+
                  builder = builder.clang_arg(\"-cxx-isystem\");
262+
                  builder = builder.clang_arg(\""
263+
                  (car (find-files (string-append
264+
                                     (assoc-ref inputs "gcc")
265+
                                     "/include/c++")
266+
                                   "-gnu$" #:directories? #t)) "\");
260267
builder = builder.include")))
261268
             #t))
269+
         (add-after 'unpack 'fix-isnan
270+
           (lambda _
271+
             ;; There is a bug preventing SymbolTable_autogen.cpp from finding
272+
             ;; isnan and isinf, although they are defined in that same file.
273+
             ;; The reason seems to be that they are already defined in math.h
274+
             (substitute* "gfx/angle/checkout/src/compiler/translator/SymbolTable_autogen.cpp"
275+
			   (("^namespace sh")
276+
				"#undef isnan
277+
#undef isinf
278+
279+
namespace sh"))
280+
             #t))
262281
         (add-before 'build 'fix-cpath
263282
           (lambda _
264283
             (setenv "CPATH" (getenv "CPLUS_INCLUDE_PATH"))

287306
              (format #t "configure flags: ~s~%" flags)
288307
              (apply invoke bash
289308
                     (string-append srcdir "/configure")
290-
                     flags))))))))
309+
                     flags))))
310+
         ;; This fixes the file chooser crash that happens with GTK 3.
311+
         (replace 'wrap-program
312+
           (lambda* (#:key inputs outputs #:allow-other-keys)
313+
             (let* ((out (assoc-ref outputs "out"))
314+
                    (lib (string-append out "/lib"))
315+
                    (gtk (assoc-ref inputs "gtk+"))
316+
                    (gtk-share (string-append gtk "/share")))
317+
               (wrap-program (car (find-files lib "^firefox$"))
318+
                 `("XDG_DATA_DIRS" ":" prefix (,gtk-share)))
319+
               #t)))))))
291320
    (inputs
292321
     `(("nspr" ,nspr)
293322
       ("nss" ,nss)