about summary refs log tree commit diff
path: root/pkgs/development/compilers/odin
diff options
context:
space:
mode:
authorLucas Ransan <lucas@ransan.tk>2021-06-25 15:16:59 +0200
committerLucas Ransan <lucas@ransan.tk>2021-07-05 22:52:59 +0200
commit5b3b8145bc2525a98362ff68148ca3e6f3696fa1 (patch)
tree25dff4bff73af746f085c161f39175c70e4fd495 /pkgs/development/compilers/odin
parent370a10c27fc13f2b70dfee2284b30d6989b4336b (diff)
odin: init at 0.13.0
Diffstat (limited to 'pkgs/development/compilers/odin')
-rw-r--r--pkgs/development/compilers/odin/default.nix57
1 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/development/compilers/odin/default.nix b/pkgs/development/compilers/odin/default.nix
new file mode 100644
index 0000000000000..5845be142b625
--- /dev/null
+++ b/pkgs/development/compilers/odin/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, fetchFromGitHub
+, llvmPackages
+, makeWrapper
+, libiconv
+}:
+
+let
+  inherit (llvmPackages) stdenv;
+in stdenv.mkDerivation rec {
+  pname = "odin";
+  version = "0.13.0";
+
+  src = fetchFromGitHub {
+    owner = "odin-lang";
+    repo = "Odin";
+    rev = "v${version}";
+    sha256 = "ke2HPxVtF/Lh74Tv6XbpM9iLBuXLdH1+IE78MAacfYY=";
+  };
+
+  nativeBuildInputs = [
+    makeWrapper
+  ];
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  postPatch = ''
+    sed -i 's/^GIT_SHA=.*$/GIT_SHA=/' Makefile
+  '';
+
+  dontConfigure = true;
+
+  buildFlags = [
+    "release"
+  ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp odin $out/bin/odin
+    cp -r core $out/bin/core
+
+    wrapProgram $out/bin/odin --prefix PATH : ${lib.makeBinPath (with llvmPackages; [
+      bintools
+      llvm
+      clang
+      lld
+    ])}
+  '';
+
+  meta = with lib; {
+    description = "A fast, concise, readable, pragmatic and open sourced programming language";
+    homepage = "https://odin-lang.org/";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ luc65r ];
+    platforms = platforms.x86_64;
+  };
+}