nur-packages

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

base.nix (1813B)


      1 { lib
      2 , stdenv
      3 , fetchgdrive
      4 , unzip
      5 , gsettings-desktop-schemas
      6 , gtk3
      7 , wxgtk
      8 , libredirect
      9 , makeWrapper
     10 , wrapGAppsHook
     11 , pname
     12 , version
     13 , id
     14 , sha256
     15 , description
     16 , homepage
     17 }:
     18 
     19 stdenv.mkDerivation {
     20   inherit pname version;
     21 
     22   src = fetchgdrive {
     23     inherit id sha256;
     24     name = "${pname}_linux64.zip";
     25   };
     26 
     27   sourceRoot = ".";
     28 
     29   nativeBuildInputs = [ makeWrapper wrapGAppsHook unzip ];
     30 
     31   buildInputs = [ gsettings-desktop-schemas gtk3 ];
     32 
     33   dontStrip = true;
     34   dontPatchELF = true;
     35 
     36   installPhase = ''
     37     [ -f ${pname} ] && install -Dm755 ${pname} -t $out/bin
     38     [ -f ${pname}_linux ] && install -Dm755 ${pname}_linux $out/bin/${pname}
     39     install -Dm644 *.so -t $out/lib
     40     install -Dm644 *.{pdf,txt} -t $out/share/doc/${pname}
     41     install -dm755 $out/share/${pname}
     42     cp -r *_Structure $out/share/${pname}
     43   '';
     44 
     45   preFixup = ''
     46     patchelf --replace-needed "./libTdhCairo.so" libTdhCairo.so \
     47       --replace-needed "./libTdhCommon.so" libTdhCommon.so \
     48       --replace-needed "./libTdhVGbase.so" libTdhVGbase.so \
     49       --replace-needed "./libTdhWx.so" libTdhWx.so \
     50       $out/bin/${pname}
     51 
     52     patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
     53       --set-rpath "$out/lib:${lib.makeLibraryPath [ stdenv.cc.cc.lib wxgtk ]}" \
     54       $out/bin/${pname}
     55 
     56     gappsWrapperArgs+=(
     57       --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
     58       --set NIX_REDIRECTS "$out/bin/${pname}_Structure=$out/share/${pname}/${pname}_Structure"
     59     )
     60   '';
     61 
     62   preferLocalBuild = true;
     63 
     64   meta = with lib; {
     65     inherit description homepage;
     66     license = licenses.cc-by-nc-sa-40;
     67     maintainers = with maintainers; [ sikmir ];
     68     platforms = [ "x86_64-linux" ];
     69     skip.ci = true;
     70     broken = true; # wxGTK30 has been removed from nixpkgs as it has reached end of life
     71   };
     72 }