• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.circleci/H12-Jan-2021-5746

build/H03-May-2022-7850

cjs/H12-Jan-2021-10,4586,519

debian/H07-May-2022-1,3541,042

doc/H12-Jan-2021-2,4851,863

examples/H03-May-2022-42

gi/H12-Jan-2021-20,47614,198

installed-tests/H12-Jan-2021-1,8221,543

libgjs-private/H12-Jan-2021-909604

modules/H12-Jan-2021-4,6243,107

subprojects/H12-Jan-2021-4334

test/H12-Jan-2021-3,4212,532

tools/H03-May-2022-2,1791,551

util/H12-Jan-2021-547336

.travis.ymlH A D12-Jan-20211.5 KiB4634

CONTRIBUTING.mdH A D12-Jan-202114.2 KiB345268

COPYINGH A D12-Jan-20211.2 KiB2821

COPYING.LGPLH A D12-Jan-202124.7 KiB483400

CPPLINT.cfgH A D12-Jan-2021550 1411

NEWSH A D12-Jan-2021103.9 KiB2,4882,018

READMEH A D12-Jan-20211 KiB3017

README.MSVC.mdH A D12-Jan-20218.3 KiB158129

README.mdH A D12-Jan-20211.1 KiB3219

gjs.doapH A D12-Jan-20211.7 KiB5041

js.gresource.xmlH A D12-Jan-20211.3 KiB3831

libgjs.mapH A D12-Jan-202138 76

libgjs.symbolsH A D12-Jan-2021303 87

meson.buildH A D03-May-202225.5 KiB712609

README

1JavaScript bindings for Cinnamon
2================================
3
4Based on GJS: https://wiki.gnome.org/action/show/Projects/Gjs
5
6Please do the following when reporting CJS crashes:
7===================================================
8
9If possible, provide a stack trace.
10
11Run dmesg and provide the line related to the crash, for instance:
12
13[ 4947.459104] cinnamon[2868]: segfault at 7f2611ffffe8 ip 00007f2667dda305 sp 00007fffb416b9d0 error 4 in libcjs.so.0.0.0[7f2667db1000+c1000]
14
15Launch the Calculator, choose Advanced Mode and set it to Hexadecimal. Then substract the loading address (first address in brackets: 7f2667db1000) from the ip (00007f2667dda305).
16
17In the example above:
18
19ip: 00007f2667dda305
20loading address: 7f2667db1000
21
2200007f2667dda305 - 7f2667db1000 = 29305
23
24This gives us the offset. Use addr2line to see what's under it in our shared library:
25
26addr2line -e /usr/lib/libcjs.so.0.0.0 29305 -fCi
27gjs_typecheck_boxed
28
29When reporting the bug, along with the trace and the dmesg line, please report that function name (in this example gjs_typecheck_boxed).
30

README.MSVC.md

