wip
authorLas Safin <me@las.rs>
Thu, 16 Sep 2021 12:16:15 +0000 (12:16 +0000)
committerLas Safin <me@las.rs>
Thu, 16 Sep 2021 12:16:15 +0000 (12:16 +0000)
nix/ilang.nix
nix/soc.nix [new file with mode: 0644]
nix/verilog.nix

index c5f548f23743304a1278a9b0e7a4232b8b435c54..14099df4c634a8d2f2c0e4668b2af721ef4caeee 100644 (file)
@@ -11,11 +11,13 @@ stdenv.mkDerivation {
   strictDeps = true;
 
   nativeBuildInputs = (with python3Packages; [
-    python migen
+    python migen c4m-jtag nmigen-soc python libresoc-ieee754fpu libresoc-openpower-isa
   ]) ++ (with litexPkgs; [ litex litedram liteeth liteiclink litescope litesdcard ]);
 
   postPatch = ''
     patchShebangs --build .
+
+    export PYTHONPATH="${../src}:$PYTHONPATH"
   '';
 
   configurePhase = "true";
diff --git a/nix/soc.nix b/nix/soc.nix
new file mode 100644 (file)
index 0000000..3df3581
--- /dev/null
@@ -0,0 +1,33 @@
+{ version }:
+
+{ lib, buildPythonPackage, yosys, runCommand, c4m-jtag, nmigen-soc
+, libresoc-ieee754fpu, libresoc-openpower-isa, python }:
+
+let
+  # If we use ../. as source, then any change to
+  # any unrelated Nix file would cause a rebuild,
+  # since the build would have access to it.
+  src = runCommand "libresoc-soc-source" {} ''
+    mkdir $out
+    cp -r ${../src} -T $out/src
+    cp -r ${../pinmux} -T $out/pinmux
+    cp -r ${../setup.py} -T $out/setup.py
+  '';
+in
+buildPythonPackage {
+  pname = "libresoc-soc";
+  inherit version src;
+
+  propagatedBuildInputs = [
+    c4m-jtag nmigen-soc python libresoc-ieee754fpu libresoc-openpower-isa yosys
+  ];
+
+  doCheck = false;
+
+  pythonImportsCheck = [ "soc" ];
+
+  meta = with lib; {
+    homepage = "https://libre-soc.org/";
+    license = licenses.lgpl3Plus;
+  };
+}
index 4ba3727c052d865fc6b1fa143e1cb5806559d9ef..89bbdb831e9ea43d6d7c965b01153377d07679c6 100644 (file)
@@ -16,9 +16,7 @@ let
 in
 stdenv.mkDerivation {
   pname = "libresoc.v";
-  inherit version;
-
-  inherit src;
+  inherit version src;
 
   strictDeps = true;