git: 8f96bb881112 - main - x11/darkman: add new port

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Tue, 13 Dec 2022 17:12:27 UTC
The branch main has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8f96bb8811120fe7b9aa2178a57d17fb6ce7c3ae

commit 8f96bb8811120fe7b9aa2178a57d17fb6ce7c3ae
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2022-10-22 10:12:59 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-12-13 17:11:36 +0000

    x11/darkman: add new port
    
    A framework for dark-mode and light-mode transitions on Unix-like desktops.
    
    https://gitlab.com/WhyNotHugo/darkman
---
 x11/Makefile                                   |  1 +
 x11/darkman/Makefile                           | 80 ++++++++++++++++++++++++++
 x11/darkman/distinfo                           | 43 ++++++++++++++
 x11/darkman/files/patch-boottimer_boottimer.go | 25 ++++++++
 x11/darkman/pkg-descr                          |  1 +
 5 files changed, 150 insertions(+)

diff --git a/x11/Makefile b/x11/Makefile
index 7bed8e4f543d..7316e74f68aa 100644
--- a/x11/Makefile
+++ b/x11/Makefile
@@ -45,6 +45,7 @@
     SUBDIR += controllermap
     SUBDIR += cool-retro-term
     SUBDIR += coreterminal
+    SUBDIR += darkman
     SUBDIR += deforaos-desktop
     SUBDIR += deforaos-keyboard
     SUBDIR += deforaos-libdesktop
