Merge pull request #297381 from emilytrau/logisim-darwin

logisim,logisim-evolution,mars-mips: add darwin bundle

authored by Weijia Wang and committed by GitHub fed21ab5 c3d5b0c0

+107 -57
+36 -20
pkgs/applications/science/logic/logisim-evolution/default.nix
··· 1 - { lib, stdenv, fetchurl, jre, makeWrapper, copyDesktopItems, makeDesktopItem, unzip }: 2 3 - stdenv.mkDerivation rec { 4 pname = "logisim-evolution"; 5 version = "3.8.0"; 6 7 src = fetchurl { 8 - url = "https://github.com/logisim-evolution/logisim-evolution/releases/download/v${version}/logisim-evolution-${version}-all.jar"; 9 - sha256 = "sha256-TFm+fa3CMp0OMhnKBc6cLIWGQbIG/OpOOCG7ea7wbCw="; 10 }; 11 - 12 dontUnpack = true; 13 14 - nativeBuildInputs = [ makeWrapper copyDesktopItems unzip ]; 15 16 desktopItems = [ 17 (makeDesktopItem { 18 - name = pname; 19 desktopName = "Logisim-evolution"; 20 exec = "logisim-evolution"; 21 icon = "logisim-evolution"; 22 - comment = meta.description; 23 categories = [ "Education" ]; 24 }) 25 ]; ··· 29 30 mkdir -p $out/bin 31 makeWrapper ${jre}/bin/java $out/bin/logisim-evolution --add-flags "-jar $src" 32 - 33 - # Create icons 34 - unzip $src "resources/logisim/img/*" 35 - for size in 16 32 48 128 256; do 36 - install -D "./resources/logisim/img/logisim-icon-$size.png" "$out/share/icons/hicolor/''${size}x''${size}/apps/logisim-evolution.png" 37 - done 38 39 runHook postInstall 40 ''; 41 42 - meta = with lib; { 43 homepage = "https://github.com/logisim-evolution/logisim-evolution"; 44 description = "Digital logic designer and simulator"; 45 mainProgram = "logisim-evolution"; 46 - maintainers = with maintainers; [ emilytrau ]; 47 - sourceProvenance = with sourceTypes; [ binaryBytecode ]; 48 - license = licenses.gpl2Plus; 49 - platforms = platforms.unix; 50 }; 51 - }
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , jre 5 + , makeBinaryWrapper 6 + , copyDesktopItems 7 + , makeDesktopItem 8 + , desktopToDarwinBundle 9 + , unzip 10 + }: 11 12 + let 13 + icon = fetchurl { 14 + url = "https://github.com/logisim-evolution/logisim-evolution/raw/9e0afa3cd6a8bfa75dab61830822cde83c70bb4b/artwork/logisim-evolution-icon.svg"; 15 + hash = "sha256-DNRimhNFt6jLdjqv7o2cNz38K6XnevxD0rGymym3xBs="; 16 + }; 17 + in 18 + stdenv.mkDerivation (finalAttrs: { 19 pname = "logisim-evolution"; 20 version = "3.8.0"; 21 22 src = fetchurl { 23 + url = "https://github.com/logisim-evolution/logisim-evolution/releases/download/v${finalAttrs.version}/logisim-evolution-${finalAttrs.version}-all.jar"; 24 + hash = "sha256-TFm+fa3CMp0OMhnKBc6cLIWGQbIG/OpOOCG7ea7wbCw="; 25 }; 26 dontUnpack = true; 27 28 + nativeBuildInputs = [ 29 + makeBinaryWrapper 30 + copyDesktopItems 31 + unzip 32 + ] ++ lib.optionals stdenv.isDarwin [ 33 + desktopToDarwinBundle 34 + ]; 35 36 desktopItems = [ 37 (makeDesktopItem { 38 + name = "logisim-evolution"; 39 desktopName = "Logisim-evolution"; 40 exec = "logisim-evolution"; 41 icon = "logisim-evolution"; 42 + comment = finalAttrs.meta.description; 43 categories = [ "Education" ]; 44 }) 45 ]; ··· 49 50 mkdir -p $out/bin 51 makeWrapper ${jre}/bin/java $out/bin/logisim-evolution --add-flags "-jar $src" 52 + install -Dm444 ${icon} $out/share/icons/hicolor/scalable/apps/logisim-evolution.svg 53 54 runHook postInstall 55 ''; 56 57 + meta = { 58 + changelog = "https://github.com/logisim-evolution/logisim-evolution/releases/tag/v${finalAttrs.version}"; 59 homepage = "https://github.com/logisim-evolution/logisim-evolution"; 60 description = "Digital logic designer and simulator"; 61 mainProgram = "logisim-evolution"; 62 + maintainers = with lib.maintainers; [ emilytrau ]; 63 + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; 64 + license = lib.licenses.gpl3Only; 65 + platforms = lib.platforms.unix; 66 }; 67 + })
+29 -15
pkgs/applications/science/logic/logisim/default.nix
··· 1 - { lib, stdenv, fetchurl, jre, makeWrapper, copyDesktopItems, makeDesktopItem, unzip }: 2 3 - stdenv.mkDerivation rec { 4 pname = "logisim"; 5 version = "2.7.1"; 6 7 src = fetchurl { 8 - url = "mirror://sourceforge/project/circuit/${lib.versions.majorMinor version}.x/${version}/logisim-generic-${version}.jar"; 9 - sha256 = "1hkvc9zc7qmvjbl9579p84hw3n8wl3275246xlzj136i5b0phain"; 10 }; 11 - 12 dontUnpack = true; 13 14 - nativeBuildInputs = [ makeWrapper copyDesktopItems unzip ]; 15 16 desktopItems = [ 17 (makeDesktopItem { 18 - name = pname; 19 desktopName = "Logisim"; 20 exec = "logisim"; 21 icon = "logisim"; 22 - comment = meta.description; 23 categories = [ "Education" ]; 24 }) 25 ]; ··· 34 unzip $src "resources/logisim/img/*" 35 for size in 16 20 24 48 64 128 36 do 37 - install -D "./resources/logisim/img/logisim-icon-$size.png" "$out/share/icons/hicolor/''${size}x''${size}/apps/logisim.png" 38 done 39 40 runHook postInstall 41 ''; 42 43 - meta = with lib; { 44 homepage = "http://www.cburch.com/logisim/"; 45 description = "Educational tool for designing and simulating digital logic circuits"; 46 mainProgram = "logisim"; 47 - maintainers = with maintainers; [ emilytrau ]; 48 - sourceProvenance = with sourceTypes; [ binaryBytecode ]; 49 - license = licenses.gpl2Plus; 50 - platforms = platforms.unix; 51 }; 52 - }
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , jre 5 + , makeBinaryWrapper 6 + , copyDesktopItems 7 + , makeDesktopItem 8 + , desktopToDarwinBundle 9 + , unzip 10 + }: 11 12 + stdenv.mkDerivation (finalAttrs: { 13 pname = "logisim"; 14 version = "2.7.1"; 15 16 src = fetchurl { 17 + url = "mirror://sourceforge/project/circuit/${lib.versions.majorMinor finalAttrs.version}.x/${finalAttrs.version}/logisim-generic-${finalAttrs.version}.jar"; 18 + hash = "sha256-Nip4wSrRjCA/7YaIcsSgHNnBIUE3nZLokrviw35ie8I="; 19 }; 20 dontUnpack = true; 21 22 + nativeBuildInputs = [ 23 + makeBinaryWrapper 24 + copyDesktopItems 25 + unzip 26 + ] ++ lib.optionals stdenv.isDarwin [ 27 + desktopToDarwinBundle 28 + ]; 29 30 desktopItems = [ 31 (makeDesktopItem { 32 + name = "logisim"; 33 desktopName = "Logisim"; 34 exec = "logisim"; 35 icon = "logisim"; 36 + comment = finalAttrs.meta.description; 37 categories = [ "Education" ]; 38 }) 39 ]; ··· 48 unzip $src "resources/logisim/img/*" 49 for size in 16 20 24 48 64 128 50 do 51 + install -Dm444 "./resources/logisim/img/logisim-icon-$size.png" "$out/share/icons/hicolor/''${size}x''${size}/apps/logisim.png" 52 done 53 54 runHook postInstall 55 ''; 56 57 + meta = { 58 homepage = "http://www.cburch.com/logisim/"; 59 description = "Educational tool for designing and simulating digital logic circuits"; 60 mainProgram = "logisim"; 61 + maintainers = with lib.maintainers; [ emilytrau ]; 62 + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; 63 + license = lib.licenses.gpl2Only; 64 + platforms = lib.platforms.unix; 65 }; 66 + })
+42 -22
pkgs/development/tools/mars-mips/default.nix
··· 1 - { lib, stdenvNoCC, fetchurl, makeWrapper, copyDesktopItems, makeDesktopItem, unzip, imagemagick, jre }: 2 3 - stdenvNoCC.mkDerivation rec { 4 pname = "mars-mips"; 5 version = "4.5"; 6 7 src = fetchurl { 8 - url = "https://courses.missouristate.edu/KenVollmar/MARS/MARS_${lib.replaceStrings ["."] ["_"] version}_Aug2014/Mars${lib.replaceStrings ["."] ["_"] version}.jar"; 9 - sha256 = "15kh1fahkkbbf4wvb6ijzny4fi5dh4pycxyzp5325dm2ddkhnd5c"; 10 }; 11 12 dontUnpack = true; 13 14 - nativeBuildInputs = [ makeWrapper copyDesktopItems unzip imagemagick ]; 15 16 desktopItems = [ 17 (makeDesktopItem { 18 - name = pname; 19 desktopName = "MARS"; 20 - exec = "mars-mips"; 21 - icon = "mars-mips"; 22 - comment = "An IDE for programming in MIPS assembly language"; 23 categories = [ "Development" "IDE" ]; 24 }) 25 ]; ··· 27 installPhase = '' 28 runHook preInstall 29 30 - export JAR=$out/share/java/${pname}/${pname}.jar 31 - install -D $src $JAR 32 - makeWrapper ${jre}/bin/java $out/bin/${pname} \ 33 --add-flags "-jar $JAR" 34 35 - unzip ${src} images/MarsThumbnail.gif 36 - mkdir -p $out/share/pixmaps 37 - convert images/MarsThumbnail.gif $out/share/pixmaps/mars-mips.png 38 39 runHook postInstall 40 ''; 41 42 - meta = with lib; { 43 description = "An IDE for programming in MIPS assembly language intended for educational-level use"; 44 - mainProgram = "mars-mips"; 45 homepage = "https://courses.missouristate.edu/KenVollmar/MARS/"; 46 - sourceProvenance = with sourceTypes; [ binaryBytecode ]; 47 - license = licenses.mit; 48 - maintainers = with maintainers; [ emilytrau ]; 49 - platforms = platforms.all; 50 }; 51 - }
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , makeBinaryWrapper 5 + , copyDesktopItems 6 + , makeDesktopItem 7 + , desktopToDarwinBundle 8 + , unzip 9 + , imagemagick 10 + , jre 11 + }: 12 13 + stdenv.mkDerivation (finalAttrs: { 14 pname = "mars-mips"; 15 version = "4.5"; 16 17 src = fetchurl { 18 + url = "https://courses.missouristate.edu/KenVollmar/MARS/MARS_${lib.replaceStrings ["."] ["_"] finalAttrs.version}_Aug2014/Mars${lib.replaceStrings ["."] ["_"] finalAttrs.version}.jar"; 19 + hash = "sha256-rDQLZ2uitiJGud935i+BrURHvP0ymrU5cWvNCZULcJY="; 20 }; 21 22 dontUnpack = true; 23 24 + nativeBuildInputs = [ 25 + makeBinaryWrapper 26 + copyDesktopItems 27 + unzip 28 + imagemagick 29 + ] ++ lib.optionals stdenv.isDarwin [ 30 + desktopToDarwinBundle 31 + ]; 32 33 desktopItems = [ 34 (makeDesktopItem { 35 + name = "mars"; 36 desktopName = "MARS"; 37 + exec = "Mars"; 38 + icon = "mars"; 39 + comment = finalAttrs.meta.description; 40 categories = [ "Development" "IDE" ]; 41 }) 42 ]; ··· 44 installPhase = '' 45 runHook preInstall 46 47 + export JAR=$out/share/java/mars/Mars.jar 48 + install -Dm444 $src $JAR 49 + makeWrapper ${jre}/bin/java $out/bin/Mars \ 50 --add-flags "-jar $JAR" 51 52 + unzip $src images/MarsThumbnail.gif 53 + for size in 16 24 32 48 64 128 256 512 54 + do 55 + mkdir -p $out/share/icons/hicolor/"$size"x"$size"/apps 56 + convert -resize "$size"x"$size" images/MarsThumbnail.gif $out/share/icons/hicolor/"$size"x"$size"/apps/mars.png 57 + done 58 59 runHook postInstall 60 ''; 61 62 + meta = { 63 description = "An IDE for programming in MIPS assembly language intended for educational-level use"; 64 + mainProgram = "Mars"; 65 homepage = "https://courses.missouristate.edu/KenVollmar/MARS/"; 66 + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; 67 + license = lib.licenses.mit; 68 + maintainers = with lib.maintainers; [ emilytrau ]; 69 + platforms = lib.platforms.all; 70 }; 71 + })