[gnome-build-meta/jjardon/freedesktop-sdk-21.08rc.4: 1/2] Unbreak WebKit build with new CMake




commit 185fc262d9537725175fd749a27a96b75fff2259
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Mon Aug 30 11:11:39 2021 -0500

    Unbreak WebKit build with new CMake
    
    See: https://trac.webkit.org/changeset/281758/webkit

 elements/sdk/webkitgtk.bst                         |  2 +
 .../webkitgtk/fix-resolve-asm-file-conflicts.patch | 88 ++++++++++++++++++++++
 2 files changed, 90 insertions(+)
---
diff --git a/elements/sdk/webkitgtk.bst b/elements/sdk/webkitgtk.bst
index 3b5f0343..4bf49196 100644
--- a/elements/sdk/webkitgtk.bst
+++ b/elements/sdk/webkitgtk.bst
@@ -8,6 +8,8 @@ sources:
   path: files/webkitgtk/toolchain.i686
 - kind: local
   path: files/webkitgtk/toolchain.arm
+- kind: patch
+  path: files/webkitgtk/fix-resolve-asm-file-conflicts.patch
 
 build-depends:
 - sdk-deps/bubblewrap.bst
diff --git a/files/webkitgtk/fix-resolve-asm-file-conflicts.patch 
b/files/webkitgtk/fix-resolve-asm-file-conflicts.patch
new file mode 100644
index 00000000..0512ae65
--- /dev/null
+++ b/files/webkitgtk/fix-resolve-asm-file-conflicts.patch
@@ -0,0 +1,88 @@
+Index: /Source/JavaScriptCore/Scripts/resolve-asm-file-conflicts.rb
+===================================================================
+--- /Source/JavaScriptCore/Scripts/resolve-asm-file-conflicts.rb       (revision 281757)
++++ /Source/JavaScriptCore/Scripts/resolve-asm-file-conflicts.rb       (revision 281758)
+@@ -61,5 +61,5 @@
+ ParseResultError = Struct.new(:error)
+ 
+-# Parses the single string literal following a .file assembler directive
++# Parses whatever follows a .file assembler directive
+ class FileDirectiveArgScanner
+   def initialize(s)
+@@ -84,8 +84,20 @@
+       return ret2
+     end
++    @s.skip(/\s*/)
+     if not @s.eos?
+-      return ParseResultError.new("Expected end of line after #{ret2.str}")
+-    end
+-    return ParseResultSuccess.new((Pathname.new(ret1.str) / ret2.str).cleanpath.to_s)
++      md5 = parse_md5
++      if md5.respond_to?(:error)
++        return ParseResultError.new("Expected end of line or md5, not `#{@s.rest}`")
++      end
++    end
++    @s.skip(/\s*/)
++    if not @s.eos?
++       return ParseResultError.new("Expected end of line, not `#{@s.rest}`")
++    end
++    filepath = Pathname.new(ret2.str)
++    if not filepath.absolute?
++      filepath = Pathname.new(ret1.str) / ret2.str
++    end
++    return ParseResultSuccess.new(filepath.cleanpath.to_s)
+   end
+   def parse_string_literal
+@@ -124,4 +136,12 @@
+     end
+   end
++  def parse_md5
++      md5 = @s.scan(/md5\s+(0x)?\h+/)
++      if md5.nil?
++          ParseResultError.new("Could not parse md5 at pos #{@s.pos} in #{@s.string}")
++      else
++          ParseResultSuccess.new(md5)
++      end
++  end
+ end
+ 
+@@ -191,4 +211,7 @@
+     ['"working_directory" "path"', ['working_directory/path']],
+ 
++    # Will not concatenate the working directory to an absolute path
++    ['"working_directory" "/path"', ['/path']],
++
+     # Will only accept up to 2 string literals
+     ['"first" "second" "third"', "Expected end of line"],
+@@ -201,5 +224,11 @@
+ 
+     # Can detect unterminated 3rd string literal
+-    ['"foo" "bar" "baz', "Expected end of line"]
++    ['"foo" "bar" "baz', "Expected end of line"],
++
++    # Can parse md5
++    ['"foo" "bar" md5 0xabcde0123456789', ['foo/bar']],
++
++    # Can parse md5 without 0x prefix
++    ['"foo" "bar" md5 abcde0123456789', ['foo/bar']]
+ 
+   ]
+@@ -377,4 +406,5 @@
+   end
+   def file_directive(md)
++    slot = md[:slot].to_i
+     tracker = @trackers.last
+ 
+@@ -386,7 +416,9 @@
+ 
+     path = pr.str
+-    tracker.register_path(path, md[:slot].to_i)
+-
+-    slot = tracker.slot_for_path(path)
++
++    if slot != 0
++      tracker.register_path(path, slot)
++      slot = tracker.slot_for_path(path)
++    end
+     @outf.puts("\t.file\t#{slot} #{md[:rest]}")
+   end


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