mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
96 lines
2.0 KiB
Nix
96 lines
2.0 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, pkg-config
|
|
, wrapGAppsHook3
|
|
, wrapQtAppsHook
|
|
, gst_all_1
|
|
, qtbase
|
|
, qtsvg
|
|
, qtmultimedia
|
|
, qttools
|
|
, qtwayland
|
|
, zlib
|
|
# only required when using poppler
|
|
, poppler
|
|
# only required when using mupdf
|
|
, freetype
|
|
, gumbo
|
|
, jbig2dec
|
|
, mupdf
|
|
, openjpeg
|
|
# choose renderer: mupdf or poppler or both (not recommended)
|
|
, usePoppler ? false
|
|
, useMupdf ? true
|
|
, useExternalRenderer ? false
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "beamerpresenter";
|
|
version = "0.2.5";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "stiglers-eponym";
|
|
repo = "BeamerPresenter";
|
|
rev = "v${version}";
|
|
hash = "sha256-ofS0KMsn0KG8squIvMPxSCgE/qNK+Kd47psNziLBBoo=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
pkg-config
|
|
wrapGAppsHook3
|
|
wrapQtAppsHook
|
|
];
|
|
|
|
dontWrapGApps = true;
|
|
|
|
buildInputs = [
|
|
gst_all_1.gst-libav
|
|
gst_all_1.gst-plugins-base
|
|
gst_all_1.gst-plugins-good
|
|
zlib
|
|
qtbase
|
|
qtsvg
|
|
qtmultimedia
|
|
qttools
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
qtwayland
|
|
] ++ lib.optionals useMupdf [
|
|
freetype
|
|
gumbo
|
|
jbig2dec
|
|
mupdf
|
|
openjpeg
|
|
] ++ lib.optionals usePoppler [
|
|
poppler
|
|
];
|
|
|
|
cmakeFlags = [
|
|
"-DGIT_VERSION=OFF"
|
|
"-DUSE_POPPLER=${if usePoppler then "ON" else "OFF"}"
|
|
"-DUSE_MUPDF=${if useMupdf then "ON" else "OFF"}"
|
|
"-DUSE_QTPDF=OFF"
|
|
"-DLINK_MUPDF_THIRD=OFF"
|
|
"-DUSE_EXTERNAL_RENDERER=${if useExternalRenderer then "ON" else "OFF"}"
|
|
"-DLINK_MUJS=OFF"
|
|
"-DLINK_GUMBO=ON"
|
|
"-DUSE_TRANSLATIONS=ON"
|
|
"-DQT_VERSION_MAJOR=${lib.versions.major qtbase.version}"
|
|
];
|
|
|
|
preFixup = ''
|
|
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Modular multi screen pdf presentation viewer";
|
|
homepage = "https://github.com/stiglers-eponym/BeamerPresenter";
|
|
license = with licenses; [ agpl3Only gpl3Plus ];
|
|
platforms = platforms.all;
|
|
maintainers = with maintainers; [ pacien dotlambda ];
|
|
mainProgram = "beamerpresenter";
|
|
};
|
|
}
|