12 gobject-introspection,
40 stdenv.mkDerivation (finalAttrs: {
51 url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor finalAttrs.version}/gjs-${finalAttrs.version}.tar.xz";
52 hash = "sha256-+zmqVjZXbeDloRcfVqGlgl4r0aaZcvsSC6eL0Qm1aTw=";
56 # Hard-code various paths
59 # Allow installing installed tests to a separate output.
60 ./installed-tests-path.patch
62 # Disable introspection test in installed tests
63 # (minijasmine:1317): GLib-GIO-WARNING **: 17:33:39.556: Error creating IO channel for /proc/self/mountinfo: No such file or directory (g-io-error-quark, 1)
64 ./disable-introspection-test.patch
73 which # for locale detection
74 libxml2 # for xml-stripblanks
75 dbus # for dbus-run-session
78 ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
93 propagatedBuildInputs = [
99 "-Dinstalled_test_prefix=${placeholder "installedTests"}"
101 ++ lib.optionals (!stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isMusl) [
102 "-Dprofiler=disabled"
105 doCheck = !stdenv.hostPlatform.isDarwin;
109 patchShebangs build/choose-tests-locale.sh
110 substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console
112 + lib.optionalString stdenv.hostPlatform.isMusl ''
113 substituteInPlace installed-tests/js/meson.build \
114 --replace "'Encoding'," "#'Encoding',"
118 # Our gobject-introspection patches make the shared library paths absolute
119 # in the GIR files. When running tests, the library is not yet installed,
120 # though, so we need to replace the absolute path with a local one during build.
121 # We are using a symlink that will be overridden during installation.
122 mkdir -p $out/lib $installedTests/libexec/installed-tests/gjs
123 ln -s $PWD/libgjs.so.0 $out/lib/libgjs.so.0
124 ln -s $PWD/subprojects/gobject-introspection-tests/libgimarshallingtests.so $installedTests/libexec/installed-tests/gjs/libgimarshallingtests.so
125 ln -s $PWD/subprojects/gobject-introspection-tests/libregress.so $installedTests/libexec/installed-tests/gjs/libregress.so
126 ln -s $PWD/subprojects/gobject-introspection-tests/libwarnlib.so $installedTests/libexec/installed-tests/gjs/libwarnlib.so
127 ln -s $PWD/installed-tests/js/libgjstesttools/libgjstesttools.so $installedTests/libexec/installed-tests/gjs/libgjstesttools.so
131 # TODO: make the glib setup hook handle moving the schemas in other outputs.
132 installedTestsSchemaDatadir="$installedTests/share/gsettings-schemas/gjs-${finalAttrs.version}"
133 mkdir -p "$installedTestsSchemaDatadir"
134 mv "$installedTests/share/glib-2.0" "$installedTestsSchemaDatadir"
137 postFixup = lib.optionalString installTests ''
138 wrapProgram "$installedTests/libexec/installed-tests/gjs/minijasmine" \
139 --prefix XDG_DATA_DIRS : "$installedTestsSchemaDatadir" \
140 --prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" testDeps}"
145 xvfb-run -s '-screen 0 800x600x24' \
146 meson test --print-errorlogs
150 separateDebugInfo = stdenv.hostPlatform.isLinux;
154 installed-tests = nixosTests.installed-tests.gjs;
157 updateScript = gnome.updateScript {
159 versionPolicy = "odd-unstable";
164 description = "JavaScript bindings for GNOME";
165 homepage = "https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md";
166 license = licenses.lgpl2Plus;
168 maintainers = teams.gnome.members;
169 platforms = platforms.unix;