nixpkgs/pkgs/applications/misc/polar-bookshelf1/default.nix
Jan Tojnar eb04659fc2 treewide: wrapGAppsHook → wrapGAppsHook3
This was achieved using the following command:

    sd 'wrapGAppsHook\b' wrapGAppsHook3 (rg -l 'wrapGAppsHook\b')

And then manually reverted the following changes:

- alias in top-level.nix
- function name in wrap-gapps-hook.sh
- comment in postFixup of at-spi2-core
- comment in gtk4
- comment in preFixup of 1password-gui/linux.nix
- comment in postFixup of qgis/unwrapped-ltr.nix and qgis/unwrapped.nix
- comment in postFixup of telegram-desktop
- comment in postFixup of fwupd
- buildCommand of mongodb-compass
- postFixup of xflux-gui
- comment in a patch in kdePackages.kde-gtk-config and plasma5Packages.kde-gtk-config
- description of programs.sway.wrapperFeatures.gtk NixOS option (manual rebuild)
2024-04-27 02:23:22 +02:00

119 lines
2.3 KiB
Nix

{ lib
, stdenv
, fetchurl
, alsa-lib
, at-spi2-atk
, atk
, autoPatchelfHook
, cairo
, cups
, curl
, dbus
, dpkg
, expat
, fontconfig
, gdk-pixbuf
, glib
, glibc
, gsettings-desktop-schemas
, gtk3
, libX11
, libXScrnSaver
, libXcomposite
, libXcursor
, libXdamage
, libXext
, libXfixes
, libXi
, libXrandr
, libXrender
, libXtst
, libnghttp2
, libudev0-shim
, libxcb
, makeWrapper
, nspr
, nss
, openssl
, pango
, wrapGAppsHook3
}:
stdenv.mkDerivation rec {
pname = "polar-bookshelf1";
version = "1.100.14";
src = fetchurl {
url = "https://github.com/burtonator/polar-bookshelf/releases/download/v${version}/polar-bookshelf-${version}-amd64.deb";
hash = "sha256-5xa+Nwu0p1x5DLn1GNI0HDt7GtBGoFQ/9qGTeq9uBgU=";
};
buildInputs = [
alsa-lib
at-spi2-atk
atk
cairo
cups
dbus
expat
fontconfig
gdk-pixbuf
glib
gsettings-desktop-schemas
gtk3
libX11
libXScrnSaver
libXcomposite
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
libxcb
nspr
nss
pango
];
nativeBuildInputs = [
autoPatchelfHook
dpkg
makeWrapper
wrapGAppsHook3
];
runtimeLibs = lib.makeLibraryPath [ libudev0-shim glibc curl openssl libnghttp2 ];
unpackPhase = ''
dpkg-deb -x $src .
'';
installPhase = ''
mkdir -p $out/share/polar-bookshelf $out/bin $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
'';
preFixup = ''
gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "${runtimeLibs}" )
# Correct desktop file `Exec`
substituteInPlace $out/share/applications/polar-bookshelf.desktop \
--replace "/opt/Polar Bookshelf/polar-bookshelf" "$out/bin/polar-bookshelf"
'';
meta = {
homepage = "https://getpolarized.io/";
description = "Personal knowledge repository for PDF and web content supporting incremental reading and document annotation";
mainProgram = "polar-bookshelf";
license = lib.licenses.gpl3Only;
maintainers = [ lib.maintainers.dansbandit ];
platforms = lib.platforms.linux;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
}