From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: How to build GnuCash with SQLite backend support? Date: Wed, 06 Dec 2017 23:50:52 -0800 Message-ID: <87h8t3f02r.fsf@gmail.com> References: <871sk72unh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMqxa-0008LT-Ja for help-guix@gnu.org; Thu, 07 Dec 2017 02:51:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMqxU-0000kt-6n for help-guix@gnu.org; Thu, 07 Dec 2017 02:51:10 -0500 Received: from mail-pf0-x236.google.com ([2607:f8b0:400e:c00::236]:45312) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eMqxT-0000kf-UI for help-guix@gnu.org; Thu, 07 Dec 2017 02:51:04 -0500 Received: by mail-pf0-x236.google.com with SMTP id u19so4078579pfa.12 for ; Wed, 06 Dec 2017 23:51:03 -0800 (PST) Received: from garuda.local ([2601:602:9d02:4725:6495:ba21:1ebe:620a]) by smtp.gmail.com with ESMTPSA id r71sm4840970pfd.144.2017.12.06.23.50.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Dec 2017 23:50:59 -0800 (PST) In-Reply-To: <871sk72unh.fsf@gmail.com> (Gary Johnson's message of "Wed, 06 Dec 2017 20:28:50 -0500") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" Cc: help-guix@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Gary Johnson writes: > Hi again, > > After spending some time with the Guix manual, I managed to write up a > new package module that defines packages for libdbi, libdbi-drivers > (just sqlite3 support for now), and gnucash-with-dbi (see attached > file). Awesome! Thank you for taking the time to do this! > However, now I'm getting a new error when I pop this file on the > GUIX_PACKAGE_PATH and run: > > $ guix package -i libdbi-drivers > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > ... > LOTS OF NORMAL CONFIG OUTPUT > ... > checking for libdbi framework... checking dbi/dbi.h usability... yes > checking dbi/dbi.h presence... yes > checking for dbi/dbi.h... yes > checking for MySQL support... no > checking for PostgreSQL support... no > checking for SQLite support... no > checking for SQLite3 support... yes > checking sqlite3.h usability... yes > checking sqlite3.h presence... yes > checking for sqlite3.h... yes > checking for library containing sqlite3_exec... -lsqlite3 > checking for Msql support... no > checking for Oracle support... no > checking for Firebird/Interbase support... no > checking for Freetds support... no > checking for Ingres support... no > checking for IBM DB2 support... no > checking for strtoll... yes > checking for atoll... yes > checking for vasprintf... yes > checking for asprintf... yes > checking for libdbi library... no > configure: error: Invalid libdbi directory - include files not found. > phase `configure' failed after 2.5 seconds > builder for `/gnu/store/nxm3ivpsngf7k9rcszry30hyjpx65iqw-libdbi-drivers-0= .9.0.drv' failed with exit code 1 > guix package: error: build failed: build of `/gnu/store/nxm3ivpsngf7k9rcs= zry30hyjpx65iqw-libdbi-drivers-0.9.0.drv' failed > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > > Okay, guys. What the heck am I missing here? I've clearly added the > libdbi and sqlite packages to the "inputs" list of the libdbi-drivers > package. The configure phase is detecting dbi.h and sqlite3.h just fine, > but then it can't find the libdbi library? Now I'm definitely lost. :( I think the problem might lie in how the libdbi author(s) have written their ./configure.in file. Check out the file in the libdbi source: =2D-8<---------------cut here---------------start------------->8--- if test "$ac_libdbi" =3D "YES"; then AC_MSG_CHECKING(for libdbi library) if test "$ac_dbi_libdir" =3D "no"; then dbi_libdirs=3D"/usr/lib /usr/local/lib /sw/lib" libdbi_libs=3D"libdbi.so libdbi.a" AC_FIND_FILE($libdbi_libs, $dbi_libdirs, ac_dbi_libdir) if test "$ac_dbi_libdir" =3D "no"; then AC_MSG_RESULT(no) AC_MSG_ERROR([Invalid libdbi directory - include files n= ot found.]) fi fi AC_MSG_RESULT([yes: libs in $ac_dbi_libdir]) LIBADD_LIBDBI=3D"$LIBADD_LIBDBI -L$ac_dbi_libdir" =20=20=20=20=20=20=20=20 AC_SUBST(LIBADD_LIBDBI) LIBDBI_LIBDIR=3D"$ac_dbi_libdir" AC_SUBST(LIBDBI_LIBDIR) fi =2D-8<---------------cut here---------------end--------------->8--- It looks like this expands to the following in ./configure: =2D-8<---------------cut here---------------start------------->8--- if test "$ac_libdbi" =3D "YES"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdbi library" >&5 $as_echo_n "checking for libdbi library... " >&6; } if test "$ac_dbi_libdir" =3D "no"; then dbi_libdirs=3D"/usr/lib /usr/local/lib /sw/lib" libdbi_libs=3D"libdbi.so libdbi.a" ac_dbi_libdir=3Dno for i in $dbi_libdirs; do for j in $libdbi_libs; do if test -r "$i/$j"; then ac_dbi_libdir=3D$i break 2 fi done done if test "$ac_dbi_libdir" =3D "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Invalid libdbi directory - include files= not found." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes: libs in $ac_dbi_li= bdir" >&5 $as_echo "yes: libs in $ac_dbi_libdir" >&6; } LIBADD_LIBDBI=3D"$LIBADD_LIBDBI -L$ac_dbi_libdir" LIBDBI_LIBDIR=3D"$ac_dbi_libdir" fi =2D-8<---------------cut here---------------end--------------->8--- Note the "dbi_libdirs" variable, which contains the value "/usr/lib /usr/local/lib /sw/lib". My guess is that the configure step is failing because it's trying (incorrectly) to look in those absolute directory paths to find the files it needs. When you build a package in Guix, the build takes place in an isolated environment. The builder only has access to inputs that you explicitly declare in your package definition (or inputs that are provided by default by the build system you choose). Any attempt to access files outside the store will fail. If that's the problem, then to fix it, there are at least two possible approaches: 1) Submit a patch that somehow fixes the issue upstream. Probably, the configure.in script should not assume an absolute path like this. I'm not too familiar with Autoconf and Automake, but I'm sure there must be a way to fix this upstream... Maybe someone else knows more. 2) Patch the ./configure script by using the "substitute*" form defined in Guix. This is a fine solution, too. You can run grep -r 'substitute\*' ~/.config/guix/latest/gnu/packages to see how it's used. You can run grep -r -A30 'define.*substitute\*' ~/.config/guix/latest to find the file where it's defined. It isn't really documented in the Guix manual (yet). You probably want to either (a) remove the check entirely, and hope that the build system will just find the libraries it needs in the build environment, or (b) explicitly set the dbi_libdirs variable to the path in the store that contains the output of the libdbi package. Option (b) seems cleaner. Hope that helps get you moving forward again! Thanks for taking the time to add packages. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAloo8twACgkQ3UCaFdgi Rp2cvg/9G1hOk5OzOAPUqmMstPwaX7lgH9xDoJJgjzzFP9yPgXFl/FzmMEjBIF3f VXRIga1KjTxhvMTi0qgwUdDPj6LALf6S0Ke5YEiC8Q2FA8fw6jxWJn4jKPEMIKSU /+9dt2BiSmJv1KjkAR1lhpl8SNTBg3CFw7aybLq2iUh7O4ja/OfG2ICTRwje1g/w YCwU/cx4B5X21EEAVJLLwnq4DFQXe0Anl6bR4EwlMnkOICiQvJlYqoRWZ7JLrihn lWX5rofVvzL44E5M/xUZ229IPyv/aGOy341MLjWh5/FerU7fnoeUhIrHxaiAQSCy U0CTZpb+T1K7XFvzJGZYDwMmaRLRCuGTST0eNgH9sVtBVFp7m933pRkGVxjfK2rn /BASjvd9fgcDkSRSmIIfNi+XC8xb+8IZs6nWEFTTBE/keYOAgP3WtXjND7NSc5Vc RRCJA+p1Unp4lI5ctVQW0fYtElk3TclrvuNHI/jyaZka8r8fFfop5yKSplKIeWW7 549/FHnFBrhP5H+je4N9R2hSSeWyzazn+V0fkLOgaAXnUxq4OfsD2wcqvedxnJI6 fOAKnNdft4POebRgGnggPzOoBicC82aXripdJmUG6+jlE1+wlTZUOoelKd9WsvD4 8zAnAHI5x/CQpW6uVJ/7SnHssyv+WUI/NsOCm5RjmbwDhgHX2sE= =sTBQ -----END PGP SIGNATURE----- --=-=-=--