guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patches question


From: ng0
Subject: Re: patches question
Date: Thu, 23 Jun 2016 13:23:47 +0000

Firefox wip, untested, not even run, just filling in fixes
which very likely have broken syntax looks like the later
inserted file. In this file there is a 140+ lines phase
which aims at doing what the following inserted patch
does. It is still growing (2 files left to patch).
As 'maybe' icecat can make use of the harfbuzz graphite
phase in this case it makes more sense to drop it
into gnu/packages/patches/ .. right?


diff --git a/config/Makefile.in b/config/Makefile.in
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -44,16 +44,18 @@ export:: $(export-preqs)
                -DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
                -DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
                -DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
                -DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
                -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
                -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
                -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
                -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
+               -DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \
+               -DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \
                $(srcdir)/system-headers | $(PERL) 
$(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
        $(INSTALL) system_wrappers $(DIST)

 GARBAGE_DIRS += system_wrappers
 endif

 ifdef WRAP_STL_INCLUDES
 ifdef GNU_CXX
diff --git a/config/system-headers b/config/system-headers
--- a/config/system-headers
+++ b/config/system-headers
@@ -1340,8 +1340,16 @@ unicode/udatpg.h
 unicode/uenum.h
 unicode/unorm.h
 unicode/unum.h
 unicode/ustring.h
 unicode/utypes.h
 #endif
 libutil.h
 unwind.h
+#if MOZ_NATIVE_GRAPHITE2==1
+graphite2/Font.h
+graphite2/Segment.h
+#endif
+#if MOZ_NATIVE_HARFBUZZ==1
+harfbuzz/hb-ot.h
+harfbuzz/hb.h
+#endif
diff --git a/dom/base/moz.build b/dom/base/moz.build
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -477,16 +477,19 @@ for var in ('MOZ_B2G_RIL', 'MOZ_B2G_FM')
         DEFINES[var] = True

 if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
     DEFINES['HAVE_SIDEBAR'] = True

 if CONFIG['MOZ_X11']:
     CXXFLAGS += CONFIG['TK_CFLAGS']

+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 GENERATED_FILES += [
     'PropertyUseCounterMap.inc',
     'UseCounterList.h',
 ]

 countermap = GENERATED_FILES['PropertyUseCounterMap.inc']
 countermap.script = 'gen-usecounters.py:property_map'
 countermap.inputs = ['UseCounters.conf']
diff --git a/gfx/graphite2/moz-gr-update.sh b/gfx/graphite2/moz-gr-update.sh
--- a/gfx/graphite2/moz-gr-update.sh
+++ b/gfx/graphite2/moz-gr-update.sh
@@ -1,11 +1,12 @@
 #!/bin/bash

 # Script used to update the Graphite2 library in the mozilla source tree
+# and bump version for --with-system-graphite2

 # This script lives in gfx/graphite2, along with the library source,
 # but must be run from the top level of the mozilla-central tree.

 # Run as
 #
 #    ./gfx/graphite2/moz-gr-update.sh RELEASE
 #
@@ -32,22 +33,26 @@ echo "This directory contains the Graphi
 echo "$TARBALL" >> gfx/graphite2/README.mozilla
 echo ""
 echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla

 # fix up includes because of bug 721839 (cstdio) and bug 803066 (Windows.h)
 #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e 
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
 #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e 
"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;

+# chase version for --with-system-graphite2
+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
+  if /GR2_VERSION_REQUIRE/" configure.in
+
 # summarize what's been touched
 echo Updated to $RELEASE.
 echo Here is what changed in the gfx/graphite2 directory:
 echo

-hg stat gfx/graphite2
+hg stat configure.in gfx/graphite2

 echo
 echo If gfx/graphite2/src/files.mk has changed, please make corresponding
 echo changes to gfx/graphite2/src/moz.build
 echo

 echo
 echo Now use hg commands to create a patch for the mozilla tree.
diff --git a/gfx/moz.build b/gfx/moz.build
--- a/gfx/moz.build
+++ b/gfx/moz.build
@@ -2,26 +2,30 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.

 if CONFIG['MOZ_TREE_CAIRO']:
     DIRS += ['cairo']

+if not CONFIG['MOZ_NATIVE_GRAPHITE2']:
+    DIRS += ['graphite2/src' ]
+
+if not CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    DIRS += ['harfbuzz/src']
+
 DIRS += [
     '2d',
     'ycbcr',
     'angle',
     'src',
     'qcms',
     'gl',
     'layers',
-    'graphite2/src',
-    'harfbuzz/src',
     'ots/src',
     'thebes',
     'ipc',
     'vr',
 ]

 if CONFIG['MOZ_ENABLE_SKIA']:
     DIRS += ['skia']
diff --git a/intl/unicharutil/util/moz.build b/intl/unicharutil/util/moz.build
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -39,9 +39,12 @@ if CONFIG['_MSC_VER']:
     CFLAGS += ['-Zl']
     CXXFLAGS += ['-Zl']

 if CONFIG['ENABLE_INTL_API']:
     CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
     LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
     USE_LIBS += ['icu']

+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 DIST_INSTALL = True
diff --git a/netwerk/dns/moz.build b/netwerk/dns/moz.build
--- a/netwerk/dns/moz.build
+++ b/netwerk/dns/moz.build
@@ -61,16 +61,19 @@ etld_data = GENERATED_FILES['etld_data.i
 etld_data.script = 'prepare_tlds.py'
 etld_data.inputs = ['effective_tld_names.dat']

 # need to include etld_data.inc
 LOCAL_INCLUDES += [
     '/netwerk/base',
 ]

+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk' and CONFIG['ANDROID_VERSION'] > '19':
     LOCAL_INCLUDES += ['%' + '%s/bionic/libc/dns/include' % 
CONFIG['ANDROID_SOURCE']]

 if CONFIG['ENABLE_INTL_API']:
     DEFINES['IDNA2008'] = True
     CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']
     CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
     LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -6425,16 +6425,59 @@ if test "$USE_FC_FREETYPE"; then
         else
             FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
             FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
         fi
     ])
 fi

 dnl ========================================================
