From 93db87d3af9c420910a0e5b452ed9ab4f7632ecb Mon Sep 17 00:00:00 2001 From: Emily Trau Date: Sun, 22 Oct 2023 06:25:48 -0700 Subject: [PATCH] m2-planet: init at 1.11.0 --- pkgs/by-name/m2/m2-planet/package.nix | 43 +++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pkgs/by-name/m2/m2-planet/package.nix diff --git a/pkgs/by-name/m2/m2-planet/package.nix b/pkgs/by-name/m2/m2-planet/package.nix new file mode 100644 index 000000000000..926d829ba691 --- /dev/null +++ b/pkgs/by-name/m2/m2-planet/package.nix @@ -0,0 +1,43 @@ +{ lib +, stdenv +, fetchFromGitHub +, m2libc +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "m2-planet"; + version = "1.11.0"; + + src = fetchFromGitHub { + owner = "oriansj"; + repo = "M2-Planet"; + rev = "Release_${finalAttrs.version}"; + hash = "sha256-xVwUO67PlRiBj/YBnnTXFGh3jH470fcbaNjABoyYes4="; + }; + + # Don't use vendored M2libc + postPatch = '' + rmdir M2libc + ln -s ${m2libc}/include/M2libc M2libc + ''; + + # Upstream overrides the optimisation to be -O0, which is incompatible with fortify. Let's disable it. + hardeningDisable = [ "fortify" ]; + + installPhase = '' + runHook preInstall + + install -D bin/M2-Planet $out/bin/M2-Planet + + runHook postInstall + ''; + + meta = with lib; { + description = "PLAtform NEutral Transpiler"; + homepage = "https://github.com/oriansj/M2-Planet"; + license = licenses.gpl3Only; + maintainers = teams.minimal-bootstrap.members; + inherit (m2libc.meta) platforms; + mainProgram = "M2-Planet"; + }; +})