* [Buildroot] [PATCH] snooze: new package
@ 2024-07-04 19:49 J. Neuschäfer via buildroot
2025-02-05 15:00 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: J. Neuschäfer via buildroot @ 2024-07-04 19:49 UTC (permalink / raw)
To: buildroot; +Cc: J. Neuschäfer
Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
---
package/Config.in | 1 +
.../snooze/0001-fix-snooze-n-format-string.patch | 38 ++++++++++++++++++++++
package/snooze/Config.in | 8 +++++
package/snooze/snooze.hash | 3 ++
package/snooze/snooze.mk | 29 +++++++++++++++++
5 files changed, 79 insertions(+)
diff --git a/package/Config.in b/package/Config.in
index 48ef1a6fdc..d2dac6a559 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2334,6 +2334,7 @@ menu "Miscellaneous"
source "package/qpdf/Config.in"
source "package/rtl_433/Config.in"
source "package/shared-mime-info/Config.in"
+ source "package/snooze/Config.in"
source "package/sunwait/Config.in"
source "package/taskd/Config.in"
source "package/wine/Config.in"
diff --git a/package/snooze/0001-fix-snooze-n-format-string.patch b/package/snooze/0001-fix-snooze-n-format-string.patch
new file mode 100644
index 0000000000..3a87844ed7
--- /dev/null
+++ b/package/snooze/0001-fix-snooze-n-format-string.patch
@@ -0,0 +1,38 @@
+From 5f9e616b29fe272fffbb31e4b7ea8ff61f781601 Mon Sep 17 00:00:00 2001
+From: Leah Neukirchen <leah@vuxu.org>
+Date: Wed, 29 May 2024 19:42:27 +0200
+Subject: [PATCH] fix "snooze -n" format string
+
+Fixes #22.
+
+Upstream: https://github.com/leahneukirchen/snooze/commit/5f9e616b29fe272fffbb31e4b7ea8ff61f781601
+---
+ snooze.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/snooze.c b/snooze.c
+index 06f0d07..e47ad11 100644
+--- a/snooze.c
++++ b/snooze.c
+@@ -329,13 +329,13 @@ main(int argc, char *argv[])
+ char weekstr[4];
+ struct tm *tm = localtime(&t);
+ strftime(weekstr, sizeof weekstr, "%a", tm);
+- printf("%s %s %2ldd%3ldh%3ldm%3lds ",
++ printf("%s %s %2dd%3dh%3dm%3ds ",
+ isotime(tm),
+ weekstr,
+- ((t - now) / (60*60*24)),
+- ((t - now) / (60*60)) % 24,
+- ((t - now) / 60) % 60,
+- (t - now) % 60);
++ ((int)(t - now) / (60*60*24)),
++ ((int)(t - now) / (60*60)) % 24,
++ ((int)(t - now) / 60) % 60,
++ (int)(t - now) % 60);
+ if(jitter) {
+ printf("(plus up to %ds for jitter)\n", jitter);
+ } else {
+--
+2.43.0
+
diff --git a/package/snooze/Config.in b/package/snooze/Config.in
new file mode 100644
index 0000000000..0e068cb607
--- /dev/null
+++ b/package/snooze/Config.in
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_SNOOZE
+ bool "snooze"
+ help
+ snooze is a tool for waiting until a particular time and then
+ running a command. Together with a service supervision system
+ such as runit, this can be used to replace cron(8).
+
+ https://github.com/leahneukirchen/snooze
diff --git a/package/snooze/snooze.hash b/package/snooze/snooze.hash
new file mode 100644
index 0000000000..c1710d857f
--- /dev/null
+++ b/package/snooze/snooze.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 d63fde85d9333188bed5996baabd833eaa00842ce117443ffbf8719c094be414 snooze-0.5.tar.gz
+sha256 2cea433f84afcfd9d55515908d3ea69ed1df00ffbf90cc48cd68d72a2b464544 README.md
diff --git a/package/snooze/snooze.mk b/package/snooze/snooze.mk
new file mode 100644
index 0000000000..a52b38abd8
--- /dev/null
+++ b/package/snooze/snooze.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# snooze
+#
+################################################################################
+
+SNOOZE_VERSION = 0.5
+SNOOZE_SITE = $(call github,leahneukirchen,snooze,v$(SNOOZE_VERSION))
+SNOOZE_LICENSE = CC0-1.0
+
+# Unfortunately, snooze doesn't have a dedicated file for the license, but it
+# is mentioned in the README and in the manpage.
+SNOOZE_LICENSE_FILES = README.md
+
+SNOOZE_MAKE_OPTS = \
+ PREFIX=/ \
+ DESTDIR=$(TARGET_DIR) \
+ CC=$(TARGET_CC) \
+ LD=$(TARGET_LD)
+
+define SNOOZE_BUILD_CMDS
+ $(MAKE) -C $(@D)/ $(SNOOZE_MAKE_OPTS)
+endef
+
+define SNOOZE_INSTALL_TARGET_CMDS
+ $(MAKE) -C $(@D)/ $(SNOOZE_MAKE_OPTS) install
+endef
+
+$(eval $(generic-package))
---
base-commit: 3ebc7c69d56430c34eba4c869d1d4fe4d1e8de55
change-id: 20240704-snooze-4f210f54eb80
Best regards,
--
J. Neuschäfer <j.neuschaefer@gmx.net>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] snooze: new package
2024-07-04 19:49 [Buildroot] [PATCH] snooze: new package J. Neuschäfer via buildroot
@ 2025-02-05 15:00 ` Peter Korsgaard
2025-02-07 1:17 ` J. Neuschäfer via buildroot
0 siblings, 1 reply; 3+ messages in thread
From: Peter Korsgaard @ 2025-02-05 15:00 UTC (permalink / raw)
To: buildroot, j.neuschaefer
On 7/4/24 21:49, J. Neuschäfer via buildroot wrote:
Hello, and sorry for the slow response.
> +++ b/package/snooze/0001-fix-snooze-n-format-string.patch
> @@ -0,0 +1,38 @@
> +From 5f9e616b29fe272fffbb31e4b7ea8ff61f781601 Mon Sep 17 00:00:00 2001
> +From: Leah Neukirchen <leah@vuxu.org>
> +Date: Wed, 29 May 2024 19:42:27 +0200
> +Subject: [PATCH] fix "snooze -n" format string
> +
> +Fixes #22.
> +
Patches need signed-off-by tags as flagged by ./utils/check-package. I
have added yours from above.
> +++ b/package/snooze/snooze.mk
> @@ -0,0 +1,29 @@
> +################################################################################
> +#
> +# snooze
> +#
> +################################################################################
> +
> +SNOOZE_VERSION = 0.5
> +SNOOZE_SITE = $(call github,leahneukirchen,snooze,v$(SNOOZE_VERSION))
> +SNOOZE_LICENSE = CC0-1.0
> +
> +# Unfortunately, snooze doesn't have a dedicated file for the license, but it
> +# is mentioned in the README and in the manpage.
> +SNOOZE_LICENSE_FILES = README.md
> +
> +SNOOZE_MAKE_OPTS = \
> + PREFIX=/ \
The default is /usr/local. Any specific reason to make it / instead of
/usr? I have made it /usr for consistency.
> + DESTDIR=$(TARGET_DIR) \
DESTDIR is used at installation time and not build time, so I moved it
to _INSTALL_TARGET_CMDS similar to how it is done for autotools packages.
> + CC=$(TARGET_CC) \
> + LD=$(TARGET_LD)
The Makefile does not use LD, so I have dropped that. Instead we need to
pass TARGET_CFLAGS and TARGET_LDFLAGS, so I have added those.
Finally you forgot to add the package to your DEVELOPERS entry.
Committed with these fixes, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH] snooze: new package
2025-02-05 15:00 ` Peter Korsgaard
@ 2025-02-07 1:17 ` J. Neuschäfer via buildroot
0 siblings, 0 replies; 3+ messages in thread
From: J. Neuschäfer via buildroot @ 2025-02-07 1:17 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: buildroot, j.neuschaefer
On Wed, Feb 05, 2025 at 04:00:07PM +0100, Peter Korsgaard wrote:
> On 7/4/24 21:49, J. Neuschäfer via buildroot wrote:
>
> Hello, and sorry for the slow response.
>
> > +++ b/package/snooze/0001-fix-snooze-n-format-string.patch
> > @@ -0,0 +1,38 @@
> > +From 5f9e616b29fe272fffbb31e4b7ea8ff61f781601 Mon Sep 17 00:00:00 2001
> > +From: Leah Neukirchen <leah@vuxu.org>
> > +Date: Wed, 29 May 2024 19:42:27 +0200
> > +Subject: [PATCH] fix "snooze -n" format string
> > +
> > +Fixes #22.
> > +
>
> Patches need signed-off-by tags as flagged by ./utils/check-package. I have
> added yours from above.
>
> > +++ b/package/snooze/snooze.mk
> > @@ -0,0 +1,29 @@
> > +################################################################################
> > +#
> > +# snooze
> > +#
> > +################################################################################
> > +
> > +SNOOZE_VERSION = 0.5
> > +SNOOZE_SITE = $(call github,leahneukirchen,snooze,v$(SNOOZE_VERSION))
> > +SNOOZE_LICENSE = CC0-1.0
> > +
> > +# Unfortunately, snooze doesn't have a dedicated file for the license, but it
> > +# is mentioned in the README and in the manpage.
> > +SNOOZE_LICENSE_FILES = README.md
> > +
> > +SNOOZE_MAKE_OPTS = \
> > + PREFIX=/ \
>
> The default is /usr/local. Any specific reason to make it / instead of /usr?
> I have made it /usr for consistency.
>
> > + DESTDIR=$(TARGET_DIR) \
>
> DESTDIR is used at installation time and not build time, so I moved it to
> _INSTALL_TARGET_CMDS similar to how it is done for autotools packages.
>
>
> > + CC=$(TARGET_CC) \
> > + LD=$(TARGET_LD)
>
> The Makefile does not use LD, so I have dropped that. Instead we need to
> pass TARGET_CFLAGS and TARGET_LDFLAGS, so I have added those.
>
>
> Finally you forgot to add the package to your DEVELOPERS entry.
>
> Committed with these fixes, thanks.
It seems I forgot quite a few things...
Thank you very much!
J. Neuschäfer
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-02-07 1:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 19:49 [Buildroot] [PATCH] snooze: new package J. Neuschäfer via buildroot
2025-02-05 15:00 ` Peter Korsgaard
2025-02-07 1:17 ` J. Neuschäfer via buildroot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox