File skia-system-gn.patch of Package python-skia-pathops
Index: skia-pathops-0.7.4/src/cpp/skia-builder/skia/bin/fetch-gn
===================================================================
--- skia-pathops-0.7.4.orig/src/cpp/skia-builder/skia/bin/fetch-gn
+++ skia-pathops-0.7.4/src/cpp/skia-builder/skia/bin/fetch-gn
@@ -6,43 +6,46 @@
# found in the LICENSE file.
import os
-import platform
-import shutil
-import stat
+#import platform
+#import shutil
+#import stat
import sys
-import tempfile
-import zipfile
+#import tempfile
+#import zipfile
-if sys.version_info[0] < 3:
- from urllib2 import urlopen
-else:
- from urllib.request import urlopen
+#if sys.version_info[0] < 3:
+# from urllib2 import urlopen
+#else:
+# from urllib.request import urlopen
os.chdir(os.path.join(os.path.dirname(__file__), os.pardir))
-gnzip = os.path.join(tempfile.mkdtemp(), 'gn.zip')
-with open(gnzip, 'wb') as f:
- OS = {'darwin': 'mac', 'linux': 'linux', 'linux2': 'linux', 'win32': 'windows'}[sys.platform]
- cpu = {'amd64': 'amd64', 'arm64': 'arm64', 'x86_64': 'amd64'}[platform.machine().lower()]
-
- rev = 'd62642c920e6a0d1756316d225a90fd6faa9e21e'
- url = 'https://chrome-infra-packages.appspot.com/dl/gn/gn/{}-{}/+/git_revision:{}'.format(
- OS,cpu,rev)
- f.write(urlopen(url).read())
+#gnzip = os.path.join(tempfile.mkdtemp(), 'gn.zip')
+#with open(gnzip, 'wb') as f:
+# OS = {'darwin': 'mac', 'linux': 'linux', 'linux2': 'linux', 'win32': 'windows'}[sys.platform]
+# cpu = {'amd64': 'amd64', 'arm64': 'arm64', 'x86_64': 'amd64'}[platform.machine().lower()]
+
+# rev = 'd62642c920e6a0d1756316d225a90fd6faa9e21e'
+# url = 'https://chrome-infra-packages.appspot.com/dl/gn/gn/{}-{}/+/git_revision:{}'.format(
+# OS,cpu,rev)
+# f.write(urlopen(url).read())
gn = 'gn.exe' if 'win32' in sys.platform else 'gn'
-with zipfile.ZipFile(gnzip, 'r') as f:
- f.extract(gn, 'bin')
+#with zipfile.ZipFile(gnzip, 'r') as f:
+# f.extract(gn, 'bin')
gn = os.path.join('bin', gn)
+if not os.path.exists(gn):
+ os.symlink("/usr/bin/gn", gn)
-os.chmod(gn, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
- stat.S_IRGRP | stat.S_IXGRP |
- stat.S_IROTH | stat.S_IXOTH )
+#os.chmod(gn, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR |
+# stat.S_IRGRP | stat.S_IXGRP |
+# stat.S_IROTH | stat.S_IXOTH )
# We'll also copy to a path that depot_tools' GN wrapper will expect to find the binary.
copy_path = 'buildtools/linux64/gn' if 'linux' in sys.platform else \
'buildtools/mac/gn' if 'darwin' in sys.platform else \
'buildtools/win/gn.exe'
-if os.path.isdir(os.path.dirname(copy_path)):
- shutil.copy(gn, copy_path)
+if os.path.isdir(os.path.dirname(copy_path)) and not os.path.exists(copy_path):
+ #shutil.copy(gn, copy_path)
+ os.symlink("/usr/bin/gn", copy_path)
Index: skia-pathops-0.7.4/src/cpp/skia-builder/skia/gn/BUILDCONFIG.gn
===================================================================
--- skia-pathops-0.7.4.orig/src/cpp/skia-builder/skia/gn/BUILDCONFIG.gn
+++ skia-pathops-0.7.4/src/cpp/skia-builder/skia/gn/BUILDCONFIG.gn
@@ -84,12 +84,13 @@ if (current_cpu == "") {
is_clang = is_android || is_ios || is_mac || is_fuchsia ||
(cc == "clang" && cxx == "clang++") || clang_win != ""
if (!is_clang && !is_win) {
- is_clang = exec_script("//gn/is_clang.py",
- [
- cc,
- cxx,
- ],
- "value")
+ #is_clang = exec_script("//gn/is_clang.py",
+ # [
+ # cc,
+ # cxx,
+ # ],
+ # "value")
+ is_clang = false
}
if (is_android) {
Index: skia-pathops-0.7.4/src/cpp/skia-builder/skia/BUILD.gn
===================================================================
--- skia-pathops-0.7.4.orig/src/cpp/skia-builder/skia/BUILD.gn
+++ skia-pathops-0.7.4/src/cpp/skia-builder/skia/BUILD.gn
@@ -961,25 +961,25 @@ optional("gpu") {
}
}
-optional("gif") {
- enabled = !skia_use_wuffs && skia_use_libgifcodec
- _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
- if ("True" ==
- exec_script("gn/checkpath.py",
- [ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
- "trim string")) {
- public_defines = [ "SK_USE_LIBGIFCODEC" ]
- public_include_dirs = [
- ".",
- skia_libgifcodec_path,
- ]
- include_dirs = public_include_dirs
- import(_libgifcodec_gni_path)
- sources = rebase_path(libgifcodec_sources + libgifcodec_public,
- ".",
- skia_libgifcodec_path)
- }
-}
+#optional("gif") {
+# enabled = !skia_use_wuffs && skia_use_libgifcodec
+# _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
+# if ("True" ==
+# exec_script("gn/checkpath.py",
+# [ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
+# "trim string")) {
+# public_defines = [ "SK_USE_LIBGIFCODEC" ]
+# public_include_dirs = [
+# ".",
+# skia_libgifcodec_path,
+# ]
+# include_dirs = public_include_dirs
+# import(_libgifcodec_gni_path)
+# sources = rebase_path(libgifcodec_sources + libgifcodec_public,
+# ".",
+# skia_libgifcodec_path)
+# }
+#}
optional("heif") {
enabled = skia_use_libheif
@@ -1216,7 +1216,7 @@ skia_component("skia") {
":avx",
":crc32",
":fontmgr_factory",
- ":gif",
+ #":gif",
":heif",
":hsw",
":jpeg_decode",
Index: skia-pathops-0.7.4/src/cpp/skia-builder/skia/gn/toolchain/BUILD.gn
===================================================================
--- skia-pathops-0.7.4.orig/src/cpp/skia-builder/skia/gn/toolchain/BUILD.gn
+++ skia-pathops-0.7.4/src/cpp/skia-builder/skia/gn/toolchain/BUILD.gn
@@ -39,7 +39,8 @@ declare_args() {
# large -j to Ninja (e.g. Goma build). Unfortunately this is also one of the
# slowest steps in a build, so we don't want to limit too much. Use the number
# of CPUs as a default.
- dlsymutil_pool_depth = exec_script("num_cpus.py", [], "value")
+ #dlsymutil_pool_depth = exec_script("num_cpus.py", [], "value")
+ dlsymutil_pool_depth = 2
# Too many linkers running at once causes issues for some builders. Allow
# such builders to limit the number of concurrent link steps.
@@ -68,7 +69,8 @@ if (current_toolchain == default_toolcha
if (0 <= link_pool_depth) {
pool("link_pool") {
if (link_pool_depth == 0) {
- depth = exec_script("num_cpus.py", [], "value")
+ #depth = exec_script("num_cpus.py", [], "value")
+ depth = 2
} else {
depth = link_pool_depth
}
@@ -295,7 +297,7 @@ template("gcc_like_toolchain") {
rspfile = "{{output}}.rsp"
rspfile_content = "{{inputs}}"
rm_py = rebase_path("../rm.py")
- command = "$shell python \"$rm_py\" \"{{output}}\" && $ar rcs {{output}} @$rspfile"
+ command = "$shell python3 \"$rm_py\" \"{{output}}\" && $ar rcs {{output}} @$rspfile"
}
outputs =