diff --git a/x11/darkman/Makefile b/x11/darkman/Makefile
new file mode 100644
index 000000000000..c90fba534b48
--- /dev/null
+++ b/x11/darkman/Makefile
@@ -0,0 +1,80 @@
+PORTNAME=	darkman
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.4.0
+CATEGORIES=	x11
+
+MAINTAINER=	jbeich@FreeBSD.org
+COMMENT=	Framework for dark-mode and light-mode transitions
+WWW=		https://gitlab.com/WhyNotHugo/darkman
+
+LICENSE=	ISCL
+LICENSE_FILE=	${WRKSRC}/LICENCE
+
+USES=		go:modules
+USE_GITHUB=	nodefault
+USE_GITLAB=	yes
+GH_TUPLE=	adrg:xdg:v0.3.3:adrg_xdg/vendor/github.com/adrg/xdg \
+		fsnotify:fsnotify:v1.5.1:fsnotify_fsnotify/vendor/github.com/fsnotify/fsnotify \
+		go-ini:ini:v1.66.2:go_ini_ini/vendor/gopkg.in/ini.v1 \
+		go-yaml:yaml:v2.4.0:go_yaml_yaml/vendor/gopkg.in/yaml.v2 \
+		godbus:dbus:v5.0.4:godbus_dbus_v5/vendor/github.com/godbus/dbus/v5 \
+		golang:sys:97ca703d548d:golang_sys/vendor/golang.org/x/sys \
+		golang:text:v0.3.7:golang_text/vendor/golang.org/x/text \
+		hashicorp:hcl:v1.0.0:hashicorp_hcl/vendor/github.com/hashicorp/hcl \
+		inconshreveable:mousetrap:v1.0.0:inconshreveable_mousetrap/vendor/github.com/inconshreveable/mousetrap \
+		magiconair:properties:v1.8.5:magiconair_properties/vendor/github.com/magiconair/properties \
+		mitchellh:mapstructure:v1.4.3:mitchellh_mapstructure/vendor/github.com/mitchellh/mapstructure \
+		pelletier:go-toml:v1.9.4:pelletier_go_toml/vendor/github.com/pelletier/go-toml \
+		sj14:astral:v0.1.2:sj14_astral/vendor/github.com/sj14/astral \
+		spf13:afero:v1.6.0:spf13_afero/vendor/github.com/spf13/afero \
+		spf13:cast:v1.4.1:spf13_cast/vendor/github.com/spf13/cast \
+		spf13:cobra:v1.3.0:spf13_cobra/vendor/github.com/spf13/cobra \
+		spf13:jwalterweatherman:v1.1.0:spf13_jwalterweatherman/vendor/github.com/spf13/jwalterweatherman \
+		spf13:pflag:v1.0.5:spf13_pflag/vendor/github.com/spf13/pflag \
+		spf13:viper:v1.10.0:spf13_viper/vendor/github.com/spf13/viper \
+		subosito:gotenv:v1.2.0:subosito_gotenv/vendor/github.com/subosito/gotenv
+GL_ACCOUNT=	WhyNotHugo
+GL_COMMIT=	5f30663e4cee23158978e382eea96d0148cf505d
+GO_TARGET=	./cmd/${PORTNAME}
+PLIST_FILES=	bin/${PORTNAME} \
+		share/bash-completion/completions/${PORTNAME} \
+		share/fish/vendor_completions.d/${PORTNAME}.fish \
+		share/zsh/site-functions/_${PORTNAME} \
+		share/dbus-1/services/nl.whynothugo.darkman.service \
+		share/dbus-1/services/org.freedesktop.impl.portal.desktop.darkman.service  \
+		share/xdg-desktop-portal/portals/${PORTNAME}.portal
+
+OPTIONS_DEFINE=	MANPAGES
+OPTIONS_DEFAULT=MANPAGES
+
+MANPAGES_BUILD_DEPENDS=	scdoc:textproc/scdoc
+MANPAGES_PLIST_FILES=	share/man/man1/${PORTNAME}.1.gz
+
+post-patch:
+# Respect LOCALBASE for {dark,light}-mode.d scripts
+	@${REINPLACE_CMD} 's,/usr/share,${LOCALBASE}/share,' \
+		${WRKSRC}/vendor/github.com/adrg/xdg/paths_unix.go
+
+post-install:
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/dbus-1/services
+	${INSTALL_DATA} ${WRKSRC}/contrib/dbus/nl.whynothugo.darkman.service \
+		${STAGEDIR}${PREFIX}/share/dbus-1/services/
+	${INSTALL_DATA} ${WRKSRC}/contrib/dbus/org.freedesktop.impl.portal.desktop.darkman.service \
+		${STAGEDIR}${PREFIX}/share/dbus-1/services/
+	${MKDIR} ${STAGEDIR}${PREFIX}/share/xdg-desktop-portal/portals
+	${INSTALL_DATA} ${WRKSRC}/contrib/portal/${PORTNAME}.portal \
+		${STAGEDIR}${PREFIX}/share/xdg-desktop-portal/portals/
+.for _shell in bash fish zsh
+	@${ECHO_MSG} "Generating ${STAGEDIR}${PREFIX}/${PLIST_FILES:M*${_shell}*}"
+	${WRKDIR}/bin/${PORTNAME} completion ${_shell} \
+		>${STAGEDIR}${PREFIX}/${PLIST_FILES:M*${_shell}*}
+.endfor
+
+do-build-MANPAGES-on:
+	scdoc < ${WRKSRC}/${PORTNAME}.1.scd >${WRKSRC}/${PORTNAME}.1
+
+do-install-MANPAGES-on:
+	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 \
+		${STAGEDIR}${PREFIX}/${MANPAGES_PLIST_FILES:H}
+
+.include <bsd.port.mk>
diff --git a/x11/darkman/distinfo b/x11/darkman/distinfo
new file mode 100644
index 000000000000..ff2128e52c98
--- /dev/null
+++ b/x11/darkman/distinfo
@@ -0,0 +1,43 @@
+TIMESTAMP = 1666433579
+SHA256 (adrg-xdg-v0.3.3_GH0.tar.gz) = 07493a0702766a2f713321928a0f304c34f900dee445f5de3a4e43c715d2e21d
+SIZE (adrg-xdg-v0.3.3_GH0.tar.gz) = 16502
+SHA256 (fsnotify-fsnotify-v1.5.1_GH0.tar.gz) = bf4be597aef95796bec7c7def6701581c5e153376ba5a5aa31c2d04470d84f1d
+SIZE (fsnotify-fsnotify-v1.5.1_GH0.tar.gz) = 32691
+SHA256 (go-ini-ini-v1.66.2_GH0.tar.gz) = ffe5847f7eac5c87e5de415c2af8144403b40dc58bca5633d792b91a0f5bd0eb
+SIZE (go-ini-ini-v1.66.2_GH0.tar.gz) = 50660
+SHA256 (go-yaml-yaml-v2.4.0_GH0.tar.gz) = d8e94679e5fff6bd1a35e10241543929a5f3da44f701755babf99b3daf0faac0
+SIZE (go-yaml-yaml-v2.4.0_GH0.tar.gz) = 73209
+SHA256 (godbus-dbus-v5.0.4_GH0.tar.gz) = cc43459f4c165c1f782aea9a1b79405b5a07cab9694a637246dacde9c889bc56
+SIZE (godbus-dbus-v5.0.4_GH0.tar.gz) = 69965
+SHA256 (golang-sys-97ca703d548d_GH0.tar.gz) = 8442ec1ca5eba53626b04367d9c39bc69fb0a2ceef9a2a950e848308b4ef0b15
+SIZE (golang-sys-97ca703d548d_GH0.tar.gz) = 1253842
+SHA256 (golang-text-v0.3.7_GH0.tar.gz) = 7cab2f6c3133ac1d422edd952b0dd2082fa55a73c2663fb2defd9bf83d649b26
+SIZE (golang-text-v0.3.7_GH0.tar.gz) = 8354718
+SHA256 (hashicorp-hcl-v1.0.0_GH0.tar.gz) = 50632428210503070fd2fde748c88b7414bf84a6a0eadebf9d8e596a033bead2
+SIZE (hashicorp-hcl-v1.0.0_GH0.tar.gz) = 70658
+SHA256 (inconshreveable-mousetrap-v1.0.0_GH0.tar.gz) = 5edc7731c819c305623568e317aa253d342be3447def97f1fa9e10eb5ad819f6
+SIZE (inconshreveable-mousetrap-v1.0.0_GH0.tar.gz) = 2290
+SHA256 (magiconair-properties-v1.8.5_GH0.tar.gz) = f85ea629d145006f4df18fd8251fa005d95c311b068848043232f52d247ba45c
+SIZE (magiconair-properties-v1.8.5_GH0.tar.gz) = 30514
+SHA256 (mitchellh-mapstructure-v1.4.3_GH0.tar.gz) = 06198bdaa6782f68990134b88b5f0c1db44757cf81721c619fff5626d97fffc4
+SIZE (mitchellh-mapstructure-v1.4.3_GH0.tar.gz) = 28418
+SHA256 (pelletier-go-toml-v1.9.4_GH0.tar.gz) = 2b00521c81b994a72d0f3bd3aa9273cb17fab61a5e9749aff1108117a8d7c397
+SIZE (pelletier-go-toml-v1.9.4_GH0.tar.gz) = 106507
+SHA256 (sj14-astral-v0.1.2_GH0.tar.gz) = e3305b66e64505f763ff5d87b31bef8dae78a0780ad93864d09341aebdd7466a
+SIZE (sj14-astral-v0.1.2_GH0.tar.gz) = 266290
+SHA256 (spf13-afero-v1.6.0_GH0.tar.gz) = d1942de010ac7932bd21618aaf478b4f1413980449c061032f18beac7805d068
+SIZE (spf13-afero-v1.6.0_GH0.tar.gz) = 62130
+SHA256 (spf13-cast-v1.4.1_GH0.tar.gz) = 3d099a48b75a66ac52dbb473c93096076dca752af51087b8d163e15e5de721f8
+SIZE (spf13-cast-v1.4.1_GH0.tar.gz) = 13381
+SHA256 (spf13-cobra-v1.3.0_GH0.tar.gz) = 5b6a1d841561112a68a46dfa58f8fd86a06abb8838cf86d085738a306fe91357
+SIZE (spf13-cobra-v1.3.0_GH0.tar.gz) = 169515
+SHA256 (spf13-jwalterweatherman-v1.1.0_GH0.tar.gz) = 4fd850a792c5738954c4801cf549d8d0bf53edd17139cd39d179aa5abf7ec68d
+SIZE (spf13-jwalterweatherman-v1.1.0_GH0.tar.gz) = 6871
+SHA256 (spf13-pflag-v1.0.5_GH0.tar.gz) = 9a2cae1f8e8ab0d2cc8ebe468e871af28d9ac0962cf0520999e3ba85f0c7b808
+SIZE (spf13-pflag-v1.0.5_GH0.tar.gz) = 50796
+SHA256 (spf13-viper-v1.10.0_GH0.tar.gz) = 8f8b240ab348d80f5eb50c473b1eb3346248dada5fc90ffc8fa6474bb862d9c8
+SIZE (spf13-viper-v1.10.0_GH0.tar.gz) = 106880
+SHA256 (subosito-gotenv-v1.2.0_GH0.tar.gz) = 5f6826992c11981018c77377f33dbc56d0be932e0d38a2f51e795c99725e7ba5
+SIZE (subosito-gotenv-v1.2.0_GH0.tar.gz) = 7359
+SHA256 (WhyNotHugo-darkman-5f30663e4cee23158978e382eea96d0148cf505d_GL0.tar.gz) = 7d5c8ddaf1c220ca7a89fa894e3d315f1982b4b55450187ae92438e150db866a
+SIZE (WhyNotHugo-darkman-5f30663e4cee23158978e382eea96d0148cf505d_GL0.tar.gz) = 48943
diff --git a/x11/darkman/files/patch-boottimer_boottimer.go b/x11/darkman/files/patch-boottimer_boottimer.go
new file mode 100644
index 000000000000..127ccdd3a81e
--- /dev/null
+++ b/x11/darkman/files/patch-boottimer_boottimer.go
@@ -0,0 +1,25 @@
+Unbreak on FreeBSD < 13 and i386
+
+boottimer/boottimer.go:35:17: could not determine kind of name for C.CLOCK_BOOTTIME
+boottimer/boottimer.go:47:13: cannot use _Ctype_long(seconds) (value of type _Ctype_long) as type _Ctype_int in struct literal
+
+--- boottimer/boottimer.go.orig	2022-10-22 10:12:59 UTC
++++ boottimer/boottimer.go
+@@ -32,7 +32,7 @@ func SetTimer(d time.Duration) {
+ // the same channel `Alarms` above.
+ func SetTimer(d time.Duration) {
+ 	var timer C.timer_t
+-	C.timer_create(C.CLOCK_BOOTTIME, nil, &timer)
++	C.timer_create(C.CLOCK_UPTIME, nil, &timer)
+ 
+ 	seconds := d.Round(time.Second).Seconds()
+ 	ns := (d - d.Truncate(time.Second)).Nanoseconds()
+@@ -44,7 +44,7 @@ func SetTimer(d time.Duration) {
+ 			tv_nsec: 0,
+ 		},
+ 		it_value: C.struct_timespec{
+-			tv_sec:  C.long(seconds),
++			tv_sec:  C.time_t(seconds),
+ 			tv_nsec: C.long(ns),
+ 		},
+ 	}
diff --git a/x11/darkman/pkg-descr b/x11/darkman/pkg-descr
new file mode 100644
index 000000000000..b2c924485ca3
--- /dev/null
+++ b/x11/darkman/pkg-descr
@@ -0,0 +1 @@
+A framework for dark-mode and light-mode transitions on Unix-like desktops.