nur-packages

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

package.nix (1498B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchurl,
      5   unzip,
      6   wine,
      7   makeWrapper,
      8   withExLexer ? true,
      9 }:
     10 let
     11   exlexer = fetchurl {
     12     url = "mirror://sourceforge/synwrite-addons/PyPlugins/plugin.Alexey.ExLexer.zip";
     13     hash = "sha256-O9wOglJp4XExWV8ODoVra3VyaqRmhB51/tupRmqDdqY=";
     14   };
     15 in
     16 stdenv.mkDerivation rec {
     17   pname = "synwrite";
     18   version = "6.41.2780";
     19 
     20   __structuredAttrs = true;
     21 
     22   src = fetchurl {
     23     urls = [
     24       "mirror://sourceforge/synwrite/Release/SynWrite.${version}.zip"
     25       "http://uvviewsoft.com/synwrite/files/SynWrite.${version}.zip"
     26     ];
     27     hash = "sha256-/WleyQoo98RLX1MJGVjjlPmZJHxiCV4ulrb1eqNHOZ8=";
     28   };
     29 
     30   sourceRoot = ".";
     31 
     32   nativeBuildInputs = [
     33     unzip
     34     makeWrapper
     35   ];
     36 
     37   installPhase = ''
     38     mkdir -p $out/opt/synwrite
     39     cp -r . $out/opt/synwrite
     40 
     41     makeWrapper ${wine}/bin/wine $out/bin/synwrite \
     42       --run "[ -d \$HOME/.synwrite ] || { cp -r $out/opt/synwrite \$HOME/.synwrite && chmod -R +w \$HOME/.synwrite; }" \
     43       --add-flags "\$HOME/.synwrite/Syn.exe"
     44   ''
     45   + lib.optionalString withExLexer ''
     46     unzip ${exlexer} -d $out/opt/synwrite/Py/syn_exlexer
     47   '';
     48 
     49   preferLocalBuild = true;
     50 
     51   meta = {
     52     description = "Advanced text editor for programmers and Notepad replacement";
     53     homepage = "https://cudatext.github.io/synwrite/";
     54     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
     55     license = lib.licenses.mpl11;
     56     maintainers = [ lib.maintainers.sikmir ];
     57     platforms = lib.platforms.all;
     58     skip.ci = true;
     59   };
     60 }