~toastal/easy-purescript-nix

f646ca97001727fcc1f396d320aceb591ce4450b — James Brock 1 year, 3 months ago 3dc8d80 + e39e502
Merge pull request #224 from jamesdbrock/spagoup

Update spago 0.21.0, purs v0.15.9
3 files changed, 39 insertions(+), 5 deletions(-)

M default.nix
A purs/0.15.9.nix
M spago.nix
M default.nix => default.nix +4 -1
@@ 6,6 6,9 @@ let
  };

  inputs = rec {
    purs-0_15_9 = import ./purs/0.15.9.nix {
      inherit pkgs;
    };
    purs-0_15_8 = import ./purs/0.15.8.nix {
      inherit pkgs;
    };


@@ 100,7 103,7 @@ let
      inherit pkgs;
    };

    purs = purs-0_15_8;
    purs = purs-0_15_9;

    purs-simple = purs;


A purs/0.15.9.nix => purs/0.15.9.nix +31 -0
@@ 0,0 1,31 @@
{ pkgs ? import <nixpkgs> { }, system ? pkgs.stdenv.hostPlatform.system }:

let
  version = "v0.15.9";

  urls = {
    "x86_64-linux" = {
      url = "https://github.com/purescript/purescript/releases/download/${version}/linux64.tar.gz";
      sha256 = "0rabinklsd8bs16f03zv7ij6d1lv4w2xwvzzgkwc862gpqvz9jq3";
    };
    "x86_64-darwin" = {
      url = "https://github.com/purescript/purescript/releases/download/${version}/macos.tar.gz";
      sha256 = "1xxg79rlf7li9f73wdbwif1dyy4hnzpypy6wx4zbnvap53habq9f";
    };
  };

  src =
    if builtins.hasAttr system urls then
      (pkgs.fetchurl urls.${system})
    else if system == "aarch64-darwin" then
      let
        useArch = "x86_64-darwin";
        msg = "Using the non-native ${useArch} binary. While this binary may run under Rosetta 2 translation, no guarantees can be made about stability or performance.";
      in
      pkgs.lib.warn msg (pkgs.fetchurl urls.${useArch})
    else
      throw "Architecture not supported: ${system}";
in
import ./mkPursDerivation.nix {
  inherit pkgs version src;
}

M spago.nix => spago.nix +4 -4
@@ 13,16 13,16 @@ in
pkgs.stdenv.mkDerivation rec {
  pname = "spago";

  version = "0.20.9";
  version = "0.21.0";

  src = if pkgs.stdenv.isDarwin
  then pkgs.fetchurl {
    url = "https://github.com/purescript/spago/releases/download/${version}/macOS.tar.gz";
    sha256 = "1c6i4pdr23n65pahw0hgv8g99w1cmv1zxm6j3ih18ch1xq32dzq9";
    sha256 = "19c0kdg7gk1c7v00lnkcsxidffab84d50d6l6vgrjy4i86ilhzd5";
  }
  else pkgs.fetchurl {
    url = "https://github.com/purescript/spago/releases/download/${version}/Linux.tar.gz";
    sha256 = "0d9hlr1lx5g4dmhs77wp1ccrpngfx84x082pi2fwfldr8xm6600m";
    sha256 = "1klczy04vwn5b39cnxflcqzap0d5kysp4dsw73i95xm5m7s37049";
  };

  buildInputs = [ pkgs.gmp pkgs.zlib pkgs.ncurses5 pkgs.stdenv.cc.cc.lib ];


@@ 38,10 38,10 @@ pkgs.stdenv.mkDerivation rec {
    SPAGO=$out/bin/spago
    ${patchelf libPath}


    mkdir -p $out/etc/bash_completion.d/
    $SPAGO --bash-completion-script $SPAGO > $out/etc/bash_completion.d/spago-completion.bash
  '';

  dontInstall = true;
}