Unverified Commit 9386013e authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

kchmviewer: enable on unix (#410878)

parents 1938d26a f399a6d5
Loading
Loading
Loading
Loading
+81 −0
Original line number Diff line number Diff line
@@ -3,64 +3,79 @@
  stdenv,
  fetchFromGitHub,
  fetchpatch,
  qmake,
  wrapQtAppsHook,
  qt5,
  chmlib,
  libzip,
  qtwebengine,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "kchmviewer";
  version = "8.0";

  src = fetchFromGitHub {
    owner = "gyunaev";
    repo = pname;
    rev = "RELEASE_${lib.replaceStrings [ "." ] [ "_" ] version}";
    sha256 = "sha256-YNpiBf6AFBCRbAZRPODvqGbQQedJJJrZFQIQyzIeBlw=";
    repo = "kchmviewer";
    tag = "RELEASE_${lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version}";
    hash = "sha256-YNpiBf6AFBCRbAZRPODvqGbQQedJJJrZFQIQyzIeBlw=";
  };

  patches = [
    # remove unused webkit
    (fetchpatch {
      url = "https://github.com/gyunaev/kchmviewer/commit/a4a3984465cb635822953350c571950ae726b539.patch";
      sha256 = "sha256-nHW18a4SrTG4fETJmKS4ojHXwnX1d1uN1m4H0GIuI28=";
      hash = "sha256-nHW18a4SrTG4fETJmKS4ojHXwnX1d1uN1m4H0GIuI28=";
    })
    # QtWebengine fixes
    (fetchpatch {
      url = "https://github.com/gyunaev/kchmviewer/commit/9ac73e7ad15de08aab6b1198115be2eb44da7afe.patch";
      sha256 = "sha256-qg2ytqA2On7jg19WZmHIOU7vLQI2hoyqItySLEA64SY=";
      hash = "sha256-qg2ytqA2On7jg19WZmHIOU7vLQI2hoyqItySLEA64SY=";
    })
    (fetchpatch {
      url = "https://github.com/gyunaev/kchmviewer/commit/99a6d94bdfce9c4578cce82707e71863a71d1453.patch";
      sha256 = "sha256-o8JkaMmcJObmMt+o/6ooCAPCi+yRAWDAgxV+tR5eHfY=";
      hash = "sha256-o8JkaMmcJObmMt+o/6ooCAPCi+yRAWDAgxV+tR5eHfY=";
    })
    # Fix build on macOS
    (fetchpatch {
      url = "https://github.com/gyunaev/kchmviewer/pull/35/commits/b68ed6fe72eaf9ee4e7e42925f5071fbd02dc6b3.patch";
      hash = "sha256-sJA0RE0Z83tYv0S42yQYWKKeLhW+YDsrxLkY5aMKKT4=";
    })
    (fetchpatch {
      url = "https://github.com/gyunaev/kchmviewer/pull/35/commits/d307e4e829c5a6f57ab0040f786c3da7fd2f0a99.patch";
      hash = "sha256-FWYfqG8heL6AnhevueCWHQc+c6Yj4+DuIdjIwXVZ+O4=";
    })
  ];

  buildInputs = [
    chmlib
    libzip
    qtwebengine
    qt5.qtwebengine
  ];

  nativeBuildInputs = [
    qmake
    wrapQtAppsHook
    qt5.qmake
    qt5.wrapQtAppsHook
  ];

  postInstall = ''
  postInstall =
    if stdenv.hostPlatform.isDarwin then
      ''
        mkdir -p $out/{Applications,bin}
        mv bin/kchmviewer.app $out/Applications
        ln -s $out/Applications/kchmviewer.app/Contents/MacOS/kchmviewer $out/bin/kchmviewer
      ''
    else
      ''
        install -Dm755 bin/kchmviewer -t $out/bin
        install -Dm644 packages/kchmviewer.png -t $out/share/pixmaps
        install -Dm644 packages/kchmviewer.desktop -t $out/share/applications
      '';

  meta = with lib; {
  meta = {
    description = "CHM (Winhelp) files viewer";
    mainProgram = "kchmviewer";
    homepage = "http://www.ulduzsoft.com/linux/kchmviewer/";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ sikmir ];
    platforms = platforms.linux;
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ sikmir ];
    platforms = lib.platforms.unix;
  };
}
})
+0 −2
Original line number Diff line number Diff line
@@ -12985,8 +12985,6 @@ with pkgs;
  kapow = libsForQt5.callPackage ../applications/misc/kapow { };
  kchmviewer = libsForQt5.callPackage ../applications/misc/kchmviewer { };
  okteta = libsForQt5.callPackage ../applications/editors/okteta { };
  k4dirstat = libsForQt5.callPackage ../applications/misc/k4dirstat { };