Hello ports@,

Currently sqlite in PHP builds its own sqlite and links it internally.  
This library is quite out of date (3.8.10.2 for 5.6 and 3.14.2 for 7.0).

I would like to link PHP to our sqlite3 package, so that it can be kept
up to date. This is assumed to also be what happens with most Linux
packages[0].

The motivation to split pdo_sqlite/sqlite3 into a separate package is
for two reasons:
1) All other databases have their own package, so it's more consistent.
2) Keeping the extensions in the SAPI would add another dependency on
the PHP-main package.

Of course I can change the patch to just link to the sqlite package
if this is not enough motivation to split them up.

If we split them up the packages that at least have sqlite calls in
them are, but might be in optional code-paths:
icinga/web2
zabbix-agent
chive
nextcloud
owncloud
piwik

I'm not 100% sure if I handled the PLIST-main correctly, but the
sqlite3.h file can be removed anyway, since it's not used anymore.

Also, I noticed a type-O in the pdo_pgsql description, so I changed
it while here.

Comments?

martijn@

[0] https://marc.info/?l=php-internals&m=150031503332312&w=2

Index: Makefile.inc
===================================================================
RCS file: /cvs/ports/lang/php/Makefile.inc,v
retrieving revision 1.104
diff -u -p -r1.104 Makefile.inc
--- Makefile.inc        23 May 2018 06:51:14 -0000      1.104
+++ Makefile.inc        24 May 2018 10:44:31 -0000
@@ -67,8 +67,6 @@ CONFIGURE_ARGS+=      --enable-shared \
                        --with-pic \
                        --with-pear=${LOCALBASE}/share/php-${PV} \
                        --with-config-file-scan-dir=${SYSCONFDIR}/php-${PV} \
-                       --with-pdo-sqlite \
-                       --with-sqlite3 \
                        --program-suffix=-${PV} \
                        --with-readline
 
@@ -237,11 +235,18 @@ WANTLIB-pdo_mysql=        crypto m pthread ssl 
 
 # pdo-pgsql
 PHP_EXTENSIONS+=       -pdo_pgsql
-COMMENT-pdo_pgsql=     PDO database access extensions for php
+COMMENT-pdo_pgsql=     PDO pgsql database access extensions for php
 CONFIGURE_ARGS+=        --with-pdo-pgsql=shared,${LOCALBASE}
 LIB_DEPENDS-pdo_pgsql= databases/postgresql
 WANTLIB-pdo_pgsql=     pq>=2 pthread
 
+# pdo-sqlite
+PHP_EXTENSIONS+=       -pdo_sqlite
+COMMENT-pdo_sqlite=    PDO sqlite3 database access extensions for php
+CONFIGURE_ARGS+=        --with-pdo-sqlite=shared,${LOCALBASE}
+LIB_DEPENDS-pdo_sqlite=        databases/sqlite3
+WANTLIB-pdo_sqlite=    sqlite3 pthread
+
 # pgsql
 PHP_EXTENSIONS+=       -pgsql
 COMMENT-pgsql=         pgsql database access extensions for php
@@ -276,6 +281,13 @@ COMMENT-snmp=              snmp protocol extensions 
 CONFIGURE_ARGS+=       --with-snmp=shared,${LOCALBASE}
 LIB_DEPENDS-snmp=      net/net-snmp
 WANTLIB-snmp=          crypto m netsnmp>=6.2 pthread
+
+# sqlite3
+PHP_EXTENSIONS+=       -sqlite3
+COMMENT-sqlite3=       sqlite3 database access extension for php
+CONFIGURE_ARGS+=       --with-sqlite3=shared,${LOCALBASE}
+LIB_DEPENDS-sqlite3=   databases/sqlite3
+WANTLIB-sqlite3=       sqlite3 pthread
 
 # pdo-dblib
 PHP_EXTENSIONS+=       -pdo_dblib
