unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* inox work in progress file
@ 2016-09-27  7:39 ng0
  0 siblings, 0 replies; only message in thread
From: ng0 @ 2016-09-27  7:39 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 173 bytes --]

Here is the file for anyone who wants to take over or improve this a
bit. I have not continued to work on the patches to store method I
started, it's all work in progress.


[-- Attachment #1.2: inox.scm --]
[-- Type: application/octet-stream, Size: 14678 bytes --]

;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 ng0 <ngillmann@runbox.com>
;;;
;;; This file is an addendum to 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 inox)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix packages)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system perl)
  #:use-module (gnu packages assembly)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages certs)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cups)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages gnuzilla)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gperf)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages image)
  #:use-module (gnu packages elf)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages libffi)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages ninja)
  #:use-module (gnu packages pciutils)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages photo)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages python)
  #:use-module (gnu packages ruby)
  #:use-module (gnu packages serialization)
  #:use-module (gnu packages video)
  #:use-module (gnu packages xiph)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg)
  #:autoload (guix hash) (port-sha256)
  #:autoload (guix base32) (bytevector->nix-base32-string)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-26)
  #:use-module (ice-9 format))

;; You can get an orientation of where to go by looking at Gentoo (chromium),
;; Gentoo overlay prism-overlay (inox), fedora, archlinux aur.
;; To get to a usable Chromium base I'd recommend Gentoo.
;; --ng0

;; Todo: enable "system" options.
(define %chromium_conf
  (list "-Dwerror="
        "-Dclang=0"
        "-Dpython_ver=2.7"
        "-Dlinux_link_gsettings=1"
        "-Dlinux_link_libpci=1"
        "-Dlinux_link_pulseaudio=1"
        "-Dlinux_strip_binary=1"
        "-Dlinux_use_bundled_binutils=0"
        "-Dlinux_use_bundled_gold=0"
        "-Dlinux_use_gold_flags=0"
        "-Dicu_use_data_file_flag=1"
        "-Dlogging_like_official_build=1"
        "-Dffmpeg_branding=Chrome"
        "-Dproprietary_codecs=1"
        "-Duse_gnome_keyring=0"
        ;;"-Duse_system_bzip2=1"
        ;;"-Duse_system_flac=1"
        ;;"-Duse_system_ffmpeg=0"
        ;;"-Duse_system_harfbuzz=1"
        ;; "-Duse_system_icu=0"
        ;; "-Duse_system_libevent=1"
        ;; "-Duse_system_libjpeg=1"
        ;; "-Duse_system_libpng=1"
        ;; "-Duse_system_libvpx=1"
        ;; "-Duse_system_libxml=0"
        ;; "-Duse_system_snappy=1"
        ;; "-Duse_system_xdg_utils=1"
        ;; ;;"-Duse_system_yasm=1"
        ;; "-Duse_system_zlib=0"
        ;; "-Dusb_ids_path=/usr/share/hwdata/usb.ids"
        "-Duse_mojo=0"
        "-Duse_gconf=0"
        "-Duse_sysroot=0"
        "-Denable_widevine=1"
        "-Ddisable_fatal_linker_warnings=1"
        "-Ddisable_glibc=1"
        "-Denable_webrtc=0"
        "-Denable_google_now=0"
        ;;"-Denable_remoting=0"
        ;;"-Dsafe_browsing_mode=0"
        "-Ddisable_sse2=1" ; see build/common.gypi
        "-Ddisable_nacl=1"
        "-Dremoting=0"
        "-Dsafe_browsing=0"
        "-Denable_rlz=0"
        "-Denable_hangout_services_extension=0"
        "-Dbranding=Chromium"
        "-Dgoogle_chrome_build=0"
        "-Denable_web_speech=1"
        "-Denable_wifi_bootstrapping=0"
        "-Denable_speech_input=0"
        "-Denable_pre_sync_backup=0"
        "-Denable_print_preview=0"
        "-Dtracing_like_official_build=1"
        "-Dfieldtrial_testing_like_official_build=1"
        "-Dfastbuild=2"))