+dnl Check for harfbuzz
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-harfbuzz,
+[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],
+MOZ_NATIVE_HARFBUZZ=1,
+MOZ_NATIVE_HARFBUZZ=)
+
+if test -n "$MOZ_NATIVE_HARFBUZZ"; then
+    PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 1.1.3)
+fi
+
+AC_SUBST(MOZ_NATIVE_HARFBUZZ)
+
+dnl ========================================================
+dnl Check for graphite2
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-graphite2,
+[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],
+MOZ_NATIVE_GRAPHITE2=1,
+MOZ_NATIVE_GRAPHITE2=)
+
+if test -n "$MOZ_NATIVE_GRAPHITE2"; then
+    PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2)
+
+    dnl graphite2.pc has bogus version, check manually
+    AC_TRY_COMPILE([ #include <graphite2/Font.h>
+                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
+                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
+                               * 100 + GR2_VERSION_BUGFIX >= \
+                               (major) * 10000 + (minor) * 100 + (bugfix) )
+                   ], [
+                     #if !GR2_VERSION_REQUIRE(1,3,8)
+                     #error "Insufficient graphite2 version."
+                     #endif
+                   ], [],
+                   [AC_MSG_ERROR([--with-system-graphite2 requested but no 
working libgraphite2 found])])
+fi
+
+AC_SUBST(MOZ_NATIVE_GRAPHITE2)
+
+dnl ========================================================
 dnl Check for pixman and cairo
 dnl ========================================================

 MOZ_TREE_CAIRO=1
 MOZ_ARG_ENABLE_BOOL(system-cairo,
 [  --enable-system-cairo   Use system cairo (located with pkgconfig)],
 MOZ_TREE_CAIRO=,
 MOZ_TREE_CAIRO=1 )
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -230,16 +230,22 @@ if CONFIG['MOZ_NATIVE_LIBVPX']:
     OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']

 if not CONFIG['MOZ_TREE_PIXMAN']:
     OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']

 if CONFIG['MOZ_ALSA']:
     OS_LIBS += CONFIG['MOZ_ALSA_LIBS']

