nur-packages

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

bin.nix (1894B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchfromgh,
      5   appimageTools,
      6   undmg,
      7 }:
      8 let
      9   inherit (stdenv.hostPlatform) system;
     10   throwSystem = throw "Unsupported system: ${system}";
     11 
     12   pname = "goldencheetah-bin";
     13   version = "3.5";
     14 
     15   suffix =
     16     {
     17       x86_64-linux = "amd64_Linux.AppImage";
     18       x86_64-darwin = "64bit_MacOS.dmg";
     19     }
     20     .${system} or throwSystem;
     21 
     22   src = fetchfromgh {
     23     owner = "GoldenCheetah";
     24     repo = "GoldenCheetah";
     25     version = "V${version}";
     26     name = "GoldenCheetah_v${version}_${suffix}";
     27     sha256 =
     28       {
     29         x86_64-linux = "07ixivsp5j05a3zsbqx5jf11x7m3rcqaw095qjqrwd0nq0nmmhg8";
     30         x86_64-darwin = "0alg0a071lpkx0v3qqkqbb93vh1nsb3d7czxl9m15v17akp8nl82";
     31       }
     32       .${system} or throwSystem;
     33   };
     34 
     35   appimageContents = appimageTools.extract { inherit pname version src; };
     36 
     37   meta = {
     38     description = "Performance software for cyclists, runners and triathletes";
     39     homepage = "https://www.goldencheetah.org/";
     40     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
     41     license = lib.licenses.gpl3;
     42     maintainers = [ lib.maintainers.sikmir ];
     43     platforms = [
     44       "x86_64-linux"
     45       "x86_64-darwin"
     46     ];
     47     skip.ci = true;
     48   };
     49 
     50   linux = appimageTools.wrapType2 rec {
     51     inherit
     52       pname
     53       version
     54       src
     55       meta
     56       ;
     57 
     58     extraInstallCommands = ''
     59       mv $out/bin/{${pname}-${version},goldencheetah}
     60       install -Dm644 ${appimageContents}/GoldenCheetah.desktop -t $out/share/applications
     61       install -Dm644 ${appimageContents}/gc.png -t $out/share/icons/hicolor/256x256/apps
     62     '';
     63   };
     64 
     65   darwin = stdenv.mkDerivation {
     66     inherit pname version meta;
     67 
     68     preferLocalBuild = true;
     69 
     70     nativeBuildInputs = [ undmg ];
     71 
     72     installPhase = ''
     73       mkdir -p $out/Applications/GoldenCheetah.app
     74       cp -r . $out/Applications/GoldenCheetah.app
     75     '';
     76   };
     77 in
     78 if stdenv.isDarwin then darwin else linux