bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting pkgconfig to a specific location


From: Vincent Fortier
Subject: Re: Getting pkgconfig to a specific location
Date: Sat, 15 Jan 2022 08:21:10 -0500

I think I have found where the issues are...  I count two:

ISSUE 1:  Yes the configure script will use the value of PKG_CONFIG_LIBDIR.
Problems with PKG_CONFIG_LIBDIR in conjunction with
--with-pkg-config-libdir= are:
a) when PKG_CONFIG_LIBDIR is set, that will always override the
--with-pkg-config-libdir= argument
c) if PKG_CONFIG_LIBDIR is NOT set, --with-pkg-config-libdir= is not
being considered and falls back to default installation path
(.../lib/x86_64-linux-gnu/...)
b) when PKG_CONFIG_LIBDIR is set but without --with-pkg-config-libdir=
, again it falls back to the default installation directory
(.../lib/x86_64-linux-gnu/...) and does not consider PKG_CONFIG_LIBDIR
at all

To me the first problem is:  it should use PKG_CONFIG_LIBDIR when
defined but be overridden by --with-pkg-config-libdir=
---

ISSUE 2: PKG_CONFIG_LIBDIR considered relative to DESTDIR
On every other package I build, PKG_CONFIG_LIBDIR variable is always
defined and treated as having its full path.  The issue here is that
ncurses always considers it relative to the destination directory.  As
such the full path is being added on-top of the destination path,
creating the other issue I'm facing.

On that front, PKG_CONFIG_LIBDIR should always be considered as
defined with full path OR have a mechanism to check that somehow.
---

In the end, my only solution so far to make this work out properly is
by setting the following two:
1- re-export PKG_CONFIG_LIBDIR so it is relative to the destination
directory instead of using a full path
2- use --with-pkg-config-libdir which can be set to =BOGUS as it
doesn't change a thing as not used.

Here's an example using BOGUS install dir + exported relative PKG_CONFIG_LIBDIR:
./configure  --host=x86_64-pc-linux-gnu --build=i686-pc-linux
--prefix=/usr/local/ncurses --with-shared
--with-terminfo-dirs=/usr/local/ncurses/share/terminfo
--with-pkg-config-libdir=/usr/local/ncurses/BOGUS --without-manpages
--without-tests --enable-rpath --enable-overwrite --enable-pc-files
--disable-stripping --disable-home-terminfo --disable-widec --verbose

And the build log snipet:

** Configuration summary for NCURSES 6.3 20211021:

       extended funcs: yes
       xterm terminfo: xterm-new

        bin directory: /usr/local/ncurses/bin
        lib directory: /usr/local/ncurses/lib
    include directory: /usr/local/ncurses/include
        man directory: /usr/local/ncurses/share/man
   terminfo directory: /usr/local/ncurses/share/terminfo
 pkg-config directory: /usr/local/ncurses/lib/pkgconfig

