Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 694776 - media-libs/openjpeg-2.3.1 : wrong include dir
Summary: media-libs/openjpeg-2.3.1 : wrong include dir
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Thomas Bracht Laumann Jespersen
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2019-09-18 02:14 UTC by Kai Krakow
Modified: 2022-05-23 20:46 UTC (History)
3 users (show)

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


Attachments
emerge --info (emerge-info.txt,12.26 KB, text/plain)
2019-09-18 02:14 UTC, Kai Krakow
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Krakow 2019-09-18 02:14:23 UTC
Created attachment 590196 [details]
emerge --info

I'm not sure if this is related to openjpeg itself or maybe to the fact I'm using profile 17.1 but any software building against openjpeg fails to find its include files, i.e. poppler:

[106/240] /bin/x86_64-pc-linux-gnu-g++ -Dpoppler_EXPORTS -I/var/tmp/portage/app-text/poppler-0.79.0-r1/work/poppler-0.79.0 -I/var/tmp/portage/app-text/poppler-0.79.0-r1/work/poppler-0.79.0/fofi -I/var/tmp/portage/app-text/poppler-0.79.0-r1/work/poppler-0.79.0/goo -I/var/tmp/portage/app-text/poppler-0.79.0-r1/work/poppler-0.79.0/poppler -I. -Ipoppler -I/usr/include/freetype2 -I/include/openjpeg-2.3 -O2 -march=native -pipe -fomit-frame-pointer -g -DNDEBUG -Wall -Wextra -Wpedantic -Wno-unused-parameter -Wcast-align -Wformat-security -Wframe-larger-than=65536 -Wlogical-op -Wmissing-format-attribute -Wnon-virtual-dtor -Woverloaded-virtual -Wmissing-declarations -Wundef -Wzero-as-null-pointer-constant -Wshadow -Wsuggest-override -O2 -march=native -pipe -fomit-frame-pointer -g -std=c++11 -Wnon-virtual-dtor -Woverloaded-virtual -fPIC   -pthread -std=c++14 -MD -MT CMakeFiles/poppler.dir/poppler/CurlPDFDocBuilder.cc.o -MF CMakeFiles/poppler.dir/poppler/CurlPDFDocBuilder.cc.o.d -o CMakeFiles/poppler.dir/poppler/CurlPDFDocBuilder.cc.o -c /var/tmp/portage/app-text/poppler-0.79.0-r1/work/poppler-0.79.0/poppler/CurlPDFDocBuilder.cc
ninja: build stopped: subcommand failed.

Note how it misses "/usr" from the openjpeg include path: -I/include/openjpeg-2.3

Looking at /usr/lib64/pkgconfig/libopenjp2.pc also reveals something may be wrong:

prefix=/usr
bindir=${prefix}/bin
mandir=${prefix}//usr/share/man
docdir=${prefix}//usr/share/doc/openjpeg-2.3.1
libdir=${prefix}/lib64
includedir=${prefix}/include/openjpeg-2.3

I don't think the lines for mandir and docdir are correct tho that should not matter for most packages. The cmake files look good, tho. But still the example above is a cmake project and fails.
Comment 1 Thomas Bracht Laumann Jespersen 2022-01-26 08:47:12 UTC
I looked into this one yesterday, and I cannot really reproduce the build failure.

On my system, the full contents of "/usr/lib64/pkgconfig/libopenjp2.pc" are:

prefix=/usr
bindir=${prefix}/bin
mandir=${prefix}//usr/share/man
docdir=${prefix}//usr/share/doc/openjpeg-2.4.0
libdir=${prefix}/lib64
includedir=${prefix}/include/openjpeg-2.4

Name: openjp2
Description: JPEG2000 library (Part 1 and 2)
URL: http://www.openjpeg.org/
Version: 2.4.0
Libs: -L${libdir} -lopenjp2
Libs.private: -lm
Cflags: -I${includedir}

and running "pkg-config --cflags libopenjp2" produces:

-I/usr/include/openjpeg-2.4

Note that the current version is 2.4.0, not 2.3.1 (and is the only available version).

I think the lines for mandir and docdir are still wrong though.
Comment 2 Larry the Git Cow gentoo-dev 2022-02-03 02:21:46 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fde99243e307bd130c6f9cc04090bcb9829ce9c0

