btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / ap / apvlv / package.nix
blob29be0626520880574d9fd394bb01531601bc214d
2   cmake,
3   copyDesktopItems,
4   ebook_tools,
5   fetchFromGitHub,
6   freetype,
7   ghostscript,
8   gtk3,
9   installShellFiles,
10   lib,
11   libepoxy,
12   libpthreadstubs,
13   libXdmcp,
14   libxkbcommon,
15   libxml2,
16   libxshmfence,
17   man,
18   pcre,
19   pkg-config,
20   poppler,
21   stdenv,
22   testers,
23   webkitgtk_4_0,
24   wrapGAppsHook3,
27 stdenv.mkDerivation (finalAttrs: {
28   pname = "apvlv";
30   # If you change the version, please also update src.rev accordingly
31   version = "0.5.0";
33   src = fetchFromGitHub {
34     owner = "naihe2010";
35     repo = "apvlv";
36     rev = "refs/tags/v0.5.0-final";
37     hash = "sha256-5Wbv3dXieymhhPmEKQu8X/38WsDA1T/IBPoMXdpzcaA=";
38   };
40   env.NIX_CFLAGS_COMPILE = "-I${poppler.dev}/include/poppler";
42   nativeBuildInputs = [
43     cmake
44     copyDesktopItems
45     ghostscript
46     installShellFiles
47     man
48     pkg-config
49     wrapGAppsHook3
50   ];
52   buildInputs = [
53     ebook_tools
54     freetype
55     gtk3
56     libepoxy
57     libpthreadstubs
58     libXdmcp
59     libxkbcommon
60     libxml2
61     libxshmfence # otherwise warnings in compilation
62     pcre
63     poppler
64     webkitgtk_4_0
65   ];
67   installPhase = ''
68     runHook preInstall
70     # binary
71     mkdir -p $out/bin
72     cp src/apvlv $out/bin/apvlv
74     # displays pdfStartup.pdf as default pdf entry
75     mkdir -p $out/share/doc/apvlv/
76     cp ../Startup.pdf $out/share/doc/apvlv/Startup.pdf
77     cp ../main_menubar.glade $out/share/doc/apvlv/main_menubar.glade
79     mkdir -p $out/etc
80     cp ../apvlvrc.example $out/etc/apvlvrc
82     installManPage ../apvlv.1
84     runHook postInstall
85   '';
87   desktopItems = [
88     "../apvlv.desktop"
89   ];
91   passthru = {
92     tests.version = testers.testVersion {
93       command = "${lib.getExe finalAttrs.finalPackage} -v";
94       package = finalAttrs.finalPackage;
95       version = "${finalAttrs.version}-rel";
96     };
97   };
99   meta = {
100     changelog = "https://github.com/naihe2010/apvlv/blob/v${finalAttrs.version}/NEWS";
101     description = "PDF viewer with Vim-like behaviour";
102     homepage = "https://naihe2010.github.io/apvlv/";
103     license = lib.licenses.lgpl2;
104     longDescription = ''
105       apvlv is a PDF/DJVU/UMD/TXT Viewer Under Linux/WIN32
106       with Vim-like behaviour.
107     '';
108     mainProgram = "apvlv";
109     maintainers = with lib.maintainers; [ ardumont anthonyroussel ];
110     platforms = lib.platforms.linux;
111   };