2023-01-16 17:25:01 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, libX11, libXinerama, libjpeg, libpng, libtiff
|
|
|
|
, libwebp, pkg-config, librsvg, glib, gtk2, libXext, libXxf86vm, poppler, vlc
|
2023-08-12 07:27:37 +00:00
|
|
|
, ghostscript, makeWrapper, tzdata, makeDesktopItem, copyDesktopItems
|
|
|
|
, directoryListingUpdater }:
|
2009-04-29 16:42:41 +00:00
|
|
|
|
2014-08-19 16:43:37 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "eaglemode";
|
2023-08-12 07:27:37 +00:00
|
|
|
version = "0.96.1";
|
2012-10-04 11:15:01 +00:00
|
|
|
|
2009-04-29 16:42:41 +00:00
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://sourceforge/eaglemode/${pname}-${version}.tar.bz2";
|
2023-08-12 07:27:37 +00:00
|
|
|
hash = "sha256-FIhCcMghzLg7Odcsou9hBw7kIaqLVUFEAKUk9uwRNNw=";
|
2009-04-29 16:42:41 +00:00
|
|
|
};
|
2012-10-04 11:15:01 +00:00
|
|
|
|
2022-12-25 16:29:02 +00:00
|
|
|
# Fixes "Error: No time zones found." on the clock
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/emClock/emTimeZonesModel.cpp --replace "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo"
|
|
|
|
'';
|
|
|
|
|
2023-01-16 17:25:01 +00:00
|
|
|
nativeBuildInputs = [ pkg-config makeWrapper copyDesktopItems ];
|
2022-12-25 16:29:02 +00:00
|
|
|
buildInputs = [ perl libX11 libXinerama libjpeg libpng libtiff libwebp
|
|
|
|
librsvg glib gtk2 libXxf86vm libXext poppler vlc ghostscript ];
|
2012-10-04 11:15:01 +00:00
|
|
|
|
2019-01-01 17:46:51 +00:00
|
|
|
# The program tries to dlopen Xxf86vm, Xext and Xinerama, so we use the
|
2010-10-24 21:27:31 +00:00
|
|
|
# trick on NIX_LDFLAGS and dontPatchELF to make it find them.
|
2009-04-29 16:42:41 +00:00
|
|
|
buildPhase = ''
|
2023-01-16 17:25:01 +00:00
|
|
|
runHook preBuild
|
2019-01-01 17:46:51 +00:00
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -lXxf86vm -lXext -lXinerama"
|
2014-12-04 13:20:47 +00:00
|
|
|
perl make.pl build
|
2023-01-16 17:25:01 +00:00
|
|
|
runHook postBuild
|
2009-04-29 16:42:41 +00:00
|
|
|
'';
|
2010-10-24 21:27:31 +00:00
|
|
|
|
|
|
|
dontPatchELF = true;
|
2019-01-01 17:46:51 +00:00
|
|
|
# eaglemode expects doc to be in the root directory
|
|
|
|
forceShare = [ "man" "info" ];
|
2010-10-24 21:27:31 +00:00
|
|
|
|
2009-04-29 16:42:41 +00:00
|
|
|
installPhase = ''
|
2023-01-16 17:25:01 +00:00
|
|
|
runHook preInstall
|
2009-04-29 16:42:41 +00:00
|
|
|
perl make.pl install dir=$out
|
2019-01-01 17:46:51 +00:00
|
|
|
wrapProgram $out/bin/eaglemode --set EM_DIR "$out" --prefix LD_LIBRARY_PATH : "$out/lib" --prefix PATH : "${ghostscript}/bin"
|
2023-01-16 17:25:01 +00:00
|
|
|
for i in 32 48 96; do
|
|
|
|
mkdir -p $out/share/icons/hicolor/''${i}x''${i}/apps
|
|
|
|
ln -s $out/res/icons/${pname}$i.png $out/share/icons/hicolor/''${i}x''${i}/apps/${pname}.png
|
|
|
|
done
|
|
|
|
runHook postInstall
|
2009-04-29 16:42:41 +00:00
|
|
|
'';
|
2012-10-04 11:15:01 +00:00
|
|
|
|
2023-01-16 17:25:01 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
exec = pname;
|
|
|
|
icon = pname;
|
|
|
|
desktopName = "Eagle Mode";
|
|
|
|
genericName = meta.description;
|
|
|
|
categories = [ "Game" "Graphics" "System" "Utility" ];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-08-12 07:27:37 +00:00
|
|
|
passthru.updateScript = directoryListingUpdater {
|
|
|
|
url = "https://eaglemode.sourceforge.net/download.html";
|
|
|
|
extraRegex = "(?!.*(x86_64|setup64|livecd)).*";
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2023-02-19 20:43:38 +00:00
|
|
|
homepage = "https://eaglemode.sourceforge.net";
|
2009-10-02 07:39:03 +00:00
|
|
|
description = "Zoomable User Interface";
|
2022-12-25 16:29:02 +00:00
|
|
|
changelog = "https://eaglemode.sourceforge.net/ChangeLog.html";
|
2015-05-28 17:20:29 +00:00
|
|
|
license = licenses.gpl3;
|
2023-01-16 17:25:01 +00:00
|
|
|
maintainers = with maintainers; [ chuangzhu ehmry ];
|
2015-11-17 20:29:29 +00:00
|
|
|
platforms = platforms.linux;
|
2009-10-02 07:39:03 +00:00
|
|
|
};
|
2009-04-29 16:42:41 +00:00
|
|
|
}
|