Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 413703 - sci-libs/grib_api should let USE flags decide which JPEG library to use
Summary: sci-libs/grib_api should let USE flags decide which JPEG library to use
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Deadline: 2019-09-26
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PMASKED
Depends on:
Blocks:
 
Reported: 2012-04-27 09:58 UTC by Roman
Modified: 2019-09-26 14:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_413703.txt,4.46 KB, text/plain)
2012-04-27 09:58 UTC, Roman
Details
make openjpeg optional even if present (grib_api-1.9.16-jpeg2k.patch,257 bytes, patch)
2012-04-27 16:57 UTC, Jeroen Roovers (RETIRED)
Details | Diff
hasty ebuild patch (grib_api-1.9.16.ebuild-413703.patch,2.61 KB, patch)
2012-04-27 17:04 UTC, Jeroen Roovers (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roman 2012-04-27 09:58:42 UTC
Created attachment 310237 [details]
emerge --info

Overall result:
ebuild does not use libjasper even if properly installed on my system.
As I see from following snippet of code from ebuild, ebuild should 
add "--with-jasper=system --without-openjpeg" to parameter list of configure script. And does not!

    if use jpeg2k; then
        myconf="--enable-jpeg"
        if hasv media-libs/jasper; then
            myconf="${myconf} --with-jasper=system --without-openjpeg"
        elif hasv media-libs/openjpeg; then
            myconf="${myconf} --without-jasper --with-openjpeg=system"
        fi
    else
        myconf="--disable-jpeg --without-jasper --without-openjpeg"
    fi


In reality, it runs configure as follows:

./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --e
nable-install-system-perl --with-perl-options=INSTALLDIRS=vendor --enable-fortran --enable-omp-packing --enable-python --enable-numpy --disable-static --with-netcdf=/usr --with-perl --with-png-support --enable-jpeg



I suspect that this statement:
   **********************************
   if hasv media-libs/jasper; then...
   **********************************

was meant by words: if there is a media-libs/jasper installed then...
But, hasv() does not do that job...


Here is, how the has(), hasv() is defined (in /usr/lib/portage/bin/isolated-functions.sh):

hasv() {
        if has "$@" ; then
                echo "$1"
                return 0
        fi
        return 1
}

has() {
        local needle=$1
        shift

        local x
        for x in "$@"; do
                [ "${x}" = "${needle}" ] && return 0
        done
        return 1
}
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-27 15:51:48 UTC
Obviously this is the wrong way to go about it. Imagine you build a tbz2 on one host that has openjpeg installed, but then deploy the tbz2 on a system with jasper installed - the dependencies in RDEPEND would be met but the deployed package would be broken.

The ebuild should have USE flags for those dependencies, and then probably define a REQUIRED_USE, and possibly a default USE to set a default dependency:

REQUIRED_USE=( jpeg2k? ( ^^ ( jasper openjpeg ) ) )

Note that it also fails in src_configure() with USE=-netcdf when sci-libs/netcdf is not installed.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-27 16:24:50 UTC
configure.ac says that when both are present, openjpeg is preferred and then goes on to entirely ignore the given configure options in favour of openjpeg. So there's a little more work to be done here.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-27 16:30:39 UTC
Building without netcdf support should be set using --with-netcdf=none, configure.ac says.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-27 16:57:30 UTC
Created attachment 310281 [details, diff]
make openjpeg optional even if present
Comment 5 Jeroen Roovers (RETIRED) gentoo-dev 2012-04-27 17:04:06 UTC
Created attachment 310283 [details, diff]
hasty ebuild patch

Not much time on my hands here, so someone should triple check this.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2019-09-26 14:50:35 UTC
Package removed.