summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Parvin D. Ouano <adrianparvino@gmail.com>2018-05-11 14:49:37 +0800
committerSystem administrator <root@ip-172-31-43-29.ap-northeast-1.compute.internal>2018-05-12 06:28:54 +0000
commit729c781f94e803b242c923001798f90f0250e2e3 (patch)
tree71053add212ecd36d1d861e6e3c0523d1c444a2e
parent5e304164f4acfdd78208838a64185f833a7d48db (diff)
downloadmc-729c781f94e803b242c923001798f90f0250e2e3.tar.gz
Add default.nix for Nix systems
-rw-r--r--default.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..646eb63
--- /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"'
+ '';
+}