base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / pa / paperlib / package.nix
blobd39e35be942bafec5537d2a9d79ee16cc53095d7
2   lib,
3   stdenv,
4   fetchurl,
5   appimageTools,
6   undmg,
7 }:
8 let
9   pname = "paperlib";
10   version = "3.1.6";
11   src =
12     fetchurl
13       {
14         x86_64-darwin = {
15           url = "https://github.com/Future-Scholars/peperlib/releases/download/release-electron-${version}/Paperlib_${version}.dmg";
16           hash = "sha256-d9vEFx59K15PO7DJYJQ2fjiagqa8oJLtoawILDF9IKc=";
17         };
18         x86_64-linux = {
19           url = "https://github.com/Future-Scholars/paperlib/releases/download/release-electron-${version}/Paperlib_${version}.AppImage";
20           hash = "sha256-2xbn9UWlcf37n9jZdZKyyevzsag6SW9YuQH/bYCRmLQ=";
21         };
22       }
23       .${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
25   passthru = {
26     inherit pname version src;
27   };
29   meta = {
30     homepage = "https://github.com/Future-Scholars/paperlib?";
31     description = "Open-source academic paper management tool";
32     license = lib.licenses.gpl3Only;
33     maintainers = with lib.maintainers; [ ByteSudoer ];
34     platforms = [
35       "x86_64-darwin"
36       "x86_64-linux"
37     ];
38     mainProgram = "paperlib";
39     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
40   };
42 if stdenv.hostPlatform.isDarwin then
43   stdenv.mkDerivation {
44     inherit
45       pname
46       version
47       src
48       meta
49       passthru
50       ;
52     nativeBuildInputs = [ undmg ];
54     installPhase = ''
55       runHook preInstall
56       mkdir -p "$out/Applications"
57       mv Paperlib.app $out/Applications/
58       runHook postInstall
59     '';
60   }
61 else
62   appimageTools.wrapType2 {
63     inherit
64       pname
65       version
66       src
67       meta
68       passthru
69       ;
71     extraPkgs = pkgs: [ pkgs.libsecret ];
72   }