+if CONFIG['MOZ_NATIVE_GRAPHITE2']:
+    OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
+
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
+
 if CONFIG['HAVE_CLOCK_MONOTONIC']:
     OS_LIBS += CONFIG['REALTIME_LIBS']

 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     OS_LIBS += [
         'GLESv2',
     ]


--- a/gfx/thebes/moz.build      2016-04-22 16:55:14.249871300 -0400
+++ b/gfx/thebes/moz.build      2016-04-22 16:56:34.149595582 -0400
@@ -306,7 +306,14 @@

 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']

-DEFINES['GRAPHITE2_STATIC'] = True
+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
+if CONFIG['MOZ_NATIVE_GRAPHITE2']:
+    CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
+else:
+    DEFINES['GRAPHITE2_STATIC'] = True
+

 if CONFIG['CLANG_CXX']:
     # Suppress warnings from Skia header files.
--- a/gfx/skia/generate_mozbuild.py     2016-03-15 18:37:29.000000000 -0400
+++ b/gfx/skia/generate_mozbuild.py     2016-04-22 20:29:06.972228378 -0400
@@ -155,6 +155,9 @@
     if CONFIG['CPU_ARCH'] == 'arm':
         SOURCES['skia/src/opts/SkBlitRow_opts_arm.cpp'].flags += 
['-fomit-frame-pointer']

+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
--- a/gfx/skia/moz.build        2016-03-15 18:37:29.000000000 -0400
+++ b/gfx/skia/moz.build        2016-04-22 20:28:18.202338752 -0400
@@ -684,6 +684,9 @@
     if CONFIG['CPU_ARCH'] == 'arm':
         SOURCES['skia/src/opts/SkBlitRow_opts_arm.cpp'].flags += 
['-fomit-frame-pointer']

+if CONFIG['MOZ_NATIVE_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'android', 'gonk', 'qt'):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']



...and this is the firefox.scm wip (which I said above
is broken and has broken syntax and also contradicting
statements in the comments as things need to be removed
and edited)

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 ng0 <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages firefox)
  #:use-module ((srfi srfi-1) #:hide (zip))
  #:use-module (gnu packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gstreamer)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages libcanberra)
  #:use-module (gnu packages cups)
  #:use-module (gnu packages mit-krb5)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages libreoffice)  ;for hunspell
  #:use-module (gnu packages image)
  #:use-module (gnu packages libffi)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages python)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages assembly)
  #:use-module (gnu packages icu4c)
  #:use-module (gnu packages video)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages zip)
  #:use-module (gnu packages gnuzilla))

