about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/tracker
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/libraries/tracker
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/tracker')
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker/default.nix79
1 files changed, 48 insertions, 31 deletions
diff --git a/nixpkgs/pkgs/development/libraries/tracker/default.nix b/nixpkgs/pkgs/development/libraries/tracker/default.nix
index 5cb3dc73daa8..e8d6ed82ed00 100644
--- a/nixpkgs/pkgs/development/libraries/tracker/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tracker/default.nix
@@ -25,19 +25,28 @@
 , json-glib
 , systemd
 , dbus
+, writeText
 }:
 
 stdenv.mkDerivation rec {
   pname = "tracker";
-  version = "3.3.0";
+  version = "3.3.2";
 
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "Bwb5b+f5XfQqzsgSwd57RZOg1kgyHKg1BqnXHiJBe9o=";
+    sha256 = "DtK5iRiVbW8WQpxgfdihTIT02gpIlw/S64yTq6PPmRM=";
   };
 
+  postPatch = ''
+    patchShebangs utils/data-generators/cc/generate
+  '';
+
+  depsBuildBuild = [
+    pkg-config
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
@@ -50,13 +59,11 @@ stdenv.mkDerivation rec {
     gobject-introspection
     docbook-xsl-nons
     docbook_xml_dtd_45
-    python3 # for data-generators
-    systemd # used for checks to install systemd user service
-    dbus # used for checks and pkg-config to install dbus service/s
-  ] ++ checkInputs; # gi is in the main meson.build and checked regardless of
-                    # whether tests are enabled
+    (python3.pythonForBuild.withPackages (p: [ p.pygobject3 ]))
+  ];
 
   buildInputs = [
+    gobject-introspection
     glib
     libxml2
     sqlite
@@ -66,37 +73,47 @@ stdenv.mkDerivation rec {
     libuuid
     json-glib
     libstemmer
-  ];
-
-  checkInputs = with python3.pkgs; [
-    pygobject3
+    dbus
+  ] ++ lib.optionals stdenv.isLinux [
+    systemd
   ];
 
   mesonFlags = [
     "-Ddocs=true"
+  ] ++ (
+    let
+      # https://gitlab.gnome.org/GNOME/tracker/-/blob/master/meson.build#L159
+      crossFile = writeText "cross-file.conf" ''
+        [properties]
+        sqlite3_has_fts5 = '${lib.boolToString (lib.hasInfix "-DSQLITE_ENABLE_FTS3" sqlite.NIX_CFLAGS_COMPILE)}'
+      '';
+    in
+    [
+      "--cross-file=${crossFile}"
+    ]
+  ) ++ lib.optionals (!stdenv.isLinux) [
+    "-Dsystemd_user_services=false"
   ];
 
   doCheck = true;
 
-  postPatch = ''
-    patchShebangs utils/g-ir-merge/g-ir-merge
-    patchShebangs utils/data-generators/cc/generate
-    patchShebangs tests/functional-tests/test-runner.sh.in
-    patchShebangs tests/functional-tests/*.py
-    patchShebangs examples/python/endpoint.py
-  '';
-
-  preCheck = ''
-    # (tracker-store:6194): Tracker-CRITICAL **: 09:34:07.722: Cannot initialize database: Could not open sqlite3 database:'/homeless-shelter/.cache/tracker/meta.db': unable to open database file
-    export HOME=$(mktemp -d)
-
-    # Our gobject-introspection patches make the shared library paths absolute
-    # in the GIR files. When running functional 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
-    ln -s $PWD/src/libtracker-sparql/libtracker-sparql-3.0.so $out/lib/libtracker-sparql-3.0.so.0
-  '';
+  preCheck =
+    let
+      linuxDot0 = lib.optionalString stdenv.isLinux ".0";
+      darwinDot0 = lib.optionalString stdenv.isDarwin ".0";
+      extension = stdenv.hostPlatform.extensions.sharedLibrary;
+    in
+    ''
+      # (tracker-store:6194): Tracker-CRITICAL **: 09:34:07.722: Cannot initialize database: Could not open sqlite3 database:'/homeless-shelter/.cache/tracker/meta.db': unable to open database file
+      export HOME=$(mktemp -d)
+
+      # Our gobject-introspection patches make the shared library paths absolute
+      # in the GIR files. When running functional 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
+      ln -s $PWD/src/libtracker-sparql/libtracker-sparql-3.0${darwinDot0}${extension} $out/lib/libtracker-sparql-3.0${darwinDot0}${extension}${linuxDot0}
+    '';
 
   checkPhase = ''
     runHook preCheck
@@ -126,6 +143,6 @@ stdenv.mkDerivation rec {
     description = "Desktop-neutral user information store, search tool and indexer";
     maintainers = teams.gnome.members;
     license = licenses.gpl2Plus;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }