3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/misc/polar-bookshelf/default.nix

91 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv, lib, makeWrapper, fetchurl
, dpkg, wrapGAppsHook, autoPatchelfHook
2020-10-25 19:38:25 +00:00
, gtk3, cairo, pango, atk, gdk-pixbuf, glib
, at-spi2-atk, dbus, libX11, libxcb, libXi
, libXcursor, libXdamage, libXrandr, libXcomposite
, libXext, libXfixes, libXrender, libXtst, libXScrnSaver
, nss, nspr, alsaLib, cups, fontconfig, expat
2020-10-25 19:38:25 +00:00
, libudev0-shim, glibc, curl, openssl, libnghttp2, gsettings-desktop-schemas }:
stdenv.mkDerivation rec {
pname = "polar-bookshelf";
version = "2.0.42";
# fetching a .deb because there's no easy way to package this Electron app
src = fetchurl {
url = "https://github.com/burtonator/polar-bookshelf/releases/download/v${version}/polar-desktop-app-${version}-amd64.deb";
hash = "sha256-JyO71wyE6b0iHAYs/6/WbG+OdUVUUPpJla+ZUzg0Gng=";
};
buildInputs = [
2020-10-25 19:38:25 +00:00
gsettings-desktop-schemas
glib
gtk3
cairo
2020-10-25 19:38:25 +00:00
pango
atk
2019-05-22 12:03:39 +01:00
gdk-pixbuf
at-spi2-atk
dbus
libX11
libxcb
libXi
libXcursor
libXdamage
libXrandr
libXcomposite
libXext
libXfixes
libXrender
libXtst
libXScrnSaver
nss
nspr
alsaLib
cups
fontconfig
expat
];
2019-05-22 12:03:39 +01:00
nativeBuildInputs = [
wrapGAppsHook
autoPatchelfHook
2019-05-22 12:03:39 +01:00
makeWrapper
dpkg
];
runtimeLibs = lib.makeLibraryPath [ libudev0-shim glibc curl openssl libnghttp2 ];
unpackPhase = "dpkg-deb -x $src .";
installPhase = ''
mkdir -p $out/share/polar-bookshelf
mkdir -p $out/bin
mkdir -p $out/lib
mv opt/Polar/* $out/share/polar-bookshelf
mv $out/share/polar-bookshelf/*.so $out/lib
mv usr/share/* $out/share/
ln -s $out/share/polar-bookshelf/polar-desktop-app $out/bin/polar-desktop-app
2019-05-22 12:03:39 +01:00
substituteInPlace $out/share/applications/polar-desktop-app.desktop \
--replace "/opt/Polar/polar-desktop-app" "$out/bin/polar-desktop-app"
'';
preFixup = ''
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${runtimeLibs}" )
'';
meta = {
homepage = "https://getpolarized.io/";
description = "Personal knowledge repository for PDF and web content supporting incremental reading and document annotation";
2021-01-15 05:42:41 +00:00
license = lib.licenses.gpl3;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.noneucat ];
};
}