about summary refs log tree commit diff
path: root/pkgs/development/libraries/gjs
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2023-12-25 21:16:44 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2024-01-08 23:54:40 +0100
commit945a05f5ab1030ec5519113d6c68af56c60aca15 (patch)
treefdefe7177b4a5b41528a653c7b48d3398c167094 /pkgs/development/libraries/gjs
parentbc85b737c58974e2ea1bf3cacaee205cb521f0d1 (diff)
gjs: add option to avoid installing tests to avoid dependency on gtk3
Diffstat (limited to 'pkgs/development/libraries/gjs')
-rw-r--r--pkgs/development/libraries/gjs/default.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/pkgs/development/libraries/gjs/default.nix b/pkgs/development/libraries/gjs/default.nix
index edcb29f3ccb71..ae0730873b8e5 100644
--- a/pkgs/development/libraries/gjs/default.nix
+++ b/pkgs/development/libraries/gjs/default.nix
@@ -23,20 +23,21 @@
 , which
 , xvfb-run
 , nixosTests
+, installTests ? true
 }:
 
 let
   testDeps = [
     gtk3 atk pango.out gdk-pixbuf harfbuzz
   ];
-in stdenv.mkDerivation rec {
+in stdenv.mkDerivation (finalAttrs: {
   pname = "gjs";
   version = "1.78.0";
 
   outputs = [ "out" "dev" "installedTests" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor finalAttrs.version}/gjs-${finalAttrs.version}.tar.xz";
     sha256 = "sha256-+6og4JF2aIMIAPkpUWiPn8CPASlq/9XNtLNfdQvifck=";
   };
 
@@ -107,12 +108,12 @@ in stdenv.mkDerivation rec {
 
   postInstall = ''
     # TODO: make the glib setup hook handle moving the schemas in other outputs.
-    installedTestsSchemaDatadir="$installedTests/share/gsettings-schemas/${pname}-${version}"
+    installedTestsSchemaDatadir="$installedTests/share/gsettings-schemas/gjs-${finalAttrs.version}"
     mkdir -p "$installedTestsSchemaDatadir"
     mv "$installedTests/share/glib-2.0" "$installedTestsSchemaDatadir"
   '';
 
-  postFixup = ''
+  postFixup = lib.optionalString installTests ''
     wrapProgram "$installedTests/libexec/installed-tests/gjs/minijasmine" \
       --prefix XDG_DATA_DIRS : "$installedTestsSchemaDatadir" \
       --prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" testDeps}"
@@ -145,4 +146,4 @@ in stdenv.mkDerivation rec {
     maintainers = teams.gnome.members;
     platforms = platforms.unix;
   };
-}
+})