about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul Meyer <49727155+katexochen@users.noreply.github.com>2024-01-05 19:48:41 +0100
committerPaul Meyer <49727155+katexochen@users.noreply.github.com>2024-02-02 15:40:39 +0100
commit3695cacfc5e8b3c3df9611a9ab174f12db6c03c7 (patch)
treeac1f61080f4203a6aa59669f98674a79fa394ded
parente43872dfc0f26e5408f11dbacf8ff7f539bd5b98 (diff)
downloadnixlib-3695cacfc5e8b3c3df9611a9ab174f12db6c03c7.tar
nixlib-3695cacfc5e8b3c3df9611a9ab174f12db6c03c7.tar.gz
nixlib-3695cacfc5e8b3c3df9611a9ab174f12db6c03c7.tar.bz2
nixlib-3695cacfc5e8b3c3df9611a9ab174f12db6c03c7.tar.lz
nixlib-3695cacfc5e8b3c3df9611a9ab174f12db6c03c7.tar.xz
nixlib-3695cacfc5e8b3c3df9611a9ab174f12db6c03c7.tar.zst
nixlib-3695cacfc5e8b3c3df9611a9ab174f12db6c03c7.zip
cronutils: init at 1.10
-rw-r--r--pkgs/by-name/cr/cronutils/package.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/by-name/cr/cronutils/package.nix b/pkgs/by-name/cr/cronutils/package.nix
new file mode 100644
index 000000000000..40c03a0e55bb
--- /dev/null
+++ b/pkgs/by-name/cr/cronutils/package.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "cronutils";
+  version = "1.10";
+
+  outputs = [ "out" "man" ];
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "cronutils";
+    rev = "version/${finalAttrs.version}";
+    hash = "sha256-XJksfX4jqE32l4HipvO26iv9W4c0Iss6DenlEatdL1k=";
+  };
+
+  patches = [
+    # Add missing libgen.h include. Backported from https://github.com/google/cronutils/pull/11.
+    (fetchpatch {
+      url = "https://github.com/google/cronutils/commit/5d742fc154fc1adcfebc646dca0c45b0f0060844.patch";
+      hash = "sha256-o1ylZ+fKL1fQYSKSOkujDsh4CUQya0wJ47uGNNC6mVQ=";
+    })
+    # Fix function declaration without a prototype. Backported from https://github.com/google/cronutils/pull/11.
+    (fetchpatch {
+      url = "https://github.com/google/cronutils/commit/c39df37c6c280e3f73ea57cfa598b8447e5a58fe.patch";
+      hash = "sha256-og/xEWn0M7+mkbLGY14nkYpV3ckr7eYrb0X22Zxmq8w=";
+    })
+    # Remove `LDLIBS+=-lrt` from Makefile. Backported from https://github.com/google/cronutils/pull/11.
+    (fetchpatch {
+      url = "https://github.com/google/cronutils/commit/de72c648d12d102b79d4e3bb57830f2d79f5702a.patch";
+      hash = "sha256-njftI3RbrjRtXpXKFHNE9HroIZr5tqVnEK77lu4+/sI=";
+    })
+  ];
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (toString [
+    "-D_DARWIN_C_SOURCE"
+    # runstat.c:81:81: error: format string is not a string literal
+    "-Wno-format-nonliteral"
+  ]);
+
+  meta = with lib; {
+    changelog = "https://github.com/google/cronutils/releases/tag/version%2F${finalAttrs.version}";
+    description = "Utilities to assist running periodic batch processing jobs";
+    homepage = "https://github.com/google/cronutils";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ katexochen ];
+    platforms = platforms.all;
+  };
+})