2021-06-02 02:45:13 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, makeWrapper
|
|
|
|
, fetchurl
|
|
|
|
, dpkg
|
|
|
|
, wrapGAppsHook
|
|
|
|
, autoPatchelfHook
|
|
|
|
, 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
|
2021-06-10 02:57:09 +00:00
|
|
|
, alsa-lib
|
2021-06-02 02:45:13 +00:00
|
|
|
, cups
|
|
|
|
, fontconfig
|
|
|
|
, expat
|
|
|
|
, libudev0-shim
|
|
|
|
, glibc
|
|
|
|
, curl
|
|
|
|
, openssl
|
|
|
|
, libnghttp2
|
|
|
|
, gsettings-desktop-schemas
|
|
|
|
, libdrm
|
|
|
|
, mesa
|
|
|
|
}:
|
2018-11-07 12:37:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "polar-bookshelf";
|
2021-06-02 02:45:13 +00:00
|
|
|
version = "2.0.103";
|
2018-11-07 12:37:27 +00:00
|
|
|
|
|
|
|
# fetching a .deb because there's no easy way to package this Electron app
|
|
|
|
src = fetchurl {
|
2020-10-22 11:35:35 +00:00
|
|
|
url = "https://github.com/burtonator/polar-bookshelf/releases/download/v${version}/polar-desktop-app-${version}-amd64.deb";
|
2021-06-02 02:45:13 +00:00
|
|
|
hash = "sha256-jcq0hW698bAhVM3fLQQeKAnld33XLkHsGjS3QwUpciQ=";
|
2018-11-07 12:37:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-02 02:45:13 +00:00
|
|
|
libdrm
|
|
|
|
mesa
|
2020-10-25 19:38:25 +00:00
|
|
|
gsettings-desktop-schemas
|
2018-11-07 12:37:27 +00:00
|
|
|
glib
|
|
|
|
gtk3
|
|
|
|
cairo
|
2020-10-25 19:38:25 +00:00
|
|
|
pango
|
2018-11-07 12:37:27 +00:00
|
|
|
atk
|
2019-05-22 11:03:39 +00:00
|
|
|
gdk-pixbuf
|
2018-11-07 12:37:27 +00:00
|
|
|
at-spi2-atk
|
|
|
|
dbus
|
|
|
|
libX11
|
|
|
|
libxcb
|
|
|
|
libXi
|
|
|
|
libXcursor
|
|
|
|
libXdamage
|
|
|
|
libXrandr
|
|
|
|
libXcomposite
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXrender
|
|
|
|
libXtst
|
|
|
|
libXScrnSaver
|
|
|
|
nss
|
|
|
|
nspr
|
2021-06-10 02:57:09 +00:00
|
|
|
alsa-lib
|
2018-11-07 12:37:27 +00:00
|
|
|
cups
|
|
|
|
fontconfig
|
|
|
|
expat
|
|
|
|
];
|
|
|
|
|
2019-05-22 11:03:39 +00:00
|
|
|
nativeBuildInputs = [
|
2018-11-07 12:37:27 +00:00
|
|
|
wrapGAppsHook
|
|
|
|
autoPatchelfHook
|
2019-05-22 11:03:39 +00:00
|
|
|
makeWrapper
|
2018-11-07 12:37:27 +00:00
|
|
|
dpkg
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeLibs = lib.makeLibraryPath [ libudev0-shim glibc curl openssl libnghttp2 ];
|
|
|
|
|
|
|
|
unpackPhase = "dpkg-deb -x $src .";
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-06-02 02:45:13 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2018-11-07 12:37:27 +00:00
|
|
|
mkdir -p $out/share/polar-bookshelf
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/lib
|
|
|
|
|
2020-10-22 11:35:35 +00:00
|
|
|
mv opt/Polar/* $out/share/polar-bookshelf
|
2018-11-07 12:37:27 +00:00
|
|
|
mv $out/share/polar-bookshelf/*.so $out/lib
|
|
|
|
|
|
|
|
mv usr/share/* $out/share/
|
|
|
|
|
2020-10-22 11:35:35 +00:00
|
|
|
ln -s $out/share/polar-bookshelf/polar-desktop-app $out/bin/polar-desktop-app
|
2019-05-22 11:03:39 +00:00
|
|
|
|
2020-10-22 11:35:35 +00:00
|
|
|
substituteInPlace $out/share/applications/polar-desktop-app.desktop \
|
|
|
|
--replace "/opt/Polar/polar-desktop-app" "$out/bin/polar-desktop-app"
|
2021-06-02 02:45:13 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2018-11-07 12:37:27 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${runtimeLibs}" )
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://getpolarized.io/";
|
2018-11-07 12:37:27 +00:00
|
|
|
description = "Personal knowledge repository for PDF and web content supporting incremental reading and document annotation";
|
2022-06-04 22:19:25 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
2021-06-02 02:45:13 +00:00
|
|
|
license = lib.licenses.gpl3Only;
|
2021-01-15 05:42:41 +00:00
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = [ lib.maintainers.noneucat ];
|
2018-11-07 12:37:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|