Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / office / qnotero / default.nix
blobff7ce4121298860c1637acbadf3076065f7823ea
1 { lib, stdenv, fetchFromGitHub, python3Packages, wrapQtAppsHook }:
3 python3Packages.buildPythonPackage rec {
4   pname = "qnotero";
6   version = "2.3.1";
8   src = fetchFromGitHub {
9     owner = "ealbiter";
10     repo = pname;
11     rev = "refs/tags/v${version}";
12     sha256 = "sha256-Rym7neluRbYCpuezRQyLc6gSl3xbVR9fvhOxxW5+Nzo=";
13   };
15   propagatedBuildInputs = [ python3Packages.pyqt5 wrapQtAppsHook ];
17   patchPhase = ''
18       substituteInPlace ./setup.py \
19         --replace "/usr/share" "usr/share"
21       substituteInPlace ./libqnotero/_themes/light.py \
22          --replace "/usr/share" "$out/usr/share"
23   '';
25   preFixup = ''
26     wrapQtApp "$out"/bin/qnotero
27   '';
29   postInstall = ''
30     mkdir $out/share
31     mv $out/usr/share/applications $out/share/applications
33     substituteInPlace $out/share/applications/qnotero.desktop \
34       --replace "Icon=/usr/share/qnotero/resources/light/qnotero.png" "Icon=qnotero"
36     mkdir -p $out/share/icons/hicolor/64x64/apps
37     ln -s $out/usr/share/qnotero/resources/light/qnotero.png \
38       $out/share/icons/hicolor/64x64/apps/qnotero.png
39   '';
41   # no tests executed
42   doCheck = false;
44   meta = {
45     description = "Quick access to Zotero references";
46     homepage = "https://www.cogsci.nl/software/qnotero";
47     license = lib.licenses.gpl2;
48     platforms = lib.platforms.unix;
49     broken = stdenv.isDarwin; # Build fails even after adding cx-freeze to `buildInputs`
50     maintainers = [ lib.maintainers.nico202 ];
51   };