bin.nix (1941B)
1 { lib 2 , stdenv 3 , fetchurl 4 , fetchgit 5 , fetchgdrive 6 , unzip 7 , wine 8 , makeWrapper 9 , withMaps ? true 10 , withExtremum ? true 11 }: 12 let 13 maps = fetchgit { 14 url = "http://parasite.kicks-ass.org:3000/sasgis/maps.git"; 15 rev = "950e1b8a02ae7ac84a6ba55e93b57d63cd064688"; 16 hash = "sha256-Zz9//kVxqrNhDvgq3YNDRwRUd+mebFgVcXsSmEx1KzQ="; 17 }; 18 extremum = fetchgdrive { 19 id = "12PM_mEE8Xck036vXd5TAzPsUZeCnztJ5"; 20 hash = "sha256-6ZF4PsEFEGYt85umWJ/ToBW3JdeKEF4n6uU73hU8oLs="; 21 name = "Extremum.zip"; 22 }; 23 in 24 stdenv.mkDerivation (finalAttrs: { 25 pname = "sasplanet-bin"; 26 version = "201212"; 27 28 src = fetchurl { 29 url = "http://www.sasgis.org/programs/sasplanet/SASPlanet_${finalAttrs.version}.zip"; 30 hash = "sha256-IHJjamzGMy/iSfvQmWU58rYE3AZToz+YB1cR6cp53Sg="; 31 }; 32 33 nativeBuildInputs = [ unzip makeWrapper ]; 34 35 # Post install regedit: 36 # * increase font size: https://askubuntu.com/a/1313810 37 # * dark theme: https://gist.github.com/Zeinok/ceaf6ff204792dde0ae31e0199d89398 38 installPhase = '' 39 mkdir -p $out/opt/sasplanet 40 cp -r . $out/opt/sasplanet 41 42 makeWrapper ${wine}/bin/wine $out/bin/sasplanet \ 43 --run "[ -d \$HOME/.sasplanet ] || { cp -r $out/opt/sasplanet \$HOME/.sasplanet && chmod -R +w \$HOME/.sasplanet; }" \ 44 --add-flags "\$HOME/.sasplanet/SASPlanet.exe" 45 '' + lib.optionalString withMaps '' 46 cp -r ${maps}/* $out/opt/sasplanet/Maps/sas.maps 47 '' + lib.optionalString withExtremum '' 48 unzip ${extremum} -d $out/opt/sasplanet/Maps/sas.maps 49 ''; 50 51 preferLocalBuild = true; 52 53 meta = with lib; { 54 description = "SAS.Planet is a program designed for viewing and downloading high-resolution satellite imagery and conventional maps"; 55 homepage = "http://www.sasgis.org/sasplaneta/"; 56 changelog = "http://www.sasgis.org/mantis/changelog_page.php"; 57 license = licenses.gpl3Plus; 58 maintainers = [ maintainers.sikmir ]; 59 platforms = platforms.all; 60 skip.ci = true; 61 }; 62 })