Unverified Commit bc9ff3c8 authored by sternenseemann's avatar sternenseemann Committed by GitHub
Browse files

haskell.{compiler,packages}.microhs: init at 0.15.4.0 (#460845)

parents 0c50eff6 8fbef809
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -284,6 +284,8 @@

- the `autossh-ng` NixOS module was introduced as a simpler alternative to the existing `autossh` module.

- Added `haskell.packages.microhs`, a set of Haskell packages built with MicroHs.

- `gnuradio`: Overriding the `.pkgs` package set is now possible with a `packageOverrides` function, like with `python.pkgs` and other language-specific package sets.
Example:

+14 −0
Original line number Diff line number Diff line
@@ -1192,6 +1192,20 @@
    githubId = 49609151;
    name = "Popa Ioan Alexandru";
  };
  AlexandreTunstall = {
    name = "Alex Tunstall";
    email = "alex@tunstall.xyz";
    matrix = "@alex:tunstall.xyz";
    github = "AlexandreTunstall";
    githubId = 32900877;
    keys = [
      {
        # Fetch with WKD (e.g. gpg --locate-external-keys alex@tunstall.xyz)
        # The fetched key should have this fingerprint (please let me know if not)
        fingerprint = "51A5 8478 068E B19D FD35  D542 F6CA 1AD5 54DC A5E4";
      }
    ];
  };
  alexandru0-dev = {
    email = "alexandru.italia32+nixpkgs@gmail.com";
    github = "alexandru0-dev";
+0 −46
Original line number Diff line number Diff line
{
  callPackage,
  stdenv,
  fetchFromGitHub,
  lib,
  writableTmpDirAsHomeHook,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "microhs";
  version = "0.15.4.0";

  src = fetchFromGitHub {
    owner = "augustss";
    repo = "MicroHs";
    tag = "v${finalAttrs.version}";
    hash = "sha256-V3Of72rpXvImV90sSoYz02H06o1J3FqHDQNbB+M6/8A=";
  };

  # mcabal doesn't seem to respect the make flag and fails with /homeless-shelter
  # This works around the issue
  nativeBuildInputs = [ writableTmpDirAsHomeHook ];

  makeFlags = [ "MCABAL=$(out)" ];
  buildFlags = [ "bootstrap" ];

  # MicroCabal is a separate repository, which should be packaged separately
  # The MicroCabal that is installed by `make install` is pregenerated, does not respect MCABAL above, and so is not useable
  postInstall = "rm $out/bin/mcabal";

  passthru = {
    updateScript = nix-update-script { };
    tests = {
      hello-world = callPackage ./test-hello-world.nix { microhs = finalAttrs.finalPackage; };
    };
  };

  meta = {
    description = "Haskell implemented with combinators";
    homepage = "https://github.com/augustss/MicroHs";
    license = lib.licenses.asl20;
    maintainers = [ lib.maintainers.steeleduncan ];
    platforms = lib.platforms.all;
  };
})
+4 −0
Original line number Diff line number Diff line
import ./common.nix {
  version = "0.15.4.0";
  hash = "sha256-FUr2EA3zbmt2Tr2F8zT1wHnB8GDlUVb2W1fP4IqNd80=";
}
+40 −0
Original line number Diff line number Diff line
{
  stdenvNoCC,
  hugs,
  makeWrapper,
  microhs-src,
}:

stdenvNoCC.mkDerivation {
  pname = "microhs";
  version = "${microhs-src.version}-hugs";

  inherit (microhs-src)
    src
    patches
    postPatch
    meta
    ;

  nativeBuildInputs = [ makeWrapper ];

  dontBuild = true;

  installPhase = ''
    runHook preInstall

    mkdir -p "$out/bin" "$out/share/microhs-hugs"
    s="$out/share/microhs-hugs/src"
    cp -r . "$s"

    makeWrapper ${hugs}/bin/runhugs "$out/bin/mhs" \
      --add-flags "'+P$s/hugs:$s/src:$s/paths:{Hugs}/packages/*:hugs/obj' -98 +o +w -h100m '$s/hugs/Main.hs'"

    runHook postInstall
  '';

  passthru = {
    isMhs = true;
    usesHugs = true;
  };
}
Loading