Eigenstate: myrddin-dev mailing list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

default.nix for Nix system


Attached to this email is a default.nix to support Nix systems.

From 4d6146f3eb085c0a99b477a3f3889e384554671c Mon Sep 17 00:00:00 2001
From: "Adrian Parvin D. Ouano" <adrianparvino@xxxxxxxxx>
Date: Fri, 11 May 2018 14:49:37 +0800
Subject: [PATCH] Add default.nix for Nix systems

---
 default.nix | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 default.nix

diff --git a/default.nix b/default.nix
new file mode 100644
index 00000000..646eb63e
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,25 @@
+{ pkgs ? (import <nixpkgs> {})
+, stdenv ? pkgs.stdenv
+, bison ? pkgs.bison
+, binutils ? pkgs.binutils
+, fetchurl ? pkgs.fetchurl
+}:
+
+stdenv.mkDerivation rec {
+  name = "myrddin";
+
+  src = ./.;
+
+  buildInputs = [ bison binutils ];
+
+  preBuild = ''
+    make bootstrap
+  '';
+
+  postPatch = ''
+    substituteInPlace "mbld/opts.myr" --replace '"ld"' '"${binutils}/bin/ld"'
+    substituteInPlace "configure"     --replace '"ld"' '"${binutils}/bin/ld"'
+    substituteInPlace "mbld/opts.myr" --replace '"as"' '"${binutils}/bin/as"'
+    substituteInPlace "configure"     --replace '"as"' '"${binutils}/bin/as"'
+  '';
+}
-- 
2.16.2


Follow-Ups:
Re: default.nix for Nix systemOri Bernstein <ori@xxxxxxxxxxxxxx>