summaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix106
1 files changed, 106 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..3c2c117
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,106 @@
+with builtins;
+let
+ nixpkgs = import <nixpkgs> {};
+ version = "3.8.6";
+ srcs = {
+ mpss-src = fetchTarball {
+ url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/15904/mpss-src-${version}.tar";
+ sha256 = "017g67yc9zqviilryxvq31vzj9hp0lxxrlir8j9vs9l83sw8dfx5";
+ };
+ };
+ kernel = nixpkgs.linuxPackages_4_4.kernel;
+
+in with nixpkgs;
+let
+ modules = stdenv.mkDerivation rec {
+ name = "mpss-modules";
+ inherit version;
+
+ src = "${srcs.mpss-src}/src/mpss-modules-${version}.tar.bz2";
+ patches = [
+ ./mpss-modules-4.4.patch
+ ];
+
+ hardeningDisable = [ "pic" "format" ];
+ nativeBuildInputs = kernel.moduleBuildDependencies;
+ builtInputs = [ kmod ];
+ enableParallelBuilding = true;
+
+ makeFlags = [
+ "KERNELRELEASE=${kernel.modDirVersion}"
+ "KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+ "DESTDIR=$(out)"
+ "MIC_CARD_ARCH=k1om"
+ ];
+
+ outputs = [ "out" "dev" ];
+
+ installPhase = ''
+ install -m644 -b -D mic.ko $out/lib/modules/${kernel.modDirVersion}/extra/mic.ko
+ install -d $dev/include/mic
+ install -m644 include/scif_ioctl.h $dev/include
+ install -m644 include/mic/io_interface.h $dev/include/mic
+ install -m644 include/mic/mic_pm.h $dev/include/mic
+ install -m644 ras/micras_api.h $dev/include/mic
+ install -m644 ras/micmca_api.h $dev/include/mic
+ '';
+ };
+ metadata = stdenv.mkDerivation rec {
+ name = "mpss-metadata";
+ inherit version;
+
+ src = "${srcs.mpss-src}/src/mpss-metadata-${version}.tar.bz2";
+
+ installPhase = ''
+ mkdir -p $out
+ install -m644 -b -D mpss-metadata.c $out/include/mpss-metadata.c
+ install -m644 -b -D mpss-metadata.mk $out/include/mpss-metadata.mk
+ install -m644 -b -D mpss-metadata.props $out/include/mpss-metadata.props
+ '';
+ };
+ gen-symver-map = stdenv.mkDerivation rec {
+ name = "gen-symver-map";
+ inherit version;
+
+ src = "${srcs.mpss-src}/src/gen-symver-map-${version}.tar.bz2";
+ buildInputs = [
+ pkgs.python27
+ ];
+ installPhase = ''
+ mkdir -p $out
+ install -m755 -b -D gen-symver-map $out/bin/gen-symver-map
+ '';
+ };
+ libscif = stdenv.mkDerivation rec {
+ name = "libscif";
+ inherit version;
+
+ nativeBuildInputs = [ gen-symver-map asciidoc-full ];
+ buildInputs = [ modules.dev ];
+ enableParallelBuilding = true;
+ src = "${srcs.mpss-src}/src/libscif-${version}.tar.bz2";
+ makeFlags = [
+ "-I${metadata}/include"
+ "DESTDIR=$(out)"
+ "prefix="
+ ];
+ };
+ daemon = stdenv.mkDerivation rec {
+ name = "mpss-daemon";
+ inherit version;
+
+ patches = [ ./mpss-daemon.patch ];
+ buildInputs = [ libscif ];
+ enableParallelBuilding = true;
+ src = "${srcs.mpss-src}/src/mpss-daemon-${version}.tar.bz2";
+ makeFlags = [
+ "DESTDIR=$(out)"
+ "prefix="
+ ];
+ preBuild = ''
+ makeFlagsArray+=(INSTALL_s="install -m 755")
+ '';
+ };
+in {
+ inherit modules daemon libscif metadata gen-symver-map;
+}