git: 5669ed84d8fe - main - sysutils/batterycat: new port had been added (+)
Alexey Dokuchaev
danfe at FreeBSD.org
Tue Jul 13 07:39:54 UTC 2021
The branch main has been updated by danfe:
URL: https://cgit.FreeBSD.org/ports/commit/?id=5669ed84d8fea5a9f7cc27021117f3fea252dded
commit 5669ed84d8fea5a9f7cc27021117f3fea252dded
Author: Alexey Dokuchaev <danfe at FreeBSD.org>
AuthorDate: 2021-07-13 07:35:12 +0000
Commit: Alexey Dokuchaev <danfe at FreeBSD.org>
CommitDate: 2021-07-13 07:35:53 +0000
sysutils/batterycat: new port had been added (+)
BatteryCat is a laptop battery monitoring and health tool: it monitors
the current charging state as well as the long-term degradation of the
laptop's battery by keeping history.
WWW: https://sourceforge.net/projects/batterycat/
---
sysutils/Makefile | 1 +
sysutils/batterycat/Makefile | 33 ++++++++++++++++++
sysutils/batterycat/distinfo | 3 ++
sysutils/batterycat/files/patch-Makefile | 60 ++++++++++++++++++++++++++++++++
sysutils/batterycat/pkg-descr | 5 +++
5 files changed, 102 insertions(+)
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 70116e27277a..dcb1339ff931 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -107,6 +107,7 @@
SUBDIR += bashtop
SUBDIR += bastille
SUBDIR += batmon
+ SUBDIR += batterycat
SUBDIR += battmond
SUBDIR += battray
SUBDIR += bchunk
diff --git a/sysutils/batterycat/Makefile b/sysutils/batterycat/Makefile
new file mode 100644
index 000000000000..e3b17e9f7483
--- /dev/null
+++ b/sysutils/batterycat/Makefile
@@ -0,0 +1,33 @@
+# Created by: Alexey Dokuchaev <danfe at FreeBSD.org>
+
+PORTNAME= batterycat
+PORTVERSION= 1.6
+CATEGORIES= sysutils
+MASTER_SITES= SF/${PORTNAME}/source_tarball
+DISTNAME= ${PORTNAME}_${PORTVERSION}
+
+MAINTAINER= danfe at FreeBSD.org
+COMMENT= Graphical battery monitoring tool
+
+LICENSE= GPLv2+
+
+USES= gmake gnome pkgconfig
+USE_GNOME= cairo gdkpixbuf2 gtk20
+
+PLIST_FILES= bin/batterycat share/applications/batterycat.desktop \
+ ${DATADIR_REL}/batterycat.html \
+ ${DATADIR_REL}/batterycat_128.xpm \
+ ${DATADIR_REL}/batterycat_32.xpm
+
+OPTIONS_DEFINE= NLS
+
+NLS_USES= gettext-tools
+NLS_MAKE_ENV= WITH_NLS=yes
+NLS_PLIST_FILES= share/locale/de/LC_MESSAGES/batterycat.mo \
+ share/locale/fr/LC_MESSAGES/batterycat.mo
+
+post-patch:
+ @${REINPLACE_CMD} -e 's,^struct BATTERY_DATA,extern &,' \
+ ${WRKSRC}/history.c
+
+.include <bsd.port.mk>
diff --git a/sysutils/batterycat/distinfo b/sysutils/batterycat/distinfo
new file mode 100644
index 000000000000..1d738455fc73
--- /dev/null
+++ b/sysutils/batterycat/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1549281701
+SHA256 (batterycat_1.6.tar.gz) = bf0525bfbf78bc20e8925058d396c95fdd4ec1f4755ba563f52c2ee5cf99383b
+SIZE (batterycat_1.6.tar.gz) = 3167776
diff --git a/sysutils/batterycat/files/patch-Makefile b/sysutils/batterycat/files/patch-Makefile
new file mode 100644
index 000000000000..862ef16d6b1f
--- /dev/null
+++ b/sysutils/batterycat/files/patch-Makefile
@@ -0,0 +1,60 @@
+--- Makefile.orig 2017-07-28 18:13:56 UTC
++++ Makefile
+@@ -1,16 +1,16 @@
+
+ PROJECT = batterycat
+-CC = gcc
+-PREFIX = /usr/local
++CC ?= gcc
++PREFIX ?= /usr/local
+
+ OBJ_DIR = obj
+ TARGET = batterycat
+ C_INCLUDE_DIRS =
+-C_PREPROC = -DENABLE_NLS -DPACKAGE=\"$(PROJECT)\" -DLOCALE_DIR=\"$(PREFIX)/share/locale\"
+-CFLAGS = -pipe `pkg-config --cflags gtk+-2.0` -Wall -g0 -O2 -DPREFIX=\"$(PREFIX)\" -Wno-deprecated-declarations
++C_PREPROC = -DPACKAGE=\"$(PROJECT)\" -DLOCALE_DIR=\"$(PREFIX)/share/locale\"
++CFLAGS += $(shell pkg-config --cflags gtk+-2.0) -Wall -DPREFIX=\"$(PREFIX)\" -Wno-deprecated-declarations
+ LIB_DIRS =
+ LIBS =
+-LDFLAGS = -pipe -s `pkg-config --libs gtk+-2.0`
++LDFLAGS += $(shell pkg-config --libs gtk+-2.0)
+
+ SRC_OBJS = \
+ $(OBJ_DIR)/config.o \
+@@ -24,21 +24,27 @@ SRC_OBJS = \
+ $(OBJ_DIR)/help_about.o \
+ $(OBJ_DIR)/batterycat-icon.o
+
+-all: $(TARGET) nls
++all: $(TARGET)
+
+ $(TARGET): $(OBJ_DIR) $(SRC_OBJS)
+ $(CC) -o $(TARGET) $(SRC_OBJS) $(LIB_DIRS) $(LIBS) $(LDFLAGS) $(FW)
+
+ nls:
+- cd po; make all
++ $(MAKE) -C po all
+
+ install: $(TARGET)
+- cp $(TARGET) $(PREFIX)/bin/.
+- mkdir -p $(PREFIX)/share/$(TARGET)
+- cp $(TARGET)*.xpm $(PREFIX)/share/$(TARGET)/.
+- cp $(TARGET).html $(PREFIX)/share/$(TARGET)/.
+- cp $(TARGET).desktop /usr/share/applications/.
+- cd po; make install
++ $(BSD_INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(PREFIX)/bin/.
++ mkdir -p $(DESTDIR)$(PREFIX)/share/$(TARGET)
++ $(BSD_INSTALL_DATA) $(TARGET)*.xpm $(DESTDIR)$(PREFIX)/share/$(TARGET)/.
++ $(BSD_INSTALL_DATA) $(TARGET).html $(DESTDIR)$(PREFIX)/share/$(TARGET)/.
++ $(BSD_INSTALL_DATA) $(TARGET).desktop $(DESTDIR)$(PREFIX)/share/applications/.
++ifeq ($(WITH_NLS),yes)
++ for lang in $(notdir $(basename $(wildcard po/*.gmo))); do \
++ $(BSD_INSTALL_DATA) po/$$lang.gmo $(DESTDIR)$(PREFIX)/share/locale/$$lang/LC_MESSAGES/batterycat.mo ; done
++
++C_PREPROC += -DENABLE_NLS
++all: nls
++endif
+
+ uninstall:
+ rm -f $(PREFIX)/bin/$(TARGET)
diff --git a/sysutils/batterycat/pkg-descr b/sysutils/batterycat/pkg-descr
new file mode 100644
index 000000000000..5589f08b0092
--- /dev/null
+++ b/sysutils/batterycat/pkg-descr
@@ -0,0 +1,5 @@
+BatteryCat is a laptop battery monitoring and health tool: it monitors
+the current charging state as well as the long-term degradation of the
+laptop's battery by keeping history.
+
+WWW: https://sourceforge.net/projects/batterycat/
More information about the dev-commits-ports-all
mailing list