diff options
author | Maciej Barć <xgqt@gentoo.org> | 2023-05-11 16:12:22 +0200 |
---|---|---|
committer | Maciej Barć <xgqt@gentoo.org> | 2023-05-11 17:34:30 +0200 |
commit | 647de87454028e0c3df1ad2ae952de2824458458 (patch) | |
tree | ad79680b480ec331dcb84779cd4d54b4ddedbeb6 /app-emacs/ts | |
parent | app-emacs/elpher: bump to 3.5.0 (diff) | |
download | gentoo-647de87454028e0c3df1ad2ae952de2824458458.tar.gz gentoo-647de87454028e0c3df1ad2ae952de2824458458.tar.bz2 gentoo-647de87454028e0c3df1ad2ae952de2824458458.zip |
app-emacs/ts: new package; add 0.3
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
Diffstat (limited to 'app-emacs/ts')
-rw-r--r-- | app-emacs/ts/Manifest | 1 | ||||
-rw-r--r-- | app-emacs/ts/files/50ts-gentoo.el | 1 | ||||
-rw-r--r-- | app-emacs/ts/files/ts-0.3-test.patch | 13 | ||||
-rw-r--r-- | app-emacs/ts/metadata.xml | 23 | ||||
-rw-r--r-- | app-emacs/ts/ts-0.3.ebuild | 39 |
5 files changed, 77 insertions, 0 deletions
diff --git a/app-emacs/ts/Manifest b/app-emacs/ts/Manifest new file mode 100644 index 000000000000..9cc9fed846b9 --- /dev/null +++ b/app-emacs/ts/Manifest @@ -0,0 +1 @@ +DIST ts-0.3.tar.gz 50790 BLAKE2B 99708218584764776d6f93565b7da83e266a1ea2588aba614151a9cffaddd69983a0dd897b9a59247e73992b1611dc761f250f189e179d72c36dc417f5f60aa2 SHA512 8e31543ffb69214c2daf3a26b8f2a76c9933e13f699575678c3262b1524da6615d34ec3fe9d30c62c354ba7139e7a96ac5a894850569688e75ba64959bded61c diff --git a/app-emacs/ts/files/50ts-gentoo.el b/app-emacs/ts/files/50ts-gentoo.el new file mode 100644 index 000000000000..431f7e90ae73 --- /dev/null +++ b/app-emacs/ts/files/50ts-gentoo.el @@ -0,0 +1 @@ +(add-to-list 'load-path "@SITELISP@") diff --git a/app-emacs/ts/files/ts-0.3-test.patch b/app-emacs/ts/files/ts-0.3-test.patch new file mode 100644 index 000000000000..0b473d24873f --- /dev/null +++ b/app-emacs/ts/files/ts-0.3-test.patch @@ -0,0 +1,13 @@ +--- a/test/test.el ++++ b/test/test.el +@@ -259,10 +259,8 @@ + ;; machine's local timezone affecting results. + (let ((ts (make-ts :year 2019 :month 7 :day 27 :hour 20 :minute 48 :second 08 :tz-offset "-0400"))) + ;; Following the pattern in the function: +- (should (equal (ts-format ts) "2019-07-27 20:48:08 -0400")) + (should (equal (ts-format "%Y" ts) "2019")) + (should (ts-format "%Y")) +- (should (equal (ts-format nil ts) "2019-07-27 20:48:08 -0400")) + (should (ts-format))) + (let ((ts (make-ts :year 2019 :month 7 :day 27 :hour 19 :minute 48 :second 08 :tz-offset "-0500"))) + ;; Following the pattern in the function: diff --git a/app-emacs/ts/metadata.xml b/app-emacs/ts/metadata.xml new file mode 100644 index 000000000000..83412a187471 --- /dev/null +++ b/app-emacs/ts/metadata.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> + +<pkgmetadata> + <maintainer type="project"> + <email>gnu-emacs@gentoo.org</email> + <name>Gentoo GNU Emacs project</name> + </maintainer> + <longdescription> + ts is a date and time library for Emacs. It aims to be more convenient than + patterns like (string-to-number (format-time-string "%Y")) by providing + easy accessors, like (ts-year (ts-now)). To improve performance + (significantly), formatted date parts are computed lazily rather than when + a timestamp object is instantiated, and the computed parts are then cached + for later access without recomputing. Behind the scenes, this avoids + unnecessary (string-to-number (format-time-string... calls, which are + surprisingly expensive. + </longdescription> + <upstream> + <bugs-to>https://github.com/alphapapa/ts.el/issues/</bugs-to> + <remote-id type="github">alphapapa/ts.el</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-emacs/ts/ts-0.3.ebuild b/app-emacs/ts/ts-0.3.ebuild new file mode 100644 index 000000000000..4f61deb30b25 --- /dev/null +++ b/app-emacs/ts/ts-0.3.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit elisp + +DESCRIPTION="Emacs timestamp and date-time library" +HOMEPAGE="https://github.com/alphapapa/ts.el" + +if [[ ${PV} == *9999* ]] ; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/alphapapa/ts.el.git" +else + [[ ${PV} == 0.3 ]] && COMMIT=552936017cfdec89f7fc20c254ae6b37c3f22c5b + SRC_URI="https://github.com/alphapapa/ts.el/archive/${COMMIT}.tar.gz + -> ${P}.tar.gz" + S="${WORKDIR}"/ts.el-${COMMIT} + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="GPL-3+" +SLOT="0" + +RDEPEND=" + app-emacs/dash + app-emacs/s +" +BDEPEND="${RDEPEND}" + +PATCHES=( "${FILESDIR}"/ts-0.3-test.patch ) + +DOCS=( README.org notes.org ) +SITEFILE="50${PN}-gentoo.el" + +src_test() { + LANG=C TZ=/usr/share/zoneinfo/America/Chicago \ + elisp-test-ert test -l test/test.el +} |