2019-11-05 02:49:38 +03:00
|
|
|
{ fetchurl
|
2021-05-06 20:32:27 +03:00
|
|
|
, lib
|
|
|
|
, stdenv
|
2019-12-18 16:59:02 +03:00
|
|
|
, meson
|
|
|
|
, ninja
|
2021-01-19 09:50:56 +03:00
|
|
|
, pkg-config
|
2021-05-08 00:18:14 +03:00
|
|
|
, gnome
|
2019-11-05 02:49:38 +03:00
|
|
|
, gtk3
|
|
|
|
, atk
|
|
|
|
, gobject-introspection
|
2020-09-21 00:46:56 +03:00
|
|
|
, spidermonkey_78
|
2019-11-05 02:49:38 +03:00
|
|
|
, pango
|
2019-11-21 01:55:02 +03:00
|
|
|
, cairo
|
2019-11-05 02:49:38 +03:00
|
|
|
, readline
|
|
|
|
, glib
|
|
|
|
, libxml2
|
|
|
|
, dbus
|
|
|
|
, gdk-pixbuf
|
2021-03-25 15:32:53 +03:00
|
|
|
, harfbuzz
|
2019-11-05 02:49:38 +03:00
|
|
|
, makeWrapper
|
2020-06-11 00:13:08 +03:00
|
|
|
, which
|
2021-05-08 16:45:03 +03:00
|
|
|
, xvfb-run
|
2019-11-21 01:55:02 +03:00
|
|
|
, nixosTests
|
2019-11-05 02:49:38 +03:00
|
|
|
}:
|
2016-09-18 22:35:23 +03:00
|
|
|
|
2020-03-14 17:28:54 +03:00
|
|
|
let
|
|
|
|
testDeps = [
|
|
|
|
gobject-introspection # for Gio and cairo typelibs
|
2021-03-25 15:32:53 +03:00
|
|
|
gtk3 atk pango.out gdk-pixbuf harfbuzz
|
2020-03-14 17:28:54 +03:00
|
|
|
];
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "gjs";
|
2021-05-06 20:32:27 +03:00
|
|
|
version = "1.68.1";
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "installedTests" ];
|
2018-02-25 23:07:20 +03:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-21 20:00:13 +03:00
|
|
|
url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2021-05-06 20:32:27 +03:00
|
|
|
sha256 = "0w2cbfpmc6alz7z8ycchhlkn586av5y8zk2xmgwzq10i0k13xyig";
|
2018-02-25 23:07:20 +03:00
|
|
|
};
|
|
|
|
|
2021-03-25 15:32:53 +03:00
|
|
|
patches = [
|
|
|
|
# Hard-code various paths
|
|
|
|
./fix-paths.patch
|
|
|
|
|
|
|
|
# Allow installing installed tests to a separate output.
|
|
|
|
./installed-tests-path.patch
|
|
|
|
];
|
|
|
|
|
2019-11-05 02:49:38 +03:00
|
|
|
nativeBuildInputs = [
|
2019-12-18 16:59:02 +03:00
|
|
|
meson
|
|
|
|
ninja
|
2021-01-19 09:50:56 +03:00
|
|
|
pkg-config
|
2019-11-05 02:49:38 +03:00
|
|
|
makeWrapper
|
2020-06-11 00:13:08 +03:00
|
|
|
which # for locale detection
|
2019-11-21 01:55:02 +03:00
|
|
|
libxml2 # for xml-stripblanks
|
2019-11-05 02:49:38 +03:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gobject-introspection
|
2019-11-21 01:55:02 +03:00
|
|
|
cairo
|
2019-11-05 02:49:38 +03:00
|
|
|
readline
|
2020-09-21 00:46:56 +03:00
|
|
|
spidermonkey_78
|
2019-11-21 01:55:02 +03:00
|
|
|
dbus # for dbus-run-session
|
2019-11-05 02:49:38 +03:00
|
|
|
];
|
2016-09-18 22:35:23 +03:00
|
|
|
|
2020-03-14 17:28:54 +03:00
|
|
|
checkInputs = [
|
2021-05-08 16:45:03 +03:00
|
|
|
xvfb-run
|
2020-03-14 17:28:54 +03:00
|
|
|
] ++ testDeps;
|
|
|
|
|
2019-11-05 02:49:38 +03:00
|
|
|
propagatedBuildInputs = [
|
2019-11-21 01:55:02 +03:00
|
|
|
glib
|
2019-11-05 02:49:38 +03:00
|
|
|
];
|
2016-09-18 22:35:23 +03:00
|
|
|
|
2019-12-18 16:59:02 +03:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dprofiler=disabled"
|
2020-03-14 17:28:54 +03:00
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
|
|
|
];
|
|
|
|
|
2020-06-10 23:43:09 +03:00
|
|
|
doCheck = true;
|
2020-03-14 17:28:54 +03:00
|
|
|
|
2018-02-15 00:19:56 +03:00
|
|
|
postPatch = ''
|
2020-06-11 00:13:08 +03:00
|
|
|
patchShebangs build/choose-tests-locale.sh
|
2020-03-14 17:28:54 +03:00
|
|
|
substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console
|
2018-02-15 00:19:56 +03:00
|
|
|
'';
|
|
|
|
|
2020-03-14 17:28:54 +03:00
|
|
|
preCheck = ''
|
|
|
|
# Our gobject-introspection patches make the shared library paths absolute
|
|
|
|
# in the GIR files. When running tests, the library is not yet installed,
|
|
|
|
# though, so we need to replace the absolute path with a local one during build.
|
|
|
|
# We are using a symlink that will be overridden during installation.
|
2020-09-21 00:46:56 +03:00
|
|
|
mkdir -p $out/lib $installedTests/libexec/installed-tests/gjs
|
2020-03-14 17:28:54 +03:00
|
|
|
ln -s $PWD/libgjs.so.0 $out/lib/libgjs.so.0
|
2020-09-21 00:46:56 +03:00
|
|
|
ln -s $PWD/installed-tests/js/libgimarshallingtests.so $installedTests/libexec/installed-tests/gjs/libgimarshallingtests.so
|
2021-05-06 20:32:27 +03:00
|
|
|
ln -s $PWD/installed-tests/js/libgjstesttools/libgjstesttools.so $installedTests/libexec/installed-tests/gjs/libgjstesttools.so
|
2020-09-21 00:46:56 +03:00
|
|
|
ln -s $PWD/installed-tests/js/libregress.so $installedTests/libexec/installed-tests/gjs/libregress.so
|
|
|
|
ln -s $PWD/installed-tests/js/libwarnlib.so $installedTests/libexec/installed-tests/gjs/libwarnlib.so
|
2020-03-14 17:28:54 +03:00
|
|
|
'';
|
2018-02-15 00:19:56 +03:00
|
|
|
|
2020-03-14 17:28:54 +03:00
|
|
|
postInstall = ''
|
2020-09-21 00:46:56 +03:00
|
|
|
# TODO: make the glib setup hook handle moving the schemas in other outputs.
|
2020-06-10 23:43:09 +03:00
|
|
|
installedTestsSchemaDatadir="$installedTests/share/gsettings-schemas/${pname}-${version}"
|
|
|
|
mkdir -p "$installedTestsSchemaDatadir"
|
|
|
|
mv "$installedTests/share/glib-2.0" "$installedTestsSchemaDatadir"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2020-09-21 00:46:56 +03:00
|
|
|
wrapProgram "$installedTests/libexec/installed-tests/gjs/minijasmine" \
|
2020-06-10 23:43:09 +03:00
|
|
|
--prefix XDG_DATA_DIRS : "$installedTestsSchemaDatadir" \
|
2021-01-21 20:00:13 +03:00
|
|
|
--prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" testDeps}"
|
2020-03-14 17:28:54 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
xvfb-run -s '-screen 0 800x600x24' \
|
|
|
|
meson test --print-errorlogs
|
|
|
|
runHook postCheck
|
2016-09-18 22:35:23 +03:00
|
|
|
'';
|
|
|
|
|
2019-11-05 02:51:07 +03:00
|
|
|
separateDebugInfo = stdenv.isLinux;
|
|
|
|
|
2019-11-05 02:49:38 +03:00
|
|
|
passthru = {
|
2019-11-21 01:55:02 +03:00
|
|
|
tests = {
|
|
|
|
installed-tests = nixosTests.installed-tests.gjs;
|
|
|
|
};
|
|
|
|
|
2021-05-08 00:18:14 +03:00
|
|
|
updateScript = gnome.updateScript {
|
2019-11-05 02:49:38 +03:00
|
|
|
packageName = "gjs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-21 20:00:13 +03:00
|
|
|
meta = with lib; {
|
2018-02-14 23:28:44 +03:00
|
|
|
description = "JavaScript bindings for GNOME";
|
2019-11-05 02:49:38 +03:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md";
|
|
|
|
license = licenses.lgpl2Plus;
|
2020-04-01 15:40:51 +03:00
|
|
|
maintainers = teams.gnome.members;
|
2016-09-18 22:35:23 +03:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|