Unverified Commit 2ffb6632 authored by jopejoe1's avatar jopejoe1 Committed by GitHub
Browse files

sigil: wrap qt app properly and move to by-name (#396355)

parents 99c18ee6 1d0a149c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -19391,6 +19391,18 @@
      }
    ];
  };
  prince213 = {
    name = "Sizhe Zhao";
    email = "prc.zhao@outlook.com";
    matrix = "@prince213:matrix.org";
    github = "Prince213";
    githubId = 25235514;
    keys = [
      {
        fingerprint = "2589 45E5 C556 7B4D B36C  3E28 A64B 5235 356E 16D1";
      }
    ];
  };
  princemachiavelli = {
    name = "Josh Hoffer";
    email = "jhoffer@sansorgan.es";
+72 −0
Original line number Diff line number Diff line
@@ -4,14 +4,10 @@
  fetchFromGitHub,
  cmake,
  pkg-config,
  makeWrapper,
  boost,
  xercesc,
  qtbase,
  qttools,
  qtwebengine,
  qtsvg,
  python3Packages,
  qt6,
}:

stdenv.mkDerivation rec {
@@ -30,16 +26,16 @@ stdenv.mkDerivation rec {
  nativeBuildInputs = [
    cmake
    pkg-config
    makeWrapper
    qt6.wrapQtAppsHook
  ];

  buildInputs = [
    boost
    xercesc
    qtbase
    qttools
    qtwebengine
    qtsvg
    qt6.qtbase
    qt6.qttools
    qt6.qtwebengine
    qt6.qtsvg
    python3Packages.lxml
  ];

@@ -47,20 +43,30 @@ stdenv.mkDerivation rec {
    sed -i '/^QTLIB_DIR=/ d' src/Resource_Files/bash/sigil-sh_install
  '';

  dontWrapQtApps = true;
  installPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
    runHook preInstall

    mkdir -p $out/Applications
    mv bin/Sigil.app $out/Applications
    # https://github.com/NixOS/nixpkgs/issues/186653
    chmod -x $out/Applications/Sigil.app/Contents/lib/*.dylib \
      $out/Applications/Sigil.app/Contents/polyfills/*.js \
      $out/Applications/Sigil.app/Contents/python3lib/*.py \
      $out/Applications/Sigil.app/Contents/hunspell_dictionaries/*.{aff,dic}

    runHook postInstall
  '';

  preFixup = ''
    wrapProgram "$out/bin/sigil" \
       --prefix PYTHONPATH : $PYTHONPATH \
       ''${qtWrapperArgs[@]}
    qtWrapperArgs+=(--prefix PYTHONPATH : "$PYTHONPATH")
  '';

  meta = {
    description = "Free, open source, multi-platform ebook (ePub) editor";
    homepage = "https://github.com/Sigil-Ebook/Sigil/";
    license = lib.licenses.gpl3;
    # currently unmaintained
    platforms = lib.platforms.linux;
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [ prince213 ];
    platforms = with lib.platforms; linux ++ darwin;
    mainProgram = "sigil";
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -5155,8 +5155,6 @@ with pkgs;
  shiv = with python3Packages; toPythonApplication shiv;
  sigil = qt6.callPackage ../applications/editors/sigil { };
  slither-analyzer = with python3Packages; toPythonApplication slither-analyzer;
  # aka., pgp-tools