Commit f411f4ae authored by linsui's avatar linsui
Browse files

safeeyes: fix double wrap

parent a5059482
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@ in
      wantedBy = [ "graphical-session.target" ];
      partOf   = [ "graphical-session.target" ];

      path = [ pkgs.alsa-utils ];

      startLimitIntervalSec = 350;
      startLimitBurst = 10;
      serviceConfig = {
+38 −38
Original line number Diff line number Diff line
{ lib, python3Packages, gobject-introspection, libappindicator-gtk3, libnotify, gtk3, gnome, xprintidle-ng, wrapGAppsHook, gdk-pixbuf, shared-mime-info, librsvg
{ lib
, buildPythonApplication
, fetchPypi
, alsa-utils
, gobject-introspection
, libappindicator-gtk3
, libnotify
, wlrctl
, gtk3
, xprintidle
, wrapGAppsHook
, babel
, psutil
, xlib
, pygobject3
, dbus-python
, croniter
}:

let inherit (python3Packages) python buildPythonApplication fetchPypi croniter;

in buildPythonApplication rec {
buildPythonApplication rec {
  pname = "safeeyes";
  version = "2.1.3";
  namePrefix = "";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1b5w887hivmdrkm1ydbar4nmnks6grpbbpvxgf9j9s46msj03c9x";
  };

  buildInputs = [
    gtk3
  nativeBuildInputs = [
    wrapGAppsHook
    gobject-introspection
    gnome.adwaita-icon-theme
    gnome.adwaita-icon-theme
  ];

  nativeBuildInputs = [
    wrapGAppsHook
  buildInputs = [
    gtk3
    libappindicator-gtk3
    libnotify
  ];

  propagatedBuildInputs = with python3Packages; [
  propagatedBuildInputs = [
    babel
    psutil
    xlib
    pygobject3
    dbus-python
    croniter

    libappindicator-gtk3
    libnotify
    xprintidle-ng
  ];

  # patch smartpause plugin
  postPatch = ''
    sed -i \
      -e 's!xprintidle!xprintidle-ng!g' \
      safeeyes/plugins/smartpause/plugin.py
  # Prevent double wrapping, let the Python wrapper use the args in preFixup.
  dontWrapGApps = true;

    sed -i \
      -e 's!xprintidle!xprintidle-ng!g' \
      safeeyes/plugins/smartpause/config.json
  postInstall = ''
    mkdir -p $out/share/applications
    cp -r safeeyes/platform/icons $out/share/icons/
    cp safeeyes/platform/safeeyes.desktop $out/share/applications/safeeyes.desktop
  '';

  preFixup = ''
    gappsWrapperArgs+=(
      --prefix XDG_DATA_DIRS : "${gdk-pixbuf}/share"
      --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
      --prefix XDG_DATA_DIRS : "${librsvg}/share"

      # safeeyes images
      --prefix XDG_DATA_DIRS : "$out/lib/${python.libPrefix}/site-packages/usr/share"
    makeWrapperArgs+=(
      "''${gappsWrapperArgs[@]}"
      --prefix PATH : ${lib.makeBinPath [ alsa-utils wlrctl xprintidle ]}
    )
    mkdir -p $out/share/applications
    cp -r safeeyes/platform/icons $out/share/
    cp safeeyes/platform/safeeyes.desktop $out/share/applications/
  '';

  doCheck = false; # no tests

  meta = {
  meta = with lib; {
    homepage = "http://slgobinath.github.io/SafeEyes";
    description = "Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder. A Free and Open Source Linux alternative to EyeLeo";
    license = lib.licenses.gpl3;
    maintainers = with lib.maintainers; [ srghma ];
    platforms = lib.platforms.all;
    license = licenses.gpl3;
    maintainers = with maintainers; [ srghma ];
    platforms = platforms.linux;
  };
}
+1 −1
Original line number Diff line number Diff line
@@ -10501,7 +10501,7 @@ with pkgs;
  safe-rm = callPackage ../tools/system/safe-rm { };
  safeeyes = callPackage ../applications/misc/safeeyes { };
  safeeyes = with python3.pkgs; toPythonApplication safeeyes;
  sahel-fonts = callPackage ../data/fonts/sahel-fonts { };
+2 −0
Original line number Diff line number Diff line
@@ -9608,6 +9608,8 @@ in {

  safe = callPackage ../development/python-modules/safe { };

  safeeyes = callPackage ../applications/misc/safeeyes { };

  safeio = callPackage ../development/python-modules/safeio { };

  safety = callPackage ../development/python-modules/safety { };