Code change:
in stdenv.mkDerivation rec { inherit pname version; <del> src = srcs.toolbox; postUnpack = '' mkdir -p $sourceRoot/third_party/{rxcpp,gtest} ln -s ${srcs.rxcpp} $sourceRoot/third_party/rxcpp/v${rxcppVersion}.tar.gz ln -s ${srcs.gtest} $sourceRoot/third_party/gtest/release-${gtestVersion}.tar.gz ''; </del> <ins> outputs = [ "out" "dev" "doc" ]; </ins> <del> # broken doCheck = false; </del> <ins> src = srcs.toolbox; </ins> patches = [ <ins> # Fix compile errors with json-c # https://github.com/shogun-toolbox/shogun/pull/4104 </ins> (fetchpatch { <del> url = "https://github.com/awild82/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch"; </del> <ins> url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch"; </ins> sha256 = "158hqv4xzw648pmjbwrhxjp7qcppqa7kvriif87gn3zdn711c49s"; }) <ins> # Fix compile errors with GCC 9+ # https://github.com/shogun-toolbox/shogun/pull/4811 (fetchpatch { url = "https://github.com/shogun-toolbox/shogun/commit/c8b670be4790e0f06804b048a6f3d77c17c3ee95.patch"; sha256 = "sha256-MxsR3Y2noFQevfqWK3nmX5iK4OVWeKBl5tfeDNgjcXk="; }) (fetchpatch { url = "https://github.com/shogun-toolbox/shogun/commit/5aceefd9fb0e2132c354b9a0c0ceb9160cc9b2f7.patch"; sha256 = "sha256-AgJJKQA8vc5oKaTQDqMdwBR4hT4sn9+uW0jLe7GteJw="; }) # Fix compile errors with Eigen 3.4 ./eigen-3.4.patch </ins> ] ++ lib.optional (!withSvmLight) ./svmlight-scrubber.patch; <del> CCACHE_DISABLE="1"; CCACHE_DIR=".ccache"; nativeBuildInputs = [ cmake ]; buildInputs = with lib; [ blas lapack bzip2 colpack curl ctags eigen hdf5 json_c lp_solve xz lzo protobuf nlopt snappy swig (libarchive.dev) libxml2 lapack glpk ] ++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ]) ++ optional  (opencvSupport) opencv; NIX_CFLAGS_COMPILE="-faligned-new"; cmakeFlags = let onOff = b: if b then "ON" else "OFF"; flag = n: b: "-D"+n+"="+onOff b; in with lib; [ (flag "ENABLE_TESTING" doCheck) (flag "BUILD_META_EXAMPLES" doCheck) (flag "CMAKE_VERBOSE_MAKEFILE:BOOL" doCheck) (flag "PythonModular" pythonSupport) (flag "OpenCV" opencvSupport) (flag "USE_SVMLIGHT" withSvmLight) </del> <ins> nativeBuildInputs = [ cmake swig ctags ] ++ (with pythonPackages; [ python jinja2 ply ]); buildInputs = [ eigen blas lapack glpk protobuf json_c libxml2 hdf5 curl libarchive bzip2 xz snappy lzo nlopt lp_solve colpack ] ++ lib.optionals pythonSupport (with pythonPackages; [ python numpy ]) ++ lib.optional opencvSupport opencv; cmakeFlags = let enableIf = cond: if cond then "ON" else "OFF"; in [ "-DBUILD_META_EXAMPLES=ON" "-DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON" "-DCMAKE_DISABLE_FIND_PACKAGE_ARPREC=ON" "-DCMAKE_DISABLE_FIND_PACKAGE_CPLEX=ON" "-DCMAKE_DISABLE_FIND_PACKAGE_Mosek=ON" "-DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=ON" "-DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=ON" "-DCMAKE_SKIP_BUILD_RPATH=OFF" "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;TrainedModelSerialization'"  # Sporadic segfault "-DENABLE_TESTING=${enableIf doCheck}" "-DDISABLE_META_INTEGRATION_TESTS=ON" "-DTRAVIS_DISABLE_META_CPP=ON" "-DPythonModular=${enableIf pythonSupport}" "-DOpenCV=${enableIf opencvSupport}" "-DUSE_SVMLIGHT=${enableIf withSvmLight}" </ins> ]; <ins> CXXFLAGS = "-faligned-new"; doCheck = true; postUnpack = '' mkdir -p $sourceRoot/third_party/{rxcpp,GoogleMock} ln -s ${srcs.rxcpp} $sourceRoot/third_party/rxcpp/v${rxcppVersion}.tar.gz ln -s ${srcs.gtest} $sourceRoot/third_party/GoogleMock/release-${gtestVersion}.tar.gz ''; </ins> postPatch = '' # Fix preprocessing SVMlight code sed -i 

Related discussion:
text: I don't really use Eigen but the patch makes sense. So, I can send a PR to keep this package on the repo for another cycle at least. I mean, I already did all of the work and it builds. Other distros end up removing it because nobody cares to maintain it.
Nice! Thanks for looking into it. Like you said, if you've already done the work to get it working I don't see why not. If it's too much work to keep it working in the future we can always revisit this and drop it.