about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/math/colpack/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/math/colpack/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/math/colpack/default.nix28
1 files changed, 20 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/applications/science/math/colpack/default.nix b/nixpkgs/pkgs/applications/science/math/colpack/default.nix
index f203852c9657..3cc9290a7626 100644
--- a/nixpkgs/pkgs/applications/science/math/colpack/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/colpack/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, gettext }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
 
@@ -12,20 +12,32 @@ stdenv.mkDerivation rec {
     sha256 = "1p05vry940mrjp6236c0z83yizmw9pk6ly2lb7d8rpb7j9h03glr";
   };
 
-  buildInputs = [ autoconf automake gettext libtool ];
+  nativeBuildInputs = [ autoreconfHook ];
 
-  configurePhase = ''
-    autoreconf -vif
-    ./configure --prefix=$out --enable-openmp
+  configureFlags = [
+    "--enable-openmp=${if stdenv.isLinux then "yes" else "no"}"
+    "--enable-examples=no"
+  ];
+
+  postInstall = ''
+    # Remove libtool archive
+    rm $out/lib/*.la
+
+    # Remove compiled examples (Basic examples get compiled anyway)
+    rm -r $out/examples
+
+    # Copy the example sources (Basic tree contains scripts and object files)
+    mkdir -p $out/share/ColPack/examples/Basic
+    cp SampleDrivers/Basic/*.cpp $out/share/ColPack/examples/Basic
+    cp -r SampleDrivers/Matrix* $out/share/ColPack/examples
   '';
 
   meta = with lib; {
     description = "A package comprising of implementations of algorithms for
     vertex coloring and derivative computation";
     homepage = "http://cscapes.cs.purdue.edu/coloringpage/software.htm#functionalities";
-    license = licenses.lgpl3;
-    platforms = platforms.linux;
+    license = licenses.lgpl3Plus;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ edwtjo ];
   };
-
 }