11 , gobject-introspection
30 gtk3 atk pango.out gdk-pixbuf harfbuzz
32 in stdenv.mkDerivation rec {
36 outputs = [ "out" "dev" "installedTests" ];
39 url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
40 sha256 = "sha256-99jJ1lPqb9eK/kpQcg4EaqK/wHj9pjXdEwZ90ZnGJdQ=";
44 # Hard-code various paths
47 # Allow installing installed tests to a separate output.
48 ./installed-tests-path.patch
56 which # for locale detection
57 libxml2 # for xml-stripblanks
58 dbus # for dbus-run-session
60 ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
75 propagatedBuildInputs = [
80 "-Dinstalled_test_prefix=${placeholder "installedTests"}"
81 ] ++ lib.optionals (!stdenv.isLinux || stdenv.hostPlatform.isMusl) [
85 doCheck = !stdenv.isDarwin;
88 patchShebangs build/choose-tests-locale.sh
89 substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console
90 '' + lib.optionalString stdenv.hostPlatform.isMusl ''
91 substituteInPlace installed-tests/js/meson.build \
92 --replace "'Encoding'," "#'Encoding',"
96 # Our gobject-introspection patches make the shared library paths absolute
97 # in the GIR files. When running tests, the library is not yet installed,
98 # though, so we need to replace the absolute path with a local one during build.
99 # We are using a symlink that will be overridden during installation.
100 mkdir -p $out/lib $installedTests/libexec/installed-tests/gjs
101 ln -s $PWD/libgjs.so.0 $out/lib/libgjs.so.0
102 ln -s $PWD/installed-tests/js/libgimarshallingtests.so $installedTests/libexec/installed-tests/gjs/libgimarshallingtests.so
103 ln -s $PWD/installed-tests/js/libgjstesttools/libgjstesttools.so $installedTests/libexec/installed-tests/gjs/libgjstesttools.so
104 ln -s $PWD/installed-tests/js/libregress.so $installedTests/libexec/installed-tests/gjs/libregress.so
105 ln -s $PWD/installed-tests/js/libwarnlib.so $installedTests/libexec/installed-tests/gjs/libwarnlib.so
109 # TODO: make the glib setup hook handle moving the schemas in other outputs.
110 installedTestsSchemaDatadir="$installedTests/share/gsettings-schemas/${pname}-${version}"
111 mkdir -p "$installedTestsSchemaDatadir"
112 mv "$installedTests/share/glib-2.0" "$installedTestsSchemaDatadir"
116 wrapProgram "$installedTests/libexec/installed-tests/gjs/minijasmine" \
117 --prefix XDG_DATA_DIRS : "$installedTestsSchemaDatadir" \
118 --prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" testDeps}"
123 xvfb-run -s '-screen 0 800x600x24' \
124 meson test --print-errorlogs
128 separateDebugInfo = stdenv.isLinux;
132 installed-tests = nixosTests.installed-tests.gjs;
135 updateScript = gnome.updateScript {
137 versionPolicy = "odd-unstable";
142 description = "JavaScript bindings for GNOME";
143 homepage = "https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md";
144 license = licenses.lgpl2Plus;
145 maintainers = teams.gnome.members;
146 platforms = platforms.unix;