Index: 5.6/Makefile
===================================================================
RCS file: /cvs/ports/lang/php/5.6/Makefile,v
retrieving revision 1.64
diff -u -p -r1.64 Makefile
--- 5.6/Makefile        23 May 2018 06:51:14 -0000      1.64
+++ 5.6/Makefile        24 May 2018 10:44:31 -0000
@@ -5,7 +5,7 @@ BROKEN-alpha=   pcre_jit_compile.c:65:2: e
 PV=            5.6
 V=             ${PV}.35
 REVISION=      1
-REVISION-main= 2
+REVISION-main= 3
 
 MASTER_SITES0= https://download.suhosin.org/
 
Index: 5.6/pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/lang/php/5.6/pkg/PLIST-main,v
retrieving revision 1.11
diff -u -p -r1.11 PLIST-main
--- 5.6/pkg/PLIST-main  23 May 2018 06:51:14 -0000      1.11
+++ 5.6/pkg/PLIST-main  24 May 2018 10:44:31 -0000
@@ -5,9 +5,7 @@
 @conflict php-fpm->=5.6,<5.7
 @conflict php5-core->=5.2
 @conflict php5-core-fastcgi->=5.2
-@conflict php5-pdo_sqlite->=5.2
 @pkgpath lang/php/5.4
