pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/www/firefox firefox: Instead of including an autogener...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/315631b0bd2c
branches:  trunk
changeset: 382840:315631b0bd2c
user:      nia <nia%pkgsrc.org@localhost>
date:      Sat Aug 06 20:47:51 2022 +0000

description:
firefox: Instead of including an autogenerated patch for libwebrtc,
do the automagic inside pre-patch. Also handle aarch64.

Require SSE2. It's probably not reasonable to patch -msse2 in everywhere,
and upstream has required SSE2 on x86 for years.

diffstat:

 www/firefox/Makefile                     |      8 +-
 www/firefox/distinfo                     |      4 +-
 www/firefox/files/replace-moz.build.awk  |     22 +
 www/firefox/mozilla-common.mk            |      3 +-
 www/firefox/patches/patch-libwebrtc.diff |  17439 -----------------------------
 5 files changed, 33 insertions(+), 17443 deletions(-)

diffs (truncated from 17526 to 300 lines):

diff -r 4c69fd2fa573 -r 315631b0bd2c www/firefox/Makefile
--- a/www/firefox/Makefile      Sat Aug 06 19:35:33 2022 +0000
+++ b/www/firefox/Makefile      Sat Aug 06 20:47:51 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.531 2022/08/03 17:09:26 ryoon Exp $
+# $NetBSD: Makefile,v 1.532 2022/08/06 20:47:51 nia Exp $
 
 FIREFOX_VER=           ${MOZ_BRANCH}${MOZ_BRANCH_MINOR}
 MOZ_BRANCH=            103.0
@@ -145,6 +145,12 @@
            -f ${FILESDIR}/nodejs-output-${PKGVERSION_NOREV}.tgz
 .endif
 
+pre-patch:
+       for f in $$(find ${WRKSRC}/third_party/libwebrtc -name moz.build -type f) ; \
+       do \
+               ${AWK} -f ${FILESDIR}/replace-moz.build.awk $$f > $$f.new; mv $$f.new $$f ; \
+       done
+
 post-build:
        ${SED} -e 's|@MOZILLA@|${MOZILLA}|g'                            \
          -e 's|@MOZILLA_NAME@|${MOZILLA_NAME}|g'                       \
diff -r 4c69fd2fa573 -r 315631b0bd2c www/firefox/distinfo
--- a/www/firefox/distinfo      Sat Aug 06 19:35:33 2022 +0000
+++ b/www/firefox/distinfo      Sat Aug 06 20:47:51 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.478 2022/08/03 17:09:26 ryoon Exp $
+$NetBSD: distinfo,v 1.479 2022/08/06 20:47:51 nia Exp $
 
 BLAKE2s (firefox-103.0.1.source.tar.xz) = 5128a952e6957b1b808dd5c513848706937e6943639d64ac6856858ae8564cb1
 SHA512 (firefox-103.0.1.source.tar.xz) = cb487e1d5d602e6b07093b5e722c4e70b9bf39f42c13c25642f263f90f9d3940d02e6fdbab9e8f41b66a50f81d70300acf81c222f08a26eed3ae55777fdc6303
@@ -23,7 +23,7 @@
 SHA1 (patch-js_src_jit_arm64_vixl_MozCpu-vixl.cpp) = fdc522e3fb626b1b8a2ebf19ad60bfc25dfa4183
 SHA1 (patch-js_src_util_NativeStack.cpp) = a0a16d8d8d78d3cc3f4d2a508586f1a7821f7dba
 SHA1 (patch-js_src_vm_ArrayBufferObject.cpp) = 0501fdcae11568ae4ea78e0d2f6b3750b7a67d47
-SHA1 (patch-libwebrtc.diff) = e007fe7dd2fd16e7d0ac4a35f9a006db4e24eb7e
+SHA1 (patch-libwebrtc.diff) = 2f83e71f95397260ec20bced3724fa5f9259765b
 SHA1 (patch-media_ffvpx_libavutil_arm_bswap.h) = de58daa0fd23d4fec50426602b65c9ea5862558a
 SHA1 (patch-media_libcubeb_src_cubeb__alsa.c) = 2ef11da83c90c41490db4c0d9809c3e1826b488a
 SHA1 (patch-media_libcubeb_src_cubeb__jack.cpp) = fc546c5e6582fd5eda64ba83287dfbbb3c9e229f
