From bad631ba0f47f822243accf9cf8e602adef00243 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Mon, 21 Aug 2023 23:31:06 -0300 Subject: [PATCH] tomato-c: init at unstable-2023-08-21 --- pkgs/applications/misc/tomato-c/default.nix | 67 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/applications/misc/tomato-c/default.nix diff --git a/pkgs/applications/misc/tomato-c/default.nix b/pkgs/applications/misc/tomato-c/default.nix new file mode 100644 index 000000000000..9f87712399f2 --- /dev/null +++ b/pkgs/applications/misc/tomato-c/default.nix @@ -0,0 +1,67 @@ +{ lib +, stdenv +, fetchFromGitHub +, libnotify +, makeWrapper +, mpv +, ncurses +, pkg-config +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "tomato-c"; + version = "unstable-2023-08-21"; + + src = fetchFromGitHub { + owner = "gabrielzschmitz"; + repo = "Tomato.C"; + rev = "6e43e85aa15f3d96811311a3950eba8ce9715634"; + hash = "sha256-RpKkQ7xhM2XqfZdXra0ju0cTBL3Al9NMVQ/oleFydDs="; + }; + + postPatch = '' + substituteInPlace Makefile \ + --replace "sudo " "" + substituteInPlace notify.c \ + --replace "/usr/local" "${placeholder "out"}" + substituteInPlace util.c \ + --replace "/usr/local" "${placeholder "out"}" + substituteInPlace tomato.desktop \ + --replace "/usr/local" "${placeholder "out"}" + ''; + + nativeBuildInputs = [ + makeWrapper + pkg-config + ]; + + buildInputs = [ + libnotify + mpv + ncurses + ]; + + installFlags = [ + "PREFIX=${placeholder "out"}" + "CPPFLAGS=$NIX_CFLAGS_COMPILE" + "LDFLAGS=$NIX_LDFLAGS" + ]; + + postFixup = '' + for file in $out/bin/*; do + wrapProgram $file \ + --prefix PATH : ${lib.makeBinPath [ libnotify mpv ]} + done + ''; + + strictDeps = true; + + meta = { + homepage = "https://github.com/gabrielzschmitz/Tomato.C"; + description = " A pomodoro timer written in pure C"; + license = with lib.licenses; [ gpl3Plus ]; + maintainers = with lib.maintainers; [ AndersonTorres ]; + mainProgram = "tomato"; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 771f9a19eed6..f78fa15ee7b4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -192,6 +192,8 @@ with pkgs; meta.platforms = lib.platforms.linux; } ../build-support/setup-hooks/auto-patchelf.sh; + tomato-c = callPackage ../applications/misc/tomato-c { }; + appflowy = callPackage ../applications/office/appflowy { }; appimageTools = callPackage ../build-support/appimage { };