Le sam. 8 janv. 2022 à 17:32, Vincent Fortier <th0ma7@gmail.com> a écrit :
>
> Le sam. 8 janv. 2022 à 17:08, Thomas Dickey <dickey@his.com> a écrit :
> >
> > On Mon, Jan 03, 2022 at 09:30:32PM -0500, Vincent Fortier wrote:
> > > Hi thomas,
> > >
> > > Le lun. 3 janv. 2022 à 17:27, Thomas Dickey <dickey@his.com> a écrit :
> > > >
> > > > On Mon, Jan 03, 2022 at 08:36:43AM -0500, Vincent Fortier wrote:
> > > > > Hi,
> > > > >
> > > > > I'm a community dev working on the SynoCommunity project.  We're using
> > > > > ncurses for multiple opensource packages that we integrate so they can
> > > > > be installed on Synology NAS (which uses linux).
> > > > >
> > > > > While trying to update ncurses to 6.3 I tried (once more) to modify
> > > > > the pkgconfig location to another location.  Under synology NAS each
> > > > > application is self-contained and installed under
> > > > > /var/packages/<app>/target.  When cross-compiling our installation
> > > > > prefix is set as such which lead to having pkgconfig directory to sit
> > > > > under $(INSTALL_PREFIX)/lib/pkgconfig.  That $(INSTALL_PREFIX) sits
> > > > > under our working directory $(INSTALL_DIR).
> > > > >
> > > > > >From the documentation the following two are obvious:
> > > > > --prefix=$(INSTALL_PREFIX)
> > > > > --with-install-prefix=$(INSTALL_DIR)   --> or using DESTDIR at make 
> > > > > install time
> > > >
> > > > hmm - "--with-install-prefix" isn't intended as the pathname by
> > > > which an application finds the data.  It is a configure-time
> > > > version of $DESTDIR (which relocates the installed data,, making
> > > > it simple(r) to construct CD images, etc.).
> > >
> > > Indeed, while doing additional testing it isn't needed at all as the
> > > framework provides all of what's needed anyway.
> >
> > good - then a workaround isn't needed,
> > just confirmation that the bug is known (and fixed).
> >
> > > > that said, the ncurses build scripts shouldn't be repeating 
> > > > '$(INSTALL_DIR)'.
> > >
> > > And I think there's a bug there.
> > >
> > > > But the configure script can be confused, since it wouldn't see
> > > > that as an absolute pathname such as "/whatever/lib/pkgconfig",
> > > > and would attempt to add an absolute prefix in front.
> > > >
> > > > That's in 6.3-release.  In post-6.3 development, I've relaxed that
> > > > a little (mainly for users who want to configure when the pkgconfig
> > > > directory does not yet exist).
> > > >
> > > > So... to let me understand the problem better, it would help to have
> > > > a script which shows the complete configure-command that you're trying.
> > > >
> > > > Given that, I can either offer some advice on workarounds, to attempt
> > > > to solve the problem :-)
> > >
> > > Indeed it looks like the configure script is confused and adding the
> > > DESTDIR to the path for an unknown reason.  Here is the output from
> > > the build log:
> > > ** Configuration summary for NCURSES 6.3 20211021:
> > >
> > >        extended funcs: yes
> > >        xterm terminfo: xterm-new
> > >
> > >         bin directory: /usr/local/ncurses/bin
> > >         lib directory: /usr/local/ncurses/lib
> > >     include directory: /usr/local/ncurses/include
> > >         man directory: /usr/local/ncurses/share/man
> > >    terminfo directory: /usr/local/ncurses/share/terminfo
> > >  pkg-config directory:
> > > /home/spksrc/gdbm-ncurse/spksrc/cross/ncurses/work-kvmx64-7.0/install//usr/local/ncurses/lib/pkgconfig
> >
> > You have the environment variable PKG_CONFIG_LIBDIR set:
> >
> >         
> > PKG_CONFIG_LIBDIR=/home/spksrc/gdbm-ncurse/spksrc/cross/ncurses/work-kvmx64-7.0/install//usr/local/ncurses/lib/pkgconfig
> >
> > If it's set, and the corresponding directory exists, then
> > the configure script attempts to use it.
> >
> > That's in an area that I've modified since 6.3
> > (the directory doesn't have to exist since that was a problem for some 
> > users,
> > and the environment variable no longer overrides the command-line option).
> >
> > > And here is my configuration (considering destination directory is
> > > provided by the framework so no argument needed):
> > > CONFIGURE_ARGS  = --with-shared
> > > CONFIGURE_ARGS += --with-terminfo-dirs=$(INSTALL_PREFIX)/share/terminfo
> > > CONFIGURE_ARGS += --with-pkg-config-libdir=$(INSTALL_PREFIX)/lib/pkgconfig
> > > CONFIGURE_ARGS += --without-manpages
> > > CONFIGURE_ARGS += --without-tests
> > > CONFIGURE_ARGS += --enable-rpath
> > > CONFIGURE_ARGS += --enable-overwrite
> > > CONFIGURE_ARGS += --enable-pc-files
> > > CONFIGURE_ARGS += --disable-stripping
> > > CONFIGURE_ARGS += --disable-widec
> > > CONFIGURE_ARGS += --disable-home-terminfo
> > >
> > > I have opened a PR at
> > > https://github.com/SynoCommunity/spksrc/pull/5047 (it also includes an
> > > update for gdbm but irrelevant for this).  There will be a log output
> > > for all packages depending on ncurses.  In there you should have the
> > > detailed output.  I've also attached one for immediate reference.
> >
> > I reduced that to a test-script (attached), and can see that it's been 
> > fixed.
>
> I'll have a second look at the scripts but interestingly when I remove
> the --with-pkg-config-libdir option it ends-up going here:
> $ ll work-kvmx64-7.0/install/usr/lib/x86_64-linux-gnu/pkgconfig/*
> -rw-r--r-- 1 spksrc spksrc 961 Jan  8 22:29
> work-kvmx64-7.0/install/usr/lib/x86_64-linux-gnu/pkgconfig/form.pc
> -rw-r--r-- 1 spksrc spksrc 961 Jan  8 22:29
> work-kvmx64-7.0/install/usr/lib/x86_64-linux-gnu/pkgconfig/menu.pc
> -rw-r--r-- 1 spksrc spksrc 990 Jan  8 22:29
> work-kvmx64-7.0/install/usr/lib/x86_64-linux-gnu/pkgconfig/ncurses++.pc
> -rw-r--r-- 1 spksrc spksrc 953 Jan  8 22:29
> work-kvmx64-7.0/install/usr/lib/x86_64-linux-gnu/pkgconfig/ncurses.pc
> -rw-r--r-- 1 spksrc spksrc 963 Jan  8 22:29
> work-kvmx64-7.0/install/usr/lib/x86_64-linux-gnu/pkgconfig/panel.pc
>
> instead of usr/local/lib/pkgconfig ...  Unless there is another
> environment variable that could have a side-effect?
>
> >
> > --
> > Thomas E. Dickey <dickey@invisible-island.net>
> > https://invisible-island.net
> > ftp://ftp.invisible-island.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]