Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-apps/davical/, www-apps/davical/files/
Date: Mon, 01 Mar 2021 08:26:15
Message-Id: 1614587156.04b1b056deb43fe70a81c54c1bb7c4feb976b1fc.juippis@gentoo
1 commit: 04b1b056deb43fe70a81c54c1bb7c4feb976b1fc
2 Author: Till Schäfer <till2.schaefer <AT> uni-dortmund <DOT> de>
3 AuthorDate: Fri Feb 26 08:39:35 2021 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 1 08:25:56 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04b1b056
7
8 www-apps/davical: support php8
9
10 add upstream patch for php8 compatibility
11
12 Bug: https://bugs.gentoo.org/764908
13 Package-Manager: Portage-3.0.13, Repoman-3.0.2
14 Signed-off-by: Till Schäfer <till2.schaefer <AT> uni-dortmund.de>
15 Closes: https://github.com/gentoo/gentoo/pull/19664
16 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
17
18 www-apps/davical/davical-1.1.9.3-r1.ebuild | 73 ++++++++++++++++++++++
19 .../files/davical-1.1.9.3-php8_compatibility.patch | 58 +++++++++++++++++
20 2 files changed, 131 insertions(+)
21
22 diff --git a/www-apps/davical/davical-1.1.9.3-r1.ebuild b/www-apps/davical/davical-1.1.9.3-r1.ebuild
23 new file mode 100644
24 index 00000000000..4b2bc1b3ed4
25 --- /dev/null
26 +++ b/www-apps/davical/davical-1.1.9.3-r1.ebuild
27 @@ -0,0 +1,73 @@
28 +# Copyright 1999-2021 Gentoo Authors
29 +# Distributed under the terms of the GNU General Public License v2
30 +
31 +EAPI=7
32 +
33 +inherit webapp
34 +
35 +DESCRIPTION="A CalDAV and CardDAV Server"
36 +HOMEPAGE="https://www.davical.org/"
37 +SRC_URI="https://www.davical.org/downloads/${PN}_${PV}.orig.tar.xz -> ${P}.tar.xz"
38 +
39 +LICENSE="GPL-2 GPL-2+ GPL-3+ LGPL-2.1+ LGPL-3+"
40 +KEYWORDS="~amd64 ~x86"
41 +IUSE="ldap"
42 +
43 +BDEPEND="sys-devel/gettext"
44 +
45 +# >=dev-lang/php-8:curly braces string offset access was removed (Bug 764908)
46 +RDEPEND="app-admin/pwgen
47 + dev-lang/php[calendar,curl,iconv,imap,ldap?,nls,pdo,postgres,xml]
48 + dev-perl/DBD-Pg
49 + dev-perl/DBI
50 + dev-perl/YAML
51 + >=dev-php/awl-0.61
52 + virtual/httpd-php"
53 +
54 +PATCHES=( "${FILESDIR}/${P}-php8_compatibility.patch" )
55 +
56 +need_httpd
57 +
58 +S="${WORKDIR}"
59 +
60 +src_compile() {
61 + emake built-locale
62 +}
63 +
64 +src_install() {
65 + webapp_src_preinst
66 +
67 + einstalldocs
68 +
69 + einfo "Installing web files"
70 + insinto "${MY_HTDOCSDIR}"
71 + doins -r htdocs/. htdocs/.htaccess
72 +
73 + einfo "Installing main files and i18n"
74 + insinto "${MY_HOSTROOTDIR}/${PN}"
75 + doins -r inc locale
76 + rm "${ED}/${MY_HOSTROOTDIR}/${PN}/inc/always.php.in" || die
77 +
78 + einfo "Installing sql files"
79 + insinto "${MY_SQLSCRIPTSDIR}"
80 + doins -r dba/.
81 +
82 + insinto /etc/${PN}
83 + doins -r config/. "${FILESDIR}/vhost-example"
84 +
85 + webapp_postinst_txt en "${FILESDIR}/postinstall-en.txt"
86 + webapp_postupgrade_txt en "${FILESDIR}/postupgrade-en.txt"
87 + webapp_src_install
88 +
89 + fperms +x "${MY_SQLSCRIPTSDIR}/create-database.sh"
90 + fperms +x "${MY_SQLSCRIPTSDIR}/update-davical-database"
91 +}
92 +
93 +pkg_postinst() {
94 + elog "If you are upgrading from a previous version of davical, don't forget to"
95 + elog "upgrade the database structure with"
96 + elog " cd /usr/share/webapps/davical/${PVR}/sqlscripts/"
97 + elog " ./update-davical-database -dbuser xxxxxxx -appuser xxxxxx"
98 +
99 + webapp_pkg_postinst
100 +}
101
102 diff --git a/www-apps/davical/files/davical-1.1.9.3-php8_compatibility.patch b/www-apps/davical/files/davical-1.1.9.3-php8_compatibility.patch
103 new file mode 100644
104 index 00000000000..de9db47ff7f
105 --- /dev/null
106 +++ b/www-apps/davical/files/davical-1.1.9.3-php8_compatibility.patch
107 @@ -0,0 +1,58 @@
108 +From f376be164eacf51d7354c728094e697ee2336218 Mon Sep 17 00:00:00 2001
109 +From: Jan Hicken <jan.hicken@××××××.de>
110 +Date: Sun, 31 Jan 2021 11:46:32 +0100
111 +Subject: [PATCH 1/2] Use brackets instead of curly braces for string offset
112 + access
113 +
114 +Curly braces have been deprecated in PHP 7.4 and unsupported in PHP 8.0.
115 +---
116 + inc/check_UTF8.php | 2 +-
117 + 1 file changed, 1 insertion(+), 1 deletion(-)
118 +
119 +diff --git a/inc/check_UTF8.php b/inc/check_UTF8.php
120 +index e3c93dbf..62dbfc00 100644
121 +--- a/inc/check_UTF8.php
122 ++++ b/inc/check_UTF8.php
123 +@@ -67,7 +67,7 @@ function utf8ToUnicode(&$str)
124 +
125 + $len = strlen($str);
126 + for($i = 0; $i < $len; $i++) {
127 +- $in = ord($str{$i});
128 ++ $in = ord($str[$i]);
129 + if (0 == $mState) {
130 + // When mState is zero we expect either a US-ASCII character or a
131 + // multi-octet sequence.
132 +--
133 +GitLab
134 +
135 +
136 +From 6cdbfcf226f0235a00206edfd119fcc90465a2b8 Mon Sep 17 00:00:00 2001
137 +From: Jan Hicken <jan.hicken@××××××.de>
138 +Date: Sun, 31 Jan 2021 11:47:41 +0100
139 +Subject: [PATCH 2/2] Add default value for errcontext variable in error
140 + handler function
141 +
142 +This variable is no longer passed in PHP 8.0.
143 +
144 +It cannot be removed however, because it would not be backwards
145 +compatible.
146 +---
147 + htdocs/setup.php | 2 +-
148 + 1 file changed, 1 insertion(+), 1 deletion(-)
149 +
150 +diff --git a/htdocs/setup.php b/htdocs/setup.php
151 +index 8b13d0ad..2a82dbf3 100644
152 +--- a/htdocs/setup.php
153 ++++ b/htdocs/setup.php
154 +@@ -13,7 +13,7 @@ function log_setup_error($errno , $errstr , $errfile , $errline) {
155 + error_log('DAViCal setup.php: Informational: '.$errfile.'('.$errline.'): ['.$errno.'] '.$errstr);
156 + }
157 +
158 +-function catch_setup_errors($errno , $errstr , $errfile , $errline , $errcontext ) {
159 ++function catch_setup_errors($errno , $errstr , $errfile , $errline , $errcontext = null ) {
160 + if ( $errno == 2 ) {
161 + // A working installation will regularly fail to include_once() for several files as it searches for the location
162 + log_setup_error($errno , $errstr , $errfile , $errline);
163 +--
164 +GitLab
165 +