commit fde99243e307bd130c6f9cc04090bcb9829ce9c0
Author:     Thomas Bracht Laumann Jespersen <t@laumann.xyz>
AuthorDate: 2022-02-02 19:19:35 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-02-03 02:20:20 +0000

    media-libs/openjpeg: Fix mandir and docdir for generated pkgconfig
    
    Update the patch to remove the ${prefix} variable from mandir and docdir
    as it results in incorrect paths.
    
    Before:
    
            $ pkg-config --variable=docdir libopenjp2
            /usr//usr/share/doc/openjpeg-2.4.0
            $ pkg-config --variable=mandir libopenjp2
            /usr//usr/share/man
    
    and after:
    
            $ pkg-config --variable=docdir libopenjp2
            /usr/share/doc/openjpeg-2.4.0-r1
            $ pkg-config --variable=mandir libopenjp2
            /usr/share/man
    
    Bug: https://bugs.gentoo.org/694776
    Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
    Package-Manager: Portage-3.0.28, Repoman-3.0.3
    Closes: https://github.com/gentoo/gentoo/pull/24000
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/openjpeg-2.4.0-r1-gnuinstalldirs.patch   | 435 +++++++++++++++++++++
 media-libs/openjpeg/openjpeg-2.4.0-r1.ebuild       | 139 +++++++
 2 files changed, 574 insertions(+)
Comment 3 Niklāvs Koļesņikovs 2022-05-23 02:07:29 UTC
I just hit a similar issue with 2.5.0 while rebuild packages overnight for unrelated reasons.

Here's the diff between the two pkgconfig files:
@@ -1,14 +1,14 @@
 prefix=/usr
 bindir=${prefix}/bin
 mandir=/usr/share/man
-docdir=/usr/share/doc/openjpeg-2.4.0-r3
+docdir=/usr/share/doc/openjpeg-2.5.0
 libdir=${prefix}/lib64
-includedir=${prefix}/include/openjpeg-2.4
+includedir=${prefix}/include
 
 Name: openjp2
 Description: JPEG2000 library (Part 1 and 2)
 URL: http://www.openjpeg.org/
-Version: 2.4.0
+Version: 2.5.0
 Libs: -L${libdir} -lopenjp2
 Libs.private: -lm
 Cflags: -I${includedir}

Please observe how 2.5.0 has includedir incorrectly set to `${prefix}/include` when of course it should be set to `${prefix}/includeopenjpeg-2.5`.
Comment 4 Thomas Bracht Laumann Jespersen 2022-05-23 09:46:08 UTC
(In reply to Niklāvs Koļesņikovs from comment #3)
> I just hit a similar issue with 2.5.0 while rebuild packages overnight for
> unrelated reasons.

Thanks for reporting this!

> Please observe how 2.5.0 has includedir incorrectly set to
> `${prefix}/include` when of course it should be set to
> `${prefix}/includeopenjpeg-2.5`.

Just to be clear, you mean "${prefix}/include/openjpeg-2.5" right? I'll look into getting this fixed.
Comment 5 Niklāvs Koļesņikovs 2022-05-23 11:06:40 UTC
Yes, I meant "${prefix}/include/openjpeg-2.5". :)
Comment 6 Thomas Bracht Laumann Jespersen 2022-05-23 11:34:33 UTC
(In reply to Niklāvs Koļesņikovs from comment #5)
> Yes, I meant "${prefix}/include/openjpeg-2.5". :)

Awesome, I'll push a fix in a PR in a moment.
Comment 7 Thomas Bracht Laumann Jespersen 2022-05-23 14:14:10 UTC
Closing this as obsolete, the 2.5.0 issue is tracked by bug 847058.
Comment 8 Larry the Git Cow gentoo-dev 2022-05-23 17:26:47 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf92bccd8ffd7dc4ff4b32b465fa5e34ca04a564

commit bf92bccd8ffd7dc4ff4b32b465fa5e34ca04a564
Author:     Thomas Bracht Laumann Jespersen <t@laumann.xyz>
AuthorDate: 2022-05-23 11:33:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-23 17:26:28 +0000

    media-libs/openjpeg: add 2.5.0-r1, fix includedir
    
    Bug: https://bugs.gentoo.org/694776
    Closes: https://bugs.gentoo.org/847058
    Signed-off-by: Thomas Bracht Laumann Jespersen <t@laumann.xyz>
    Closes: https://github.com/gentoo/gentoo/pull/25607
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/openjpeg/files/openjpeg-2.5.0-gnuinstalldirs.patch         | 4 ++--
 .../openjpeg/{openjpeg-2.5.0.ebuild => openjpeg-2.5.0-r1.ebuild}      | 0
 2 files changed, 2 insertions(+), 2 deletions(-)