2018-11-07 13:37:27 +01:00
|
|
|
{ stdenv, lib, makeWrapper, fetchurl
|
|
|
|
, dpkg, wrapGAppsHook, autoPatchelfHook
|
2019-05-22 13:03:39 +02:00
|
|
|
, gtk3, cairo, gnome2, atk, gdk-pixbuf, glib
|
2018-11-07 13:37:27 +01:00
|
|
|
, at-spi2-atk, dbus, libX11, libxcb, libXi
|
|
|
|
, libXcursor, libXdamage, libXrandr, libXcomposite
|
|
|
|
, libXext, libXfixes, libXrender, libXtst, libXScrnSaver
|
|
|
|
, nss, nspr, alsaLib, cups, fontconfig, expat
|
|
|
|
, libudev0-shim, glibc, curl, openssl, libnghttp2, gnome3 }:
|
|
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "polar-bookshelf";
|
2019-03-27 15:42:49 +01:00
|
|
|
version = "1.13.10";
|
2018-11-07 13:37:27 +01:00
|
|
|
|
|
|
|
# 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-bookshelf-${version}-amd64.deb";
|
2019-03-27 15:42:49 +01:00
|
|
|
sha256 = "1bxcyf6n2m5x1z8ic6kzskinyyc6lh6nj0bycbwc524n6ms5j99p";
|
2018-11-07 13:37:27 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gnome3.gsettings_desktop_schemas
|
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
cairo
|
|
|
|
gnome2.pango
|
|
|
|
atk
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf
|
2018-11-07 13:37:27 +01:00
|
|
|
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 13:03:39 +02:00
|
|
|
nativeBuildInputs = [
|
2018-11-07 13:37:27 +01:00
|
|
|
wrapGAppsHook
|
|
|
|
autoPatchelfHook
|
2019-05-22 13:03:39 +02:00
|
|
|
makeWrapper
|
2018-11-07 13:37:27 +01:00
|
|
|
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\ Bookshelf/* $out/share/polar-bookshelf
|
|
|
|
mv $out/share/polar-bookshelf/*.so $out/lib
|
|
|
|
|
|
|
|
mv usr/share/* $out/share/
|
|
|
|
|
|
|
|
ln -s $out/share/polar-bookshelf/polar-bookshelf $out/bin/polar-bookshelf
|
2019-05-22 13:03:39 +02:00
|
|
|
|
2018-11-17 11:01:33 +01:00
|
|
|
# Correct desktop file `Exec`
|
|
|
|
substituteInPlace $out/share/applications/polar-bookshelf.desktop \
|
|
|
|
--replace "/opt/Polar Bookshelf/polar-bookshelf" "$out/bin/polar-bookshelf"
|
2018-11-07 13:37:27 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${runtimeLibs}" )
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://getpolarized.io/";
|
2018-11-07 13:37:27 +01:00
|
|
|
description = "Personal knowledge repository for PDF and web content supporting incremental reading and document annotation";
|
|
|
|
license = stdenv.lib.licenses.gpl3;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.noneucat ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|