;; (define inox-patchset-53.0.2785.101
;;   (origin
;;     (method url-fetch)
;;     (uri (string-append "https://github.com/gcarq/inox-patchset"
;;          "/archive/53.0.2785.101.tar.gz"))
;;     (file-name "inox-patchset-53.0.2785.101.tar.gz")
;;     (sha256
;;      (base32
;;       "1a0wfgnwgzw2gvi14zrp16jwk5hcaqwkfnd8vy8q3pgbdn5farhm"))))

(define (patch-url name)
  "Return the URL of inox patch NAME."
  (format #f "https://raw.githubusercontent.com/gcarq/inox-patchset/53.0.2785.101/" name))

(define (inox-patch name sha256)
  "Return the origin of inox patch NAME, with expected hash SHA256"
  (origin
    (method url-fetch)
    (uri (patch-url name))
    (sha256 sha256)))

(define-syntax-rule (patch-series (name hash) ...)
  (list (inox-patch name (base32 hash))
        ...))

(define %patch-series-53.0.2785.101
  ;; This is the current content of inox-patchset for version used by chromium,
  ;; generated using 'download-patches' below.
  (patch-series
   ("add-duckduckgo-search-engine.patch"
    "0ldmmkhybwcckcamxb0nkl0xrkrnz8csr4x53ic27p6mg90yd2jh")
   ("branding.patch"
    "001xrzw9ghx9i3rma3r638zxrdwnv7k34nfgvyqwmc5f4andsvpy")
   ("chromium-52.0.2743.116-unset-madv_free.patch"
    "09y2c46w65ndzv3fj0ishql33cb3jkkk4y0wxlwzbri9iziajfiv")
   ("chromium-sandbox-pie.patch"
    "0j75nhmvynw1rl2x0w4ab951nfcsbfwf3y19b71gffcxbxk2n3fd")
   ("chromium-widevine.patch"
    "024q1kqd3y931z75906r8hf849a2xb4cqfcxflavwzss5s9cpzfn")
   ("disable-autofill-download-manager.patch"
    "03fqxpdviqjddgfikp11hwf8nma1czy8q3zknjrxbwc5h06n0jrd")
   ("disable-battery-status-service.patch"
    "0yn87cjxzysfcw7wpdgd1ypv6c4am75pv5k193gyz6j6ks7r2vn4")
   ("disable-default-extensions.patch"
    "0qqs0x9whsixhq3ylaib3vz4xvhzrsrhcg8na6ayaxsril6zhmkd")
   ("disable-first-run-behaviour.patch"
    "04sgs990gihwdh60b3wdk9ryi3n505xk8nbfnvi4ybahiw1zwzn4")
   ("disable-gcm-status-check.patch"
    "07hll8yvnpmss0yldkrn5b9d6ack4qf7c463yambgyjzchpld0dh")
   ("disable-google-ipv6-probes.patch"
    "0z1w43sigpdl1fpnsh8rwh63slkv76n3p6gkm4vnbxs2hn2flbjn")
   ("disable-google-url-tracker.patch"
    "13j7j00ys7x5hdj6ra1rj43wz8dwmfvxxbdpwkgvixlr61zrscm7")
   ("disable-missing-key-warning.patch"
    "11g3yq53nj1qkqba9zy0h7vr6ja7sj3gjdq8r0lqjamdbapmvdsm")
   ("disable-new-avatar-menu.patch"
    "0g7zxvwlahpwgpg68rk843j5ls1r72y1jhd13dl60asar8fpadwy")
   ("disable-translation-lang-fetch.patch"
    "1kkx1pspy41bpcbvskdsa45a9jcg0s9rq4244azrph5ba4vmjqh3")
   ("disable-update-pings.patch"
    "1n6szvmijlssfymh7h4zymzjq0kkjpiisqbg7bqra5fmgp2f074y")
   ("disable-web-resource-service.patch"
    "1bhnwm9mi42ypxxsh8iw7cnqcgvwh0afhs6qg4dk8z93ilnvkfn2")
   ("restore-classic-ntp.patch"
    "01xwggbmhiralbx90qvazdd8ynp6cmlaf00rznkwwk4qibx72i7d")
   ("launcher-branding.patch"
    "0zkjj9zjkxgpb7djaxlyxlasq1ghy19grrfmfm9i7h8l50drf4l4")
   ("modify-default-prefs.patch"
    "04gabn1lw6gclw9ppmmzxcqyzlqr27vr1afrrqyljjn89801wcrs")))

(define (download-patches store count)
  "Download COUNT inox patches into store.  Return a list of
number/base32-hash tuples, directly usable in the 'patch-series' form."
  (unfold (cut > <> count)
          (lambda (name)
            (let* ((patch (download-to-store store (patch-url name))))
              (list name
                    (bytevector->nix-base32-string
                     (call-with-input-file patch port-sha256)))))
          1+
          1))

(define (download-data store count)
  "Download everything which is not a patch from inox to the store."
  ;; There's raw data we need to download and use:
  ;; (inox.desktop "0j5ia11md0806ww65hbk48m0xs0yy30c4ddsqp0q5x2phyd96gzz")
  ;; (inox.install "1pyzffw0if23yd74yn69w4znmqnswvx764zd4vfaxvgnkqjwhc76")
  ;; (product_logo_128.png "1b9d4bdn1mxg3507ddnh1v4c45kk264g4m5lgnng1yafgnc96sc9")
  ;; (product_logo_16.png "1pb877x90kjck9gs6517mj90sqmg4akfk8h4kq7l5508d6j1yivi")
  ;; (product_logo_22.png "02g5cr9q3587hm4fgaxyq5cqr6qpx41hj72asyq6f5dwzg73llsa")
  ;; (product_logo_24.png "1zbmi7rv1qfy8xz609byj0d589ylhplals5d2ksik60fbq68723v")
  ;; (product_logo_256.png "0m3k6d4hbvqfax3n9vzhaia0wvmbqvf582a0kqyydz87vjxv7y9x")
  ;; (product_logo_32.png "154xp8chgg2jv7b7i829mz9rc2if8wi68n6x3935nm8k7fqf644c")
  ;; (product_logo_48.png "1sxyyahkncxryag1dwsna8vyxm6iqydl29rw2z1k8x1vv1qvf26c")
  ;; (product_logo_64.png "1zznvm910q7380qrr0x4841043raq8iwky9smgbb97h633dfi8ak")
  )

(define-public inox
  (package
    (name "inox")
    (version "53.0.2785.101")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "https://commondatastorage.googleapis.com/chromium-browser-official/"
             "chromium-" version ".tar.xz"))
       (sha256
        (base32
         "1q5fqhsnfv1485f16dbxc1f0biynv37qkvimpr8l41hi9gbmxigd"))))
       ;; (patch-flags '("-p0"))
       ;; (patches %patch-series-53.0.2785.101)))
    (build-system gnu-build-system)
    ;; Metabug: https://bugs.chromium.org/p/chromium/issues/detail?id=28287
    (arguments
     `(#:tests? #f ; Nope.
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-sources
           (lambda _
             (substitute* "build/common.gypi"
               (("/bin/echo") "echo"))))
         ;; (add-after 'unpack 'unpack-inox
         ;;   (lambda* (#:key inputs outputs #:allow-other-keys)
         ;;     (with-directory-excursion ".."
         ;;       (copy-file (assoc-ref inputs "inox-patchset-53.0.2785.101")
         ;;                  "inox-patchset-53.0.2785.101.tar.gz")
         ;;       (zero? (system* "tar" "xvf" "inox-patchset-53.0.2785.101.tar.gz")))))
         (delete 'configure)
         (add-after 'unpack 'set-env
           (lambda _
             (setenv "CHROMIUM_HOME" (string-append (assoc-ref %outputs "out")
                                                    "/lib/inox-browser"))))
         (replace 'build
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((ninja (string-append (assoc-ref inputs "ninja") "/bin/ninja"))
                   (out   (assoc-ref outputs "out")))
               (system* "build/linux/unbundle/replace_gyp_files.py" ,@%chromium_conf)
               (system* "build/gyp_chromium" "--depth=." ,@%chromium_conf)
               (mkdir-p "out/release")
               (system* ninja "-C" "out/release" "chrome" "chrome_sandbox" "chromedriver"))))
         (replace 'install
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out")))
               ;; add more later
               (system* "make" (string-append "PREFIX=" out) install-strip )))))))
    (native-inputs
     `(("gperf" ,gperf)
       ("libvpx" ,libvpx)
       ("mesa" ,mesa)
       ("ninja" ,ninja)
       ("python-2" ,python-2)
       ("yasm" ,yasm)
       ("gzip" ,gzip)
       ("bison" ,bison)
       ("flex" ,flex)
       ("pkg-config" ,pkg-config)))
    (inputs
     `(("alsa-lib" ,alsa-lib)
       ("bzip2" ,bzip2)
       ("dbus" ,dbus)
       ("cups" ,cups) ; disable later
       ("elfutils" ,elfutils)
       ("expat" ,expat)
       ("glib" ,glib)
       ("jsoncpp" ,jsoncpp)
       ("nspr" ,nspr)
       ("eudev" ,eudev)
       ("gconf" ,gconf)
       ("libffi" ,libffi)
       ("libgnome-keyring" ,libgnome-keyring)
       ("freetype" ,freetype)
       ("pciutils" ,pciutils)
       ("cairo" ,cairo)
       ("gdk-pixbuf" ,gdk-pixbuf)
       ;; ("kerberos" ,kerberos)
       ("flac" ,flac)
       ("gtk-2" ,gtk+-2)
       ("harfbuzz" ,harfbuzz)
       ;; ("inox-patchset-53.0.2785.101" ,inox-patchset-53.0.2785.101)
       ("libevent" ,libevent)
       ("libexif" ,libexif)
       ("libgcrypt" ,libgcrypt)
       ("libvpx" ,libvpx)
       ;; https://chromium.googlesource.com/chromium/deps/nss/+/master
       ;; http://crbug.com/58087
       ;; ("nss-certs" ,nss-certs) ; or nss
       ;; ("nss" ,nss)
       ("pciutils" ,pciutils)
       ("perl" ,perl)
       ("perl-file-basedir" ,perl-file-basedir)
       ("perl-json" ,perl-json)
       ("pulseaudio" ,pulseaudio)
       ("python2-beautifulsoup4" ,python2-beautifulsoup4)
       ("python2-html5lib" ,python2-html5lib)
       ("python2-jinja2" ,python2-jinja2)
       ("python2-ply" ,python2-ply)
       ("python2-simplejson" ,python2-simplejson)
       ("ruby" ,ruby)
       ("libxi" ,libxi)
       ("libxcursor" ,libxcursor)
       ("libxcomposite" ,libxcomposite)
       ("libxdamage" ,libxdamage)
       ("libxext" ,libxext)
       ("libxfixes" ,libxfixes)
       ("libxinerama" ,libxinerama)
       ("libxrandr" ,libxrandr)
       ("libxrender" ,libxrender)
       ("libxscrnsaver" ,libxscrnsaver)
       ("libxtst" ,libxtst)
       ("pango" ,pango)
       ("snappy" ,snappy)
       ("libxml2" ,libxml2)
       ("libxslt" ,libxslt)
       ("libwebp" ,libwebp)
       ;;ttf-fonts (gentoo ebuild)
       ;; ("libxxs" ,libxxs)
       ("xdg-utils" ,xdg-utils)))
    (home-page "https://www.chromium.org/")
    (synopsis "Chromium web browser")
    (description
     "Chromium is an open-source browser project that aims to build
a safer, faster, and more stable way for all Internet users to
experience the web.")
    (license (list license:bsd-3 ; chromium
                   license:gpl3)))) ; patchset

(define-public perl-file-basedir
  (package
    (name "perl-file-basedir")
    (version "0.07")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "mirror://cpan/authors/id/K/KI/KIMRYAN/File-BaseDir-"
             version ".tar.gz"))
       (sha256
        (base32
         "0aq8d4hsaxqibp36f773y6dfck7zd82v85sp8vhi6pjkg3pmf2hj"))))
    (build-system perl-build-system)
    (native-inputs
     `(("perl-file-which" ,perl-file-which)
       ("perl-module-build" ,perl-module-build)))
    (inputs
     `(("perl-ipc-system-simple" ,perl-ipc-system-simple)))
    (home-page "http://search.cpan.org/dist/File-BaseDir")
    (synopsis "Use the Freedesktop.org base directory specification")
    (description "fill-in-yourself!")
    (license (package-license perl))))

;;; inox.scm ends here

[-- Attachment #1.3: Type: text/plain, Size: 24 bytes --]

-- 
              ng0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 800 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-27  7:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27  7:39 inox work in progress file ng0

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).