Unverified Commit c3e30f8a authored by Emily's avatar Emily Committed by GitHub
Browse files

qt5.qtwebengine: drop (#480196)

parents 7124eb5c 44853158
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1213,7 +1213,6 @@
  ./services/networking/geph.nix
  ./services/networking/ghostunnel.nix
  ./services/networking/git-daemon.nix
  ./services/networking/globalprotect-vpn.nix
  ./services/networking/gns3-server.nix
  ./services/networking/gnunet.nix
  ./services/networking/go-autoconfig.nix
+7 −0
Original line number Diff line number Diff line
@@ -214,6 +214,13 @@ in
    ] "The fourStoreEndpoint module has been removed")
    (mkRemovedOptionModule [ "services" "fprot" ] "The corresponding package was removed from nixpkgs.")
    (mkRemovedOptionModule [ "services" "frab" ] "The frab module has been removed")
    (mkRemovedOptionModule
      [
        "services"
        "globalprotect"
      ]
      "The corresponding package was removed from nixpkgs, as it depended on qt5 webengine. A replacements based on tauri exist upstream, but requires non-trivial maintainance in nixpkgs to update."
    )
    (mkRemovedOptionModule
      [
        "services"
+0 −62
Original line number Diff line number Diff line
{
  config,
  lib,
  pkgs,
  ...
}:
let
  cfg = config.services.globalprotect;

  execStart =
    if cfg.csdWrapper == null then
      "${pkgs.globalprotect-openconnect}/bin/gpservice"
    else
      "${pkgs.globalprotect-openconnect}/bin/gpservice --csd-wrapper=${cfg.csdWrapper}";
in

{
  options.services.globalprotect = {
    enable = lib.mkEnableOption "globalprotect";

    settings = lib.mkOption {
      description = ''
        GlobalProtect-openconnect configuration. For more information, visit
        <https://github.com/yuezk/GlobalProtect-openconnect/wiki/Configuration>.
      '';
      default = { };
      example = {
        "vpn1.company.com" = {
          openconnect-args = "--script=/path/to/vpnc-script";
        };
      };
      type = lib.types.attrs;
    };

    csdWrapper = lib.mkOption {
      description = ''
        A script that will produce a Host Integrity Protection (HIP) report,
        as described at <https://www.infradead.org/openconnect/hip.html>
      '';
      default = null;
      example = lib.literalExpression ''"''${pkgs.openconnect}/libexec/openconnect/hipreport.sh"'';
      type = lib.types.nullOr lib.types.path;
    };
  };

  config = lib.mkIf cfg.enable {
    services.dbus.packages = [ pkgs.globalprotect-openconnect ];

    environment.etc."gpservice/gp.conf".text = lib.generators.toINI { } cfg.settings;

    systemd.services.gpservice = {
      description = "GlobalProtect openconnect DBus service";
      serviceConfig = {
        Type = "dbus";
        BusName = "com.yuezk.qt.GPService";
        ExecStart = execStart;
      };
      wantedBy = [ "multi-user.target" ];
      after = [ "network.target" ];
    };
  };
}
+0 −118
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  cmake,
  curl,
  fetchFromGitHub,
  hunspell,
  pkg-config,
  qmake,
  qtbase,
  qtwebengine,
  wrapGAppsHook3,
  wrapQtAppsHook,
}:
let
  version = "2.0.0";
  srcs = {
    mindforger = fetchFromGitHub {
      owner = "dvorka";
      repo = "mindforger";
      rev = version;
      sha256 = "sha256-+8miV2xuQcaWGdWCEXPIg6EXjAHtgD9pX7Z8ZNhpMjA=";
    };
    cmark-gfm = fetchFromGitHub {
      owner = "dvorka";
      repo = "cmark";
      rev = "4ca8688093228c599432a87d7bd945804c573d51";
      sha256 = "sha256-0WiG8aot8mc0h1BKPgC924UKQrgunZvKKBy9bD7nhoQ=";
    };
    mindforger-repository = fetchFromGitHub {
      owner = "dvorka";
      repo = "mindforger-repository";
      rev = "ec81a27e5de6408bbcd3f6d7733a7c6f3b52e433";
      sha256 = "sha256-JGTP1He7G2Obmsav64Lf7BLHp8OTvPtg38VHsrEC36o=";
    };
  };
in
stdenv.mkDerivation {
  pname = "mindforger";
  inherit version;

  src = srcs.mindforger;

  nativeBuildInputs = [
    cmake
    pkg-config
    qmake
    wrapGAppsHook3
    wrapQtAppsHook
  ];
  buildInputs = [
    curl
    hunspell
    qtbase
    qtwebengine
  ];

  # Disable the cmake hook (so we don't try to build MindForger with it), and
  # build MindForger's internal fork of cmark-gfm ahead of MindForger itself.
  #
  # Moreover unpack the docs that are needed for the MacOS build.
  postUnpack = ''
    cp -TR ${srcs.cmark-gfm} $sourceRoot/deps/cmark-gfm
  ''
  + lib.optionalString stdenv.hostPlatform.isDarwin ''
    cp -TR ${srcs.mindforger-repository} $sourceRoot/doc
  '';
  dontUseCmakeConfigure = true;
  preBuild = ''
    (
          mkdir deps/cmark-gfm/build &&
          cd deps/cmark-gfm/build &&
          cmake -DCMARK_TESTS=OFF -DCMARK_SHARED=OFF .. &&
          cmake --build . --parallel
      )'';

  doCheck = true;

  patches = [
    ./hunspell_pkgconfig.patch
  ];

  postPatch = ''
    substituteInPlace lib/src/install/installer.cpp --replace /usr "$out"
    substituteInPlace app/resources/gnome-shell/mindforger.desktop --replace /usr "$out"
    for f in app/app.pro lib/lib.pro; do
      substituteInPlace "$f" --replace "QMAKE_CXX = g++" ""
    done
  '';

  qmakeFlags = [
    "-r"
    "mindforger.pro"
    "CONFIG+=mfnoccache"
    "CONFIG+=mfwebengine"
  ];

  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
    mkdir "$out"/Applications
    mv app/mindforger.app "$out"/Applications/
  '';

  meta = {
    description = "Thinking Notebook & Markdown IDE";
    longDescription = ''
      MindForger is actually more than an editor or IDE - it's human
      mind inspired personal knowledge management tool
    '';
    homepage = "https://www.mindforger.com";
    license = lib.licenses.gpl2Plus;
    platforms = [
      "aarch64-linux"
      "x86_64-linux"
    ];
    maintainers = with lib.maintainers; [ cyplo ];
    mainProgram = "mindforger";
  };
}
+0 −23
Original line number Diff line number Diff line
diff --git a/app/app.pro b/app/app.pro
index 89ff5c0b..9625ecd1 100644
--- a/app/app.pro
+++ b/app/app.pro
@@ -159,12 +159,13 @@ macx {
 
 } else:unix {
     # pkgconfig-based configuration does not work @ Ubuntu
-    #  CONFIG += link_pkgconfig
-    #  PKGCONFIG += hunspell
+    # but does on NixOS
+    CONFIG += link_pkgconfig
+    PKGCONFIG += hunspell
 
-    # hardcoded paths are (unfortunately) more robust:
-    INCLUDEPATH += /usr/include/hunspell
-    LIBS += -lhunspell
+    # Where hardcoded paths are (unfortunately) more robust^W^W^W^Wannoying:
+    #  INCLUDEPATH += /usr/include/hunspell
+    #  LIBS += -lhunspell
 
     HEADERS += \
       ./src/qt/spelling/dictionary_provider_hunspell.h \
Loading