summary refs log tree commit diff
path: root/pkgs/development/libraries/gaia
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2019-10-04 10:13:42 +0300
committerDoron Behar <doron.behar@gmail.com>2019-10-04 11:26:38 +0300
commite86ef91b58d23d28c327b59c9ed4b6041bd8c9cb (patch)
tree39a060a58d42a009ba001de25392c6d45dbbcfe9 /pkgs/development/libraries/gaia
parentea5d2a0efa6938aa586688918f3c72d377855007 (diff)
downloadnixpkgs-e86ef91b58d23d28c327b59c9ed4b6041bd8c9cb.tar
nixpkgs-e86ef91b58d23d28c327b59c9ed4b6041bd8c9cb.tar.gz
nixpkgs-e86ef91b58d23d28c327b59c9ed4b6041bd8c9cb.tar.bz2
nixpkgs-e86ef91b58d23d28c327b59c9ed4b6041bd8c9cb.tar.lz
nixpkgs-e86ef91b58d23d28c327b59c9ed4b6041bd8c9cb.tar.xz
nixpkgs-e86ef91b58d23d28c327b59c9ed4b6041bd8c9cb.tar.zst
nixpkgs-e86ef91b58d23d28c327b59c9ed4b6041bd8c9cb.zip
gaia: init at 2.4.5
Diffstat (limited to 'pkgs/development/libraries/gaia')
-rw-r--r--pkgs/development/libraries/gaia/default.nix81
1 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/development/libraries/gaia/default.nix b/pkgs/development/libraries/gaia/default.nix
new file mode 100644
index 00000000000..d35feb62158
--- /dev/null
+++ b/pkgs/development/libraries/gaia/default.nix
@@ -0,0 +1,81 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, libyaml
+, swig
+, pkgconfig
+, wafHook
+, makeWrapper
+, qt4
+, python
+, pythonSupport ? true
+# Default to false since it brakes the build
+, stlfacadeSupport ? false
+, assertsSupport ? true
+, cyclopsSupport ? true
+}:
+
+assert pythonSupport -> python != null;
+
+stdenv.mkDerivation rec {
+  pname = "gaia";
+  version = "2.4.5";
+
+  src = fetchFromGitHub {
+    owner = "MTG";
+    repo = "gaia";
+    rev = "v${version}";
+    sha256 = "12jxb354s2dblr2ghnl3w05m23jgzvrrgywfj8jaa32j3gw48fv2";
+  };
+
+  # Fix installation error when waf tries to put files in /etc/
+  prePatch = ''
+  '' + lib.optionalString cyclopsSupport ''
+    substituteInPlace src/wscript \
+      --replace "/etc/cyclops" "$out/etc/cyclops" \
+      --replace "/etc/init.d" "$out/etc/init.d"
+  '';
+
+  # This is not exactly specified in upstream's README but it's needed by the
+  # resultings $out/bin/gaiafusion script
+  pythonEnv = (if pythonSupport then
+    python.withPackages(ps: with ps; [
+      pyyaml
+    ])
+  else null);
+
+  nativeBuildInputs = [
+    wafHook
+    pkgconfig
+    swig
+    makeWrapper
+  ];
+  buildInputs = [
+    libyaml
+    qt4
+  ]
+    ++ lib.optionals (pythonSupport) [
+      pythonEnv
+    ]
+  ;
+  wafConfigureFlags = [
+  ]
+    ++ lib.optionals (pythonSupport) [ "--with-python-bindings" ]
+    ++ lib.optionals (stlfacadeSupport) [ "--with-stlfacade" ]
+    ++ lib.optionals (assertsSupport) [ "--with-asserts" ]
+    ++ lib.optionals (cyclopsSupport) [ "--with-cyclops" ]
+  ;
+  # only gaiafusion is a python executable that needs patchShebangs
+  postInstall = (if pythonSupport then ''
+    # We can't use patchShebangs because it will use bare bones $python/bin/python
+    # and we need a python environment with pyyaml
+    wrapProgram $out/bin/gaiafusion --prefix PYTHONPATH : $out/${python.sitePackages}:${pythonEnv}/${python.sitePackages}
+  '' else "");
+
+  meta = with lib; {
+    homepage = "https://github.com/MTG/gaia";
+    description = "C++ library with python bindings which implements similarity measures and classifications on the results of audio analysis, and generates classification models that Essentia can use to compute high-level description of music";
+    maintainers = with maintainers; [ doronbehar ];
+    license = licenses.agpl3;
+  };
+}