From 57044ad81a7b9db8c7ec19a5df90bd1c1bf18f7fb353d001fefeb973bc404f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Thu, 15 Dec 2022 12:46:53 +0000 Subject: [PATCH] Accepting request 1042980 from home:dimstar:Factory - Add upstream patch b7ac5d0c.patch: Fix build with Ruby 3.2. OBS-URL: https://build.opensuse.org/request/show/1042980 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/webkit2gtk3?expand=0&rev=374 --- b7ac5d0c.patch | 82 +++++++++++++++++++++++++++++++++++++++++++++ webkit2gtk3.changes | 5 +++ webkit2gtk3.spec | 2 ++ 3 files changed, 89 insertions(+) create mode 100644 b7ac5d0c.patch diff --git a/b7ac5d0c.patch b/b7ac5d0c.patch new file mode 100644 index 0000000..d1af793 --- /dev/null +++ b/b7ac5d0c.patch @@ -0,0 +1,82 @@ +From b7ac5d0ccc7ca3ed6bf4f2d40fde60247ce87d3c Mon Sep 17 00:00:00 2001 +From: Dominique Leuenberger +Date: Mon, 12 Dec 2022 21:24:11 -0800 +Subject: [PATCH] Fix build with Ruby 3.2 + https://bugs.webkit.org/show_bug.cgi?id=246743 + +Reviewed by Ross Kirsling. + +File.exists has been declared deprecated since Ruby 2.1 (2013) and with Ruby 3.2 gets removed for good. + +* Source/JavaScriptCore/offlineasm/config.rb: +* Source/JavaScriptCore/offlineasm/parser.rb: +* Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb: + +Canonical link: https://commits.webkit.org/257775@main +--- + Source/JavaScriptCore/offlineasm/config.rb | 4 ++-- + Source/JavaScriptCore/offlineasm/parser.rb | 8 ++++---- + .../Scripts/update-LegacyInspectorBackendCommands.rb | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Source/JavaScriptCore/offlineasm/config.rb b/Source/JavaScriptCore/offlineasm/config.rb +index ba0043119f32..7811626db5e5 100644 +--- a/Source/JavaScriptCore/offlineasm/config.rb ++++ b/Source/JavaScriptCore/offlineasm/config.rb +@@ -23,11 +23,11 @@ + + buildProductsDirectory = ENV['BUILT_PRODUCTS_DIR']; + headersFolderPath = ENV['WK_LIBRARY_HEADERS_FOLDER_PATH']; +-if buildProductsDirectory and File.exists?(buildProductsDirectory) ++if buildProductsDirectory and File.exist?(buildProductsDirectory) + $: << "#{buildProductsDirectory}#{headersFolderPath}/WebKitAdditions/Scripts" + end + sdkRootDirectory = ENV['SDKROOT']; +-if sdkRootDirectory and File.exists?(sdkRootDirectory) ++if sdkRootDirectory and File.exist?(sdkRootDirectory) + $: << "#{sdkRootDirectory}#{headersFolderPath}/WebKitAdditions/Scripts" + end + +diff --git a/Source/JavaScriptCore/offlineasm/parser.rb b/Source/JavaScriptCore/offlineasm/parser.rb +index 12a22b5cc819..07e38b63972b 100644 +--- a/Source/JavaScriptCore/offlineasm/parser.rb ++++ b/Source/JavaScriptCore/offlineasm/parser.rb +@@ -840,10 +840,10 @@ def parseSequence(final, comment) + additionsDirectoryName = "#{@buildProductsDirectory}#{@headersFolderPath}/WebKitAdditions/" + end + fileName = IncludeFile.new(moduleName, additionsDirectoryName).fileName +- if not File.exists?(fileName) ++ if not File.exist?(fileName) + fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName + end +- fileExists = File.exists?(fileName) ++ fileExists = File.exist?(fileName) + raise "File not found: #{fileName}" if not fileExists and not isOptional + list << parse(fileName, @options, @sources) if fileExists + else +@@ -876,10 +876,10 @@ def parseIncludes(final, comment, options) + additionsDirectoryName = "#{@buildProductsDirectory}#{@headersFolderPath}/WebKitAdditions/" + end + fileName = IncludeFile.new(moduleName, additionsDirectoryName).fileName +- if not File.exists?(fileName) ++ if not File.exist?(fileName) + fileName = IncludeFile.new(moduleName, @tokens[@idx].codeOrigin.fileName.dirname).fileName + end +- fileExists = File.exists?(fileName) ++ fileExists = File.exist?(fileName) + raise "File not found: #{fileName}" if not fileExists and not isOptional + if fileExists + parser = Parser.new(readTextFile(fileName), SourceFile.new(fileName), options) +diff --git a/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb b/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb +index 680dee7406d1..40737afaa4c5 100755 +--- a/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb ++++ b/Source/WebInspectorUI/Scripts/update-LegacyInspectorBackendCommands.rb +@@ -36,7 +36,7 @@ def run + end + + generated_path = File.join tmpdir, output_filename +- if !File.exists?(generated_path) ++ if !File.exist?(generated_path) + puts "ERROR: Generated file does not exist at expected path." + exit 1 + end diff --git a/webkit2gtk3.changes b/webkit2gtk3.changes index 529c268..2c732ed 100644 --- a/webkit2gtk3.changes +++ b/webkit2gtk3.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Dec 14 16:45:15 UTC 2022 - Dominique Leuenberger + +- Add upstream patch b7ac5d0c.patch: Fix build with Ruby 3.2. + ------------------------------------------------------------------- Thu Nov 17 13:29:15 UTC 2022 - Guillaume GARDET diff --git a/webkit2gtk3.spec b/webkit2gtk3.spec index 49eb65b..f54e05f 100644 --- a/webkit2gtk3.spec +++ b/webkit2gtk3.spec @@ -83,6 +83,8 @@ Source99: webkit2gtk3.keyring # PATCH-FIX-OPENSUSE no-forced-sse.patch jengelh@iani.de -- cure execution of illegal instruction in i586 webkit Patch0: no-forced-sse.patch +# PATCH-FIX-UPSTREAM b7ac5d0c.patch dimstar@opensuse.org -- Fix build with Ruby 3.2 +Patch1: https://github.com/WebKit/WebKit/commit/b7ac5d0c.patch BuildRequires: Mesa-libEGL-devel BuildRequires: Mesa-libGL-devel