nixpkgs/pkgs/development/tools/mars-mips/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.8 KiB
Nix
Raw Normal View History

2024-03-20 08:57:31 +03:00
{ lib
, stdenv
, fetchurl
, makeBinaryWrapper
, copyDesktopItems
, makeDesktopItem
, desktopToDarwinBundle
, unzip
, imagemagick
, jre
}:
2021-07-24 15:59:01 +03:00
2024-03-20 08:57:31 +03:00
stdenv.mkDerivation (finalAttrs: {
2021-07-24 15:59:01 +03:00
pname = "mars-mips";
version = "4.5";
src = fetchurl {
2024-03-20 08:57:31 +03:00
url = "https://courses.missouristate.edu/KenVollmar/MARS/MARS_${lib.replaceStrings ["."] ["_"] finalAttrs.version}_Aug2014/Mars${lib.replaceStrings ["."] ["_"] finalAttrs.version}.jar";
hash = "sha256-rDQLZ2uitiJGud935i+BrURHvP0ymrU5cWvNCZULcJY=";
2021-07-24 15:59:01 +03:00
};
dontUnpack = true;
2024-03-20 08:57:31 +03:00
nativeBuildInputs = [
makeBinaryWrapper
copyDesktopItems
unzip
imagemagick
] ++ lib.optionals stdenv.isDarwin [
desktopToDarwinBundle
];
2021-07-24 15:59:01 +03:00
desktopItems = [
(makeDesktopItem {
2024-03-20 08:57:31 +03:00
name = "mars";
2021-07-24 15:59:01 +03:00
desktopName = "MARS";
2024-03-20 08:57:31 +03:00
exec = "Mars";
icon = "mars";
comment = finalAttrs.meta.description;
categories = [ "Development" "IDE" ];
2021-07-24 15:59:01 +03:00
})
];
installPhase = ''
runHook preInstall
2024-03-20 08:57:31 +03:00
export JAR=$out/share/java/mars/Mars.jar
install -Dm444 $src $JAR
makeWrapper ${jre}/bin/java $out/bin/Mars \
2021-07-24 15:59:01 +03:00
--add-flags "-jar $JAR"
2024-03-20 08:57:31 +03:00
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
2021-07-24 15:59:01 +03:00
runHook postInstall
'';
2024-03-20 08:57:31 +03:00
meta = {
2021-07-24 15:59:01 +03:00
description = "An IDE for programming in MIPS assembly language intended for educational-level use";
2024-03-20 08:57:31 +03:00
mainProgram = "Mars";
2021-07-24 15:59:01 +03:00
homepage = "https://courses.missouristate.edu/KenVollmar/MARS/";
2024-03-20 08:57:31 +03:00
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ emilytrau ];
platforms = lib.platforms.all;
2021-07-24 15:59:01 +03:00
};
2024-03-20 08:57:31 +03:00
})