1Instructions for building GJS on Visual Studio or clang-cl
2==========================================================
3Building the GJS on Windows is now supported using Visual Studio
4versions 2017 or later with or without clang-cl in both 32-bit and
564-bit (x64) flavors, via Meson.  It should be noted that a
6recent-enough Windows SDK from Microsoft is still required if using
7clang-cl, as we will still use items from the Windows SDK.  If using
8Visual Studio, Visual Studio 2017 15.9.x or later are known to work;
9earlier versions at after Visual Studio 2017 15.6 may or may not work,
10please let us know how things went if Visual Studio 15.6, 15.7 or 15.8
11is used.
12
13Recent official binary installers of CLang (which contains clang-cl)
14from the LLVM website are known to work to build SpiderMonkey 78 and
15GJS.
16
17You will need the following items to build GJS using Visual Studio
18or clang-cl (they can be built with Visual Studio 2015 or later,
19unless otherwise noted):
20-SpiderMonkey 78.x (mozjs-78). This must be built with clang-cl as
21 the Visual Studio  compiler is no longer supported for building this.
22 Please see the below section carefully on this...
23-GObject-Introspection (G-I) 1.61.2 or later
24-GLib 2.58.x or later, (which includes GIO, GObject, and the
25 associated tools)
26-Cairo including Cairo-GObject support (Optional)
27-GTK+-3.20.x or later (Optional)
28-and anything that the above items depend on.
29
30Note again that SpiderMonkey must be built using Visual Studio with
31clang-cl, and the rest should preferably be built with Visual Studio
32or clang-cl as well.  The Visual Studio version used for building the
33other dependencies should preferably be the same across the board, or,
34if using Visual Studio 2015 or later, Visual Studio 2015 through 2019.
35
36Please also be aware that the Rust MSVC toolchains that correspond to
37the platform you are building for must also be present to build
38SpiderMonkey.  Please refer to the Rust website on how to install the
39Rust compilers and toolchains for MSVC.  This applies to clang-cl
40builds as well.
41
42Be aware that it is often hard to find a suitable source release for
43SpiderMonkey nowadays, so it may be helpful to look in
44
45ftp://ftp.gnome.org/pub/gnome/teams/releng/tarballs-needing-help/mozjs/
46
47for the suitable release series of SpiderMonkey that corresponds to
48the GJS version that is being built, as GJS depends on ESR (Extended
49Service Release, a.k.a Long-term support) releases of SpiderMonkey.
50
51You may also be able to obtain the SpiderMonkey 78.x sources via the
52FireFox (ESR) or Thunderbird 78.x sources, in $(srcroot)/js.
53
54Please do note that the build must be done carefully, in addition to the
55official instructions that are posted on the Mozilla website:
56
57https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Build_Documentation
58
59For the configuration step, you will need to run the following:
60
61(64-bit/x64 builds)
62JS_STANDALONE=1 $(mozjs_srcroot)/js/src/configure --enable-nspr-build --host=x86_64-pc-mingw32 --target=x86_64-pc-mingw32 --prefix=<some_prefix> --disable-jemalloc --with-libclang-path=<full_path_to_directory_containing_libclang_dll> --with-clang-path=<full_path_to_directory_containing_clang_exe>
63
64(32-bit builds)
65JS_STANDALONE=1 $(mozjs_srcroot)/js/src/configure --enable-nspr-build --host=i686-pc-mingw32 --target=i686-pc-mingw32 --prefix=<some_prefix> --disable-jemalloc --with-libclang-path=<full_path_to_directory_containing_libclang_dll> --with-clang-path=<full_path_to_directory_containing_clang_exe>
66
67Notice that "JS_STANDALONE=1" and "--disable-jemalloc" are absolutely required,
68otherwise GJS will not build/run correctly.  If your GJS build crashes upon
69launch, use Depedency Walker to ensure that mozjs-78.dll does not depend on
70mozglue.dll!  If it does, or if GJS fails to link with missing arena_malloc() and
71friends symbols, you have built SpiderMoney incorrectly and will need to rebuild
72SpiderMonkey (with the build options as noted above) and retry the build.
73Note in particular that a mozglue.dll should *not* be in $(builddir)/dist/bin,
74although there will be a mozglue.lib somewhere in the build tree (which, you can
75safely delete after building SpiderMonkey).  The --host=... and --target=...
76are absolutely required for all builds, as per the Mozilla's SpiderMonkey build
77instructions, as Rust is being involved here.
78
79You may want to pass in --disable-js-shell to not build the JS
80shell that comes with SpiderMonkey to save time, and perhaps
81use --with-system-nspr (instead of the --enable-nspr-build as
82above), --with-system-zlib and --with-system-icu if you know
83what you are doing and that their pkg-config files
84(or headers/LIB's) can be found directly or using configuration
85options, to further save time.
86
87After the configuration finishes successfully, you may run 'mozmake' and
88'mozmake install' as you would for a standard SpiderMonkey build.  If
89'mozmake install' does not work for you for some reason, the DLLs you
90need and js.exe (if you did not pass in --disable-js-shell) can be
91found in $(buildroot)/dist/bin (you need *all* the DLLs, make sure
92that there is no mozglue.dll, otherwise you will need to redo your
93build as noted above), and the required headers are found in
94$(buildroot)/dist/include.  Note that for PDB files and .lib files,
95you will need to search for them in $(buildroot),
96where the PDB file names match the filenames for the DLLs/EXEs in
97$(buildroot)/dist/bin, and you will need to look for the following .lib files:
98-mozjs-78.lib
99-js_static.lib (optional)
100-nspr4.lib (optional, recommended for future use, if --enable-nspr-build is used)
101-plc4.lib (optional, recommended for future use, if --enable-nspr-build is used)
102-plds4.lib (optional, recommended for future use, if --enable-nspr-build is used)
103
104You may want to put the .lib's and DLLs/EXEs into $(PREFIX)\lib and
105$(PREFIX)\bin respectively, and put the headers into
106$(PREFIX)\include\mozjs-78 for convenience.
107
108You will need to place the generated mozjs-78.pc pkg-config file into
109$(PREFIX)\lib\pkgconfig and ensure that pkg-config can find it by
110setting PKG_CONFIG_PATH.  Ensure that the 'includedir' and 'libdir'
111in there is correct, and remove the 'nspr' entry from the
112'Requires.private:' line and change
113'-include ${includedir}/mozjs-78/js/RequiredDefines.h' to
114'-FI${includedir}/mozjs-78/js/RequiredDefines.h', so that the
115mozjs-78.pc can be used correctly in Visual Studio/clang-cl builds.  You
116will also need to ensure that the existing GObject-Introspection
117installation (if used) is on the same drive where the GJS sources
118are (and therefore where the GJS build is being carried out).
119
120Since Mozilla insisted that clang-cl is to be used to build SpiderMonkey,
121note that some SpideMonkey headers might need be updated as follows, if intending
122to build without clang-cl, since there are some GCC-ish assumptions here:
123
124-Update $(includedir)/mozjs-78/js/AllocPolicy.h (after the build):
125
126Get rid of the 'JS_FRIEND_API' macro from the class
127'TempAllocPolicy : public AllocPolicyBase' (ca. lines 112 and 178),
128for the member method definitions of onOutOfMemory() and reportAllocOverflow()
129
130======================
131To carry out the build
132======================
133If using clang-cl, you will need to set *both* the environment variables CC
134and CXX to: 'clang-cl [--target=<target_triplet>]' (without the quotes); please
135see https://clang.llvm.org/docs/CrossCompilation.html on how the target triplet
136can be defined, which is used if using the cross-compilation capabilities of CLang.
137In this case, you need to ensure that 'clang-cl.exe' and 'lld-link.exe' (i.e. your
138LLVM bindir) are present in your PATH.
139
140You need to install Python 3.5.x or later, as well as the
141pkg-config tool, Meson (via pip) and Ninja.  Perform a build by doing the
142following, in an appropriate Visual Studio command prompt
143in an empty build directory:
144
145meson <path_to_gjs_sources> --buildtype=... --prefix=<some_prefix> -Dskip_dbus_tests=true
146
147(Note that -Dskip_dbus_tests=true is required for MSVC/clang-cl builds; please
148see the Meson documentation for the values accepted by buildtype)
149
150You may want to view the build options after the configuration succeeds
151by using 'meson configure'
152
153When the configuration succeeds, run:
154ninja
155
156You may choose to install the build results using 'ninja install'
157or running the 'install' project when the build succeeds.
158

README.md

1JavaScript bindings for Cinnamon
2================================
3
4Based on GJS: https://wiki.gnome.org/action/show/Projects/Gjs
5
6Please do the following when reporting CJS crashes:
7===================================================
8
9If possible, provide a stack trace.
10
11Run dmesg and provide the line related to the crash, for instance:
12
13`[ 4947.459104] cinnamon[2868]: segfault at 7f2611ffffe8 ip **00007f2667dda305** sp 00007fffb416b9d0 error 4 in libcjs.so.0.0.0[**7f2667db1000**+c1000]`
14
15Launch the Calculator, choose Advanced Mode and set it to Hexadecimal. Then substract the loading address (first address in brackets: 7f2667db1000) from the ip (00007f2667dda305).
16
17In the example above:
18
19ip: 00007f2667dda305
20loading address: 7f2667db1000
21
22`00007f2667dda305 - 7f2667db1000 = 29305`
23
24This gives us the offset. Use addr2line to see what's under it in our shared library:
25
26```
27addr2line -e /usr/lib/libcjs.so.0.0.0 29305 -fCi
28gjs_typecheck_boxed
29```
30
31When reporting the bug, along with the trace and the dmesg line, please report that function name (in this example gjs_typecheck_boxed).
32