Browse Source

gjs package update

Signed-off-by: guibuilder_pel7x64builder0 <guibuilder@powerel.org>
master
guibuilder_pel7x64builder0 6 years ago
parent
commit
f1f2ac3cd5
  1. 12
      SOURCES/build-icu-big-endian.patch
  2. 12
      SOURCES/build-missing-xlocale-h.patch
  3. 30
      SOURCES/copy-headers.patch
  4. 184
      SOURCES/disable-destoyed-object-criticals.patch
  5. 21
      SOURCES/disable-extra-threads.patch
  6. 66
      SOURCES/disable-mozglue.patch
  7. 12
      SOURCES/gjs-mozjs-dont-export-abort.patch
  8. 48
      SOURCES/include-configure-script.patch
  9. 12
      SOURCES/mozilla-1253216.patch
  10. 12
      SOURCES/xulrunner-24.0-jemalloc-ppc.patch
  11. 12
      SOURCES/xulrunner-24.0-s390-inlines.patch
  12. 528
      SPECS/gjs.spec

12
SOURCES/build-icu-big-endian.patch

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
diff -up mozilla-aurora/build/autoconf/icu.m4.icu-endian mozilla-aurora/build/autoconf/icu.m4
--- mozilla-aurora/build/autoconf/icu.m4.icu-endian 2016-12-09 09:11:01.227317790 +0100
+++ mozilla-aurora/build/autoconf/icu.m4 2016-12-09 09:18:40.608712247 +0100
@@ -78,7 +78,7 @@ if test -n "$USE_ICU"; then
# TODO: the l is actually endian-dependent
# We could make this set as 'l' or 'b' for little or big, respectively,
# but we'd need to check in a big-endian version of the file.
- ICU_DATA_FILE="icudt${version}l.dat"
+ ICU_DATA_FILE="icudt${version}b.dat"
dnl We won't build ICU data as a separate file when building
dnl JS standalone so that embedders don't have to deal with it.

12
SOURCES/build-missing-xlocale-h.patch

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
diff -up thunderbird-52.3.0/mozilla/intl/icu/source/i18n/digitlst.cpp.xlocale thunderbird-52.3.0/mozilla/intl/icu/source/i18n/digitlst.cpp
--- thunderbird-52.3.0/mozilla/intl/icu/source/i18n/digitlst.cpp.xlocale 2017-08-24 14:42:48.634084293 +0200
+++ thunderbird-52.3.0/mozilla/intl/icu/source/i18n/digitlst.cpp 2017-08-24 14:42:50.534084676 +0200
@@ -64,7 +64,7 @@
# if U_PLATFORM_USES_ONLY_WIN32_API || U_PLATFORM == U_PF_CYGWIN
# include <locale.h>
# else
-# include <xlocale.h>
+# include <locale.h>
# endif
#endif

30
SOURCES/copy-headers.patch

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
From 8b2d7a77bfb4dbd513763501ed7e9722058ee9af Mon Sep 17 00:00:00 2001
From: Rico Tzschichholz <ricotz@ubuntu.com>
Date: Wed, 5 Jul 2017 22:45:59 -0700
Subject: [PATCH] build: Copy headers on install instead of symlinking

