superfile: 1.1.6 -> 1.1.7 (#371308)
[NixPkgs.git] / pkgs / by-name / gl / glamoroustoolkit / package.nix
blob345ebe83d10e24dc1b3292344188e5c8fc96c799
2   lib,
3   stdenv,
4   fetchzip,
5   fetchurl,
6   patchelf,
7   wrapGAppsHook3,
8   cairo,
9   dbus,
10   fontconfig,
11   freetype,
12   glib,
13   gtk3,
14   libX11,
15   libXcursor,
16   libXext,
17   libXi,
18   libXrandr,
19   libXrender,
20   libgit2,
21   libglvnd,
22   libuuid,
23   libxcb,
24   harfbuzz,
25   libsoup_3,
26   webkitgtk_4_1,
27   zenity,
30 stdenv.mkDerivation (finalAttrs: {
31   pname = "glamoroustoolkit";
32   version = "1.1.8";
34   src = fetchzip {
35     url = "https://github.com/feenkcom/gtoolkit-vm/releases/download/v${finalAttrs.version}/GlamorousToolkit-x86_64-unknown-linux-gnu.zip";
36     stripRoot = false;
37     hash = "sha256-r7q8apszeiON3MPMSY7GHHTh+hSXlAl35pUTxFV78kk=";
38   };
40   nativeBuildInputs = [
41     wrapGAppsHook3
42   ];
44   sourceRoot = ".";
46   dontConfigure = true;
47   dontBuild = true;
48   dontPatchELF = true;
49   dontStrip = true;
51   installPhase = ''
52     runHook preInstall
54     install -d $out/bin $out/lib
55     cp -r $src/bin $src/lib $out/
56     cp ${./GlamorousToolkit-GetImage} $out/bin/GlamorousToolkit-GetImage
58     runHook postInstall
59   '';
61   preFixup =
62     let
63       libPath = lib.makeLibraryPath [
64         cairo
65         dbus
66         fontconfig
67         freetype
68         glib
69         gtk3
70         libX11
71         libXcursor
72         libXext
73         libXi
74         libXrandr
75         libXrender
76         libglvnd
77         libuuid
78         libxcb
79         harfbuzz # libWebView.so
80         libsoup_3 # libWebView.so
81         webkitgtk_4_1 # libWebView.so
82         (lib.getLib stdenv.cc.cc)
83       ];
84       binPath = lib.makeBinPath [
85         zenity # File selection dialog
86       ];
87     in
88     ''
89       chmod +x $out/lib/*.so
90       patchelf \
91         --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
92         --set-rpath "${libPath}:$out/lib" \
93         $out/bin/GlamorousToolkit $out/bin/GlamorousToolkit-cli
94       patchelf --shrink-rpath \
95         $out/bin/GlamorousToolkit $out/bin/GlamorousToolkit-cli
96       patchelf \
97         --set-rpath "${libPath}:$out/lib" \
98         $out/lib/*.so
99       patchelf --shrink-rpath $out/lib/*.so
100       #
101       # shrink-rpath gets it wrong for the following libraries,
102       # restore the full rpath.
103       #
104       patchelf \
105         --set-rpath "${libPath}:$out/lib" \
106         $out/lib/libPharoVMCore.so \
107         $out/lib/libWinit.so \
108         $out/lib/libPixels.so
109       patchelf --set-rpath $out/lib $out/lib/libssl.so
111       ln -s $out/lib/libcrypto.so $out/lib/libcrypto.so.1.1
112       ln -s $out/lib/libcairo.so $out/lib/libcairo.so.2
113       rm $out/lib/libgit2.so
114       ln -s "${libgit2}/lib/libgit2.so" $out/lib/libgit2.so.1.1
116       gappsWrapperArgs+=(
117         --prefix PATH : ${binPath}
118       )
119     '';
121   meta = {
122     homepage = "https://gtoolkit.com";
123     description = "GlamorousToolkit Development Environment";
124     license = lib.licenses.mit;
125     maintainers = [ lib.maintainers.akgrant43 ];
126     platforms = [ "x86_64-linux" ];
127     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
128   };