[Pkg-mediawiki-commits] [wikidiff2] 01/01: Update for PHP7 compat as 1.2+git03ea59f-1
Kunal Mehta
legoktm-guest at moszumanska.debian.org
Fri Jul 1 19:58:09 UTC 2016
This is an automated email from the git hooks/post-receive script.
legoktm-guest pushed a commit to branch master
in repository wikidiff2.
commit f95cf856a8af82c572bb5da2346e9de692a67006
Author: Kunal Mehta <legoktm at member.fsf.org>
Date: Sun Jun 26 11:14:30 2016 +0200
Update for PHP7 compat as 1.2+git03ea59f-1
And other misc fixes
---
debian/changelog | 10 +++++++
debian/control | 10 +++----
debian/dirs | 2 +-
debian/install | 2 +-
debian/patches/php7.diff | 72 ++++++++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 11 +++-----
7 files changed, 94 insertions(+), 14 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 47265ec..34802cf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+wikidiff2 (1.2+git03ea59f-2) unstable; urgency=medium
+
+ * Update for PHP7 support, patch from upstream (Closes: #821633, #821720)
+ * Update dependencies for PHP7
+ * Standards version 3.9.8
+ * Add myself (Kunal Mehta) to uploaders list, removed Jonathon
+ * Improved extended description (Closes: #763753)
+
+ -- Kunal Mehta <legoktm at member.fsf.org> Fri, 17 Jun 2016 17:01:21 -0700
+
wikidiff2 (1.2+git03ea59f-1) unstable; urgency=medium
* Add Vcs-* fields to debian/control
diff --git a/debian/control b/debian/control
index 02e7ad6..5a13ac9 100644
--- a/debian/control
+++ b/debian/control
@@ -2,19 +2,19 @@ Source: wikidiff2
Section: php
Priority: optional
Maintainer: Mediawiki Maintenance Team <pkg-mediawiki-devel at lists.alioth.debian.org>
-Uploaders: Romain Beauxis <toots at rastageeks.org>, Jonathan Wiltshire <jmw at debian.org>
-Build-Depends: debhelper (>= 9), php5-dev, libthai-dev, pkg-config, php5-cli
+Uploaders: Romain Beauxis <toots at rastageeks.org>, Kunal Mehta <legoktm at member.fsf.org>
+Build-Depends: debhelper (>= 9), php-dev, libthai-dev, pkg-config, php-cli
Homepage: http://www.mediawiki.org/wiki/Extension:Wikidiff2
-Standards-Version: 3.9.5
+Standards-Version: 3.9.8
Vcs-Git: git://anonscm.debian.org/collab-maint/wikidiff2.git
Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/wikidiff2.git
Package: php-wikidiff2
Architecture: any
-Depends: php5 | php5-cli, ${misc:Depends}, ${shlibs:Depends}, ${php:Depends}
+Depends: php | php-cli, ${misc:Depends}, ${shlibs:Depends}, ${php:Depends}
Recommends: mediawiki
Description: external diff engine for mediawiki
- Wikidiff2 is PHP 5 module providing external diff
+ Wikidiff2 is a PHP module providing external diff
engine for MediaWiki. It performs word-level
(space-delimited) diffs on general text, and
character-level diffs on text composed of characters
diff --git a/debian/dirs b/debian/dirs
index 1519dde..031cfbe 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -1 +1 @@
-etc/php5/mods-available
+etc/php/7.0/mods-available
diff --git a/debian/install b/debian/install
index 329e292..c106911 100644
--- a/debian/install
+++ b/debian/install
@@ -1,2 +1,2 @@
-wikidiff2.ini etc/php5/mods-available
+wikidiff2.ini etc/php/7.0/mods-available
debian/etc/mediawiki-extensions etc
diff --git a/debian/patches/php7.diff b/debian/patches/php7.diff
new file mode 100644
index 0000000..22ec651
--- /dev/null
+++ b/debian/patches/php7.diff
@@ -0,0 +1,72 @@
+Index: wikidiff2-1.2+git03ea59f/php_wikidiff2.cpp
+===================================================================
+--- wikidiff2-1.2+git03ea59f.orig/php_wikidiff2.cpp 2016-06-14 14:19:09.000000000 -0700
++++ wikidiff2-1.2+git03ea59f/php_wikidiff2.cpp 2016-06-14 14:19:58.236052141 -0700
+@@ -12,6 +12,13 @@
+ #include "TableDiff.h"
+ #include "InlineDiff.h"
+
++
++#if PHP_MAJOR_VERSION >= 7
++#define COMPAT_RETURN_STRINGL(s, l) { RETURN_STRINGL(s, l); return; }
++#else
++#define COMPAT_RETURN_STRINGL(s, l) { RETURN_STRINGL(s, l, 1); return; }
++#endif
++
+ static int le_wikidiff2;
+
+ zend_function_entry wikidiff2_functions[] = {
+@@ -81,9 +88,15 @@
+ char *text1 = NULL;
+ char *text2 = NULL;
+ int argc = ZEND_NUM_ARGS();
++#if PHP_MAJOR_VERSION >= 7
++ size_t text1_len;
++ size_t text2_len;
++ zend_long numContextLines;
++#else
+ int text1_len;
+ int text2_len;
+ long numContextLines;
++#endif
+
+ if (zend_parse_parameters(argc TSRMLS_CC, "ssl", &text1, &text1_len, &text2,
+ &text2_len, &numContextLines) == FAILURE)
+@@ -96,8 +109,8 @@
+ TableDiff wikidiff2;
+ Wikidiff2::String text1String(text1, text1_len);
+ Wikidiff2::String text2String(text2, text2_len);
+- const Wikidiff2::String & ret = wikidiff2.execute(text1String, text2String, numContextLines);
+- RETURN_STRINGL( const_cast<char*>(ret.data()), ret.size(), 1);
++ const Wikidiff2::String & ret = wikidiff2.execute(text1String, text2String, (int)numContextLines);
++ COMPAT_RETURN_STRINGL( const_cast<char*>(ret.data()), ret.size());
+ } catch (std::bad_alloc &e) {
+ zend_error(E_WARNING, "Out of memory in wikidiff2_do_diff().");
+ } catch (...) {
+@@ -115,9 +128,15 @@
+ char *text1 = NULL;
+ char *text2 = NULL;
+ int argc = ZEND_NUM_ARGS();
++#if PHP_MAJOR_VERSION >= 7
++ size_t text1_len;
++ size_t text2_len;
++ zend_long numContextLines;
++#else
+ int text1_len;
+ int text2_len;
+ long numContextLines;
++#endif
+
+ if (zend_parse_parameters(argc TSRMLS_CC, "ssl", &text1, &text1_len, &text2,
+ &text2_len, &numContextLines) == FAILURE)
+@@ -130,8 +149,8 @@
+ InlineDiff wikidiff2;
+ Wikidiff2::String text1String(text1, text1_len);
+ Wikidiff2::String text2String(text2, text2_len);
+- const Wikidiff2::String& ret = wikidiff2.execute(text1String, text2String, numContextLines);
+- RETURN_STRINGL( const_cast<char*>(ret.data()), ret.size(), 1);
++ const Wikidiff2::String& ret = wikidiff2.execute(text1String, text2String, (int)numContextLines);
++ COMPAT_RETURN_STRINGL( const_cast<char*>(ret.data()), ret.size());
+ } catch (std::bad_alloc &e) {
+ zend_error(E_WARNING, "Out of memory in wikidiff2_inline_diff().");
+ } catch (...) {
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..feb2158 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+php7.diff
diff --git a/debian/rules b/debian/rules
index 954b790..ca7bb1b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,11 +8,8 @@ CXXFLAGS+=-Wno-write-strings
dh $@
override_dh_auto_configure:
- # Slightly hacked here to make it work with other PHP installations
- # earlier in the path, so I don't have to make chroots. Really it should just
- # be phpize && dh_auto_configure.
/usr/bin/phpize
- dh_auto_configure -- --with-php-config=/usr/bin/php-config
+ dh_auto_configure
override_dh_auto_test:
NO_INTERACTION=1 make test
@@ -20,6 +17,6 @@ override_dh_auto_test:
override_dh_auto_install:
INSTALL_ROOT=$(CURDIR)/debian/php-wikidiff2 make install
-override_dh_gencontrol:
- echo "php:Depends=phpapi-$(shell php-config5 --phpapi)" >> debian/php-wikidiff2.substvars
- dh_gencontrol
+override_dh_auto_clean:
+ /usr/bin/phpize --clean
+ dh_auto_clean
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/wikidiff2.git
More information about the Pkg-mediawiki-commits
mailing list