nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (2082B)


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