about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/jfbview
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/os-specific/linux/jfbview
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/jfbview')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/jfbview/default.nix68
1 files changed, 68 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/jfbview/default.nix b/nixpkgs/pkgs/os-specific/linux/jfbview/default.nix
new file mode 100644
index 000000000000..e037ad98226d
--- /dev/null
+++ b/nixpkgs/pkgs/os-specific/linux/jfbview/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchFromGitHub
+, freetype, harfbuzz, jbig2dec, libjpeg, libX11, mupdf, ncurses, openjpeg
+, openssl
+
+, imageSupport ? true, imlib2 ? null }:
+
+let
+  package = if imageSupport
+    then "jfbview"
+    else "jfbpdf";
+  binaries = if imageSupport
+    then [ "jfbview" "jpdfcat" "jpdfgrep" ] # all require imlib2
+    else [ "jfbpdf" ]; # does not
+in
+
+stdenv.mkDerivation rec {
+  name = "${package}-${version}";
+  version = "0.5.6";
+
+  src = fetchFromGitHub {
+    repo = "JFBView";
+    owner = "jichu4n";
+    rev = version;
+    sha256 = "09rcmlf04aka0yzr25imadi0fl4nlbsxcahs7fhvzx4nql4halqw";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  buildInputs = [
+    freetype harfbuzz jbig2dec libjpeg libX11 mupdf ncurses openjpeg
+    openssl
+  ] ++ stdenv.lib.optionals imageSupport [
+    imlib2
+  ];
+
+  configurePhase = ''
+    # Hack. Probing (`ldconfig -p`) fails with ‘cannot execute binary file’.
+    # Overriding `OPENJP2 =` later works, but makes build output misleading:
+    substituteInPlace Makefile --replace "ldconfig -p" "echo libopenjp2"
+
+    make config.mk
+  '';
+
+  buildFlags = binaries;
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install ${toString binaries} $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "PDF and image viewer for the Linux framebuffer";
+    longDescription = ''
+      A very fast PDF and image viewer for the Linux framebuffer with some
+      advanced and unique features, including:
+      - Reads PDFs (MuPDF) and common image formats (Imlib2)
+      - Supports arbitrary zoom (10% - 1000%) and rotation
+      - Table of Contents (TOC) viewer for PDF documents
+      - Multi-threaded rendering on multi-core machines
+      - Asynchronous background rendering of the next page
+      - Customizable multi-threaded caching
+    '';
+    homepage = https://seasonofcode.com/pages/jfbview.html;
+    license = licenses.asl20;
+    platforms = platforms.linux;
+  };
+}