diff -r 4c69fd2fa573 -r 315631b0bd2c www/firefox/files/replace-moz.build.awk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/www/firefox/files/replace-moz.build.awk   Sat Aug 06 20:47:51 2022 +0000
@@ -0,0 +1,22 @@
+/^if CONFIG\[\"OS_TARGET\"\] == \"Android\":/{
+       flag = 1;
+       print $0;
+       next;
+}
+/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\":/{
+       flag = 0;
+       sub(/^if CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] 
== \"FreeBSD\":");
+       print $0;
+       next;
+}
+{
+       if (flag != 1) {
+               sub(/^    DEFINES\[\"WEBRTC_LINUX\"\] = True/, "    if CONFIG\[\"OS_TARGET\"\] == \"Linux\":\n        DEFINES\[\"WEBRTC_LINUX\"\] = True\n    else:\n        DEFINES\[\"WEBRTC_BSD\"\] 
= True");
+               sub(/^if not CONFIG\[\"MOZ_DEBUG\"\] and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if not CONFIG[\"MOZ_DEBUG\"] and (CONFIG[\"OS_TARGET\"] == \"Linux\" or CONFIG[\"OS_TARGET\"] == 
\"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+               sub(/^if CONFIG\[\"MOZ_DEBUG\"\] == \"1\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"MOZ_DEBUG\"] == \"1\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+               sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"aarch64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"CPU_ARCH\"] == \"aarch64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+               sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"x86\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"CPU_ARCH\"] == \"x86\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+               sub(/^if CONFIG\[\"CPU_ARCH\"\] == \"x86_64\" and CONFIG\[\"OS_TARGET\"\] == \"Linux\":/, "if CONFIG[\"CPU_ARCH\"] == \"x86_64\" and (CONFIG[\"OS_TARGET\"] == \"Linux\" or 
CONFIG[\"OS_TARGET\"] == \"NetBSD\" or CONFIG[\"OS_TARGET\"] == \"OpenBSD\" or CONFIG[\"OS_TARGET\"] == \"FreeBSD\"):");
+       }
+       print $0;
+}
diff -r 4c69fd2fa573 -r 315631b0bd2c www/firefox/mozilla-common.mk
--- a/www/firefox/mozilla-common.mk     Sat Aug 06 19:35:33 2022 +0000
+++ b/www/firefox/mozilla-common.mk     Sat Aug 06 20:47:51 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mozilla-common.mk,v 1.237 2022/08/05 09:52:10 nia Exp $
+# $NetBSD: mozilla-common.mk,v 1.238 2022/08/06 20:47:51 nia Exp $
 #
 # common Makefile fragment for mozilla packages based on gecko 2.0.
 #
@@ -35,6 +35,7 @@
 .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
 TOOL_DEPENDS+=         nasm>=2.14:../../devel/nasm
 TOOL_DEPENDS+=         yasm>=1.1:../../devel/yasm
+CFLAGS+=               -msse2
 .endif
 
 # This is to work around build failures where an upstream configuration script
diff -r 4c69fd2fa573 -r 315631b0bd2c www/firefox/patches/patch-libwebrtc.diff
--- a/www/firefox/patches/patch-libwebrtc.diff  Sat Aug 06 19:35:33 2022 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,17439 +0,0 @@
-$NetBSD: patch-libwebrtc.diff,v 1.7 2022/08/03 17:09:26 ryoon Exp $
-
-Generated by scripts in http://ftp.netbsd.org/pub/NetBSD/misc/ryoon/firefox-103.0-create-libwebrtc.diff and modified by hand.
-
-diff -ur firefox-103.0.orig/third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build firefox-103.0/third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build
---- third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build  2022-07-19 03:44:36.000000000 +0900
-+++ third_party/libwebrtc/api/adaptation/resource_adaptation_api_gn/moz.build  2022-07-26 23:57:28.491578328 +0900
-@@ -67,14 +67,17 @@
-     DEFINES["__STDC_CONSTANT_MACROS"] = True
-     DEFINES["__STDC_FORMAT_MACROS"] = True
- 
--if CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD":
- 
-     DEFINES["USE_AURA"] = "1"
-     DEFINES["USE_GLIB"] = "1"
-     DEFINES["USE_NSS_CERTS"] = "1"
-     DEFINES["USE_OZONE"] = "1"
-     DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_LINUX"] = True
-+    if CONFIG["OS_TARGET"] == "Linux":
-+        DEFINES["WEBRTC_LINUX"] = True
-+    else:
-+        DEFINES["WEBRTC_BSD"] = True
-     DEFINES["WEBRTC_POSIX"] = True
-     DEFINES["_FILE_OFFSET_BITS"] = "64"
-     DEFINES["_LARGEFILE64_SOURCE"] = True
-@@ -147,7 +150,7 @@
- 
-     DEFINES["_DEBUG"] = True
- 
--if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["MOZ_DEBUG"] == "1" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
- 
-     DEFINES["_DEBUG"] = True
- 
-@@ -200,4 +203,13 @@
- 
-     DEFINES["_GNU_SOURCE"] = True
- 
-+if CONFIG["CPU_ARCH"] == "x86":
-+    CFLAGS += [
-+        "-msse2"
-+    ]
-+
-+    CXXFLAGS += [
-+        "-msse2"
-+    ]
-+
- Library("resource_adaptation_api_gn")
-diff -ur firefox-103.0.orig/third_party/libwebrtc/api/array_view_gn/moz.build firefox-103.0/third_party/libwebrtc/api/array_view_gn/moz.build
---- third_party/libwebrtc/api/array_view_gn/moz.build  2022-07-19 03:44:30.000000000 +0900
-+++ third_party/libwebrtc/api/array_view_gn/moz.build  2022-07-26 23:57:28.411454920 +0900
-@@ -63,14 +63,17 @@
-     DEFINES["__STDC_CONSTANT_MACROS"] = True
-     DEFINES["__STDC_FORMAT_MACROS"] = True
- 
--if CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD":
- 
-     DEFINES["USE_AURA"] = "1"
-     DEFINES["USE_GLIB"] = "1"
-     DEFINES["USE_NSS_CERTS"] = "1"
-     DEFINES["USE_OZONE"] = "1"
-     DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_LINUX"] = True
-+    if CONFIG["OS_TARGET"] == "Linux":
-+        DEFINES["WEBRTC_LINUX"] = True
-+    else:
-+        DEFINES["WEBRTC_BSD"] = True
-     DEFINES["WEBRTC_POSIX"] = True
-     DEFINES["_FILE_OFFSET_BITS"] = "64"
-     DEFINES["_LARGEFILE64_SOURCE"] = True
-@@ -135,7 +138,7 @@
- 
-     DEFINES["_DEBUG"] = True
- 
--if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["MOZ_DEBUG"] == "1" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
- 
-     DEFINES["_DEBUG"] = True
- 
-@@ -180,4 +183,13 @@
- 
-     DEFINES["_GNU_SOURCE"] = True
- 
-+if CONFIG["CPU_ARCH"] == "x86":
-+    CFLAGS += [
-+        "-msse2"
-+    ]
-+
-+    CXXFLAGS += [
-+        "-msse2"
-+    ]
-+
- Library("array_view_gn")
-diff -ur firefox-103.0.orig/third_party/libwebrtc/api/audio/aec3_config_gn/moz.build firefox-103.0/third_party/libwebrtc/api/audio/aec3_config_gn/moz.build
---- third_party/libwebrtc/api/audio/aec3_config_gn/moz.build   2022-07-19 03:44:25.000000000 +0900
-+++ third_party/libwebrtc/api/audio/aec3_config_gn/moz.build   2022-07-26 23:57:28.532316610 +0900
-@@ -67,14 +67,17 @@
-     DEFINES["__STDC_CONSTANT_MACROS"] = True
-     DEFINES["__STDC_FORMAT_MACROS"] = True
- 
--if CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD":
- 
-     DEFINES["USE_AURA"] = "1"
-     DEFINES["USE_GLIB"] = "1"
-     DEFINES["USE_NSS_CERTS"] = "1"
-     DEFINES["USE_OZONE"] = "1"
-     DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_LINUX"] = True
-+    if CONFIG["OS_TARGET"] == "Linux":
-+        DEFINES["WEBRTC_LINUX"] = True
-+    else:
-+        DEFINES["WEBRTC_BSD"] = True
-     DEFINES["WEBRTC_POSIX"] = True
-     DEFINES["_FILE_OFFSET_BITS"] = "64"
-     DEFINES["_LARGEFILE64_SOURCE"] = True
-@@ -147,7 +150,7 @@
- 
-     DEFINES["_DEBUG"] = True
- 
--if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["MOZ_DEBUG"] == "1" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
- 
-     DEFINES["_DEBUG"] = True
- 
-@@ -200,4 +203,13 @@
- 
-     DEFINES["_GNU_SOURCE"] = True
- 
-+if CONFIG["CPU_ARCH"] == "x86":
-+    CFLAGS += [
-+        "-msse2"
-+    ]
-+
-+    CXXFLAGS += [
-+        "-msse2"
-+    ]
-+
- Library("aec3_config_gn")
-diff -ur firefox-103.0.orig/third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build firefox-103.0/third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build
---- third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build  2022-07-19 03:44:26.000000000 +0900
-+++ third_party/libwebrtc/api/audio/aec3_factory_gn/moz.build  2022-07-26 23:57:28.536379004 +0900
-@@ -68,14 +68,17 @@
-     DEFINES["__STDC_CONSTANT_MACROS"] = True
-     DEFINES["__STDC_FORMAT_MACROS"] = True
- 
--if CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD":
- 
-     DEFINES["USE_AURA"] = "1"
-     DEFINES["USE_GLIB"] = "1"
-     DEFINES["USE_NSS_CERTS"] = "1"
-     DEFINES["USE_OZONE"] = "1"
-     DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_LINUX"] = True
-+    if CONFIG["OS_TARGET"] == "Linux":
-+        DEFINES["WEBRTC_LINUX"] = True
-+    else:
-+        DEFINES["WEBRTC_BSD"] = True
-     DEFINES["WEBRTC_POSIX"] = True
-     DEFINES["_FILE_OFFSET_BITS"] = "64"
-     DEFINES["_LARGEFILE64_SOURCE"] = True
-@@ -155,7 +158,7 @@
- 
-     DEFINES["_DEBUG"] = True
- 
--if CONFIG["MOZ_DEBUG"] == "1" and CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["MOZ_DEBUG"] == "1" and (CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD"):
- 
-     DEFINES["_DEBUG"] = True
- 
-@@ -208,4 +211,13 @@
- 
-     DEFINES["_GNU_SOURCE"] = True
- 
-+if CONFIG["CPU_ARCH"] == "x86":
-+    CFLAGS += [
-+        "-msse2"
-+    ]
-+
-+    CXXFLAGS += [
-+        "-msse2"
-+    ]
-+
- Library("aec3_factory_gn")
-diff -ur firefox-103.0.orig/third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build firefox-103.0/third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build
---- third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build       2022-07-19 03:44:36.000000000 +0900
-+++ third_party/libwebrtc/api/audio/audio_frame_api_gn/moz.build       2022-07-26 23:57:28.530954587 +0900
-@@ -68,14 +68,17 @@
-     DEFINES["__STDC_CONSTANT_MACROS"] = True
-     DEFINES["__STDC_FORMAT_MACROS"] = True
- 
--if CONFIG["OS_TARGET"] == "Linux":
-+if CONFIG["OS_TARGET"] == "Linux" or CONFIG["OS_TARGET"] == "NetBSD" or CONFIG["OS_TARGET"] == "OpenBSD" or CONFIG["OS_TARGET"] == "FreeBSD":
- 
-     DEFINES["USE_AURA"] = "1"
-     DEFINES["USE_GLIB"] = "1"
-     DEFINES["USE_NSS_CERTS"] = "1"
-     DEFINES["USE_OZONE"] = "1"
-     DEFINES["USE_UDEV"] = True
--    DEFINES["WEBRTC_LINUX"] = True
-+    if CONFIG["OS_TARGET"] == "Linux":
-+        DEFINES["WEBRTC_LINUX"] = True
-+    else:
-+        DEFINES["WEBRTC_BSD"] = True
-     DEFINES["WEBRTC_POSIX"] = True
-     DEFINES["_FILE_OFFSET_BITS"] = "64"
-     DEFINES["_LARGEFILE64_SOURCE"] = True
-@@ -148,7 +151,7 @@
- 



Home | Main Index | Thread Index | Old Index