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