nixpkgs/pkgs/by-name/gl/glamoroustoolkit/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

130 lines
2.9 KiB
Nix

{
lib,
stdenv,
fetchzip,
fetchurl,
patchelf,
wrapGAppsHook3,
cairo,
dbus,
fontconfig,
freetype,
glib,
gtk3,
libX11,
libXcursor,
libXext,
libXi,
libXrandr,
libXrender,
libgit2,
libglvnd,
libuuid,
libxcb,
harfbuzz,
libsoup_3,
webkitgtk_4_1,
zenity,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "glamoroustoolkit";
version = "1.1.8";
src = fetchzip {
url = "https://github.com/feenkcom/gtoolkit-vm/releases/download/v${finalAttrs.version}/GlamorousToolkit-x86_64-unknown-linux-gnu.zip";
stripRoot = false;
hash = "sha256-r7q8apszeiON3MPMSY7GHHTh+hSXlAl35pUTxFV78kk=";
};
nativeBuildInputs = [
wrapGAppsHook3
];
sourceRoot = ".";
dontConfigure = true;
dontBuild = true;
dontPatchELF = true;
dontStrip = true;
installPhase = ''
runHook preInstall
install -d $out/bin $out/lib
cp -r $src/bin $src/lib $out/
cp ${./GlamorousToolkit-GetImage} $out/bin/GlamorousToolkit-GetImage
runHook postInstall
'';
preFixup =
let
libPath = lib.makeLibraryPath [
cairo
dbus
fontconfig
freetype
glib
gtk3
libX11
libXcursor
libXext
libXi
libXrandr
libXrender
libglvnd
libuuid
libxcb
harfbuzz # libWebView.so
libsoup_3 # libWebView.so
webkitgtk_4_1 # libWebView.so
(lib.getLib stdenv.cc.cc)
];
binPath = lib.makeBinPath [
zenity # File selection dialog
];
in
''
chmod +x $out/lib/*.so
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libPath}:$out/lib" \
$out/bin/GlamorousToolkit $out/bin/GlamorousToolkit-cli
patchelf --shrink-rpath \
$out/bin/GlamorousToolkit $out/bin/GlamorousToolkit-cli
patchelf \
--set-rpath "${libPath}:$out/lib" \
$out/lib/*.so
patchelf --shrink-rpath $out/lib/*.so
#
# shrink-rpath gets it wrong for the following libraries,
# restore the full rpath.
#
patchelf \
--set-rpath "${libPath}:$out/lib" \
$out/lib/libPharoVMCore.so \
$out/lib/libWinit.so \
$out/lib/libPixels.so
patchelf --set-rpath $out/lib $out/lib/libssl.so
ln -s $out/lib/libcrypto.so $out/lib/libcrypto.so.1.1
ln -s $out/lib/libcairo.so $out/lib/libcairo.so.2
rm $out/lib/libgit2.so
ln -s "${libgit2}/lib/libgit2.so" $out/lib/libgit2.so.1.1
gappsWrapperArgs+=(
--prefix PATH : ${binPath}
)
'';
meta = {
homepage = "https://gtoolkit.com";
description = "GlamorousToolkit Development Environment";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.akgrant43 ];
platforms = [ "x86_64-linux" ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})