nixpkgs/pkgs/applications/office/beamerpresenter/default.nix

52 lines
1.5 KiB
Nix
Raw Normal View History

2021-05-10 06:27:30 +00:00
{ lib, stdenv, fetchFromGitHub, installShellFiles,
qmake, qtbase, qtmultimedia, wrapQtAppsHook,
poppler, mupdf, freetype, jbig2dec, openjpeg, gumbo,
2021-05-09 21:51:26 +00:00
renderer ? "mupdf" }:
2020-07-06 17:21:56 +00:00
2021-05-09 21:51:26 +00:00
let
renderers = {
2021-05-10 06:27:30 +00:00
mupdf.buildInputs = [ mupdf freetype jbig2dec openjpeg gumbo ];
2021-05-09 21:51:26 +00:00
poppler.buildInputs = [ poppler ];
};
2021-05-10 06:27:30 +00:00
in
stdenv.mkDerivation rec {
2020-07-06 17:21:56 +00:00
pname = "beamerpresenter";
2021-05-09 21:51:26 +00:00
version = "0.2.0";
2020-07-06 17:21:56 +00:00
src = fetchFromGitHub {
owner = "stiglers-eponym";
repo = "BeamerPresenter";
rev = "v${version}";
2021-05-09 21:51:26 +00:00
sha256 = "10i5nc5b5syaqvsixam4lmfiz3b5cphbjfgfqavi5jilq769792a";
2020-07-06 17:21:56 +00:00
};
2021-05-10 06:27:30 +00:00
nativeBuildInputs = [ qmake installShellFiles wrapQtAppsHook ];
2021-05-09 21:51:26 +00:00
buildInputs = [ qtbase qtmultimedia ] ++ renderers.${renderer}.buildInputs;
qmakeFlags = [ "RENDERER=${renderer}" ];
2020-07-06 17:21:56 +00:00
postPatch = ''
shopt -s globstar
2021-05-09 21:51:26 +00:00
for f in **/*.{pro,conf,h,cpp}; do
substituteInPlace "$f" \
--replace "/usr/" "$out/" \
--replace "/etc/" "$out/etc/" \
--replace '$${GUI_CONFIG_PATH}' "$out/etc/xdg/beamerpresenter/gui.json"
2020-07-06 17:21:56 +00:00
done
'';
2021-05-10 06:27:30 +00:00
postInstall = lib.optionalString stdenv.isDarwin ''
wrapQtApp "$out"/bin/beamerpresenter.app/Contents/MacOS/beamerpresenter
'';
meta = with lib; {
2021-05-09 21:51:26 +00:00
description = "Modular multi screen pdf presentation software respecting your window manager";
2020-07-06 17:21:56 +00:00
homepage = "https://github.com/stiglers-eponym/BeamerPresenter";
2021-05-09 21:51:26 +00:00
license = licenses.agpl3Plus;
2020-07-06 17:21:56 +00:00
platforms = platforms.all;
maintainers = with maintainers; [ pacien ];
};
}