(define-public firefox
  (package
    (name "firefox")
    (version "45.2.0esr")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://archive.mozilla.org/pub/";
                           name "/releases/" version "/source/"
                           name "-" version ".source.tar.xz"))
       (sha256
        (base32
         "0jw0firs0rsg1a6msxbw6kar49rlscbnwmasvhcwjca20ds9fwhs"))
       (patches (search-patches
                 "icecat-avoid-bundled-includes.patch"
                 "firefox_system_harfbuzz_graphite_bug847568.patch"
                 "firefox_allow-utf8-fallback.patch"))
       (modules '((guix build utils)))
       ;; we might encounter things here which have been
       ;; solved in the patchsets by gentoo.
       (snippet
        '(begin
           (for-each delete-file-recursively
                     '("intl/icu" "nsprpub"
                       "modules/freetype2" "modules/zlib"
                       "modules/libbz2"
                       "ipc/chromium/src/third_party/libevent"
                       "media/libvpx" "security/nss" "gfx/cairo"
                       "js/src/ctypes/libffi" "db/sqlite3"))
                       ;; todo? libogg libtheora
                       ;; libvorbis libopus speex
                       ;; not packaged atm: libtremor
                       ;; not packaged atm: soundtouch))
           #t))))
    ;; according to gentoo those are the deps:
    ;; rdep: >=nss-3.21.1 >=nspr-4.12
    ;; dep: opengl
    ;; how to build:
    ;; 1. do stuff, patches etc
    ;; 2. autoreconf, cd js/src autoreconf
    ;; update configure of jemalloc(? wat):
    ;;; cd memory/jemalloc/src  autoreconf
    ;; preconfigure it:
    ;; configure (build) it:
    ;; CC= CXX= LD=
    ;; also: MOZ_MAKE_FLAGS="stuff" SHELL="/bin/bash"
    ;; make -f client.mk realbuild
    ;; install it:
    ;; as branding we'll use official it seems:
    ;; part of make already:
    ;; sizes="16 22 24 32 256" icon_path="browser/branding/official" 