Patch ported forward to mozjs52 by Philip Chimento
<philip.chimento@gmail.com>.
---
python/mozbuild/mozbuild/backend/recursivemake.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/python/mozbuild/mozbuild/backend/recursivemake.py b/python/mozbuild/mozbuild/backend/recursivemake.py
index 132dcf94..33d489a6 100644
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -1307,11 +1307,11 @@ def _process_final_target_files(self, obj, files, backend_file):
raise Exception("Wildcards are only supported in the filename part of "
"srcdir-relative or absolute paths.")
- install_manifest.add_pattern_symlink(basepath, wild, path)
+ install_manifest.add_pattern_copy(basepath, wild, path)
else:
- install_manifest.add_pattern_symlink(f.srcdir, f, path)
+ install_manifest.add_pattern_copy(f.srcdir, f, path)
else:
- install_manifest.add_symlink(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' % (

184
SOURCES/disable-destoyed-object-criticals.patch

@ -0,0 +1,184 @@ @@ -0,0 +1,184 @@
From 847139d26929fb8e97c58a7a34a21b95f0855b94 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Fri, 16 Feb 2018 10:51:37 -0500
Subject: [PATCH] object: only print stacktraces when debugging enabled

We have a bunch of corruption right now spamming the
log.

This commit gets rid of the spam unless G_MESSAGES_DEBUG
is set.
---
gi/object.cpp | 105 ++++++++++++++++++++++++++++++++++------------------------
1 file changed, 61 insertions(+), 44 deletions(-)

diff --git a/gi/object.cpp b/gi/object.cpp
index e77de884..c2eb7dae 100644
--- a/gi/object.cpp 2018-01-27 17:38:36.000000000 -0500
+++ b/gi/object.cpp 2018-02-16 13:14:15.834892741 -0500
@@ -89,6 +89,29 @@ GJS_DEFINE_PRIV_FROM_JS(ObjectInstance,
static void disassociate_js_gobject (GObject *gobj);
+static void
+gjs_log_stacktrace(const char *format,
+ ...)
+{
+ const char *domain;
+ va_list args;
+
+ domain = g_getenv("G_MESSAGES_DEBUG");
+
+ if (!domain)
+ return;
+
+ if (!g_str_equal(domain, "all") &&
+ !strstr(domain, G_LOG_DOMAIN))
+ return;
+
+ va_start(args, format);
+ g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args);
+ va_end(args);
+
+ gjs_dumpstack();
+}
+
typedef enum {
SOME_ERROR_OCCURRED = false,
NO_SUCH_G_PROPERTY,
@@ -410,12 +433,11 @@ object_instance_get_prop(JSContext
return true;
if (priv->g_object_finalized) {
- g_critical("Object %s.%s (%p), has been already finalized. "
- "Impossible to get any property from it.",
- priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
- priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
- priv->gobj);
- gjs_dumpstack();
+ gjs_log_stacktrace("Object %s.%s (%p), has been already finalized. "
+ "Impossible to get any property from it.",
+ priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
+ priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
+ priv->gobj);
return true;
}
@@ -530,12 +552,11 @@ object_instance_set_prop(JSContext
return result.succeed();
if (priv->g_object_finalized) {
- g_critical("Object %s.%s (%p), has been already finalized. "
- "Impossible to set any property to it.",
- priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
- priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
- priv->gobj);
- gjs_dumpstack();
+ gjs_log_stacktrace("Object %s.%s (%p), has been already finalized. "
+ "Impossible to set any property to it.",
+ priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
+ priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
+ priv->gobj);
return result.succeed();
}
@@ -777,12 +798,11 @@ object_instance_resolve(JSContext
}
if (priv->g_object_finalized) {
- g_critical("Object %s.%s (%p), has been already finalized. "
- "Impossible to resolve it.",
- priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
- priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
- priv->gobj);
- gjs_dumpstack();
+ gjs_log_stacktrace("Object %s.%s (%p), has been already finalized. "
+ "Impossible to resolve it.",
+ priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
+ priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
+ priv->gobj);
*resolved = false;
return true;
@@ -1471,11 +1491,11 @@ object_instance_trace(JSTracer *tracer,
return;
if (priv->g_object_finalized) {
- g_debug("Object %s.%s (%p), has been already finalized. "
- "Impossible to trace it.",
- priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
- priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
- priv->gobj);
+ gjs_log_stacktrace("Object %s.%s (%p), has been already finalized. "
+ "Impossible to trace it.",
+ priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
+ priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
+ priv->gobj);
return;
}
@@ -1680,13 +1700,12 @@ real_connect_func(JSContext *context,
return false;
}
if (priv->g_object_finalized) {
- g_critical("Object %s.%s (%p), has been already deallocated - impossible to connect to signal. "
- "This might be caused by the fact that the object has been destroyed from C "
- "code using something such as destroy(), dispose(), or remove() vfuncs",
- priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
- priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
- priv->gobj);
- gjs_dumpstack();
+ gjs_log_stacktrace("Object %s.%s (%p), has been already deallocated - impossible to connect to signal. "
+ "This might be caused by the fact that the object has been destroyed from C "
+ "code using something such as destroy(), dispose(), or remove() vfuncs",
+ priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
+ priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
+ priv->gobj);
return true;
}
@@ -1777,13 +1796,12 @@ emit_func(JSContext *context,
}
if (priv->g_object_finalized) {
- g_critical("Object %s.%s (%p), has been already deallocated - impossible to emit signal. "
- "This might be caused by the fact that the object has been destroyed from C "
- "code using something such as destroy(), dispose(), or remove() vfuncs",
- priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
- priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
- priv->gobj);
- gjs_dumpstack();
+ gjs_log_stacktrace("Object %s.%s (%p), has been already deallocated - impossible to emit signal. "
+ "This might be caused by the fact that the object has been destroyed from C "
+ "code using something such as destroy(), dispose(), or remove() vfuncs",
+ priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
+ priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
+ priv->gobj);
return true;
}
@@ -2197,13 +2215,12 @@ gjs_typecheck_object(JSContext *co
}
if (priv->g_object_finalized) {
- g_critical("Object %s.%s (%p), has been already deallocated - impossible to access to it. "
- "This might be caused by the fact that the object has been destroyed from C "
- "code using something such as destroy(), dispose(), or remove() vfuncs",
- priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
- priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
- priv->gobj);
- gjs_dumpstack();
+ gjs_log_stacktrace("Object %s.%s (%p), has been already deallocated - impossible to access to it. "
+ "This might be caused by the fact that the object has been destroyed from C "
+ "code using something such as destroy(), dispose(), or remove() vfuncs",
+ priv->info ? g_base_info_get_namespace( (GIBaseInfo*) priv->info) : "",
+ priv->info ? g_base_info_get_name( (GIBaseInfo*) priv->info) : g_type_name(priv->gtype),
+ priv->gobj);
return true;
}
--
2.14.3

21
SOURCES/disable-extra-threads.patch

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
diff -up firefox-52.6.0esr/js/src/vm/Runtime.cpp.disable-extra-threads firefox-52.6.0esr/js/src/vm/Runtime.cpp
--- firefox-52.6.0esr/js/src/vm/Runtime.cpp.disable-extra-threads 2018-02-08 10:16:13.453828939 -0500
+++ firefox-52.6.0esr/js/src/vm/Runtime.cpp 2018-02-08 10:23:31.283458826 -0500
@@ -283,6 +283,17 @@ JSRuntime::init(uint32_t maxbytes, uint3
ownerThreadNative_ = (size_t)pthread_self();
#endif
+ const char* enable_js_helper_threads;
+ enable_js_helper_threads = getenv("GJS_ENABLE_JS_HELPER_THREADS");
+
+#if defined(__PPC64__) && defined (__LITTLE_ENDIAN__)
+ if (enable_js_helper_threads == NULL)
+ js::DisableExtraThreads();
+#endif
+
+ if (enable_js_helper_threads != NULL && enable_js_helper_threads[0] == '0')
+ js::DisableExtraThreads();
+
if (!mainThread.init())
return false;

66
SOURCES/disable-mozglue.patch

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
From 7e6d628456af3e99ebcb9a01a27e1461585082a4 Mon Sep 17 00:00:00 2001
From: Till Schneidereit <till@tillschneidereit.net>
Date: Thu, 1 Oct 2015 12:59:09 +0200
Subject: [PATCH] Disable MOZ_GLUE_IN_PROGRAM in stand-alone builds on all
platforms

Otherwise, build fails not being able to find HashBytes.

Patch ported forward to mozjs52 by Philip Chimento
<philip.chimento@gmail.com>.

https://bugzilla.mozilla.org/show_bug.cgi?id=1176787
---
js/src/old-configure.in | 23 ++++++++++++++---------
mozglue/build/moz.build | 2 +-
2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/js/src/old-configure.in b/js/src/old-configure.in
index 1c5c9e21..ff0617e3 100644
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -1623,16 +1623,21 @@ dnl ========================================================
dnl = Enable jemalloc
dnl ========================================================
-case "${OS_TARGET}" in
-Android|WINNT|Darwin)
+dnl In stand-alone builds we always only want to link executables against mozglue.
+if test "$JS_STANDALONE"; then
MOZ_GLUE_IN_PROGRAM=
- ;;
-*)
- dnl On !Android !Windows !OSX, we only want to link executables against mozglue
- MOZ_GLUE_IN_PROGRAM=1
- AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
- ;;
-esac
+else
+ case "${OS_TARGET}" in
+ Android|WINNT|Darwin)
+ MOZ_GLUE_IN_PROGRAM=
+ ;;
+ *)
+ dnl On !Android !Windows !OSX, we only want to link executables against mozglue
+ MOZ_GLUE_IN_PROGRAM=1
+ AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
+ ;;
+ esac
+fi
if test "$MOZ_MEMORY"; then
if test "x$MOZ_DEBUG" = "x1"; then
diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build
index d2897477..e3be5a2b 100644
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -6,7 +6,7 @@
# Build mozglue as a shared lib on Windows, OSX and Android.
# If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in
-if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
+if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android') and not CONFIG['JS_STANDALONE']:
SharedLibrary('mozglue')
else:
Library('mozglue')

12
SOURCES/gjs-mozjs-dont-export-abort.patch

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
diff -urNp firefox-52.4.0esr.orig/memory/mozalloc/mozalloc_abort.cpp firefox-52.4.0esr/memory/mozalloc/mozalloc_abort.cpp
--- firefox-52.4.0esr.orig/memory/mozalloc/mozalloc_abort.cpp 2017-12-04 16:29:43.956029600 +0100
+++ firefox-52.4.0esr/memory/mozalloc/mozalloc_abort.cpp 2017-12-04 18:21:05.296157795 +0100
@@ -55,7 +55,7 @@ void fillAbortMessage(char (&msg)[N], ui
}
#endif
-#if defined(XP_UNIX) && !defined(MOZ_ASAN)
+#if 0
// Define abort() here, so that it is used instead of the system abort(). This
// lets us control the behavior when aborting, in order to get better results
// on *NIX platforms. See mozalloc_abort for details.

48
SOURCES/include-configure-script.patch

@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
From 4a06a1a6a71293decb83aee7adb74bc709493106 Mon Sep 17 00:00:00 2001
From: Philip Chimento <philip.chimento@gmail.com>
Date: Wed, 5 Jul 2017 22:57:09 -0700
Subject: [PATCH] build: Include configure script, be nicer about options

A configure script is not included in the SpiderMonkey tarball by
default. Also, we have to account for JHbuild passing extra unknown
options like --disable-Werror.

https://bugzilla.mozilla.org/show_bug.cgi?id=1379540
---
js/src/configure | 9 +++++++++
python/mozbuild/mozbuild/configure/__init__.py | 2 +-
python/mozbuild/mozbuild/configure/options.py | 6 +++++-
3 files changed, 15 insertions(+), 2 deletions(-)
create mode 100755 js/src/configure

diff --git a/python/mozbuild/mozbuild/configure/__init__.py b/python/mozbuild/mozbuild/configure/__init__.py
index 0fe640ca..09b460d3 100644
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -356,7 +356,7 @@ def run(self, path=None):
# All options should have been removed (handled) by now.
for arg in self._helper:
without_value = arg.split('=', 1)[0]
- raise InvalidOptionError('Unknown option: %s' % without_value)
+ print('Ignoring', without_value, ': Unknown option')
# Run the execution queue
for func, args in self._execution_queue:
diff --git a/python/mozbuild/mozbuild/configure/options.py b/python/mozbuild/mozbuild/configure/options.py
index 4310c862..15bfe425 100644
--- a/python/mozbuild/mozbuild/configure/options.py
+++ b/python/mozbuild/mozbuild/configure/options.py
@@ -402,7 +402,11 @@ def __init__(self, environ=os.environ, argv=sys.argv):
def add(self, arg, origin='command-line', args=None):
assert origin != 'default'
- prefix, name, values = Option.split_option(arg)
+ try:
+ prefix, name, values = Option.split_option(arg)
+ except InvalidOptionError as e:
+ print('Ignoring', arg, ':', e)
+ return
if args is None:
args = self._extra_args
if args is self._extra_args and name in self._extra_args:

12
SOURCES/mozilla-1253216.patch

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
diff -up firefox-48.0/js/src/jit/AtomicOperations.h.old firefox-48.0/js/src/jit/AtomicOperations.h
--- firefox-48.0/js/src/jit/AtomicOperations.h.old 2016-07-27 09:42:43.148175449 +0200
+++ firefox-48.0/js/src/jit/AtomicOperations.h 2016-07-27 09:41:13.000000000 +0200
@@ -340,7 +340,7 @@ AtomicOperations::isLockfree(int32_t siz
# elif defined(__aarch64__)
# include "jit/arm64/AtomicOperations-arm64.h"
# else
-# include "jit/none/AtomicOperations-none.h" // These MOZ_CRASH() always
+# include "jit/none/AtomicOperations-ppc.h"
# endif
#elif defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
# include "jit/x86-shared/AtomicOperations-x86-shared.h"

12
SOURCES/xulrunner-24.0-jemalloc-ppc.patch

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
diff -up firefox-48.0/memory/mozjemalloc/jemalloc.c.jemalloc-ppc firefox-48.0/memory/mozjemalloc/jemalloc.c
--- firefox-48.0/memory/mozjemalloc/jemalloc.c.jemalloc-ppc 2016-07-26 10:51:46.385434384 +0200
+++ firefox-48.0/memory/mozjemalloc/jemalloc.c 2016-07-26 10:53:49.061023106 +0200
@@ -1090,7 +1090,7 @@ static const bool config_recycle = false
* controlling the malloc behavior are defined as compile-time constants
* for best performance and cannot be altered at runtime.
*/
-#if !defined(__ia64__) && !defined(__sparc__) && !defined(__mips__) && !defined(__aarch64__)
+#if !defined(__ia64__) && !defined(__sparc__) && !defined(__mips__) && !defined(__aarch64__) && !(defined(__powerpc__))
#define MALLOC_STATIC_SIZES 1
#endif

12
SOURCES/xulrunner-24.0-s390-inlines.patch

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
diff -up xulrunner-25.0/mozilla-release/js/src/vm/SPSProfiler.cpp.s390-inlines xulrunner-25.0/mozilla-release/js/src/vm/SPSProfiler.cpp
--- xulrunner-25.0/mozilla-release/js/src/vm/SPSProfiler.cpp.s390-inlines 2013-10-23 16:04:01.773093979 +0200
+++ xulrunner-25.0/mozilla-release/js/src/vm/SPSProfiler.cpp 2013-10-23 16:04:44.551134551 +0200
@@ -4,6 +4,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "jscntxtinlines.h"
+
#include "vm/SPSProfiler.h"
#include "mozilla/DebugOnly.h"

528
SPECS/gjs.spec

@ -0,0 +1,528 @@ @@ -0,0 +1,528 @@
%global glib2_version 2.50.0
%global gobject_introspection_version 1.41.4
%global gtk3_version 3.20

%global bundled_mozjs 1

%if 0%{?bundled_mozjs}
%global mozjs_major 52
%global mozjs_version 52.6.0

# Big endian platforms
%ifarch ppc ppc64 s390 s390x
%define big_endian 1
%endif
%endif

Name: gjs
Version: 1.50.4
Release: 4%{?dist}
Summary: Javascript Bindings for GNOME

# The following files contain code from Mozilla which
# is triple licensed under MPL1.1/LGPLv2+/GPLv2+:
# The console module (modules/console.c)
# Stack printer (gjs/stack.c)
%if 0%{?bundled_mozjs}
License: MIT and (MPLv1.1 or GPLv2+ or LGPLv2+) and MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2.1 and LGPLv2.1+ and AFL and ASL 2.0
%else
License: MIT and (MPLv1.1 or GPLv2+ or LGPLv2+)
%endif
URL: https://wiki.gnome.org/Projects/Gjs
Source0: https://download.gnome.org/sources/%{name}/1.50/%{name}-%{version}.tar.xz

%if 0%{?bundled_mozjs}
Source1: https://ftp.mozilla.org/pub/firefox/releases/%{mozjs_version}esr/source/firefox-%{mozjs_version}esr.source.tar.xz
Provides: bundled(mozjs) = %{mozjs_version}

# https://bugzilla.redhat.com/show_bug.cgi?id=1510876
Patch0001: gjs-mozjs-dont-export-abort.patch

# Patches from Debian mozjs52_52.3.1-4.debian.tar.xz:
Patch0002: copy-headers.patch

# Downstream RHEL patches
Patch0003: disable-extra-threads.patch
Patch0004: disable-destoyed-object-criticals.patch

# Patches from https://github.com/ptomato/mozjs / Debian mozjs52_52.3.1-4.debian.tar.xz
Patch0101: disable-mozglue.patch
Patch0104: include-configure-script.patch

# Patches from Fedora firefox package:
Patch18: xulrunner-24.0-jemalloc-ppc.patch
Patch19: xulrunner-24.0-s390-inlines.patch
Patch26: build-icu-big-endian.patch
Patch36: build-missing-xlocale-h.patch
Patch304: mozilla-1253216.patch
%endif

BuildRequires: cairo-gobject-devel
BuildRequires: chrpath
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
BuildRequires: readline-devel
BuildRequires: dbus-glib-devel
BuildRequires: gettext
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gtk3-devel >= %{gtk3_version}
%if 0%{?bundled_mozjs}
BuildRequires: autoconf213
BuildRequires: perl-devel
BuildRequires: pkgconfig(libffi)
BuildRequires: pkgconfig(zlib)
BuildRequires: python2-devel
BuildRequires: readline-devel
BuildRequires: /usr/bin/zip
%else
BuildRequires: mozjs52-devel
%endif
BuildRequires: pkgconfig

Requires: glib2%{?_isa} >= %{glib2_version}
Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version}
Requires: gtk3%{?_isa} >= %{gtk3_version}

%if 0%{?bundled_mozjs}
# Firefox does not allow to build with system version of jemalloc
Provides: bundled(jemalloc) = 4.3.1

# Make sure we don't add requires/provides for private libraries
%global __provides_exclude_from ^%{_libdir}/gjs/
%global __requires_exclude ^libmozjs-%{mozjs_major}\\.so.*
%endif

%description
Gjs allows using GNOME libraries from Javascript. It's based on the
Spidermonkey Javascript engine from Mozilla and the GObject introspection
framework.

%package devel
Summary: Development package for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
Files for development with %{name}.

%package tests
Summary: Tests for the gjs package
Requires: %{name}%{?_isa} = %{version}-%{release}

%description tests
The gjs-tests package contains tests that can be used to verify
the functionality of the installed gjs package.

%prep
%setup -q

%if 0%{?bundled_mozjs}
# Extract mozjs archive
tar -xf %{S:1}

# Apply mozjs patches
pushd firefox-%{mozjs_version}esr
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1

%patch0101 -p1
%patch0104 -p1

%patch18 -p1 -b .jemalloc-ppc
%patch19 -p2 -b .s390-inlines

# Patch for big endian platforms only
%if 0%{?big_endian}
%patch26 -p1 -b .icu
%patch36 -p2 -b .xlocale
%endif

%patch304 -p1 -b .1253216

# Remove zlib directory (to be sure using system version)
rm -rf modules/zlib
popd

%patch0004 -p1 -b .debug
%endif

%build
%if 0%{?bundled_mozjs}
pushd firefox-%{mozjs_version}esr/js/src
# Disable null pointer gcc6 optimization in gcc6 (rhbz#1328045)
export CFLAGS="%{optflags} -fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks"
export CXXFLAGS=$CFLAGS
LINKFLAGS="%{?__global_ldflags}"
export PYTHON=/usr/bin/python2

autoconf-2.13
%configure \
--without-system-icu \
--enable-posix-nspr-emulation \
--with-system-zlib \
--enable-tests \
--disable-strip \
--with-intl-api \
--enable-readline \
--enable-shared-js \
--disable-optimize \
--enable-pie \
%ifarch s390 s390x
--disable-jemalloc \
%endif
%ifarch %{arm} aarch64 ppc ppc64 ppc64le
--disable-ion
%endif

%if 0%{?big_endian}
echo "Generate big endian version of config/external/icu/data/icud58l.dat"
pushd ../..
./mach python intl/icu_sources_data.py .
ls -l config/external/icu/data
rm -f config/external/icu/data/icudt*l.dat
popd
%endif

%make_build
popd

cat > mozjs-%{mozjs_major}.pc << EOF
Name: SpiderMonkey %{mozjs_version}
Description: The Mozilla library for JavaScript
Version: %{mozjs_version}

Libs: -L`pwd`/firefox-%{mozjs_version}esr/js/src/dist/sdk/lib -Wl,-rpath=%{_libdir}/gjs -lmozjs-%{mozjs_major}
Cflags: -include `pwd`/firefox-%{mozjs_version}esr/js/src/dist/include/js/RequiredDefines.h -I`pwd`/firefox-%{mozjs_version}esr/js/src/dist/include
EOF
%endif

%if 0%{?bundled_mozjs}
export PKG_CONFIG_PATH=`pwd`
export LD_LIBRARY_PATH=`pwd`/firefox-%{mozjs_version}esr/js/src/dist/sdk/lib
export LDFLAGS="%{?__global_ldflags} -Wl,--as-needed"
%endif
%configure --disable-static --enable-installed-tests --without-dbus-tests

make %{?_smp_mflags} V=1
%if 0%{?bundled_mozjs}
sed -i -e 's/ mozjs-%{mozjs_major}//g' gjs-1.0.pc
%endif

%install
%if 0%{?bundled_mozjs}
mkdir -p %{buildroot}%{_libdir}/gjs
cp -a firefox-%{mozjs_version}esr/js/src/js/src/libmozjs-%{mozjs_major}.so %{buildroot}%{_libdir}/gjs/
%endif
%make_install

# Remove lib64 rpaths
chrpath --delete %{buildroot}%{_bindir}/gjs-console
chrpath --delete %{buildroot}%{_libexecdir}/gjs/installed-tests/minijasmine

find %{buildroot} -name '*.la' -exec rm -f {} ';'

%check
%if 0%{?bundled_mozjs}
pushd firefox-%{mozjs_version}esr/js/src
# Run SpiderMonkey tests
%ifarch %{ix86} x86_64 %{arm} aarch64
tests/jstests.py -d -s -t 1800 --no-progress ../../js/src/js/src/shell/js
%else
tests/jstests.py -d -s -t 1800 --no-progress ../../js/src/js/src/shell/js || :
%endif

# Run basic JIT tests
%ifarch %{ix86} x86_64 %{arm} aarch64
jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/js/src/shell/js basic
%else
jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/js/src/shell/js basic || :
%endif
popd
%endif
#make check

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%license COPYING
%doc NEWS README
%{_bindir}/gjs
%{_bindir}/gjs-console
%{_libdir}/*.so.*
%{_libdir}/gjs

%files devel
%doc examples/*
%{_includedir}/gjs-1.0
%{_libdir}/pkgconfig/gjs-1.0.pc
%{_libdir}/*.so

%files tests
%{_libexecdir}/gjs/installed-tests
%{_datadir}/installed-tests

%changelog
* Fri Feb 16 2018 Kalev Lember <klember@redhat.com> - 1.50.4-4
- Avoid emitting critical warnings for finalized objects
Resolves: #1546059

* Mon Feb 12 2018 Ray Strode <rstrode@redhat.com> - 1.50.4-3
- Fix ppc64le architecture check
Related: #1523121

* Thu Feb 08 2018 Ray Strode <rstrode@redhat.com> - 1.50.4-2
- Diasble JS Helper threads on ppc64le
Related: #1523121

* Thu Feb 01 2018 Kalev Lember <klember@redhat.com> - 1.50.4-1
- Update to 1.50.4
- Update mozjs52 to 52.6.0
- Related: #1525499

* Thu Feb 01 2018 Kalev Lember <klember@redhat.com> - 1.50.2-4
- Fix /usr/bin/gjs-console multilib file conflict
- Resolves: #1517890

* Mon Dec 04 2017 Debarshi Ray <rishi@fedoraproject.org> - 1.50.2-3
- Fix start-up on aarch64
- Resolves: #1510876

* Wed Nov 08 2017 Kalev Lember <klember@redhat.com> - 1.50.2-2
- Fix /usr/bin/gjs linking with bundled mozjs52
- Resolves: #1510876

* Wed Nov 01 2017 Kalev Lember <klember@redhat.com> - 1.50.2-1
- Update to 1.50.2
- Related: #1505747

* Mon Oct 30 2017 Kalev Lember <klember@redhat.com> - 1.50.1-1
- Update to 1.50.1
- Bundle mozjs52 52.4.0 as a private library
- Resolves: #1505747

* Tue Oct 24 2017 Florian Müllner <fmuellner@redhat.com> - 1.47.0-1
- Update to 1.47.0
- Related: #1481381

* Wed Sep 21 2016 Kalev Lember <klember@redhat.com> - 1.46.0-1
- Update to 1.46.0
- Resolves: #1386870

* Thu Mar 19 2015 Richard Hughes <rhughes@redhat.com> - 1.42.0-1
- Update to 1.42.0
- Resolves: #1174518

* Tue Mar 18 2014 Colin Walters <walters@redhat> - 1.36.1-2
- Revert previous attempts to build 1.37.1, just go back to 1.36.1-2
- Resolves: #1070805

* Mon Apr 29 2013 Kalev Lember <kalevlember@gmail.com> - 1.36.1-1
- Update to 1.36.1

* Tue Mar 26 2013 Kalev Lember <kalevlember@gmail.com> - 1.36.0-1
- Update to 1.36.0

* Thu Mar 21 2013 Kalev Lember <kalevlember@gmail.com> - 1.35.9-1
- Update to 1.35.9

* Wed Feb 20 2013 Richard Hughes <rhughes@redhat.com> - 1.35.8-1
- Update to 1.35.8

* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.35.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Jan 15 2013 Matthias Clasen <mclasen@redhat.com> - 1.35.4-1
- Update to 1.35.4

* Thu Dec 20 2012 Kalev Lember <kalevlember@gmail.com> - 1.35.3-1
- Update to 1.35.3

* Tue Nov 20 2012 Richard Hughes <hughsient@gmail.com> - 1.35.2-1
- Update to 1.35.2

* Tue Sep 25 2012 Kalev Lember <kalevlember@gmail.com> - 1.34.0-1
- Update to 1.34.0

* Wed Sep 19 2012 Richard Hughes <hughsient@gmail.com> - 1.33.14-1
- Update to 1.33.14

* Thu Sep 06 2012 Richard Hughes <hughsient@gmail.com> - 1.33.10-1
- Update to 1.33.10

* Tue Aug 21 2012 Richard Hughes <hughsient@gmail.com> - 1.33.9-1
- Update to 1.33.9

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.33.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Tue Jul 17 2012 Richard Hughes <hughsient@gmail.com> - 1.33.4-1
- Update to 1.33.4

* Thu Jul 5 2012 Peter Robinson <pbrobinson@fedoraproject.org> - 1.33.3-2
- Enable verbose build

* Tue Jun 26 2012 Richard Hughes <hughsient@gmail.com> - 1.33.3-1
- Update to 1.33.3

* Sat Jun 9 2012 Matthias Clasen <mclasen@redhat.com> - 1.33.2-2
- Fix the build

* Thu Jun 07 2012 Richard Hughes <hughsient@gmail.com> - 1.33.2-1
- Update to 1.33.2

* Wed Mar 28 2012 Richard Hughes <hughsient@gmail.com> - 1.32.0-1
- Update to 1.32.0

* Wed Mar 21 2012 Matthias Clasen <mclasen@redhat.com> - 1.31.22-1
- Update to 1.31.22

* Mon Mar 5 2012 Matthias Clasen <mclasen@redhat.com> - 1.31.20-1
- Update to 1.31.20

* Tue Feb 7 2012 Colin Walters <walters@verbum.org> - 1.31.10-2
- Drop custom .gir/.typelib directories; see upstream commit
ea4d639eab307737870479b6573d5dab9fb2915a

* Thu Jan 19 2012 Matthias Clasen <mclasen@redhat.com> - 1.31.10-1
- 1.31.10

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.31.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Dec 20 2011 Matthias Clasen <mclasen@redhat.com> 1.31.6-1
- 1.31.6

* Fri Dec 02 2011 Karsten Hopp <karsten@redhat.com> 1.31.0-2
- fix crash on PPC, bugzilla 749604

* Wed Nov 2 2011 Matthias Clasen <mclasen@redhat.com> - 1.31.0-1
- Update to 1.31.0

* Tue Sep 27 2011 Ray <rstrode@redhat.com> - 1.30.0-1
- Update to 1.30.0

* Wed Sep 21 2011 Matthias Clasen <mclasen@redhat.com> 1.29.18-1
- Update to 1.29.18

* Mon Sep 05 2011 Luis Bazan <bazanluis20@gmail.com> 1.29.17-2
- mass rebuild

* Tue Aug 30 2011 Matthias Clasen <mclasen@redhat.com> 1.29.17-1
- Update to 1.29.17

* Thu Aug 18 2011 Matthias Clasen <mclasen@redhat.com> 1.29.16-1
- Update to 1.29.16

* Thu Jul 28 2011 Colin Walters <walters@verbum.org> - 1.29.0-3
- BR latest g-i to fix build issue

* Mon Jun 27 2011 Adam Williamson <awilliam@redhat.com> - 1.29.0-2
- build against js, not gecko (from f15 branch, but patch not needed)
- BR cairo-devel (also from f15)

* Fri Jun 17 2011 Tomas Bzatek <tbzatek@redhat.com> - 1.29.0-1
- Update to 1.29.0

* Thu Apr 28 2011 Christopher Aillon <caillon@redhat.com> - 0.7.14-3
- Rebuild against newer gecko

* Thu Apr 14 2011 Colin Walters <walters@verbum.org> - 0.7.14-2
- BR readline; closes #696254

* Mon Apr 4 2011 Colin Walters <walters@verbum.org> - 0.7.14-1
- Update to 0.7.14; fixes notification race condition on login

* Tue Mar 22 2011 Christopher Aillon <caillon@redhat.com> - 0.7.13-3
- Rebuild against newer gecko

* Fri Mar 18 2011 Christopher Aillon <caillon@redhat.com> - 0.7.13-2
- Rebuild against newer gecko

* Thu Mar 10 2011 Colin Walters <walters@verbum.org> - 0.7.13-1
- Update to 0.7.13

* Wed Mar 9 2011 Christopher Aillon <caillon@redhat.com> - 0.7.11-3
- Rebuild against newer gecko

* Fri Feb 25 2011 Christopher Aillon <caillon@redhat.com> - 0.7.11-2
- Rebuild against newer gecko

* Tue Feb 22 2011 Owen Taylor <otaylor@redhat.com> - 0.7.11-1
- Update to 0.7.11

* Thu Feb 10 2011 Christopher Aillon <caillon@redhat.com> - 0.7.10-4
- Require gecko-libs instead of xulrunner

* Wed Feb 9 2011 Colin Walters <walters@verbum.org> - 0.7.10-3
- Add a hardcoded Requires on xulrunner; see comment

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Jan 25 2011 Colin Walters <walters@verbum.org> - 0.7.10-1
- New upstream release

* Tue Jan 25 2011 Christopher Aillon <caillon@redhat.com> - 0.7.9-3
- Rebuild for new xulrunner

* Fri Jan 14 2011 Christopher Aillon <caillon@redhat.com> - 0.7.9-2
- Rebuild for new xulrunner

* Fri Jan 14 2011 Colin Walters <walters@verbum.org> - 0.7.9-1
- 0.7.9

* Wed Jan 12 2011 Colin Walters <walters@verbum.org> - 0.7.8-1
- Update to 0.7.8
- Drop upstreamed patches
- BR latest g-i for GI_TYPE_TAG_UNICHAR

* Wed Dec 29 2010 Dan Williams <dcbw@redhat.com> - 0.7.7-3
- Work around Mozilla JS API changes

* Wed Dec 22 2010 Colin Walters <walters@verbum.org> - 0.7.7-2
- Remove rpath removal; we need an rpath on libmozjs, since
it's in a nonstandard directory.

* Mon Nov 15 2010 Owen Taylor <otaylor@redhat.com> - 0.7.7-1
- Update to 0.7.7

* Tue Nov 9 2010 Owen Taylor <otaylor@redhat.com> - 0.7.6-1
- Update to 0.7.6

* Fri Oct 29 2010 Owen Taylor <otaylor@redhat.com> - 0.7.5-1
- Update to 0.7.5

* Mon Oct 4 2010 Owen Taylor <otaylor@redhat.com> - 0.7.4-1
- Update to 0.7.4

* Wed Jul 14 2010 Colin Walters <walters@verbum.org> - 0.7.1-3
- Rebuild for new gobject-introspection

* Mon Jul 12 2010 Colin Walters <walters@verbum.org> - 0.7.1-2
- New upstream version
- Changes to allow builds from snapshots

* Fri May 28 2010 Matthias Clasen <mclasen@redhat.com> 0.7-1
- Update to 0.7

* Wed Mar 24 2010 Peter Robinson <pbrobinson@gmail.com> 0.6-1
- New upstream 0.6 stable release

* Sat Feb 20 2010 Peter Robinson <pbrobinson@gmail.com> 0.5-1
- New upstream 0.5 release

* Thu Jan 14 2010 Peter Robinson <pbrobinson@gmail.com> 0.5-0.1
- Move to git snapshot to fix compile against xulrunner 1.9.2.1

* Thu Aug 27 2009 Peter Robinson <pbrobinson@gmail.com> 0.4-1
- New upstream 0.4 release

* Fri Aug 7 2009 Peter Robinson <pbrobinson@gmail.com> 0.3-2
- Updates from the review request

* Wed Jul 8 2009 Peter Robinson <pbrobinson@gmail.com> 0.3-1
- New upstream release. Clarify licensing for review

* Sat Jun 27 2009 Peter Robinson <pbrobinson@gmail.com> 0.2-1
- Initial packaging
Loading…
Cancel
Save