Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, fetchFromGitHub 3, llvmPackages 4, makeWrapper 5, libiconv 6}: 7 8let 9 inherit (llvmPackages) stdenv; 10in stdenv.mkDerivation rec { 11 pname = "odin"; 12 version = "0.13.0"; 13 14 src = fetchFromGitHub { 15 owner = "odin-lang"; 16 repo = "Odin"; 17 rev = "v${version}"; 18 sha256 = "ke2HPxVtF/Lh74Tv6XbpM9iLBuXLdH1+IE78MAacfYY="; 19 }; 20 21 nativeBuildInputs = [ 22 makeWrapper 23 ]; 24 25 buildInputs = lib.optional stdenv.isDarwin libiconv; 26 27 postPatch = '' 28 sed -i 's/^GIT_SHA=.*$/GIT_SHA=/' Makefile 29 ''; 30 31 dontConfigure = true; 32 33 buildFlags = [ 34 "release" 35 ]; 36 37 installPhase = '' 38 mkdir -p $out/bin 39 cp odin $out/bin/odin 40 cp -r core $out/bin/core 41 42 wrapProgram $out/bin/odin --prefix PATH : ${lib.makeBinPath (with llvmPackages; [ 43 bintools 44 llvm 45 clang 46 lld 47 ])} 48 ''; 49 50 meta = with lib; { 51 description = "A fast, concise, readable, pragmatic and open sourced programming language"; 52 homepage = "https://odin-lang.org/"; 53 license = licenses.bsd2; 54 maintainers = with maintainers; [ luc65r ]; 55 platforms = platforms.x86_64; 56 }; 57}