about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix b/nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix
new file mode 100644
index 000000000000..688c0ec7c399
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, pkg-config, mkl }:
+
+stdenv.mkDerivation {
+  pname = "mkl-test";
+  version = mkl.version;
+
+  src = ./.;
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ mkl ];
+
+  doCheck = true;
+
+  buildPhase = ''
+    # Check regular Nix build.
+    gcc $(pkg-config --cflags --libs mkl-dynamic-ilp64-seq) test.c -o test
+
+    # Clear flags to ensure that we are purely relying on options
+    # provided by pkg-config.
+    NIX_CFLAGS_COMPILE="" \
+    NIX_LDFLAGS="" \
+      gcc $(pkg-config --cflags --libs mkl-dynamic-ilp64-seq) test.c -o test
+  '';
+
+  installPhase = ''
+    touch $out
+  '';
+
+  checkPhase = ''
+    ./test
+  '';
+}