pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/mozjs60



Module Name:    pkgsrc
Committed By:   wiz
Date:           Sun Apr  5 06:10:28 UTC 2020

Added Files:
        pkgsrc/lang/mozjs60: DESCR Makefile PLIST buildlink3.mk distinfo
        pkgsrc/lang/mozjs60/patches: patch-.._.._config_rules.mk
            patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py
            patch-jsdate.cpp patch-vm_Time.cpp patch-vm_Time.h

Log Message:
lang/mozjs60: import mozjs60-60.8.0

I've named this mozjs60 to match what Linux distributions, in particular
Debian, do. Previous versions in pkgsrc are called spidermonkey*

This directory contains SpiderMonkey 60, the JavaScript engine by
Mozilla.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/mozjs60/DESCR pkgsrc/lang/mozjs60/Makefile \
    pkgsrc/lang/mozjs60/PLIST pkgsrc/lang/mozjs60/buildlink3.mk \
    pkgsrc/lang/mozjs60/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/lang/mozjs60/patches/patch-.._.._config_rules.mk \
    pkgsrc/lang/mozjs60/patches/patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py \
    pkgsrc/lang/mozjs60/patches/patch-jsdate.cpp \
    pkgsrc/lang/mozjs60/patches/patch-vm_Time.cpp \
    pkgsrc/lang/mozjs60/patches/patch-vm_Time.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/lang/mozjs60/DESCR