icon="firefox" name="Mozilla Firefox"
    ;; for size in ${sizes}; do
    ;;  insinto "/share/icons/hicolor/${size}x${size}/apps"
    ;;  newins "${icon_path}/default${size}.png" "${icon}.png"
    ;; done
    ;; different name for 128x128
    ;; insinto /share/icons/hicolor/128x128/apps
    ;; newins "${icon_path}/mozicon128.png" "${icon}.png"
    ;; legacy DEs:
    ;; newicon "${icon_path}/content/icon48.png" "${icon}.png"
    ;; newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
    ;; sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${icon}:" \
    ;; "${ED}/usr/share/applications/${PN}.desktop" || die
    ;; update the gnome icon cache.
    ;; done.
    ;; I package this version for a future inherit of torbrowser.
    ;; some of the patches might only be specific to this version
    (build-system gnu-build-system)
    (inputs
     `(("alsa-lib" ,alsa-lib)
       ("bzip2" ,bzip2)
       ("cairo" ,cairo)
       ("cups" ,cups)
       ("dbus-glib" ,dbus-glib)
       ("gdk-pixbuf" ,gdk-pixbuf)
       ("glib" ,glib)
       ("gstreamer" ,gstreamer)
       ("gst-plugins-base" ,gst-plugins-base)
       ("gtk+" ,gtk+-2)
       ("pango" ,pango)
       ("freetype" ,freetype)
       ("hunspell" ,hunspell)
       ("libcanberra" ,libcanberra)
       ("libgnome" ,libgnome)
       ("libxft" ,libxft)
       ("libevent" ,libevent)
       ("libxinerama" ,libxinerama)
       ("libxscrnsaver" ,libxscrnsaver)
       ("libxcomposite" ,libxcomposite)
       ("libxt" ,libxt)
       ("libffi" ,libffi)
       ("libvpx" ,libvpx)
       ("icu4c" ,icu4c)
       ("pixman" ,pixman)
       ("pulseaudio" ,pulseaudio)
       ("mesa" ,mesa)
       ("mit-krb5" ,mit-krb5)
       ("nspr" ,nspr)
       ("nss" ,nss)
       ("sqlite" ,sqlite)
       ("startup-notification" ,startup-notification)
       ("unzip" ,unzip)
       ("yasm" ,yasm)
       ("zip" ,zip)
       ("zlib" ,zlib)))
    (native-inputs
     `(("perl" ,perl)
       ("python" ,python-2) ; Python 3 not supported
       ("python2-pysqlite" ,python2-pysqlite)
       ("pkg-config" ,pkg-config)))
    ;; firefox 45esr depends on either qt5 or gtk3 (or gtk2?)
    (arguments
     `(#:out-of-source? #t ; built outside of source dir
       ;;#:tests? #f ;assumption: no check target.
       ;;#:validate-runpath? #f
       #:configure-flags
       '(;; debug build: 8GiB, normal: 4GiB
         "--disable-debug" "--disable-debug-symbols"

         ;; use system libs:
         "--with-system-zlib" "--with-system-bz2"
         "--with-system-libevent" "--with-system-libvpx"
         "--with-system-icu"
         "--with-system-nspr" "--with-nspr-prefix=/location"
         "--with-system-nss" "--with-nss-prefix=/location"
         "--enable-system-pixman" "--enable-system-cairo"
         "--enable-system-ffi" "--enable-system-hunspell"
         "--enable-system-sqlite"
         ;; --enable-system-cairo ;; --with-system-jpeg
         ;; --with-system-harfbuff ;; --with-system-graphite2 (?)

         ;; other
         "--enable-pango" "--enable-svg" ; wasn't there a bug w png?

         ;; branding
         ;; If you want the resulting program to call itself "Firefox" instead
         ;; of "Shiretoko" or whatever, enable this option.  However, those
         ;; binaries may not be distributed without permission from the
         ;; Mozilla Foundation, see 
https://www.mozilla.org/foundation/trademarks/.
         "--with-branding=browser/branding/aurora"
         ;; necko-wifi is optional, disable it (wth is this even):
         "--disable-necko-wifi"

         ;; for now, disable google api ... however this works:
         ;; todo.

         ;; media
         "--enable-ogg" "--enable-wave"
         "--enable-gstreamer=1.0" "--enable-pulseaudio"

         ;; general
         "--libdir=/location" "--enable-gio"
         "--disable-crashreporter" "--enable-system-ffi"
         "--enable-default-toolkit=cairo-gtk3"
         ;; unclear:
         ;; "--disable-skia" "--disable-gconf"
         ;; can the guix let firefox play in sandboxes? is it necessary?
         "--enable-content-sandbox" ; wtf that
         "--disable-content-sandbox-reporter"
         ;;"--disable-installer" "--enable-release" ; ? wth
         ;;"--enable-official-branding" ; (c)!
         ;;"--enable-strip" "--enable-optimize" ;? wat.
         "--disable-updater" "--with-intl-api")
       #:modules ((ice-9 ftw)
                  (ice-9 rdelim)
                  (ice-9 match)
                  ,@%gnu-build-system-modules)
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'ensure-no-mtimes-pre-1980
           (lambda _
             (let ((early-1980 315619200)) ; 1980-01-02 utc
               (ftw "." (lambda (file stat flag)
                          (unless (<= early-1980 (stat:mtime stat))
                            (utime file early-1980 early-1980))
                          #t))
               #t)))
         (add-after 'unpack 'remove-h264parse-from-blacklist
           (lambda _
             (substitute* "dom/media/gstreamer/GStreamerFormatHelper.cpp"
               (("^  \"h264parse\",\n") ""))
             #t))
         (add-after 'unpack 
'arrange-to-link-libxul-with-libraries-it-might-dlopen
           (lambda _
             (substitute* "toolkit/library/moz.build"
               (("^# This needs to be last")
                "OS_LIBS += [
'GL', 'gnome-2', 'canberra', 'Xss', 'cups', 'gssapi_krb5',
'gstreamer-1.0', 'gstapp-1.0', 'gstvideo-1.0', ]\n\n"))
             #t))
         (add-after 'unpack 'use-system-harfbuzz-graphite
           (lambda _
             (substitute* "config/Makefile.in"
               (("^-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \\")
                "-DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \\\n
-DMOZ_NATIVE_GRAPHITE2=$(MOZ_NATIVE_GRAPHITE2) \\\n
-DMOZ_NATIVE_HARFBUZZ=$(MOZ_NATIVE_HARFBUZZ) \\\n"))
             (substitute* "config/system-headers"
               (("^unwind.h")
                "unwind.h\n
                #if MOZ_NATIVE_GRAPHITE2==1\n
                graphite2/Font.h\n
                graphite2/Segment.h\n
                #endif\n
                #if MOZ_NATIVE_HARFBUZZ==1\n
                harfbuzz/hb-ot.h\n
                harfbuzz/hb.h\n
                #endif"))
             (substitute* "dom/base/moz.build"
               (("^if CONFIG['MOZ_X11']:\n
CXXFLAGS += CONFIG['TK_CFLAGS']")
                "^if CONFIG['MOZ_X11']:\n
CXXFLAGS += CONFIG['TK_CFLAGS']\n
if CONFIG['MOZ_NATIVE_HARFBUZZ']:\n
CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']\n\n"))
             (substitute* "gfx/graphite2/moz-gr-update.sh"
               (("^# Script used to update the Graphite2 library in the mozilla 
source tree")
                "# Script used to update the Graphite2 library in the mozilla 
source tree
# and bump version for --with-system-graphite2")
               (("#find gfx/graphite2/ -name \"*.h\" -exec perl -p -i -e 
\"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;\" {} \;")
                "#find gfx/graphite2/ -name \"*.h\" -exec perl -p -i -e 
\"s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;\" {} \;\n\n
# chase version for --with-system-graphite2
perl -p -i -e \"s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
if /GR2_VERSION_REQUIRE/\" configure.in\n\n")
               (("hg stat gfx/graphite2")
                "hg stat configure.in gfx/graphite2"))
             (substitute* "gfx/moz.build"
               (("^if CONFIG['MOZ_TREE_CAIRO']:\n
DIRS += ['cairo']")
                "if CONFIG['MOZ_TREE_CAIRO']:\n
DIRS += ['cairo']\n
if not CONFIG['MOZ_NATIVE_GRAPHITE2']:\n
    DIRS += ['graphite2/src' ]\n\n
if not CONFIG['MOZ_NATIVE_HARFBUZZ']:\n
    DIRS += ['harfbuzz/src']\n\n")
               (("DIRS += [\n
'2d',\n
'ycbcr',\n
'angle',\n
'src',\n
'qcms',\n
'gl',\n
'layers',\n
'graphite2/src',\n
'harfbuzz/src',\n
'ots/src',\n
'thebes',\n
'ipc',\n
'vr',\n
]\n")
                "DIRS += [\n
'2d',\n
'ycbcr',\n
'angle',\n
'src',\n
'qcms',\n
'gl',\n
'layers',\n
'ots/src',\n
'thebes',\n
'ipc',\n
'vr',\n
]\n"))
             (substitute* "intl/unicharutil/util/moz.build"
               (("if CONFIG['ENABLE_INTL_API']:\n
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']\n
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']\n
USE_LIBS += ['icu']\n\n")
                "if CONFIG['ENABLE_INTL_API']:\n
CXXFLAGS += CONFIG['MOZ_ICU_CFLAGS']\n
LOCAL_INCLUDES += CONFIG['MOZ_ICU_INCLUDES']\n
USE_LIBS += ['icu']\n\n
if CONFIG['MOZ_NATIVE_HARFBUZZ']:\n
CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']\n\n"))
             (substitute* "netwerk/dns/moz.build"
               (("# need to include etld_data.inc
LOCAL_INCLUDES += [\n
'/netwerk/base',\n
]\n\n")
                "# need to include etld_data.inc
330LOCAL_INCLUDES += [\n
331'/netwerk/base',\n
332]\n\n
if CONFIG['MOZ_NATIVE_HARFBUZZ']:\n
CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']\n\n"))
             (substitute* "configure.in"
               (("else\n
FT2_CFLAGS=\"$FT2_CFLAGS $_FONTCONFIG_CFLAGS\"\n
FT2_LIBS=\"$FT2_LIBS $_FONTCONFIG_LIBS\"\n
fi\n
])\n
fi\n\n
dnl ========================================================\n")
                "else\n
FT2_CFLAGS=\"$FT2_CFLAGS $_FONTCONFIG_CFLAGS\"\n
FT2_LIBS=\"$FT2_LIBS $_FONTCONFIG_LIBS\"\n
fi\n
])\n
fi\n\n
dnl ========================================================\n
dnl Check for harfbuzz\n
dnl ========================================================\n\n
MOZ_ARG_WITH_BOOL(system-harfbuzz,\n
[  --with-system-harfbuzz  Use system harfbuzz (located with pkgconfig)],\n
MOZ_NATIVE_HARFBUZZ=1,\n
MOZ_NATIVE_HARFBUZZ=)\n\n
if test -n \"$MOZ_NATIVE_HARFBUZZ\"\; then\n
PKG_CHECK_MODULES(MOZ_HARFBUZZ, harfbuzz >= 1.1.3)\n
fi\n\n
AC_SUBST(MOZ_NATIVE_HARFBUZZ)\n\n
dnl ========================================================\n
dnl Check for graphite2\n
dnl ========================================================\n\n
MOZ_ARG_WITH_BOOL(system-graphite2,\n
[  --with-system-graphite2 Use system graphite2 (located with pkgconfig)],\n
MOZ_NATIVE_GRAPHITE2=1,\n
MOZ_NATIVE_GRAPHITE2=)\n\n
if test -n \"$MOZ_NATIVE_GRAPHITE2\"\; then\n
PKG_CHECK_MODULES(MOZ_GRAPHITE2, graphite2)\n\n
dnl graphite2.pc has bogus version, check manually\n
AC_TRY_COMPILE([ #include <graphite2/Font.h>\n
#define GR2_VERSION_REQUIRE(major,minor,bugfix)  \\\n
( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \\\n
* 100 + GR2_VERSION_BUGFIX >= \\\n
(major) * 10000 + \(minor\) * 100 + \(bugfix\) \) \n
], [\n
#if !GR2_VERSION_REQUIRE(1,3,8\)\n
#error \"Insufficient graphite2 version.\"\n
#endif\n
], [],\n
[AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 
found]\)])\n
fi\n\n
AC_SUBST(MOZ_NATIVE_GRAPHITE2\)\n\n
dnl ========================================================\n"))
             #t))
         (replace 'configure
           (lambda* (#:key outputs configure-flags #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bash (which "bash"))
                    (abs-srcdir (getcwd))
                    (srcdir (string-append "../" (basename abs-srcdir)))
                    (flags `(,(string-append "--prefix=" out)
                             ,(string-append "--with-l10n-base="
                                             abs-srcdir "/l10n")
                             ,@configure-flags)))
               (setenv "SHELL" bash)
               (setenv "CONFIG_SHELL" bash)
               ;; or objdir...?:
               (mkdir "../build")
               (chdir "../build")
               (format #t "build directory: ~s~%" (getcwd))
               (format #t "configure flags: ~s~%" flags)
               (zero? (apply system* bash
                             (string-append srcdir "/configure")
                             flags)))))
         ;; we are entirely missing a .desktop afaic.
         ;;(add-before 'configure 'install-desktop-entry)
    (synopsis "I shit unicorns")
    (description "I kissed a brick and I licked it.")
    (home-page "https://www.mozilla.com/firefox";)
    (license license:mpl2.0)
    ;; for graphite we want to do:
    ;; echo "sticky_pref(\"gfx.font_rendering.graphite.enabled\",true);" >> 
"${prefs_file}" || die
    ;; we also want gmp blobs to be disabled..

--
♥Ⓐ ng0
For non-prism friendly talk find me on
psyced.org / loupsycedyglgamf.onion



reply via email to

[Prev in Thread] Current Thread [Next in Thread]