nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 44 lines 975 B view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 m2libc, 6}: 7 8stdenv.mkDerivation (finalAttrs: { 9 pname = "m2-planet"; 10 version = "1.11.0"; 11 12 src = fetchFromGitHub { 13 owner = "oriansj"; 14 repo = "M2-Planet"; 15 rev = "Release_${finalAttrs.version}"; 16 hash = "sha256-xVwUO67PlRiBj/YBnnTXFGh3jH470fcbaNjABoyYes4="; 17 }; 18 19 # Don't use vendored M2libc 20 postPatch = '' 21 rmdir M2libc 22 ln -s ${m2libc}/include/M2libc M2libc 23 ''; 24 25 # Upstream overrides the optimisation to be -O0, which is incompatible with fortify. Let's disable it. 26 hardeningDisable = [ "fortify" ]; 27 28 installPhase = '' 29 runHook preInstall 30 31 install -D bin/M2-Planet $out/bin/M2-Planet 32 33 runHook postInstall 34 ''; 35 36 meta = with lib; { 37 description = "PLAtform NEutral Transpiler"; 38 homepage = "https://github.com/oriansj/M2-Planet"; 39 license = licenses.gpl3Only; 40 teams = [ teams.minimal-bootstrap ]; 41 inherit (m2libc.meta) platforms; 42 mainProgram = "M2-Planet"; 43 }; 44})