diff -u /dev/null pkgsrc/lang/mozjs60/DESCR:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/DESCR   Sun Apr  5 06:10:28 2020
@@ -0,0 +1,2 @@
+This directory contains SpiderMonkey 60, the JavaScript engine by
+Mozilla.
Index: pkgsrc/lang/mozjs60/Makefile
diff -u /dev/null pkgsrc/lang/mozjs60/Makefile:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/Makefile        Sun Apr  5 06:10:28 2020
@@ -0,0 +1,59 @@
+# $NetBSD: Makefile,v 1.1 2020/04/05 06:10:28 wiz Exp $
+
+DISTNAME=      mozjs60_60.8.0.orig
+PKGNAME=       ${DISTNAME:S/_/-/:S/.orig//}
+CATEGORIES=    lang
+MASTER_SITES=  http://deb.debian.org/debian/pool/main/m/mozjs60/
+EXTRACT_SUFX=  .tar.xz
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://packages.debian.org/unstable/libmozjs-60-0
+COMMENT=       SpiderMonkey JavaScript library (60.x branch)
+#LICENSE=      # TODO: (see mk/license.mk)
+
+WRKSRC=                ${WRKDIR}/mozjs-60.8.0/js/src
+USE_TOOLS+=    autoconf213 gmake perl pkg-config
+USE_LANGUAGES= c c++
+
+GCC_REQD+=     4.8
+
+HAS_CONFIGURE=         yes
+CONFIGURE_DIRS=                build
+CONFIGURE_SCRIPT=      ../configure
+CONFIGURE_ARGS+=       --prefix=${PREFIX}
+CONFIGURE_ARGS+=       --with-system-icu
+CONFIGURE_ARGS+=       --with-system-zlib
+CONFIGURE_ARGS+=       --enable-readline
+CONFIGURE_ARGS+=       --with-system-nspr
+#CONFIGURE_ARGS+=      --enable-posix-nspr-emulation
+CONFIGURE_ARGS+=       --with-pthreads
+CONFIGURE_ARGS+=       --disable-jemalloc
+CONFIGURE_ARGS+=       --disable-debug-symbols
+CONFIGURE_ARGS+=       --enable-strip
+# --with-intl-api
+# --disable-optimize
+
+PKGCONFIG_OVERRIDE+=   build/js.pc.in
+PKGCONFIG_OVERRIDE+=   ctypes/libffi/libffi.pc.in
+
+PYTHON_VERSIONS_ACCEPTED=      27
+
+pre-configure:
+       cd ${WRKSRC} && autoconf-2.13
+       mkdir ${WRKSRC}/build
+
+post-install:
+       cd ${DESTDIR}${PREFIX}/lib && \
+               ${MV} libmozjs-60.so libmozjs-60.so.0.0.0 && \
+               ${LN} -s libmozjs-60.so.0.0.0 libmozjs-60.so.0 && \
+               ${LN} -s libmozjs-60.so.0 libmozjs-60.so
+       ${RM} -f ${DESTDIR}${PREFIX}/lib/libjs_static.ajs
+       ${CHMOD} -x ${DESTDIR}${PREFIX}/include/mozjs-60/js-config.h
+       ${CHMOD} -x ${DESTDIR}${PREFIX}/lib/pkgconfig/mozjs-60.pc
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../lang/python/tool.mk"
+.include "../../textproc/icu/buildlink3.mk"
+.include "../../devel/nspr/buildlink3.mk"
+.include "../../mk/readline.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/lang/mozjs60/PLIST
diff -u /dev/null pkgsrc/lang/mozjs60/PLIST:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/PLIST   Sun Apr  5 06:10:28 2020
@@ -0,0 +1,174 @@
+@comment $NetBSD: PLIST,v 1.1 2020/04/05 06:10:28 wiz Exp $
+bin/js60
+bin/js60-config
+include/mozjs-60/double-conversion/double-conversion.h
+include/mozjs-60/double-conversion/utils.h
+include/mozjs-60/fdlibm.h
+include/mozjs-60/js-config.h
+include/mozjs-60/js.msg
+include/mozjs-60/js/AllocPolicy.h
+include/mozjs-60/js/CallArgs.h
+include/mozjs-60/js/CallNonGenericMethod.h
+include/mozjs-60/js/CharacterEncoding.h
+include/mozjs-60/js/Class.h
+include/mozjs-60/js/Conversions.h
+include/mozjs-60/js/Date.h
+include/mozjs-60/js/Debug.h
+include/mozjs-60/js/GCAPI.h
+include/mozjs-60/js/GCAnnotations.h
+include/mozjs-60/js/GCHashTable.h
+include/mozjs-60/js/GCPolicyAPI.h
+include/mozjs-60/js/GCVariant.h
+include/mozjs-60/js/GCVector.h
+include/mozjs-60/js/HashTable.h
+include/mozjs-60/js/HeapAPI.h
+include/mozjs-60/js/Id.h
+include/mozjs-60/js/Initialization.h
+include/mozjs-60/js/MemoryMetrics.h
+include/mozjs-60/js/Principals.h
+include/mozjs-60/js/Printf.h
+include/mozjs-60/js/ProfilingFrameIterator.h
+include/mozjs-60/js/ProfilingStack.h
+include/mozjs-60/js/ProtoKey.h
+include/mozjs-60/js/Proxy.h
+include/mozjs-60/js/Realm.h
+include/mozjs-60/js/RefCounted.h
+include/mozjs-60/js/RequiredDefines.h
+include/mozjs-60/js/Result.h
+include/mozjs-60/js/RootingAPI.h
+include/mozjs-60/js/SliceBudget.h
+include/mozjs-60/js/Stream.h
+include/mozjs-60/js/StructuredClone.h
+include/mozjs-60/js/SweepingAPI.h
+include/mozjs-60/js/TraceKind.h
+include/mozjs-60/js/TracingAPI.h
+include/mozjs-60/js/TrackedOptimizationInfo.h
+include/mozjs-60/js/TypeDecls.h
+include/mozjs-60/js/UbiNode.h
+include/mozjs-60/js/UbiNodeBreadthFirst.h
+include/mozjs-60/js/UbiNodeCensus.h
+include/mozjs-60/js/UbiNodeDominatorTree.h
+include/mozjs-60/js/UbiNodePostOrder.h
+include/mozjs-60/js/UbiNodeShortestPaths.h
+include/mozjs-60/js/UniquePtr.h
+include/mozjs-60/js/Utility.h
+include/mozjs-60/js/Value.h
+include/mozjs-60/js/Vector.h
+include/mozjs-60/js/WeakMapPtr.h
+include/mozjs-60/js/Wrapper.h
+include/mozjs-60/jsapi.h
+include/mozjs-60/jsfriendapi.h
+include/mozjs-60/jsperf.h
+include/mozjs-60/jspubtd.h
+include/mozjs-60/jstypes.h
+include/mozjs-60/malloc_decls.h
+include/mozjs-60/mozilla/Alignment.h
+include/mozjs-60/mozilla/AllocPolicy.h
+include/mozjs-60/mozilla/AlreadyAddRefed.h
+include/mozjs-60/mozilla/Array.h
+include/mozjs-60/mozilla/ArrayUtils.h
+include/mozjs-60/mozilla/Assertions.h
+include/mozjs-60/mozilla/Atomics.h
+include/mozjs-60/mozilla/Attributes.h
+include/mozjs-60/mozilla/AutoProfilerLabel.h
+include/mozjs-60/mozilla/BinarySearch.h
+include/mozjs-60/mozilla/BloomFilter.h
+include/mozjs-60/mozilla/BufferList.h
+include/mozjs-60/mozilla/Casting.h
+include/mozjs-60/mozilla/ChaosMode.h
+include/mozjs-60/mozilla/Char16.h
+include/mozjs-60/mozilla/CheckedInt.h
+include/mozjs-60/mozilla/Compiler.h
+include/mozjs-60/mozilla/Compression.h
+include/mozjs-60/mozilla/DebugOnly.h
+include/mozjs-60/mozilla/Decimal.h
+include/mozjs-60/mozilla/DefineEnum.h
+include/mozjs-60/mozilla/DoublyLinkedList.h
+include/mozjs-60/mozilla/EndianUtils.h
+include/mozjs-60/mozilla/EnumSet.h
+include/mozjs-60/mozilla/EnumTypeTraits.h
+include/mozjs-60/mozilla/EnumeratedArray.h
+include/mozjs-60/mozilla/EnumeratedRange.h
+include/mozjs-60/mozilla/FStream.h
+include/mozjs-60/mozilla/FastBernoulliTrial.h
+include/mozjs-60/mozilla/FloatingPoint.h
+include/mozjs-60/mozilla/GuardObjects.h
+include/mozjs-60/mozilla/HashFunctions.h
+include/mozjs-60/mozilla/IndexSequence.h
+include/mozjs-60/mozilla/IntegerPrintfMacros.h
+include/mozjs-60/mozilla/IntegerRange.h
+include/mozjs-60/mozilla/IntegerTypeTraits.h
+include/mozjs-60/mozilla/JSONWriter.h
+include/mozjs-60/mozilla/Likely.h
+include/mozjs-60/mozilla/LinkedList.h
+include/mozjs-60/mozilla/MacroArgs.h
+include/mozjs-60/mozilla/MacroForEach.h
+include/mozjs-60/mozilla/MathAlgorithms.h
+include/mozjs-60/mozilla/Maybe.h
+include/mozjs-60/mozilla/MaybeOneOf.h
+include/mozjs-60/mozilla/MemoryChecking.h
+include/mozjs-60/mozilla/MemoryReporting.h
+include/mozjs-60/mozilla/Move.h
+include/mozjs-60/mozilla/NotNull.h
+include/mozjs-60/mozilla/NullPtr.h
+include/mozjs-60/mozilla/Opaque.h
+include/mozjs-60/mozilla/OperatorNewExtensions.h
+include/mozjs-60/mozilla/Pair.h
+include/mozjs-60/mozilla/Path.h
+include/mozjs-60/mozilla/PlatformConditionVariable.h
+include/mozjs-60/mozilla/PlatformMutex.h
+include/mozjs-60/mozilla/PodOperations.h
+include/mozjs-60/mozilla/Poison.h
+include/mozjs-60/mozilla/Printf.h
+include/mozjs-60/mozilla/Range.h
+include/mozjs-60/mozilla/RangedArray.h
+include/mozjs-60/mozilla/RangedPtr.h
+include/mozjs-60/mozilla/ReentrancyGuard.h
+include/mozjs-60/mozilla/RefCountType.h
+include/mozjs-60/mozilla/RefCounted.h
+include/mozjs-60/mozilla/RefPtr.h
+include/mozjs-60/mozilla/Result.h
+include/mozjs-60/mozilla/ResultExtensions.h
+include/mozjs-60/mozilla/ReverseIterator.h
+include/mozjs-60/mozilla/RollingMean.h
+include/mozjs-60/mozilla/SHA1.h
+include/mozjs-60/mozilla/Saturate.h
+include/mozjs-60/mozilla/ScopeExit.h
+include/mozjs-60/mozilla/Scoped.h
+include/mozjs-60/mozilla/SegmentedVector.h
+include/mozjs-60/mozilla/SmallPointerArray.h
+include/mozjs-60/mozilla/Span.h
+include/mozjs-60/mozilla/SplayTree.h
+include/mozjs-60/mozilla/Sprintf.h
+include/mozjs-60/mozilla/StackWalk.h
+include/mozjs-60/mozilla/StaticAnalysisFunctions.h
+include/mozjs-60/mozilla/TaggedAnonymousMemory.h
+include/mozjs-60/mozilla/TemplateLib.h
+include/mozjs-60/mozilla/TextUtils.h
+include/mozjs-60/mozilla/ThreadLocal.h
+include/mozjs-60/mozilla/ThreadSafeWeakPtr.h
+include/mozjs-60/mozilla/TimeStamp.h
+include/mozjs-60/mozilla/ToString.h
+include/mozjs-60/mozilla/Tuple.h
+include/mozjs-60/mozilla/TypeTraits.h
+include/mozjs-60/mozilla/TypedEnumBits.h
+include/mozjs-60/mozilla/Types.h
+include/mozjs-60/mozilla/UniquePtr.h
+include/mozjs-60/mozilla/UniquePtrExtensions.h
+include/mozjs-60/mozilla/Unused.h
+include/mozjs-60/mozilla/Variant.h
+include/mozjs-60/mozilla/Vector.h
+include/mozjs-60/mozilla/WeakPtr.h
+include/mozjs-60/mozilla/WrappingOperations.h
+include/mozjs-60/mozilla/XorShift128PlusRNG.h
+include/mozjs-60/mozilla/fallible.h
+include/mozjs-60/mozilla/mozalloc.h
+include/mozjs-60/mozilla/mozalloc_abort.h
+include/mozjs-60/mozilla/mozalloc_oom.h
+include/mozjs-60/mozjemalloc_types.h
+include/mozjs-60/mozmemory.h
+include/mozjs-60/mozmemory_wrap.h
+lib/libmozjs-60.so
+lib/libmozjs-60.so.0
+lib/libmozjs-60.so.0.0.0
+lib/pkgconfig/mozjs-60.pc
Index: pkgsrc/lang/mozjs60/buildlink3.mk
diff -u /dev/null pkgsrc/lang/mozjs60/buildlink3.mk:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/buildlink3.mk   Sun Apr  5 06:10:28 2020
@@ -0,0 +1,16 @@
+# $NetBSD: buildlink3.mk,v 1.1 2020/04/05 06:10:28 wiz Exp $
+
+BUILDLINK_TREE+=       mozjs60
+
+.if !defined(MOZJS60_BUILDLINK3_MK)
+MOZJS60_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.mozjs60+=        mozjs60>=60.8.0
+BUILDLINK_PKGSRCDIR.mozjs60?=  ../../lang/mozjs60
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../textproc/icu/buildlink3.mk"
+.include "../../devel/nspr/buildlink3.mk"
+.endif # MOZJS60_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -mozjs60
Index: pkgsrc/lang/mozjs60/distinfo
diff -u /dev/null pkgsrc/lang/mozjs60/distinfo:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/distinfo        Sun Apr  5 06:10:28 2020
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2020/04/05 06:10:28 wiz Exp $
+
+SHA1 (mozjs60_60.8.0.orig.tar.xz) = b66207ee477c110995029f173e6b026f2e013591
+RMD160 (mozjs60_60.8.0.orig.tar.xz) = fef033969a51dc56c84669d33401f60bd499de6d
+SHA512 (mozjs60_60.8.0.orig.tar.xz) = ad4d5d17824b1d0e50fc43a56cb5ffe022ffd150ce0e4af4e57326b8c1a8688c90da72c156122f637f558300b1caeb2f50d0bc83a1a12455fed3be656dd8c5be
+Size (mozjs60_60.8.0.orig.tar.xz) = 25294372 bytes
+SHA1 (patch-.._.._config_rules.mk) = cf3421d991e1cbfab4c0cdcb7b648b1388fa32d5
+SHA1 (patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py) = dda670432e5673c5d28dcf6c4902d4a724e71170
+SHA1 (patch-jsdate.cpp) = f9314460476ffbc00fe85a75bddc964807d0153f
+SHA1 (patch-vm_Time.cpp) = 5c08e7b3997055c50f40aadcaefb81628cf1133c
+SHA1 (patch-vm_Time.h) = 1dbc623a9b5e249d84bffd1b036feb7b6a54ce75

Index: pkgsrc/lang/mozjs60/patches/patch-.._.._config_rules.mk
diff -u /dev/null pkgsrc/lang/mozjs60/patches/patch-.._.._config_rules.mk:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/patches/patch-.._.._config_rules.mk     Sun Apr  5 06:10:28 2020
@@ -0,0 +1,18 @@
+$NetBSD: patch-.._.._config_rules.mk,v 1.1 2020/04/05 06:10:28 wiz Exp $
+
+Add soname switch to linker, regardless of Operating System
+
+Bug-Debian: http://bugs.debian.org/746705
+
+--- ../../config/rules.mk.orig 2019-07-01 09:07:38.000000000 +0000
++++ ../../config/rules.mk
+@@ -367,6 +367,9 @@ endif
+ endif
+ EXTRA_DEPS += $(SYMBOLS_FILE)
+ endif
++
++EXTRA_DSO_LDOPTS += -Wl,-soname,lib$(JS_LIBRARY_NAME).so.0
++
+ #
+ # GNU doesn't have path length limitation
+ #
Index: pkgsrc/lang/mozjs60/patches/patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py
diff -u /dev/null pkgsrc/lang/mozjs60/patches/patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/patches/patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py   Sun Apr  5 06:10:28 2020
@@ -0,0 +1,21 @@
+$NetBSD: patch-.._.._python_mozbuild_mozbuild_backend_recursivemake.py,v 1.1 2020/04/05 06:10:28 wiz Exp $
+
+Copy headers on install instead of symlinking
+
+--- ../../python/mozbuild/mozbuild/backend/recursivemake.py.orig       2019-07-01 09:07:46.000000000 +0000
++++ ../../python/mozbuild/mozbuild/backend/recursivemake.py
+@@ -1427,11 +1427,11 @@ class RecursiveMakeBackend(CommonBackend
+                                 raise Exception("Wildcards are only supported in the filename part of "
+                                                 "srcdir-relative or absolute paths.")
+ 
+-                            install_manifest.add_pattern_link(basepath, wild, path)
++                            install_manifest.add_pattern_copy(basepath, wild, path)
+                         else:
+-                            install_manifest.add_pattern_link(f.srcdir, f, path)
++                            install_manifest.add_pattern_copy(f.srcdir, f, path)
+                     else:
+-                        install_manifest.add_link(f.full_path, dest)
++                        install_manifest.add_copy(f.full_path, dest)
+                 else:
+                     install_manifest.add_optional_exists(dest)
+                     backend_file.write('%s_FILES += %s\n' % (
Index: pkgsrc/lang/mozjs60/patches/patch-jsdate.cpp
diff -u /dev/null pkgsrc/lang/mozjs60/patches/patch-jsdate.cpp:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/patches/patch-jsdate.cpp        Sun Apr  5 06:10:28 2020
@@ -0,0 +1,33 @@
+$NetBSD: patch-jsdate.cpp,v 1.1 2020/04/05 06:10:28 wiz Exp $
+
+Always use the equivalent year to determine the time zone offset and name
+
+Reviewed-by: Jeff Walden
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1415202
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1479687
+Origin: upstream
+Applied-upstream: 62, commit:https://hg.mozilla.org/mozilla-central/rev/ce9f1466ec78
+
+--- jsdate.cpp.orig    2019-07-01 09:07:41.000000000 +0000
++++ jsdate.cpp
+@@ -2353,12 +2353,16 @@ static PRMJTime ToPRMJTime(double localT
+ static size_t FormatTime(char* buf, int buflen, const char* fmt, double utcTime,
+                          double localTime) {
+   PRMJTime prtm = ToPRMJTime(localTime, utcTime);
+-  int eqivalentYear = IsRepresentableAsTime32(utcTime)
+-                          ? prtm.tm_year
+-                          : EquivalentYearForDST(prtm.tm_year);
++
++  // If an equivalent year was used to compute the date/time components, use
++  // the same equivalent year to determine the time zone name and offset in
++  // PRMJ_FormatTime(...).
++  int timeZoneYear = IsRepresentableAsTime32(utcTime)
++                         ? prtm.tm_year
++                         : EquivalentYearForDST(prtm.tm_year);
+   int offsetInSeconds = (int)floor((localTime - utcTime) / msPerSecond);
+ 
+-  return PRMJ_FormatTime(buf, buflen, fmt, &prtm, eqivalentYear,
++  return PRMJ_FormatTime(buf, buflen, fmt, &prtm, timeZoneYear,
+                          offsetInSeconds);
+ }
+ 
Index: pkgsrc/lang/mozjs60/patches/patch-vm_Time.cpp
diff -u /dev/null pkgsrc/lang/mozjs60/patches/patch-vm_Time.cpp:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/patches/patch-vm_Time.cpp       Sun Apr  5 06:10:28 2020
@@ -0,0 +1,52 @@
+$NetBSD: patch-vm_Time.cpp,v 1.1 2020/04/05 06:10:28 wiz Exp $
+
+Always use the equivalent year to determine the time zone offset and name
+
+Reviewed-by: Jeff Walden
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1415202
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1479687
+Origin: upstream
+Applied-upstream: 62, commit:https://hg.mozilla.org/mozilla-central/rev/ce9f1466ec78
+
+--- vm/Time.cpp.orig   2019-07-01 09:07:44.000000000 +0000
++++ vm/Time.cpp
+@@ -247,7 +247,7 @@ static void PRMJ_InvalidParameterHandler
+ 
+ /* Format a time value into a buffer. Same semantics as strftime() */
+ size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt,
+-                       const PRMJTime* prtm, int equivalentYear,
++                       const PRMJTime* prtm, int timeZoneYear,
+                        int offsetInSeconds) {
+   size_t result = 0;
+ #if defined(XP_UNIX) || defined(XP_WIN)
+@@ -280,7 +280,8 @@ size_t PRMJ_FormatTime(char* buf, int bu
+      * Fill out |td| to the time represented by |prtm|, leaving the
+      * timezone fields zeroed out. localtime_r will then fill in the
+      * timezone fields for that local time according to the system's
+-     * timezone parameters.
++     * timezone parameters. Use |timeZoneYear| for the year to ensure the time
++     * zone name matches the time zone offset used by the caller.
+      */
+     struct tm td;
+     memset(&td, 0, sizeof(td));
+@@ -290,19 +291,12 @@ size_t PRMJ_FormatTime(char* buf, int bu
+     td.tm_mday = prtm->tm_mday;
+     td.tm_mon = prtm->tm_mon;
+     td.tm_wday = prtm->tm_wday;
+-    td.tm_year = prtm->tm_year - 1900;
++    td.tm_year = timeZoneYear - 1900;
+     td.tm_yday = prtm->tm_yday;
+     td.tm_isdst = prtm->tm_isdst;
+ 
+     time_t t = mktime(&td);
+ 
+-    // If |prtm| cannot be represented in |time_t| the year is probably
+-    // out of range, try again with the DST equivalent year.
+-    if (t == static_cast<time_t>(-1)) {
+-      td.tm_year = equivalentYear - 1900;
+-      t = mktime(&td);
+-    }
+-
+     // If either mktime or localtime_r failed, fill in the fallback time
+     // zone offset |offsetInSeconds| and set the time zone identifier to
+     // the empty string.
Index: pkgsrc/lang/mozjs60/patches/patch-vm_Time.h
diff -u /dev/null pkgsrc/lang/mozjs60/patches/patch-vm_Time.h:1.1
--- /dev/null   Sun Apr  5 06:10:28 2020
+++ pkgsrc/lang/mozjs60/patches/patch-vm_Time.h Sun Apr  5 06:10:28 2020
@@ -0,0 +1,21 @@
+$NetBSD: patch-vm_Time.h,v 1.1 2020/04/05 06:10:28 wiz Exp $
+
+Always use the equivalent year to determine the time zone offset and name
+
+Reviewed-by: Jeff Walden
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1415202
+Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1479687
+Origin: upstream
+Applied-upstream: 62, commit:https://hg.mozilla.org/mozilla-central/rev/ce9f1466ec78
+
+--- vm/Time.h.orig     2019-07-01 09:07:43.000000000 +0000
++++ vm/Time.h
+@@ -49,7 +49,7 @@ inline void PRMJ_NowShutdown() {}
+ 
+ /* Format a time value into a buffer. Same semantics as strftime() */
+ extern size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt,
+-                              const PRMJTime* tm, int equivalentYear,
++                              const PRMJTime* tm, int timeZoneYear,
+                               int offsetInSeconds);
+ 
+ /**



Home | Main Index | Thread Index | Old Index