2019-11-05 00:49:38 +01:00
|
|
|
{ fetchurl
|
2020-03-14 15:28:54 +01:00
|
|
|
, fetchpatch
|
2019-11-05 00:49:38 +01:00
|
|
|
, stdenv
|
2019-12-18 14:59:02 +01:00
|
|
|
, meson
|
|
|
|
, ninja
|
2019-11-05 00:49:38 +01:00
|
|
|
, pkgconfig
|
|
|
|
, gnome3
|
|
|
|
, gtk3
|
|
|
|
, atk
|
|
|
|
, gobject-introspection
|
2019-12-18 14:59:02 +01:00
|
|
|
, spidermonkey_68
|
2019-11-05 00:49:38 +01:00
|
|
|
, pango
|
2019-11-20 23:55:02 +01:00
|
|
|
, cairo
|
2019-11-05 00:49:38 +01:00
|
|
|
, readline
|
|
|
|
, glib
|
|
|
|
, libxml2
|
|
|
|
, dbus
|
|
|
|
, gdk-pixbuf
|
|
|
|
, makeWrapper
|
2020-06-10 23:13:08 +02:00
|
|
|
, which
|
2020-03-14 15:28:54 +01:00
|
|
|
, xvfb_run
|
2019-11-20 23:55:02 +01:00
|
|
|
, nixosTests
|
2019-11-05 00:49:38 +01:00
|
|
|
}:
|
2016-09-18 21:35:23 +02:00
|
|
|
|
2020-03-14 15:28:54 +01:00
|
|
|
let
|
|
|
|
testDeps = [
|
|
|
|
gobject-introspection # for Gio and cairo typelibs
|
|
|
|
gtk3 atk pango.out gdk-pixbuf
|
|
|
|
];
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gjs";
|
2020-07-09 09:05:17 +02:00
|
|
|
version = "1.64.4";
|
2018-02-25 21:07:20 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "mirror://gnome/sources/gjs/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2020-07-09 09:05:17 +02:00
|
|
|
sha256 = "0k6l2qc2vkws34zrgdhl57qxf0jjkar2iziz6qn4n1w7va73mk53";
|
2018-02-25 21:07:20 +01:00
|
|
|
};
|
|
|
|
|
2019-11-20 23:55:02 +01:00
|
|
|
outputs = [ "out" "dev" "installedTests" ];
|
2018-02-14 22:19:56 +01:00
|
|
|
|
2019-11-05 00:49:38 +01:00
|
|
|
nativeBuildInputs = [
|
2019-12-18 14:59:02 +01:00
|
|
|
meson
|
|
|
|
ninja
|
2019-11-05 00:49:38 +01:00
|
|
|
pkgconfig
|
|
|
|
makeWrapper
|
2020-06-10 23:13:08 +02:00
|
|
|
which # for locale detection
|
2019-11-20 23:55:02 +01:00
|
|
|
libxml2 # for xml-stripblanks
|
2019-11-05 00:49:38 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gobject-introspection
|
2019-11-20 23:55:02 +01:00
|
|
|
cairo
|
2019-11-05 00:49:38 +01:00
|
|
|
readline
|
2019-12-18 14:59:02 +01:00
|
|
|
spidermonkey_68
|
2019-11-20 23:55:02 +01:00
|
|
|
dbus # for dbus-run-session
|
2019-11-05 00:49:38 +01:00
|
|
|
];
|
2016-09-18 21:35:23 +02:00
|
|
|
|
2020-03-14 15:28:54 +01:00
|
|
|
checkInputs = [
|
|
|
|
xvfb_run
|
|
|
|
] ++ testDeps;
|
|
|
|
|
2019-11-05 00:49:38 +01:00
|
|
|
propagatedBuildInputs = [
|
2019-11-20 23:55:02 +01:00
|
|
|
glib
|
2019-11-05 00:49:38 +01:00
|
|
|
];
|
2016-09-18 21:35:23 +02:00
|
|
|
|
2019-12-18 14:59:02 +01:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dprofiler=disabled"
|
2020-03-14 15:28:54 +01:00
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Hard-code various paths
|
|
|
|
./fix-paths.patch
|
|
|
|
|
|
|
|
# Allow installing installed tests to a separate output.
|
|
|
|
./installed-tests-path.patch
|
2018-02-14 22:19:56 +01:00
|
|
|
];
|
|
|
|
|
2020-06-10 22:43:09 +02:00
|
|
|
doCheck = true;
|
2020-03-14 15:28:54 +01:00
|
|
|
|
2018-02-14 22:19:56 +01:00
|
|
|
postPatch = ''
|
2020-06-10 23:13:08 +02:00
|
|
|
patchShebangs build/choose-tests-locale.sh
|
2020-03-14 15:28:54 +01:00
|
|
|
substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console
|
2018-02-14 22:19:56 +01:00
|
|
|
'';
|
|
|
|
|
2020-03-14 15:28:54 +01: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.
|
|
|
|
mkdir -p $out/lib $installedTests/libexec/gjs/installed-tests
|
|
|
|
ln -s $PWD/libgjs.so.0 $out/lib/libgjs.so.0
|
|
|
|
ln -s $PWD/installed-tests/js/libgimarshallingtests.so $installedTests/libexec/gjs/installed-tests/libgimarshallingtests.so
|
|
|
|
ln -s $PWD/installed-tests/js/libregress.so $installedTests/libexec/gjs/installed-tests/libregress.so
|
|
|
|
ln -s $PWD/installed-tests/js/libwarnlib.so $installedTests/libexec/gjs/installed-tests/libwarnlib.so
|
|
|
|
'';
|
2018-02-14 22:19:56 +01:00
|
|
|
|
2020-03-14 15:28:54 +01:00
|
|
|
postInstall = ''
|
2020-06-10 22:43:09 +02:00
|
|
|
# TODO: make the glib setup hook handle this
|
|
|
|
installedTestsSchemaDatadir="$installedTests/share/gsettings-schemas/${pname}-${version}"
|
|
|
|
mkdir -p "$installedTestsSchemaDatadir"
|
|
|
|
mv "$installedTests/share/glib-2.0" "$installedTestsSchemaDatadir"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2018-02-14 22:19:56 +01:00
|
|
|
wrapProgram "$installedTests/libexec/gjs/installed-tests/minijasmine" \
|
2020-06-10 22:43:09 +02:00
|
|
|
--prefix XDG_DATA_DIRS : "$installedTestsSchemaDatadir" \
|
2020-03-14 15:28:54 +01:00
|
|
|
--prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" testDeps}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
xvfb-run -s '-screen 0 800x600x24' \
|
|
|
|
meson test --print-errorlogs
|
|
|
|
runHook postCheck
|
2016-09-18 21:35:23 +02:00
|
|
|
'';
|
|
|
|
|
2019-11-05 00:51:07 +01:00
|
|
|
separateDebugInfo = stdenv.isLinux;
|
|
|
|
|
2019-11-05 00:49:38 +01:00
|
|
|
passthru = {
|
2019-11-20 23:55:02 +01:00
|
|
|
tests = {
|
|
|
|
installed-tests = nixosTests.installed-tests.gjs;
|
|
|
|
};
|
|
|
|
|
2019-11-05 00:49:38 +01:00
|
|
|
updateScript = gnome3.updateScript {
|
|
|
|
packageName = "gjs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-09-18 21:35:23 +02:00
|
|
|
meta = with stdenv.lib; {
|
2018-02-14 21:28:44 +01:00
|
|
|
description = "JavaScript bindings for GNOME";
|
2019-11-05 00:49:38 +01:00
|
|
|
homepage = "https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md";
|
|
|
|
license = licenses.lgpl2Plus;
|
2020-04-01 14:40:51 +02:00
|
|
|
maintainers = teams.gnome.members;
|
2016-09-18 21:35:23 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|