start working on skia

Julien LepillerTue Feb 28 17:45:27+0100 2017

f12a628

start working on skia

chromium-gn-remove-third-party.patch unknown status 1

1+
From 36f44a39630a329b79432836ec6aecb8ab54a6e5 Mon Sep 17 00:00:00 2001
2+
From: Julien Lepiller <julien@lepiller.eu>
3+
Date: Tue, 28 Feb 2017 13:39:58 +0100
4+
Subject: [PATCH] remove third party
5+
6+
---
7+
 tools/gn/bootstrap/bootstrap.py | 34 +---------------------------------
8+
 1 file changed, 1 insertion(+), 33 deletions(-)
9+
10+
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py
11+
index 90adca2..0c790a2 100755
12+
--- a/tools/gn/bootstrap/bootstrap.py
13+
+++ b/tools/gn/bootstrap/bootstrap.py
14+
@@ -541,29 +541,9 @@ def write_gn_ninja(path, root_gen_dir, options):
15+
         'base/time/time_posix.cc',
16+
         'base/trace_event/heap_profiler_allocation_register_posix.cc',
17+
     ])
18+
-    static_libraries['libevent'] = {
19+
-        'sources': [
20+
-            'base/third_party/libevent/buffer.c',
21+
-            'base/third_party/libevent/evbuffer.c',
22+
-            'base/third_party/libevent/evdns.c',
23+
-            'base/third_party/libevent/event.c',
24+
-            'base/third_party/libevent/event_tagging.c',
25+
-            'base/third_party/libevent/evrpc.c',
26+
-            'base/third_party/libevent/evutil.c',
27+
-            'base/third_party/libevent/http.c',
28+
-            'base/third_party/libevent/log.c',
29+
-            'base/third_party/libevent/poll.c',
30+
-            'base/third_party/libevent/select.c',
31+
-            'base/third_party/libevent/signal.c',
32+
-            'base/third_party/libevent/strlcpy.c',
33+
-        ],
34+
-        'tool': 'cc',
35+
-        'include_dirs': [],
36+
-        'cflags': cflags + ['-DHAVE_CONFIG_H'],
37+
-    }
38+
 
39+
   if is_linux:
40+
-    libs.extend(['-lrt', '-latomic'])
41+
+    libs.extend(['-lrt', '-latomic', '-levent'])
42+
     ldflags.extend(['-pthread'])
43+
 
44+
     static_libraries['xdg_user_dirs'] = {
45+
@@ -587,12 +567,6 @@ def write_gn_ninja(path, root_gen_dir, options):
46+
         'base/threading/platform_thread_linux.cc',
47+
         'base/trace_event/malloc_dump_provider.cc',
48+
     ])
49+
-    static_libraries['libevent']['include_dirs'].extend([
50+
-        os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'linux')
51+
-    ])
52+
-    static_libraries['libevent']['sources'].extend([
53+
-        'base/third_party/libevent/epoll.c',
54+
-    ])
55+
 
56+
 
57+
   if is_mac:
58+
@@ -622,12 +596,6 @@ def write_gn_ninja(path, root_gen_dir, options):
59+
         'base/threading/platform_thread_mac.mm',
60+
         'base/trace_event/malloc_dump_provider.cc',
61+
     ])
62+
-    static_libraries['libevent']['include_dirs'].extend([
63+
-        os.path.join(SRC_ROOT, 'base', 'third_party', 'libevent', 'mac')
64+
-    ])
65+
-    static_libraries['libevent']['sources'].extend([
66+
-        'base/third_party/libevent/kqueue.c',
67+
-    ])
68+
 
69+
     libs.extend([
70+
         '-framework', 'AppKit',
71+
-- 
72+
2.7.4
73+

more/packages/google.scm

1919
(define-module (more packages google)
2020
  #:use-module ((guix licenses) #:prefix license:)
2121
  #:use-module (gnu packages)
22+
  #:use-module (gnu packages compression)
23+
  #:use-module (gnu packages icu4c)
24+
  #:use-module (gnu packages fontutils)
25+
  #:use-module (gnu packages gnuzilla)
26+
  #:use-module (gnu packages image)
27+
  #:use-module (gnu packages libevent)
2228
  #:use-module (gnu packages python)
2329
  #:use-module (gnu packages perl)
2430
  #:use-module (gnu packages ruby)
2531
  #:use-module (gnu packages ninja)
32+
  #:use-module (gnu packages xml)
2633
  #:use-module (guix packages)
2734
  #:use-module (guix download)
2835
  #:use-module (guix git-download)

4249
        (sha256
4350
         (base32
4451
          "1q2kg85pd6lv036w7lsss5mhiiva9rx4f0410sbn9bnazhghib4s"))
52+
        (patches (search-patches "chromium-gn-remove-third-party.patch"))
4553
        (modules '((guix build utils)))
4654
        (snippet
4755
         '(begin
48-
           (for-each delete-file-recursively
49-
                     (find-files "." "third_party"))))))
56+
           (delete-file-recursively "base/third_party/libevent")))))
