nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

at fix-function-merge 86 lines 2.1 kB view raw
1{ pkgs 2, lib 3, stdenv 4, fetchFromGitHub 5, erlang 6, makeWrapper 7, coreutils 8, curl 9, bash 10, debugInfo ? false 11} @ inputs: 12 13{ baseName ? "elixir" 14, version 15, erlang ? inputs.erlang 16, minimumOTPVersion 17, sha256 ? null 18, rev ? "v${version}" 19, src ? fetchFromGitHub { inherit rev sha256; owner = "elixir-lang"; repo = "elixir"; } 20, escriptPath ? "lib/elixir/generate_app.escript" 21} @ args: 22 23let 24 inherit (lib) getVersion versionAtLeast optional concatStringsSep; 25 26in 27assert versionAtLeast (getVersion erlang) minimumOTPVersion; 28 29stdenv.mkDerivation ({ 30 pname = "${baseName}"; 31 32 inherit src version debugInfo; 33 34 nativeBuildInputs = [ makeWrapper ]; 35 buildInputs = [ erlang ]; 36 37 LANG = "C.UTF-8"; 38 LC_TYPE = "C.UTF-8"; 39 40 ERLC_OPTS = 41 let 42 erlc_opts = [ "deterministic" ] 43 ++ optional debugInfo "debug_info"; 44 in 45 "[${concatStringsSep "," erlc_opts}]"; 46 47 preBuild = '' 48 patchShebangs ${escriptPath} || true 49 50 substituteInPlace Makefile \ 51 --replace "/usr/local" $out 52 ''; 53 54 postFixup = '' 55 # Elixir binaries are shell scripts which run erl. Add some stuff 56 # to PATH so the scripts can run without problems. 57 58 for f in $out/bin/*; do 59 b=$(basename $f) 60 if [ "$b" = mix ]; then continue; fi 61 wrapProgram $f \ 62 --prefix PATH ":" "${lib.makeBinPath [ erlang coreutils curl bash ]}" 63 done 64 65 substituteInPlace $out/bin/mix \ 66 --replace "/usr/bin/env elixir" "${coreutils}/bin/env $out/bin/elixir" 67 ''; 68 69 pos = builtins.unsafeGetAttrPos "sha256" args; 70 meta = with lib; { 71 homepage = "https://elixir-lang.org/"; 72 description = "Functional, meta-programming aware language built on top of the Erlang VM"; 73 74 longDescription = '' 75 Elixir is a functional, meta-programming aware language built on 76 top of the Erlang VM. It is a dynamic language with flexible 77 syntax and macro support that leverages Erlang's abilities to 78 build concurrent, distributed and fault-tolerant applications 79 with hot code upgrades. 80 ''; 81 82 license = licenses.epl10; 83 platforms = platforms.unix; 84 maintainers = teams.beam.members; 85 }; 86})