-@pkgpath lang/php/5.4,-pdo_sqlite
 @pkgpath lang/php/5.6,-fpm
 @pkgpath lang/php/5.6,-main,ap2
 @extraunexec rm -f ${SYSCONFDIR}/php-${PV}/php-${PV}.sample/*
@@ -281,9 +279,6 @@ share/php-${PV}/include/ext/spl/spl_func
 share/php-${PV}/include/ext/spl/spl_heap.h
 share/php-${PV}/include/ext/spl/spl_iterators.h
 share/php-${PV}/include/ext/spl/spl_observer.h
-share/php-${PV}/include/ext/sqlite3/
-share/php-${PV}/include/ext/sqlite3/libsqlite/
-share/php-${PV}/include/ext/sqlite3/libsqlite/sqlite3.h
 share/php-${PV}/include/ext/standard/
 share/php-${PV}/include/ext/standard/base64.h
 share/php-${PV}/include/ext/standard/basic_functions.h
Index: 5.6/pkg/PLIST-pdo_sqlite
===================================================================
RCS file: 5.6/pkg/PLIST-pdo_sqlite
diff -N 5.6/pkg/PLIST-pdo_sqlite
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 5.6/pkg/PLIST-pdo_sqlite    24 May 2018 10:44:31 -0000
@@ -0,0 +1,7 @@
+@comment $OpenBSD$
+@option no-default-conflict
+@option is-branch
+@conflict php-pdo_sqlite->=5.6,<5.7
+lib/php-${PV}/modules/pdo_sqlite.so
+share/examples/php-${PV}/pdo_sqlite.ini
+@sample ${SYSCONFDIR}/php-${PV}.sample/pdo_sqlite.ini
Index: 5.6/pkg/PLIST-sqlite3
===================================================================
RCS file: 5.6/pkg/PLIST-sqlite3
diff -N 5.6/pkg/PLIST-sqlite3
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 5.6/pkg/PLIST-sqlite3       24 May 2018 10:44:31 -0000
@@ -0,0 +1,7 @@
+@comment $OpenBSD$
+@option no-default-conflict
+@option is-branch
+@conflict php-sqlite3->=5.6,<5.7
+lib/php-${PV}/modules/sqlite3.so
+share/examples/php-${PV}/sqlite3.ini
+@sample ${SYSCONFDIR}/php-${PV}.sample/sqlite3.ini
Index: 7.0/Makefile
===================================================================
RCS file: /cvs/ports/lang/php/7.0/Makefile,v
retrieving revision 1.47
diff -u -p -r1.47 Makefile
--- 7.0/Makefile        23 May 2018 06:51:14 -0000      1.47
+++ 7.0/Makefile        24 May 2018 10:44:31 -0000
@@ -5,7 +5,7 @@ BROKEN-sparc64= SIGBUS during phar gener
 PV=            7.0
 V=             ${PV}.29
 REVISION=      1
-REVISION-main= 2
+REVISION-main= 3
 
 BUILD_DEPENDS+=        devel/bison
 
Index: 7.0/pkg/PLIST-main
===================================================================
RCS file: /cvs/ports/lang/php/7.0/pkg/PLIST-main,v
retrieving revision 1.7
diff -u -p -r1.7 PLIST-main
--- 7.0/pkg/PLIST-main  23 May 2018 06:51:14 -0000      1.7
+++ 7.0/pkg/PLIST-main  24 May 2018 10:44:31 -0000
@@ -5,9 +5,7 @@
 @conflict php-fpm->=7.0,<7.1
 @conflict php5-core->=5.2
 @conflict php5-core-fastcgi->=5.2
-@conflict php5-pdo_sqlite->=5.2
 @pkgpath lang/php/5.4
-@pkgpath lang/php/5.4,-pdo_sqlite
 @pkgpath lang/php/7.0,-fpm
 @extraunexec rm -f ${SYSCONFDIR}/php-${PV}/php-${PV}.sample/*
 @mode 1700
@@ -278,9 +276,6 @@ share/php-${PV}/include/ext/spl/spl_func
 share/php-${PV}/include/ext/spl/spl_heap.h
 share/php-${PV}/include/ext/spl/spl_iterators.h
 share/php-${PV}/include/ext/spl/spl_observer.h
-share/php-${PV}/include/ext/sqlite3/
-share/php-${PV}/include/ext/sqlite3/libsqlite/
-share/php-${PV}/include/ext/sqlite3/libsqlite/sqlite3.h
 share/php-${PV}/include/ext/standard/
 share/php-${PV}/include/ext/standard/base64.h
 share/php-${PV}/include/ext/standard/basic_functions.h
Index: 7.0/pkg/PLIST-pdo_sqlite
===================================================================
RCS file: 7.0/pkg/PLIST-pdo_sqlite
diff -N 7.0/pkg/PLIST-pdo_sqlite
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 7.0/pkg/PLIST-pdo_sqlite    24 May 2018 10:44:31 -0000
@@ -0,0 +1,7 @@
+@comment $OpenBSD$
+@option no-default-conflict
+@option is-branch
+@conflict php-pdo_sqlite->=7.0,<7.1
+lib/php-${PV}/modules/pdo_sqlite.so
+share/examples/php-${PV}/pdo_sqlite.ini
+@sample ${SYSCONFDIR}/php-${PV}.sample/pdo_sqlite.ini
Index: 7.0/pkg/PLIST-sqlite3
===================================================================
RCS file: 7.0/pkg/PLIST-sqlite3
diff -N 7.0/pkg/PLIST-sqlite3
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ 7.0/pkg/PLIST-sqlite3       24 May 2018 10:44:31 -0000
@@ -0,0 +1,7 @@
+@comment $OpenBSD$
+@option no-default-conflict
+@option is-branch
+@conflict php-sqlite3->=7.0,<7.1
+lib/php-${PV}/modules/sqlite3.so
+share/examples/php-${PV}/sqlite3.ini
+@sample ${SYSCONFDIR}/php-${PV}.sample/sqlite3.ini
Index: files/DESCR-pdo_sqlite
===================================================================
RCS file: files/DESCR-pdo_sqlite
diff -N files/DESCR-pdo_sqlite
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ files/DESCR-pdo_sqlite      24 May 2018 10:44:31 -0000
@@ -0,0 +1,2 @@
+PDO_SQLITE is a driver that implements the PHP Data Objects (PDO)
+interface to enable access to SQLite 3 databases.
Index: files/DESCR-sqlite3
===================================================================
RCS file: files/DESCR-sqlite3
diff -N files/DESCR-sqlite3
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ files/DESCR-sqlite3 24 May 2018 10:44:31 -0000
@@ -0,0 +1,4 @@
+This is an extension for the SQLite Embeddable SQL Database Engine.
+SQLite is a C library that implements an embeddable SQL database
+engine. Programs that link with the SQLite library can have SQL
+database access without running a separate RDBMS process.

Reply via email to