5057
    (build-system gnu-build-system)
5158
    (home-page "https://chromium.googlesource.com/chromium/src")
5259
    (synopsis "Google web browser")
5360
    (description "Google web browser.")
5461
    (license "bsd-3")))
5562
63+
(define-public skia
64+
  (package
65+
    (name "skia")
66+
    (version "0")
67+
    (source
68+
      (origin
69+
        (method git-fetch)
70+
        (uri (git-reference
71+
               (url "https://skia.googlesource.com/skia.git")
72+
               (commit "c746bc15c167bc2a22169c2211fd2e65d9e266f5")))
73+
        (file-name (string-append name "-" version))
74+
        (sha256
75+
         (base32
76+
          "1x5m8ri6hmj9pbq4amglhkwbkcvhqp4vh8njwlrnlrsaipfdy62c"))
77+
        (modules '((guix build utils)))
78+
        (snippet
79+
         `(delete-file-recursively "third_party"))))
80+
    (build-system gnu-build-system)
81+
    (arguments
82+
     `(#:tests? #f
83+
       #:phases
84+
       (modify-phases %standard-phases
85+
         (replace 'configure
86+
           (lambda* (#:key outputs #:allow-other-keys)
87+
             (zero? (system*
88+
                      "gn" "gen" "out/Shared"
89+
                      (string-append "--args="
90+
                                     "cc=\"gcc\" "
91+
                                     "cxx=\"g++\" "
92+
                                     "skia_use_sfntly=false "
93+
                                     "skia_use_system_expat=true "
94+
                                     "skia_use_system_libjpeg_turbo=true "
95+
                                     "skia_use_system_freetype2=true "
96+
                                     ;"skia_use_system_icu=true "
97+
                                     "skia_use_system_libpng=true "
98+
                                     "skia_use_system_libwebp=true "
99+
                                     "skia_use_system_zlib=true "
100+
                                     "is_official_build=true "
101+
                                     "is_component_build=true")))))
102+
         (replace 'build
103+
           (lambda* (#:key outputs #:allow-other-keys)
104+
             (zero? (system* "ninja" "-C" "out/Shared")))))))
105+
    (native-inputs
106+
     `(("gn" ,google-gn)
107+
       ("ninja" ,ninja)
108+
       ("python" ,python-2)))
109+
    (inputs
110+
     `(("expat" ,expat)
111+
       ("freetype" ,freetype)
112+
       ("libpng" ,libpng)
113+
       ("libz" ,zlib)
114+
       ("icu" ,icu4c)
115+
       ("libwebp" ,libwebp)
116+
       ("libjpeg-turbo" ,libjpeg-turbo)))
117+
    (home-page "https://skia.org")
118+
    (synopsis "Graphics library")
119+
    (description "Graphics library.")
120+
    (license "bsd-3")))
121+
56122
(define-public google-gn
57123
  (package
58124
    (inherit chromium)
59125
    (name "google-gn")
60-
    (version "0")
61126
    (build-system gnu-build-system)
62127
    (arguments
63128
     `(#:tests? #f
64129
       #:phases
65130
       (modify-phases %standard-phases
66131
         (delete 'configure)
132+
         (add-before 'build 'fix-include
133+
           (lambda* (#:key inputs #:allow-other-keys)
134+
             (let* ((libevent (assoc-ref inputs "libevent"))
135+
                    (event-h (string-append libevent "/include/event.h")))
136+
               (substitute* "base/message_loop/message_pump_libevent.cc"
137+
                 (("base/third_party/libevent/event.h") event-h)))))
67138
         (replace 'build
68139
           (lambda* (#:key outputs #:allow-other-keys)
69140
             (chdir "tools/gn")

77148
    (native-inputs
78149
     `(("python" ,python-2)
79150
       ("ninja" ,ninja)))
151+
    (inputs
152+
     `(("libevent" ,libevent)
153+
       ("icu" ,icu4c)
154+
       ("nspr" ,nspr)))
80155
    (home-page "https://chromium.googlesource.com/chromium/buildtools.git")
81156
    (synopsis "Google gn")
82157
    (description "Google gn.")