Unverified Commit 1ea636c4 authored by Eric Bailey's avatar Eric Bailey Committed by GitHub
Browse files

lfe: 2.1.4 -> 2.2.0, simplify to single version (#449931)

parents 4564e21f 736d50b2
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -85,8 +85,7 @@ let

      elixir-ls = callPackage ./elixir-ls { inherit elixir; };

      lfe = lfe_2_1;
      lfe_2_1 = lib'.callLFE ../interpreters/lfe/2.1.nix { inherit erlang buildRebar3 buildHex; };
      lfe = callPackage ../interpreters/lfe { inherit erlang buildRebar3 buildHex; };

      livebook = callPackage ./livebook { };

+0 −7
Original line number Diff line number Diff line
{ mkDerivation }:

mkDerivation {
  version = "2.1.4";
  hash = "sha256-mDavRI2it0SrSR0iBItm2MfjI+F/zCy38YSd2KpE0Hs=";
  maximumOTPVersion = "27";
}
+30 −52
Original line number Diff line number Diff line
{
  bash,
  buildHex,
  buildRebar3,
  config,
  lib,
  fetchFromGitHub,
  coreutils,
  erlang,
  fetchFromGitHub,
  lib,
  makeWrapper,
  coreutils,
  bash,
  buildRebar3,
  buildHex,
}:

{
  baseName ? "lfe",
  version,
  maximumOTPVersion,
  sha256 ? "",
  hash ? "",
  rev ? version,
  src ? fetchFromGitHub {
    inherit hash rev sha256;
    owner = "lfe";
    repo = "lfe";
  },
  patches ? [ ],
}:

let
  inherit (lib)
    assertMsg
    makeBinPath
    optionalString
    getVersion
    versionAtLeast
    versionOlder
    versions
    ;

  mainVersion = versions.major (getVersion erlang);
  version = "2.2.0";
  hash = "sha256-47lEUVU9Api1Yj1q+Ch8aIV8kaALhst1ty8RHTwMVcI=";

  maximumOTPVersion = "27";
  mainVersion = versions.major (getVersion erlang);
  maxAssert = versionAtLeast maximumOTPVersion mainVersion;

  proper = buildHex {
@@ -56,22 +42,27 @@ else
    LFE ${version} is supported on OTP <=${maximumOTPVersion}, not ${mainVersion}.
  '';
  buildRebar3 {
    name = baseName;
    name = "lfe";
    inherit version;

    src = fetchFromGitHub {
      owner = "lfe";
      repo = "lfe";
      tag = "v${version}";
      inherit hash;
    };

    inherit src version;
    patches = [
      ./fix-rebar-config.patch
      ./dedup-ebins.patch
    ];

    nativeBuildInputs = [
      makeWrapper
      erlang
    ];

    beamDeps = [ proper ];
    patches = [
      ./fix-rebar-config.patch
      ./dedup-ebins.patch
    ]
    ++ patches;
    doCheck = true;
    checkTarget = "travis";

    makeFlags = [
      "-e"
@@ -79,26 +70,12 @@ else
      "PREFIX=$$out"
    ];

    # These installPhase tricks are based on Elixir's Makefile.
    # TODO: Make, upload, and apply a patch.
    installPhase = optionalString (versionOlder version "1.3") ''
      local libdir=$out/lib/lfe
      local ebindir=$libdir/ebin
      local bindir=$libdir/bin

      rm -Rf $ebindir
      install -m755 -d $ebindir
      install -m644 _build/default/lib/lfe/ebin/* $ebindir
    # override buildRebar3's install to let the builder use make install
    installPhase = "";

      install -m755 -d $bindir

      for bin in bin/lfe{,c,doc,script}; do install -m755 $bin $bindir; done

      install -m755 -d $out/bin
      for file in $bindir/*; do ln -sf $file $out/bin/; done
    '';
    doCheck = true;
    checkTarget = "travis";

    # Thanks again, Elixir.
    postFixup = ''
      # LFE binaries are shell scripts which run erl and lfe.
      # Add some stuff to PATH so the scripts can run without problems.
@@ -124,7 +101,8 @@ else
      '';

      homepage = "https://lfe.io";
      downloadPage = "https://github.com/rvirding/lfe/releases";
      downloadPage = "https://github.com/lfe/lfe/releases";
      changelog = "https://github.com/lfe/lfe/releases/tag/v${version}";

      license = licenses.asl20;
      teams = [ teams.beam ];
+0 −1
Original line number Diff line number Diff line
@@ -5754,7 +5754,6 @@ with pkgs;
    rebar3WithPlugins
    fetchHex
    lfe
    lfe_2_1
    ;

  beamPackages = dontRecurseIntoAttrs beam27Packages;
+0 −1
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@ in
      elixir_1_15
      elixir-ls
      lfe
      lfe_2_1
      ;
  };