Merge pull request #189206 from wegank/scilab-bin-darwin

authored by Sandro and committed by GitHub cba7f9e9 55f4a530

+42 -29
+42 -29
pkgs/applications/science/math/scilab-bin/default.nix
··· 1 - { stdenv, fetchurl, lib, xorg }: 2 3 let 4 - badArch = throw "scilab-bin requires i686-linux or x86_64-linux"; 5 - 6 - architecture = 7 - if stdenv.hostPlatform.system == "i686-linux" then 8 - "i686" 9 - else if stdenv.hostPlatform.system == "x86_64-linux" then 10 - "x86_64" 11 - else 12 - badArch; 13 - in 14 - stdenv.mkDerivation rec { 15 pname = "scilab-bin"; 16 version = "6.1.1"; 17 18 - src = fetchurl { 19 - url = "https://www.scilab.org/download/${version}/scilab-${version}.bin.linux-${architecture}.tar.gz"; 20 - sha256 = 21 - if stdenv.hostPlatform.system == "i686-linux" then 22 - "0fgjc2ak3b2qi6yin3fy50qwk2bcj0zbz1h4lyyic9n1n1qcliib" 23 - else if stdenv.hostPlatform.system == "x86_64-linux" then 24 - "sha256-PuGnz2YdAhriavwnuf5Qyy0cnCeRHlWC6dQzfr7bLHk=" 25 - else 26 - badArch; 27 }; 28 29 libPath = lib.makeLibraryPath [ 30 stdenv.cc.cc ··· 89 # Moving other share/ folders 90 mv $out/opt/scilab-${version}/share/{appdata,locale,mime} $out/share 91 ''; 92 - 93 - meta = { 94 - homepage = "http://www.scilab.org/"; 95 - description = "Scientific software package for numerical computations (Matlab lookalike)"; 96 - sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 97 - # see http://www.scilab.org/legal_notice 98 - license = "Scilab"; 99 }; 100 - }
··· 1 + { lib, stdenv, fetchurl, undmg, makeWrapper, xorg }: 2 3 let 4 pname = "scilab-bin"; 5 version = "6.1.1"; 6 7 + srcs = { 8 + aarch64-darwin = fetchurl { 9 + url = "https://www.utc.fr/~mottelet/scilab/download/${version}/scilab-${version}-accelerate-arm64.dmg"; 10 + sha256 = "sha256-L4dxD8R8bY5nd+4oDs5Yk0LlNsFykLnAM+oN/O87SRI="; 11 + }; 12 + x86_64-darwin = fetchurl { 13 + url = "https://www.utc.fr/~mottelet/scilab/download/${version}/scilab-${version}-x86_64.dmg"; 14 + sha256 = "sha256-tBeqzllMuogrGcJxGqEl2DdNXaiwok3yhzWSdlWY5Fc="; 15 + }; 16 + x86_64-linux = fetchurl { 17 + url = "https://www.scilab.org/download/${version}/scilab-${version}.bin.linux-x86_64.tar.gz"; 18 + sha256 = "sha256-PuGnz2YdAhriavwnuf5Qyy0cnCeRHlWC6dQzfr7bLHk="; 19 + }; 20 + }; 21 + src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); 22 + 23 + meta = { 24 + homepage = "http://www.scilab.org/"; 25 + description = "Scientific software package for numerical computations (Matlab lookalike)"; 26 + platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ]; 27 + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 28 + license = lib.licenses.gpl2Only; 29 }; 30 + 31 + darwin = stdenv.mkDerivation rec { 32 + inherit pname version src meta; 33 + 34 + nativeBuildInputs = [ undmg makeWrapper ]; 35 + 36 + sourceRoot = "scilab-${version}.app"; 37 + 38 + installPhase = '' 39 + mkdir -p $out/{Applications/scilab.app,bin} 40 + cp -R . $out/Applications/scilab.app 41 + makeWrapper $out/{Applications/scilab.app/Contents/MacOS,bin}/scilab 42 + ''; 43 + }; 44 + 45 + linux = stdenv.mkDerivation rec { 46 + inherit pname version src meta; 47 48 libPath = lib.makeLibraryPath [ 49 stdenv.cc.cc ··· 108 # Moving other share/ folders 109 mv $out/opt/scilab-${version}/share/{appdata,locale,mime} $out/share 110 ''; 111 }; 112 + in 113 + if stdenv.isDarwin then darwin else linux