pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/misc/sunwait Add a variant of the "sunwait" program, u...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/06889bb87dc8
branches:  trunk
changeset: 328094:06889bb87dc8
user:      martin <martin%pkgsrc.org@localhost>
date:      Wed Jan 16 14:43:22 2019 +0000

description:
Add a variant of the "sunwait" program, used to calculate sunset and
sunrise (usefull in semi automatic astro-photography or home automation).
With big help from leonardo.

diffstat:

 misc/sunwait/DESCR                      |   5 +++
 misc/sunwait/Makefile                   |  14 ++++++++++
 misc/sunwait/PLIST                      |   2 +
 misc/sunwait/distinfo                   |   9 ++++++
 misc/sunwait/patches/patch-Makefile     |  44 +++++++++++++++++++++++++++++++++
 misc/sunwait/patches/patch-sunriset.cpp |  15 +++++++++++
 misc/sunwait/patches/patch-sunwait.cpp  |  15 +++++++++++
 7 files changed, 104 insertions(+), 0 deletions(-)

diffs (132 lines):

diff -r af6fa10aa9d6 -r 06889bb87dc8 misc/sunwait/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sunwait/DESCR        Wed Jan 16 14:43:22 2019 +0000
@@ -0,0 +1,5 @@
+Sunwait is a small program for calculating sunrise and sunset,
+as well as civil, nautical and astronimical twilight.
+
+It has features that make it usefull for home automation
+tasks.
diff -r af6fa10aa9d6 -r 06889bb87dc8 misc/sunwait/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sunwait/Makefile     Wed Jan 16 14:43:22 2019 +0000
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1 2019/01/16 14:43:22 martin Exp $
+
+DISTNAME=      sunwait-0.8
+CATEGORIES=    misc
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=klada/}
+
+MAINTAINER=    martin%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/klada/sunwait
+COMMENT=       Calculate sunrise, sunset and twilight
+LICENSE=       gnu-gpl-v2
+
+USE_LANGUAGES+=        c++11
+
+.include "../../mk/bsd.pkg.mk"
diff -r af6fa10aa9d6 -r 06889bb87dc8 misc/sunwait/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sunwait/PLIST        Wed Jan 16 14:43:22 2019 +0000
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2019/01/16 14:43:22 martin Exp $
+bin/sunwait
diff -r af6fa10aa9d6 -r 06889bb87dc8 misc/sunwait/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sunwait/distinfo     Wed Jan 16 14:43:22 2019 +0000
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2019/01/16 14:43:22 martin Exp $
+
+SHA1 (sunwait-0.8.tar.gz) = eed1453e288d03d200d4f74634324a343434f426
+RMD160 (sunwait-0.8.tar.gz) = ffad86c063eac4952141016fde056056d44963b4
+SHA512 (sunwait-0.8.tar.gz) = 974aec925e08d42f6b9d617cd033ab21af314b04a0bab100f9b473e038df7eb65a86de2240ef2d5308af5385c929607d591c6f7b738925622e38040af6368166
+Size (sunwait-0.8.tar.gz) = 20302 bytes
+SHA1 (patch-Makefile) = 63276adb2587a251d9bb896ec82cd5ba6b3d6c07
+SHA1 (patch-sunriset.cpp) = 759aa1f2c0301f8fab3a264167d25a077ed205ee
+SHA1 (patch-sunwait.cpp) = cf5b2251a4b0de5e95cdbd06a432824b623df42b
diff -r af6fa10aa9d6 -r 06889bb87dc8 misc/sunwait/patches/patch-Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sunwait/patches/patch-Makefile       Wed Jan 16 14:43:22 2019 +0000
@@ -0,0 +1,44 @@
+$NetBSD: patch-Makefile,v 1.1 2019/01/16 14:43:22 martin Exp $
+
+- Use CC instead of C to specify the C compiler and do not hardcode gcc
+- Honors user's {C,LD}FLAGS
+- Make the install target more flexible
+
+--- Makefile.orig      2015-09-20 14:07:55.000000000 +0000
++++ Makefile
+@@ -5,23 +5,29 @@
+ #
+ 
+ 
+-C=gcc
+-CFLAGS=-c -Wall 
+-LDFLAGS= -lm -lstdc++
++CC=c++
++CFLAGS+=-c -Wall -D__linux__
++LDFLAGS+= -lm -lstdc++
+ SOURCES=sunwait.cpp sunriset.cpp print.cpp sunwait.h sunriset.h print.h
+ OBJECTS=$(SOURCES:.cpp=.o)
+ EXECUTABLE=sunwait
+ 
++PREFIX?=      /usr
++
++INSTALL_PROGRAM?=     install -m 755
++INSTALL_PROGRAM_DIR?= install -d -m 755
++
+ all: $(SOURCES) $(EXECUTABLE)
+       
+ $(EXECUTABLE): $(OBJECTS)
+-      $(C) $(OBJECTS) -o $@ $(LDFLAGS)
++      $(CC) $(OBJECTS) -o $@ $(LDFLAGS)
+ 
+ .cpp.o:
+-      $(C) $(CFLAGS) $< -o $@
++      $(CC) $(CFLAGS) $< -o $@
+ 
+ clean:
+       rm -f *.o sunwait
+ 
+ install:
+-      install -D -m 755 sunwait $(DESTDIR)/usr/bin/sunwait
++      ${INSTALL_PROGRAM_DIR} $(DESTDIR)$(PREFIX)/bin
++      ${INSTALL_PROGRAM} sunwait $(DESTDIR)$(PREFIX)/bin/sunwait
diff -r af6fa10aa9d6 -r 06889bb87dc8 misc/sunwait/patches/patch-sunriset.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sunwait/patches/patch-sunriset.cpp   Wed Jan 16 14:43:22 2019 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-sunriset.cpp,v 1.1 2019/01/16 14:43:22 martin Exp $
+
+Use fabs() instead of integer abs() for double values.
+
+--- sunriset.cpp.orig  2015-09-20 16:07:55.000000000 +0200
++++ sunriset.cpp       2018-07-19 14:17:06.794662715 +0200
+@@ -92,7 +92,7 @@
+   /* compute the diurnal arc that the sun traverses to reach the specified altitide altit: */
+   double cost = (sind(altitude) - sind(pRun->latitude) * sind(sdec)) / (cosd(pRun->latitude) * cosd(sdec));
+ 
+-  if (abs(cost) < 1.0)
++  if (fabs(cost) < 1.0)
+     diurnalArc = 2*acosd(cost)/15.0;    /* Diurnal arc, hours */
+   else if (cost>=1.0)
+     diurnalArc =  0.0; // Polar Night
diff -r af6fa10aa9d6 -r 06889bb87dc8 misc/sunwait/patches/patch-sunwait.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/sunwait/patches/patch-sunwait.cpp    Wed Jan 16 14:43:22 2019 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-sunwait.cpp,v 1.1 2019/01/16 14:43:22 martin Exp $
+
+Fix typo that causes a warning from newer gcc.
+
+--- sunwait.cpp.orig   2015-09-20 16:07:55.000000000 +0200
++++ sunwait.cpp        2018-07-19 14:15:25.334426961 +0200
+@@ -661,7 +661,7 @@
+     if (pRun->debug == ONOFF_ON) printf ("Debug: argv[%d]: >%s<\n", i, arg);
+ 
+     // Strip any hyphen from arguments, but not negative signs of numbers
+-    if (arg[0] == '-' && arg[1] != '\0' && !isdigit(arg[1])) *arg++;
++    if (arg[0] == '-' && arg[1] != '\0' && !isdigit(arg[1])) arg++;
+ 
+     // Normal help or version info
+          if   (!strcmp (arg, "v")             ||



Home | Main Index | Thread Index | Old Index