nur-packages

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

default.nix (2205B)


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