Skip to content

Commit

Permalink
gjs: clean up
Browse files Browse the repository at this point in the history
* Do not propagate spidermonkey, it is only needed gjs to link against.
* Split out dev output, any propagated dependencies should go there.
* Drop unnecessary sed, the readline thing is no longer there.
* Add passthru.tests to allow running installed tests easily.
* Drop pango from buildInputs, we only need it as a transitive dependency of gtk3 for installed tests; gjs actually depends on cairo.
* Move libxml2 to nativeBuildInputs, it is called by glib-compile-resources when xml-stripblanks preprocessing is used.
* Propagate glib, as it is in Requires in the pc file.

It is just 2.5 MB closure reduction but every megabyte counts.
  • Loading branch information
jtojnar committed Nov 21, 2019
1 parent e89b215 commit 201c1d3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions pkgs/development/libraries/gjs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
, gobject-introspection
, spidermonkey_60
, pango
, cairo
, readline
, glib
, libxml2
, dbus
, gdk-pixbuf
, makeWrapper
, nixosTests
}:

stdenv.mkDerivation rec {
Expand All @@ -24,24 +26,24 @@ stdenv.mkDerivation rec {
sha256 = "1xf68rbagkflb9yi3visfw8cbxqlzd717y8jakgw0y6whzm1dpxl";
};

outputs = [ "out" "installedTests" ];
outputs = [ "out" "dev" "installedTests" ];

nativeBuildInputs = [
pkgconfig
makeWrapper
libxml2 # for xml-stripblanks
];

buildInputs = [
libxml2
gobject-introspection
glib
pango
cairo
readline
dbus
spidermonkey_60
dbus # for dbus-run-session
];

propagatedBuildInputs = [
spidermonkey_60
glib
];

configureFlags = [
Expand All @@ -55,8 +57,6 @@ stdenv.mkDerivation rec {
'';

postInstall = ''
sed 's|-lreadline|-L${readline.out}/lib -lreadline|g' -i $out/lib/libgjs.la
moveToOutput "share/installed-tests" "$installedTests"
moveToOutput "libexec/gjs/installed-tests" "$installedTests"
Expand All @@ -67,6 +67,10 @@ stdenv.mkDerivation rec {
separateDebugInfo = stdenv.isLinux;

passthru = {
tests = {
installed-tests = nixosTests.installed-tests.gjs;
};

updateScript = gnome3.updateScript {
packageName = "gjs";
};
Expand Down

0 comments on commit 201c1d3

Please sign in to comment.