Skip to content

Commit

Permalink
calibre: use qt5.wrapQtAppsHook, partially fixes #65313
Browse files Browse the repository at this point in the history
Still fails due to Qt issue.
  • Loading branch information
FRidh committed Jul 30, 2019
1 parent 92cb811 commit 1190f69
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions pkgs/applications/misc/calibre/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ stdenv, fetchurl, poppler_utils, pkgconfig, libpng
, imagemagick, libjpeg, fontconfig, podofo, qtbase, qmake, icu, sqlite
, makeWrapper, unrarSupport ? false, chmlib, python2Packages, libusb1, libmtp
, xdg_utils, makeDesktopItem, wrapGAppsHook, removeReferencesTo
, xdg_utils, makeDesktopItem, wrapGAppsHook, removeReferencesTo, qt5
}:

stdenv.mkDerivation rec {
Expand Down Expand Up @@ -35,7 +35,7 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

nativeBuildInputs = [ makeWrapper pkgconfig qmake removeReferencesTo ];
nativeBuildInputs = [ makeWrapper pkgconfig qmake removeReferencesTo qt5.wrapQtAppsHook ];

buildInputs = [
poppler_utils libpng imagemagick libjpeg
Expand All @@ -48,6 +48,11 @@ stdenv.mkDerivation rec {
odfpy
]);

qtWrapperArgs = [
"--prefix PYTHONPATH: $PYTHONPATH"
"--prefix PATH: ${poppler_utils.out}/bin}"
];

installPhase = ''
runHook preInstall
Expand All @@ -70,9 +75,8 @@ stdenv.mkDerivation rec {
sed -i "s/env python[0-9.]*/python/" $PYFILES
sed -i "2i import sys; sys.argv[0] = 'calibre'" $out/bin/calibre
for a in $out/bin/*; do
wrapProgram $a --prefix PYTHONPATH : $PYTHONPATH \
--prefix PATH : ${poppler_utils.out}/bin
for program in $out/bin/*; do
wrapQtApp $program
done
# Replace @out@ by the output path.
Expand All @@ -95,6 +99,10 @@ stdenv.mkDerivation rec {
remove-references-to -t ${podofo.dev} $out/lib/calibre/calibre/plugins/podofo.so
'';

postFixup = ''

This comment has been minimized.

Copy link
@Mic92

Mic92 Jul 30, 2019

Member

What is the purpose here?

'';

disallowedReferences = [ podofo.dev ];

calibreDesktopItem = makeDesktopItem {
Expand Down

0 comments on commit 1190f69

Please sign in to comment.