summary refs log tree commit diff
diff options
context:
space:
mode:
authorSebastián Mancilla <smancill@smancill.dev>2023-05-21 19:28:57 -0400
committerSebastián Mancilla <smancill@smancill.dev>2023-05-21 22:34:00 -0400
commitc812170c74f4cb21a5794eead6205edd0058b8db (patch)
treea25209a563229c0d6c3cf375056ef228e2886e21
parent273b32abe2565301552f0874c97ea954a8db67c9 (diff)
downloadnixpkgs-c812170c74f4cb21a5794eead6205edd0058b8db.tar
nixpkgs-c812170c74f4cb21a5794eead6205edd0058b8db.tar.gz
nixpkgs-c812170c74f4cb21a5794eead6205edd0058b8db.tar.bz2
nixpkgs-c812170c74f4cb21a5794eead6205edd0058b8db.tar.lz
nixpkgs-c812170c74f4cb21a5794eead6205edd0058b8db.tar.xz
nixpkgs-c812170c74f4cb21a5794eead6205edd0058b8db.tar.zst
nixpkgs-c812170c74f4cb21a5794eead6205edd0058b8db.zip
shogun: refactor derivation
-rw-r--r--pkgs/applications/science/machine-learning/shogun/default.nix32
1 files changed, 18 insertions, 14 deletions
diff --git a/pkgs/applications/science/machine-learning/shogun/default.nix b/pkgs/applications/science/machine-learning/shogun/default.nix
index c7209d00af5..60b5a4948d3 100644
--- a/pkgs/applications/science/machine-learning/shogun/default.nix
+++ b/pkgs/applications/science/machine-learning/shogun/default.nix
@@ -50,21 +50,21 @@ let
 
   srcs = {
     toolbox = fetchFromGitHub {
-      owner = pname + "-toolbox";
-      repo = pname;
-      rev = pname + "_" + version;
-      sha256 = "05s9dclmk7x5d7wnnj4qr6r6c827m72a44gizcv09lxr28pr9inz";
+      owner = "shogun-toolbox";
+      repo = "shogun";
+      rev =  "shogun_${version}";
+      sha256 = "sha256-38aULxK50wQ2+/ERosSpRyBmssmYSGv5aaWfWSlrSRc=";
       fetchSubmodules = true;
     };
 
     # The CMake external projects expect the packed archives
     rxcpp = fetchurl {
       url = "https://github.com/Reactive-Extensions/RxCpp/archive/v${rxcppVersion}.tar.gz";
-      sha256 = "0y2isr8dy2n1yjr9c5570kpc9lvdlch6jv0jvw000amwn5d3krsh";
+      sha256 = "sha256-UOc5WrG8KgAA3xJsaSCjbdPE7gSnFJay9MEK31DWUXg=";
     };
     gtest = fetchurl {
       url = "https://github.com/google/googletest/archive/release-${gtestVersion}.tar.gz";
-      sha256 = "1n5p1m2m3fjrjdj752lf92f9wq3pl5cbsfrb49jqbg52ghkz99jq";
+      sha256 = "sha256-WKb0J3yivIVlIis7vVihd2CenEiOinJkk1m6UUUNt9g=";
     };
   };
 in
@@ -77,13 +77,6 @@ stdenv.mkDerivation rec {
   src = srcs.toolbox;
 
   patches = [
-    # Fix compile errors with json-c
-    # https://github.com/shogun-toolbox/shogun/pull/4104
-    (fetchpatch {
-      url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
-      sha256 = "158hqv4xzw648pmjbwrhxjp7qcppqa7kvriif87gn3zdn711c49s";
-    })
-
     # Fix compile errors with GCC 9+
     # https://github.com/shogun-toolbox/shogun/pull/4811
     (fetchpatch {
@@ -95,6 +88,13 @@ stdenv.mkDerivation rec {
       sha256 = "sha256-AgJJKQA8vc5oKaTQDqMdwBR4hT4sn9+uW0jLe7GteJw=";
     })
 
+    # Fix compile errors with json-c
+    # https://github.com/shogun-toolbox/shogun/pull/4104
+    (fetchpatch {
+      url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
+      sha256 = "sha256-OhEWwrHtD/sOcjHmPY/C9zJ8ruww8yXrRcTw38nGEJU=";
+    })
+
     # Fix compile errors with Eigen 3.4
     ./eigen-3.4.patch
 
@@ -126,6 +126,10 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = let
     enableIf = cond: if cond then "ON" else "OFF";
+    excludeTestsRegex = lib.concatStringsSep "|" [
+      # sporadic segfault
+      "TrainedModelSerialization"
+    ];
   in [
     "-DBUILD_META_EXAMPLES=ON"
     "-DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON"
@@ -134,7 +138,7 @@ stdenv.mkDerivation rec {
     "-DCMAKE_DISABLE_FIND_PACKAGE_Mosek=ON"
     "-DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=ON"
     "-DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=ON"
-    "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;TrainedModelSerialization'"  # Sporadic segfault
+    "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;'${excludeTestsRegex}'"
     "-DENABLE_TESTING=${enableIf doCheck}"
     "-DDISABLE_META_INTEGRATION_TESTS=ON"
     "-DTRAVIS_DISABLE_META_CPP=ON"