2023-06-28 14:54:20 +08:00
|
|
|
{
|
|
|
|
lib, stdenv, fetchurl, autoPatchelfHook, wrapGAppsHook,
|
|
|
|
glib, gtk2, xorg, libGLU, gtk3, writeShellScript, gsettings-desktop-schemas, xdg-utils
|
|
|
|
}:
|
2023-06-25 11:38:01 +08:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec
|
|
|
|
{
|
|
|
|
pname = "vesta";
|
2023-06-25 11:45:15 +08:00
|
|
|
version = "3.5.5";
|
2023-06-25 11:38:01 +08:00
|
|
|
src = fetchurl
|
|
|
|
{
|
2023-06-25 11:45:15 +08:00
|
|
|
url = "https://jp-minerals.org/vesta/archives/${version}/VESTA-gtk3.tar.bz2";
|
|
|
|
sha256 = "sRzQNJA7+hsjLWmykqe6bH0p1/aGEB8hCuxCyPzxYHs=";
|
2023-06-25 11:38:01 +08:00
|
|
|
};
|
|
|
|
desktopFile = fetchurl
|
|
|
|
{
|
|
|
|
url = "https://aur.archlinux.org/cgit/aur.git/plain/VESTA.desktop?h=vesta&id=4fae08afc37ee0fd88d14328cf0d6b308fea04d1";
|
|
|
|
sha256 = "Tq4AzQgde2KIWKA1k6JlxvdphGG9JluHMZjVw0fBUeQ=";
|
|
|
|
};
|
|
|
|
|
2023-07-18 18:39:40 +08:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook ];
|
|
|
|
buildInputs = [ glib gtk2 xorg.libXxf86vm libGLU gtk3 xorg.libXtst ];
|
2023-06-25 11:38:01 +08:00
|
|
|
|
|
|
|
unpackPhase = "tar -xf ${src}";
|
|
|
|
|
2023-07-25 18:06:24 +08:00
|
|
|
installPhase =
|
2023-06-28 14:54:20 +08:00
|
|
|
# Note '<<-' here, it strips tabs before EOF. It doesn't work with spaces
|
2023-06-25 11:38:01 +08:00
|
|
|
''
|
2023-06-28 14:54:20 +08:00
|
|
|
echo $out
|
2023-06-25 11:38:01 +08:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp ${desktopFile} $out/share/applications/vesta.desktop
|
|
|
|
sed -i "s|Exec=.*|Exec=$out/bin/vesta|" $out/share/applications/vesta.desktop
|
2023-06-28 14:54:20 +08:00
|
|
|
sed -i "s|Icon=.*|Icon=$out/opt/VESTA-gtk3/img/logo.png|" $out/share/applications/vesta.desktop
|
2023-06-25 11:38:01 +08:00
|
|
|
|
|
|
|
mkdir -p $out/opt
|
|
|
|
cp -r VESTA-gtk3 $out/opt/VESTA-gtk3
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2023-06-28 14:54:20 +08:00
|
|
|
tee $out/bin/vesta <<- EOF
|
|
|
|
#!${stdenv.shell}
|
|
|
|
export XDG_DATA_DIRS=$GSETTINGS_SCHEMAS_PATH\''${XDG_DATA_DIRS:+:}\$XDG_DATA_DIRS
|
|
|
|
export PATH="\$PATH\''${PATH:+:}${xdg-utils}/bin"
|
|
|
|
$out/opt/VESTA-gtk3/VESTA "\$@"
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/vesta
|
2023-06-25 11:38:01 +08:00
|
|
|
|
|
|
|
patchelf --remove-needed libjawt.so $out/opt/VESTA-gtk3/PowderPlot/libswt-awt-gtk-3346.so
|
|
|
|
'';
|
|
|
|
}
|