tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
mars-mips: add darwin bundle
Emily Trau
2 years ago
52be0c1e
0d9610c5
+42
-22
1 changed file
expand all
collapse all
unified
split
pkgs
development
tools
mars-mips
default.nix
+42
-22
pkgs/development/tools/mars-mips/default.nix
···
1
1
-
{ lib, stdenvNoCC, fetchurl, makeWrapper, copyDesktopItems, makeDesktopItem, unzip, imagemagick, jre }:
1
1
+
{ lib
2
2
+
, stdenv
3
3
+
, fetchurl
4
4
+
, makeBinaryWrapper
5
5
+
, copyDesktopItems
6
6
+
, makeDesktopItem
7
7
+
, desktopToDarwinBundle
8
8
+
, unzip
9
9
+
, imagemagick
10
10
+
, jre
11
11
+
}:
2
12
3
3
-
stdenvNoCC.mkDerivation rec {
13
13
+
stdenv.mkDerivation (finalAttrs: {
4
14
pname = "mars-mips";
5
15
version = "4.5";
6
16
7
17
src = fetchurl {
8
8
-
url = "https://courses.missouristate.edu/KenVollmar/MARS/MARS_${lib.replaceStrings ["."] ["_"] version}_Aug2014/Mars${lib.replaceStrings ["."] ["_"] version}.jar";
9
9
-
sha256 = "15kh1fahkkbbf4wvb6ijzny4fi5dh4pycxyzp5325dm2ddkhnd5c";
18
18
+
url = "https://courses.missouristate.edu/KenVollmar/MARS/MARS_${lib.replaceStrings ["."] ["_"] finalAttrs.version}_Aug2014/Mars${lib.replaceStrings ["."] ["_"] finalAttrs.version}.jar";
19
19
+
hash = "sha256-rDQLZ2uitiJGud935i+BrURHvP0ymrU5cWvNCZULcJY=";
10
20
};
11
21
12
22
dontUnpack = true;
13
23
14
14
-
nativeBuildInputs = [ makeWrapper copyDesktopItems unzip imagemagick ];
24
24
+
nativeBuildInputs = [
25
25
+
makeBinaryWrapper
26
26
+
copyDesktopItems
27
27
+
unzip
28
28
+
imagemagick
29
29
+
] ++ lib.optionals stdenv.isDarwin [
30
30
+
desktopToDarwinBundle
31
31
+
];
15
32
16
33
desktopItems = [
17
34
(makeDesktopItem {
18
18
-
name = pname;
35
35
+
name = "mars";
19
36
desktopName = "MARS";
20
20
-
exec = "mars-mips";
21
21
-
icon = "mars-mips";
22
22
-
comment = "An IDE for programming in MIPS assembly language";
37
37
+
exec = "Mars";
38
38
+
icon = "mars";
39
39
+
comment = finalAttrs.meta.description;
23
40
categories = [ "Development" "IDE" ];
24
41
})
25
42
];
···
27
44
installPhase = ''
28
45
runHook preInstall
29
46
30
30
-
export JAR=$out/share/java/${pname}/${pname}.jar
31
31
-
install -D $src $JAR
32
32
-
makeWrapper ${jre}/bin/java $out/bin/${pname} \
47
47
+
export JAR=$out/share/java/mars/Mars.jar
48
48
+
install -Dm444 $src $JAR
49
49
+
makeWrapper ${jre}/bin/java $out/bin/Mars \
33
50
--add-flags "-jar $JAR"
34
51
35
35
-
unzip ${src} images/MarsThumbnail.gif
36
36
-
mkdir -p $out/share/pixmaps
37
37
-
convert images/MarsThumbnail.gif $out/share/pixmaps/mars-mips.png
52
52
+
unzip $src images/MarsThumbnail.gif
53
53
+
for size in 16 24 32 48 64 128 256 512
54
54
+
do
55
55
+
mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps
56
56
+
convert -resize "$size"x"$size" images/MarsThumbnail.gif $out/share/icons/hicolor/"$size"x"$size"/apps/mars.png
57
57
+
done
38
58
39
59
runHook postInstall
40
60
'';
41
61
42
42
-
meta = with lib; {
62
62
+
meta = {
43
63
description = "An IDE for programming in MIPS assembly language intended for educational-level use";
44
44
-
mainProgram = "mars-mips";
64
64
+
mainProgram = "Mars";
45
65
homepage = "https://courses.missouristate.edu/KenVollmar/MARS/";
46
46
-
sourceProvenance = with sourceTypes; [ binaryBytecode ];
47
47
-
license = licenses.mit;
48
48
-
maintainers = with maintainers; [ emilytrau ];
49
49
-
platforms = platforms.all;
66
66
+
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
67
67
+
license = lib.licenses.mit;
68
68
+
maintainers = with lib.maintainers; [ emilytrau ];
69
69
+
platforms = lib.platforms.all;
50
70
};
51
51
-
}
71
71
+
})