Merge pull request #162270 from Artturin/starumlfix

This commit is contained in:
Artturi 2022-03-02 06:00:35 +02:00 committed by GitHub
commit ac5db4d3d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
{ stdenv, lib, fetchurl, makeWrapper { stdenv, lib, fetchurl
, dpkg, patchelf , dpkg, patchelf, wrapGAppsHook
, hicolor-icon-theme
, gtk3, glib, systemd , gtk3, glib, systemd
, xorg, nss, nspr , xorg, nss, nspr
, atk, at-spi2-atk, dbus , atk, at-spi2-atk, dbus
@ -30,7 +31,8 @@ stdenv.mkDerivation rec {
sha256 = "sha256-CUOdpR8RExMLeOX8469egENotMNuPU4z8S1IGqA21z0="; sha256 = "sha256-CUOdpR8RExMLeOX8469egENotMNuPU4z8S1IGqA21z0=";
}; };
nativeBuildInputs = [ makeWrapper dpkg ]; nativeBuildInputs = [ wrapGAppsHook dpkg ];
buildInputs = [ glib hicolor-icon-theme ];
unpackPhase = '' unpackPhase = ''
mkdir pkg mkdir pkg
@ -39,8 +41,14 @@ stdenv.mkDerivation rec {
''; '';
installPhase = '' installPhase = ''
mkdir $out mkdir -p $out/bin
mv opt/StarUML $out/bin mv opt $out
mv usr/share $out
rm -rf $out/share/doc
substituteInPlace $out/share/applications/staruml.desktop \
--replace "/opt/StarUML/staruml" "$out/bin/staruml"
mkdir -p $out/lib mkdir -p $out/lib
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/ ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/
@ -48,9 +56,15 @@ stdenv.mkDerivation rec {
patchelf \ patchelf \
--interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
$out/bin/staruml $out/opt/StarUML/staruml
wrapProgram $out/bin/staruml \
--prefix LD_LIBRARY_PATH : $out/lib:${LD_LIBRARY_PATH} ln -s $out/opt/StarUML/staruml $out/bin/staruml
'';
preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH ':' $out/lib:${LD_LIBRARY_PATH}
)
''; '';
meta = with lib; { meta = with lib; {