nixpkgs/pkgs/by-name/ma/mars-mips/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

80 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchurl,
makeBinaryWrapper,
copyDesktopItems,
makeDesktopItem,
desktopToDarwinBundle,
unzip,
imagemagick,
jre,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mars-mips";
version = "4.5";
src = fetchurl {
url = "https://courses.missouristate.edu/KenVollmar/MARS/MARS_${
lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version
}_Aug2014/Mars${lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version}.jar";
hash = "sha256-rDQLZ2uitiJGud935i+BrURHvP0ymrU5cWvNCZULcJY=";
};
dontUnpack = true;
nativeBuildInputs =
[
makeBinaryWrapper
copyDesktopItems
unzip
imagemagick
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
desktopToDarwinBundle
];
desktopItems = [
(makeDesktopItem {
name = "mars";
desktopName = "MARS";
exec = "Mars";
icon = "mars";
comment = finalAttrs.meta.description;
categories = [
"Development"
"IDE"
];
})
];
installPhase = ''
runHook preInstall
export JAR=$out/share/java/mars/Mars.jar
install -Dm444 $src $JAR
makeWrapper ${jre}/bin/java $out/bin/Mars \
--add-flags "-jar $JAR"
unzip $src images/MarsThumbnail.gif
for size in 16 24 32 48 64 128 256 512
do
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
convert -resize "$size"x"$size" images/MarsThumbnail.gif $out/share/icons/hicolor/"$size"x"$size"/apps/mars.png
done
runHook postInstall
'';
meta = {
description = "An IDE for programming in MIPS assembly language intended for educational-level use";
mainProgram = "Mars";
homepage = "https://courses.missouristate.edu/KenVollmar/MARS/";
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ emilytrau ];
platforms = lib.platforms.all;
};
})