Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Mon, Nov 28, 2011 at 02:23:21PM +0100, Alex Thurgood wrote: Le 28/11/2011 11:47, Alexander Thurgood a écrit : However, I have no idea how you would enter the strings for a remote db instance, in particular, the parameter separators. Trawling around the net and in the postgres documentation didn't get me any further, because any of the strings I tried failed miserably with either a failed host lookup, or else a message saying that I needed to add ='' after my colon separators. OK, I seem to have figured it out from re-reading libpq documentation. If you have any remaining question, contact me. As I'm not always keeping up with mailing lists, so feel free to CC me. Note that one can also give the connection information in environment variables and in configuration files. See http://developer.postgresql.org/pgdocs/postgres/libpq-envars.html http://developer.postgresql.org/pgdocs/postgres/libpq-pgpass.html http://developer.postgresql.org/pgdocs/postgres/libpq-pgservice.html One can even add a level of indirection and get connection information from LDAP http://developer.postgresql.org/pgdocs/postgres/libpq-ldap.html This all is probably beyond the scope of an introductory documentation. host=10.0.0.1 dbname=mydb Yes; hostaddr can be used instead/additionally to host when giving a numeric IP, but that's most probably beyond the scope of an introductory document. (I imagine that one could enter the usr/pwd combo in the URL field too, Yes, as in user=FOO password=BAR, but LO will ask for a username anyway and it will override the one from the URL (or any of the other ways: files, LDAP, ...). The LO prompt overrides URL could easily be inverted, but I thought this would be the most natural. As to the other methods, not possible to invert priority. Ditto for the password, except that one can instruct LO not to ask for a password by unchecking the password required checkbox; I haven't tested it, but I imagine it works. -- Lionel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Thu, Nov 17, 2011 at 01:35:25AM +0100, Fridrich Strba wrote: On 16/11/11 23:22, Lionel Elie Mamane wrote: *** Necessary before pushing to master *** - Add an option --enable-ext-postgresql-sdbc, similar to --enable-ext-mysql-connector, and if that option is not given don't build postgresql-sdbc I can give you a hand with this next week. Is it enough? That's done with the kind help of Norbert Thiebaud. The code is now in master, but: - General review of connectivity/source/drivers/postgresql/makefile.mk - The .oxt file is created in ${OUTDIR}/lib; that's probably not that good a choice. MySQL driver seems to do it ${OUTDIR}/bin, shall PostgreSQL driver do the same? - The build system currently just creates a .oxt file; should probably be changed to take into account --with-extension-integration. Will help with this too, My I kindly remind you of this? We are already missing the beta0 deadline, I'd like not to miss the 3.5 features deadline. Thanks in advance! not sure about the internal postgresql though. Yeah, keeping it as external is OK; after all, we do that for the MySQL C client library, too. -- Lionel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
Le 28/11/11 10:32, Lionel Elie Mamane a écrit : Hi Lionel, I want to write up some help about the driver because I thought that while we were waiting for the connector to be integrated, I'd put it up as an extension on the extensions site. However, to do that, I need to write up a little mini-help with the string connection info. I managed to get the driver to work on my Linux 32bit installation under Ubuntu 11.10, but it took me quite a while to establish the connection with the required connstr parameters. As it turns out, for a locally running pg instance, all the user has to enter is the dbname in the URL field, so something like : dbname='mydb' The wizard then goes on to ask for User/PWD combo and allow you to test. However, I have no idea how you would enter the strings for a remote db instance, in particular, the parameter separators. Trawling around the net and in the postgres documentation didn't get me any further, because any of the strings I tried failed miserably with either a failed host lookup, or else a message saying that I needed to add ='' after my colon separators. Could you fill me in please on the string sequence required ? TIA, Alex PS : I haven't managed to build the connector on Mac OSX yet, because configure keeps saying it can't find pq_config. I tried setting the env var manually from the terminal, but it still refuses to see it, so I'll end up having to edit my bash/plist file to get the path in. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
Le 28/11/2011 11:47, Alexander Thurgood a écrit : Hi all, However, I have no idea how you would enter the strings for a remote db instance, in particular, the parameter separators. Trawling around the net and in the postgres documentation didn't get me any further, because any of the strings I tried failed miserably with either a failed host lookup, or else a message saying that I needed to add ='' after my colon separators. Could you fill me in please on the string sequence required ? OK, I seem to have figured it out from re-reading libpq documentation. The URL field accepts connection strings of pair KEYWORD=VALUE, so one can enter : host=10.0.0.1 dbname=mydb and then move on to the user/pwd field and connection test (I imagine that one could enter the usr/pwd combo in the URL field too, but I haven't tried that yet. I will try and write something up about this in the next few days unless someone beats me to it. Alex ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Mon, 2011-11-28 at 14:23 +0100, Alex Thurgood wrote: However, I have no idea how you would enter the strings for a remote db instance, in particular, the parameter separators. ... OK, I seem to have figured it out from re-reading libpq documentation. The URL field accepts connection strings of pair KEYWORD=VALUE, so one can enter : host=10.0.0.1 dbname=mydb Gosh - it sounds like an horrific user experience :-) Presumably in the star-treck future, having a per-backend UI with key/value pairs specified that can be presented pleasantly with descriptions, widgets etc. filled out would be rather nicer. Perhaps an easy hack ;-) ATB, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Fri, Nov 18, 2011 at 11:16:07AM +, Michael Meeks wrote: On Fri, 2011-11-18 at 00:21 +0100, Lionel Elie Mamane wrote: Thanks; this being applied, I have pushed to master. Lovely - glad it landed finally. Any chance of mentioning it (and some of the other nice fixes database bits you've done) in the release notes wiki page (...) For PostgreSQL-SDBC, let's wait until we at least have a successful build of it within master, and I've run the code compiled against master at least once :) As to the other fixes, the release notes seem to be mainly about new features. Are horrible bug fixes also welcome there? -- Lionel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Thu, Nov 17, 2011 at 05:36:14PM -0600, Norbert Thiebaud wrote: On Thu, Nov 17, 2011 at 5:21 PM, Lionel Elie Mamane lio...@mamane.lu wrote: However, the makefile.mk does not work at all; dmake in that directory seems to compute dependencies, but not do anything else. That bug was definitely not introduced by your patch, it must be a difference in the dmake setup between master and libreoffice-3-4 (that makefile.mk worked alright in libreoffice-3-4). Any pointer / clue? I'm on anther branch right now... but you can verbose=t build in the module (or possibly a with the dmake directly) that should print the command line that dmake is executing... Well, it prints nothing. dmake -v shows lines like: Checking prerequisite [../../../unxlngx6/slo/pq_xkey.obj] dmake: Making [../../../unxlngx6/misc/s_pq_xkey.dpcc] dmake: Up to date [../../../unxlngx6/misc/s_pq_xkey.dpcc], prq time = 1321566187 , target time = 1321566880) which I understand to be dependencies computation, but after that, nothing. I think I'll wait until one of you has time to take a look :) -- Lionel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Fri, 2011-11-18 at 00:21 +0100, Lionel Elie Mamane wrote: Thanks; this being applied, I have pushed to master. Lovely - glad it landed finally. Any chance of mentioning it (and some of the other nice fixes database bits you've done) in the release notes wiki page at: http://wiki.documentfoundation.org/ReleaseNotes/3.5 It's a shame not to have a credit there :-) All the best, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
Hi Lionel, On Wed, Nov 16, 2011 at 4:22 PM, Lionel Elie Mamane lio...@mamane.lu wrote: I'd like some help from a LO build system expert to make postgresql-sdbc well-behaved in this other and build-related respects: attache a patch that make building it conditional. few questions/remarks (mostly on the form, rather than on substance... I only glanced at the commits) Is there a reason why did you not push it as a feature branch on our own git ? 5a2b8cba519bb9d34d3a28a51adcda334147096f: Humm, not sure you can do that, but even if you could, removing SISSL is not a good idea since that is what allow that code to be merged in libreoffice (which is MPL/LGPLv3+) nitpick: f1127d15dfa2cf03cb4a0c79bc2ddf332b8d6093 and later: @@ -1,42 +1,42 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; eval:(c-set-style bsd); tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ please don't do that. I have a style set to what works for me, it is no nice to try to force another on me. (note that I'm actually fine with the bsd-style you picked there... but that is not the point) that tagline line was meant to force only the 'mandatory part' : no tabs and indent of 4. Norbert From 401a9fe32c707b066dc8ab084b13cb3bc845a225 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud nthieb...@gmail.com Date: Thu, 17 Nov 2011 03:18:49 -0600 Subject: [PATCH] make postgresql-sdbc connectivity optional --- configure.in | 34 +--- connectivity/source/drivers/postgresql/makefile.mk |5 +++ set_soenv.in |1 + 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index d586b46..e75548b 100644 --- a/configure.in +++ b/configure.in @@ -359,6 +359,11 @@ AC_ARG_ENABLE(ext-pdfimport, [Disable the PDF Import extension.]) ) +AC_ARG_ENABLE(ext-postgresql-sdbc, +AS_HELP_STRING([--enable-ext-postgresql-sdbc], +[Enable the build of the PostgreSQL sdbc extension.]) +) + AC_ARG_ENABLE(ext-presenter-console, AS_HELP_STRING([--disable-ext-presenter-console], [Disable the Presenter Console extension.]) @@ -5358,19 +5363,24 @@ fi dnl === dnl Check for PostgreSQL stuff dnl === -AC_PATH_PROG(PGCONFIG, pg_config) -if test -z $PGCONFIG; then -AC_MSG_ERROR([pg_config needed]) -fi -save_CFLAGS=$CFLAGS -save_LIBS=$LIBS -CFLAGS=-I`pg_config --includedir` -AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], []) -AC_CHECK_LIB(pq, PQconnectdbParams, [], -[AC_MSG_ERROR(libpq not found or too old. Need = 9.0)], []) -CFLAGS=$save_CFLAGS -LIBS=$save_LIBS -SYSTEM_POSTGRESQL=YES # only option atm :-) + +if test x$enable_ext_postgresql_sdbc = xyes; then +AC_PATH_PROG(PGCONFIG, pg_config) +if test -z $PGCONFIG; then +AC_MSG_ERROR([pg_config needed]) +fi +save_CFLAGS=$CFLAGS +save_LIBS=$LIBS +CFLAGS=-I`pg_config --includedir` +AC_CHECK_HEADER([libpq-fe.h], [], [AC_MSG_ERROR([libpq-fe.h is needed])], []) +AC_CHECK_LIB(pq, PQconnectdbParams, [], +[AC_MSG_ERROR(libpq not found or too old. Need = 9.0)], []) +CFLAGS=$save_CFLAGS +LIBS=$save_LIBS +BUILD_POSTGRESQL_SDBC=YES +SYSTEM_POSTGRESQL=YES # only option atm :-) +fi +AC_SUBST(BUILD_POSTGRESQL_SDBC) AC_SUBST(SYSTEM_POSTGRESQL) dnl === diff --git a/connectivity/source/drivers/postgresql/makefile.mk b/connectivity/source/drivers/postgresql/makefile.mk index 43b4d5d..8c8c022 100644 --- a/connectivity/source/drivers/postgresql/makefile.mk +++ b/connectivity/source/drivers/postgresql/makefile.mk @@ -36,6 +36,9 @@ NO_DEFAULT_STL=TRUE # --- Settings - .INCLUDE : settings.mk + +.IF $(BUILD_POSTGRESQL_SDBC) == YES + .IF $(SYSTEM_POSTGRESQL) != YES .INCLUDE : $(SOLARINCDIR)$/postgresql/postgresql-version.mk .ENDIF @@ -145,6 +148,8 @@ SLOFILES= $(LIB1OBJFILES) $(LIB2OBJFILES) DRIVERNAME=postgresql-sdbc-$(PQ_SDBC_VERSION).oxt ALLTAR : $(DLLDEST)$/$(DRIVERNAME) +.ENDIF # BUILD_POSTGRESQL_SDBC + # --- Targets -- .INCLUDE : target.mk diff --git a/set_soenv.in b/set_soenv.in index 8538419..78bc704 100755 --- a/set_soenv.in +++ b/set_soenv.in @@ -2002,6 +2002,7 @@ ToFile( XINERAMA_LINK, @XINERAMA_LINK@,e ); ToFile( SYSTEM_REDLAND,@SYSTEM_REDLAND@, e ); ToFile( REDLAND_CFLAGS,@REDLAND_CFLAGS@, e ); ToFile( REDLAND_LIBS, @REDLAND_LIBS@, e ); +ToFile( BUILD_POSTGRESQL_SDBC, @BUILD_POSTGRESQL_SDBC@, e ); ToFile( SYSTEM_POSTGRESQL, @SYSTEM_POSTGRESQL@, e ); ToFile( SYSTEM_HUNSPELL, @SYSTEM_HUNSPELL@, e ); ToFile( HUNSPELL_CFLAGS, @HUNSPELL_CFLAGS@, e );
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Thu, Nov 17, 2011 at 03:22:33AM -0600, Norbert Thiebaud wrote: On Wed, Nov 16, 2011 at 4:22 PM, Lionel Elie Mamane lio...@mamane.lu wrote: I'd like some help from a LO build system expert to make postgresql-sdbc well-behaved in this other and build-related respects: attache a patch that make building it conditional. Thanks; this being applied, I have pushed to master. However, the makefile.mk does not work at all; dmake in that directory seems to compute dependencies, but not do anything else. That bug was definitely not introduced by your patch, it must be a difference in the dmake setup between master and libreoffice-3-4 (that makefile.mk worked alright in libreoffice-3-4). Any pointer / clue? On Thu, Nov 17, 2011 at 01:35:25AM +0100, Fridrich Strba wrote: I can give you a hand with this next week. Is it enough? Unless someone else picks it up first, it will have to do :) -- Lionel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Thu, Nov 17, 2011 at 5:21 PM, Lionel Elie Mamane lio...@mamane.lu wrote: On Thu, Nov 17, 2011 at 03:22:33AM -0600, Norbert Thiebaud wrote: On Wed, Nov 16, 2011 at 4:22 PM, Lionel Elie Mamane lio...@mamane.lu wrote: I'd like some help from a LO build system expert to make postgresql-sdbc well-behaved in this other and build-related respects: attache a patch that make building it conditional. Thanks; this being applied, I have pushed to master. However, the makefile.mk does not work at all; dmake in that directory seems to compute dependencies, but not do anything else. That bug was definitely not introduced by your patch, it must be a difference in the dmake setup between master and libreoffice-3-4 (that makefile.mk worked alright in libreoffice-3-4). Any pointer / clue? I'm on anther branch right now... but you can verbose=t build in the module (or possibly a with the dmake directly) that should print the command line that dmake is executing... that may give a clue... next is to dig in solenv/inc/* to look at the different thing the makefile include and try to figure out what is going on. Norbert ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] PostgreSQL-SDBC in LO: build system help
On Fri, Nov 11, 2011 at 01:08:33PM +0100, Lionel Elie Mamane wrote: PostgreSQL native (SDBC) driver for LibreOffice, (...) any oppositions to merging it into master OK, I have something that compiles against master and could be committed, except it would break the build on machines that don't have libpq-dev, because postgresql-sdbc is built unconditionally. I'd like some help from a LO build system expert to make postgresql-sdbc well-behaved in this other and build-related respects: *** Necessary before pushing to master *** - Add an option --enable-ext-postgresql-sdbc, similar to --enable-ext-mysql-connector, and if that option is not given don't build postgresql-sdbc *** Can be done after push, but preferably before beta0! *** - We probably want to implement --without-system-postgresql case? - General review of connectivity/source/drivers/postgresql/makefile.mk - The .oxt file is created in ${OUTDIR}/lib; that's probably not that good a choice. MySQL driver seems to do it ${OUTDIR}/bin, shall PostgreSQL driver do the same? - The build system currently just creates a .oxt file; should probably be changed to take into account --with-extension-integration. The code is at git://anonscm.alioth.debian.org/users/lmamane/libreoffice/core.git Do something like: git remote add pgsql-sdbc git://anonscm.alioth.debian.org/users/lmamane/libreoffice/core.git git fetch pgsql-sdbc git checkout -b sdbc-pgsql remotes/pgsql-sdbc/master git rebase master And hack away. Thanks in advance, -- Lionel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On 16/11/11 23:22, Lionel Elie Mamane wrote: *** Necessary before pushing to master *** - Add an option --enable-ext-postgresql-sdbc, similar to --enable-ext-mysql-connector, and if that option is not given don't build postgresql-sdbc I can give you a hand with this next week. Is it enough? - General review of connectivity/source/drivers/postgresql/makefile.mk - The .oxt file is created in ${OUTDIR}/lib; that's probably not that good a choice. MySQL driver seems to do it ${OUTDIR}/bin, shall PostgreSQL driver do the same? - The build system currently just creates a .oxt file; should probably be changed to take into account --with-extension-integration. Will help with this too, not sure about the internal postgresql though. It depends how big the internal library would be and how much dependecies it would have. Cheers Fridrich ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] PostgreSQL-SDBC in LO: build system help
On Thu, Nov 17, 2011 at 01:35:25AM +0100, Fridrich Strba wrote: not sure about the internal postgresql though. It depends how big the internal library would be and how much dependecies it would have. I had kinda assumed it was policy to put these kind of things as internal. OTOH, I now see we have internal mysql-connector-c++, but not internal libmysqlclient (the C library used by mysql-connector-c++), so by analogy I'm happy to leave libpq an external-only dependency. As to size, libpq sources is distributed (only) as part of the whole of PostgreSQL (15MiB compressed); the relevant directory is only 932kiB (uncompressed) so we could certainly make a tarball with just that and put *that* to be downloaded in src/. As to dependencies, a cursory glance shows gssapi, krb5 and ldap, but these are all optional. -- Lionel ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice