include-what-you-use: ship docs, use python 3, other nits

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

include-what-you-use: ship docs, use python 3, other nits

Klemens Nanni-2
Came here to ship docs so I don't have to browse the web to lern how to
use it, but improved a bit more while here.

- derive PKGNAME from DISTNAME so future bumps require only one change
- sync WANTLIB according to `port-lib-depends-check`
- PERMIT_PACKAGE
- use TLS
- use Python3
- Python is RDEP only
- adjust all Python shebangs
- enable tests

        $ make test
        [...]
        Ran 113 tests in 55.429s

        FAILED (failures=3)

OK?  I can also split things up and commit hunks separately if that's
tidier.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile 16 Feb 2019 12:06:23 -0000 1.15
+++ Makefile 10 Jun 2019 16:45:12 -0000
@@ -3,28 +3,40 @@
 COMMENT= tool to analyse \#includes in C and C++ source files
 CATEGORIES= devel
 DISTNAME= include-what-you-use-0.11.src
-PKGNAME= include-what-you-use-0.11
-REVISION= 0
+PKGNAME= ${DISTNAME:.src=}
+REVISION= 1
 
-HOMEPAGE= http://include-what-you-use.org
+HOMEPAGE= https://include-what-you-use.org
 MASTER_SITES= ${HOMEPAGE}/downloads/
 WRKDIST= ${WRKDIR}/include-what-you-use
 
 MAINTAINER= Jonathan Gray <[hidden email]>
 
 # BSD
-PERMIT_PACKAGE_CDROM= Yes
+PERMIT_PACKAGE= Yes
 
-WANTLIB= c curses execinfo form m pthread z
+WANTLIB= ${COMPILER_LIBCXX} c m pthread
 LLVM_V= 7.0.1
 BUILD_DEPENDS= devel/llvm>=${LLVM_V}
 RUN_DEPENDS= devel/llvm>=${LLVM_V}
 LIB_DEPENDS= devel/libexecinfo
 
 MODULES= devel/cmake lang/python
+MODPY_BUILDDEP= No
+MODPY_VERSION= ${MODPY_DEFAULT_VERSION_3}
+MODPY_ADJ_FILES= *.py
+
 COMPILER= base-clang ports-gcc
 COMPILER_LANGS= c++
 
-MODPY_ADJ_FILES = fix_includes.py iwyu_tool.py
+DOCDIR= ${PREFIX}/share/doc/include-what-you-use
+
+do-test:
+ cd ${WRKSRC} && ./run_iwyu_tests.py
+
+post-install:
+ ${INSTALL_DATA_DIR} ${DOCDIR}/
+ ${INSTALL_DATA} ${WRKSRC}/docs/* ${DOCDIR}/
+ ${INSTALL_DATA} ${WRKSRC}/README.md ${PREFIX}/share/include-what-you-use/
 
 .include <bsd.port.mk>
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST 1 Jan 2017 06:58:37 -0000 1.2
+++ pkg/PLIST 10 Jun 2019 15:48:02 -0000
@@ -2,9 +2,20 @@
 bin/fix_includes.py
 @bin bin/include-what-you-use
 bin/iwyu_tool.py
+share/doc/include-what-you-use/
+share/doc/include-what-you-use/IWYUMappings.md
+share/doc/include-what-you-use/IWYUPragmas.md
+share/doc/include-what-you-use/WhatIsAUse.md
+share/doc/include-what-you-use/WhyIWYU.md
+share/doc/include-what-you-use/WhyIWYUIsDifficult.md
 share/include-what-you-use/
+share/include-what-you-use/README.md
+share/include-what-you-use/boost-1.64-all-private.imp
+share/include-what-you-use/boost-1.64-all.imp
 share/include-what-you-use/boost-all-private.imp
 share/include-what-you-use/boost-all.imp
+share/include-what-you-use/clang-6.intrinsics.imp
+share/include-what-you-use/gcc-8.intrinsics.imp
 share/include-what-you-use/gcc.libc.imp
 share/include-what-you-use/gcc.stl.headers.imp
 share/include-what-you-use/gcc.symbols.imp

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Stuart Henderson
On 2019/06/10 18:47, Klemens Nanni wrote:
>  
> -WANTLIB= c curses execinfo form m pthread z
> +WANTLIB= ${COMPILER_LIBCXX} c m pthread
>  LLVM_V= 7.0.1
>  BUILD_DEPENDS= devel/llvm>=${LLVM_V}
>  RUN_DEPENDS= devel/llvm>=${LLVM_V}
>  LIB_DEPENDS= devel/libexecinfo

Removing execinfo from WANTLIB nullifies the devel/libexecinfo LIB_DEPENDS ..

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Klemens Nanni-2
On Mon, Jun 10, 2019 at 08:10:58PM +0100, Stuart Henderson wrote:
> Removing execinfo from WANTLIB nullifies the devel/libexecinfo LIB_DEPENDS ..
That... is a valid point.  I'll leave it in and double check tooling's
output before cooking diffs, thanks.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile 16 Feb 2019 12:06:23 -0000 1.15
+++ Makefile 10 Jun 2019 20:33:34 -0000
@@ -3,28 +3,40 @@
 COMMENT= tool to analyse \#includes in C and C++ source files
 CATEGORIES= devel
 DISTNAME= include-what-you-use-0.11.src
-PKGNAME= include-what-you-use-0.11
-REVISION= 0
+PKGNAME= ${DISTNAME:.src=}
+REVISION= 1
 
-HOMEPAGE= http://include-what-you-use.org
+HOMEPAGE= https://include-what-you-use.org
 MASTER_SITES= ${HOMEPAGE}/downloads/
 WRKDIST= ${WRKDIR}/include-what-you-use
 
 MAINTAINER= Jonathan Gray <[hidden email]>
 
 # BSD
-PERMIT_PACKAGE_CDROM= Yes
+PERMIT_PACKAGE= Yes
 
-WANTLIB= c curses execinfo form m pthread z
+WANTLIB= ${COMPILER_LIBCXX} c execinfo m pthread
 LLVM_V= 7.0.1
 BUILD_DEPENDS= devel/llvm>=${LLVM_V}
 RUN_DEPENDS= devel/llvm>=${LLVM_V}
 LIB_DEPENDS= devel/libexecinfo
 
 MODULES= devel/cmake lang/python
+MODPY_BUILDDEP= No
+MODPY_VERSION= ${MODPY_DEFAULT_VERSION_3}
+MODPY_ADJ_FILES= *.py
+
 COMPILER= base-clang ports-gcc
 COMPILER_LANGS= c++
 
-MODPY_ADJ_FILES = fix_includes.py iwyu_tool.py
+DOCDIR= ${PREFIX}/share/doc/include-what-you-use
+
+do-test:
+ cd ${WRKSRC} && ./run_iwyu_tests.py
+
+post-install:
+ ${INSTALL_DATA_DIR} ${DOCDIR}/
+ ${INSTALL_DATA} ${WRKSRC}/docs/* ${DOCDIR}/
+ ${INSTALL_DATA} ${WRKSRC}/README.md ${PREFIX}/share/include-what-you-use/
 
 .include <bsd.port.mk>
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST 1 Jan 2017 06:58:37 -0000 1.2
+++ pkg/PLIST 10 Jun 2019 15:48:02 -0000
@@ -2,9 +2,20 @@
 bin/fix_includes.py
 @bin bin/include-what-you-use
 bin/iwyu_tool.py
+share/doc/include-what-you-use/
+share/doc/include-what-you-use/IWYUMappings.md
+share/doc/include-what-you-use/IWYUPragmas.md
+share/doc/include-what-you-use/WhatIsAUse.md
+share/doc/include-what-you-use/WhyIWYU.md
+share/doc/include-what-you-use/WhyIWYUIsDifficult.md
 share/include-what-you-use/
+share/include-what-you-use/README.md
+share/include-what-you-use/boost-1.64-all-private.imp
+share/include-what-you-use/boost-1.64-all.imp
 share/include-what-you-use/boost-all-private.imp
 share/include-what-you-use/boost-all.imp
+share/include-what-you-use/clang-6.intrinsics.imp
+share/include-what-you-use/gcc-8.intrinsics.imp
 share/include-what-you-use/gcc.libc.imp
 share/include-what-you-use/gcc.stl.headers.imp
 share/include-what-you-use/gcc.symbols.imp

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Ingo Schwarze
Hi Klemens,

the authors of this tool absolutely do not understand how documentation
works.  That said, i agree it is better to install whatever piss-poor
and disorganized musings they do provide rather than installing no
documentation whatsoever.

See below in-line for two questions, none of which are intended to
oppose or even delay your commit.

Yours,
  Ingo


Klemens Nanni wrote on Mon, Jun 10, 2019 at 10:34:21PM +0200:

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
> retrieving revision 1.15
> diff -u -p -r1.15 Makefile
> --- Makefile 16 Feb 2019 12:06:23 -0000 1.15
> +++ Makefile 10 Jun 2019 20:33:34 -0000
> @@ -3,28 +3,40 @@
>  COMMENT= tool to analyse \#includes in C and C++ source files
>  CATEGORIES= devel
>  DISTNAME= include-what-you-use-0.11.src
> -PKGNAME= include-what-you-use-0.11
> -REVISION= 0
> +PKGNAME= ${DISTNAME:.src=}
> +REVISION= 1
>  
> -HOMEPAGE= http://include-what-you-use.org
> +HOMEPAGE= https://include-what-you-use.org
>  MASTER_SITES= ${HOMEPAGE}/downloads/
>  WRKDIST= ${WRKDIR}/include-what-you-use
>  
>  MAINTAINER= Jonathan Gray <[hidden email]>
>  
>  # BSD
> -PERMIT_PACKAGE_CDROM= Yes
> +PERMIT_PACKAGE= Yes
>  
> -WANTLIB= c curses execinfo form m pthread z
> +WANTLIB= ${COMPILER_LIBCXX} c execinfo m pthread
>  LLVM_V= 7.0.1
>  BUILD_DEPENDS= devel/llvm>=${LLVM_V}
>  RUN_DEPENDS= devel/llvm>=${LLVM_V}

Why does this have an unconditional dependency on ports LLVM?
For example, on amd64, it actually uses base LLVM unless i read
the build logs incorrectly.

I realize this is unrelated to your changes, just wondering...

Uh oh...  Then again, is see stuff like

  CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/local/bin/llvm-ar
  CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/local/bin/llvm-ranlib
  CMAKE_C_COMPILER_AR:FILEPATH=/usr/local/bin/llvm-ar
  CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/local/bin/llvm-ranlib
  CMAKE_LINKER:FILEPATH=/usr/bin/ld
  CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
  Clang_DIR:PATH=/usr/local/lib/cmake/clang
  LLVM_DIR:PATH=/usr/local/lib/cmake/llvm

in CMakeCache.txt - mixing toolchains like this makes me feel uneasy,
even if both clangs currently happen to be 7.0.1 on amd64.
Is this really safe, even if the two should occasionally diverge,
which they sometimes do according to what i have seen in the past?

>  LIB_DEPENDS= devel/libexecinfo
>  
>  MODULES= devel/cmake lang/python
> +MODPY_BUILDDEP= No
> +MODPY_VERSION= ${MODPY_DEFAULT_VERSION_3}
> +MODPY_ADJ_FILES= *.py
> +
>  COMPILER= base-clang ports-gcc
>  COMPILER_LANGS= c++
>  
> -MODPY_ADJ_FILES = fix_includes.py iwyu_tool.py
> +DOCDIR= ${PREFIX}/share/doc/include-what-you-use
> +
> +do-test:
> + cd ${WRKSRC} && ./run_iwyu_tests.py
> +
> +post-install:
> + ${INSTALL_DATA_DIR} ${DOCDIR}/
> + ${INSTALL_DATA} ${WRKSRC}/docs/* ${DOCDIR}/
> + ${INSTALL_DATA} ${WRKSRC}/README.md ${PREFIX}/share/include-what-you-use/

It feels like you install README.md to the wrong place.
Can you install it to /usr/local/share/doc/include-what-you-use/
instead, together with the other "documentation"?

Yes, the file is a total mess in so far as it mixes build instructions
(which shouldn't be installed at all) with usage instructions - which
ought to be in a section 1 manual page, include-what-you-use(1).  But
given that it does contain some usage instructions, even though well
hidden among a lot of crap and very imprecise, i think it does
belong in ${DOCDIR}/.

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Klemens Nanni-2
On Tue, Jun 11, 2019 at 12:11:37AM +0200, Ingo Schwarze wrote:
> Why does this have an unconditional dependency on ports LLVM?
> For example, on amd64, it actually uses base LLVM unless i read
> the build logs incorrectly.
>
> I realize this is unrelated to your changes, just wondering...
I intentionally did not look into the "actual port" itself if you will
as I just wanted to fix the first user experience and platonic ports
fixes.

There's also an upstream update available - I can look into this once
this is settled.

> It feels like you install README.md to the wrong place.
> Can you install it to /usr/local/share/doc/include-what-you-use/
> instead, together with the other "documentation"?
I put the readme under $prefix/share/$port/ as usually done (by me?)
since it contains a bit of everything (as you elaborated), but I surely
have no objections putting it besides the rest.

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Jonathan Gray-11
In reply to this post by Klemens Nanni-2
On Mon, Jun 10, 2019 at 10:34:21PM +0200, Klemens Nanni wrote:
> On Mon, Jun 10, 2019 at 08:10:58PM +0100, Stuart Henderson wrote:
> > Removing execinfo from WANTLIB nullifies the devel/libexecinfo LIB_DEPENDS ..
> That... is a valid point.  I'll leave it in and double check tooling's
> output before cooking diffs, thanks.

I don't see why you are removing libcurses and libz from wantlib

$ ldd /usr/local/bin/include-what-you-use  
/usr/local/bin/include-what-you-use:
        Start            End              Type  Open Ref GrpRef Name
        0000050a920fd000 0000050a9352b000 exe   2    0   0      /usr/local/bin/include-what-you-use
        0000050d4ff04000 0000050d4ff11000 rlib  0    2   0      /usr/lib/libpthread.so.26.1
        0000050d8fd16000 0000050d939de000 rlib  0    1   0      /usr/local/lib/libLLVM-7.so
        0000050d0ced0000 0000050d0cfc2000 rlib  0    2   0      /usr/lib/libc++.so.2.2
        0000050d17810000 0000050d17853000 rlib  0    3   0      /usr/lib/libc++abi.so.0.1
        0000050d68782000 0000050d687b1000 rlib  0    2   0      /usr/lib/libm.so.10.1
        0000050d1e240000 0000050d1e336000 rlib  0    1   0      /usr/lib/libc.so.95.1
        0000050d45d6c000 0000050d45da9000 rlib  0    1   0      /usr/lib/libedit.so.5.2
        0000050d1cbec000 0000050d1cc07000 rlib  0    1   0      /usr/lib/libz.so.5.0
        0000050d62d77000 0000050d62dd9000 rlib  0    1   0      /usr/lib/libcurses.so.14.0
        0000050d1a310000 0000050d1a310000 ld.so 0    1   0      /usr/libexec/ld.so

Is there a push to move everything to python3 now?

Changing MODPY_ADJ_FILES to a glob seems a bit pointless.

Should do-test explictly use ${MODPY_BIN} ?

>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
> retrieving revision 1.15
> diff -u -p -r1.15 Makefile
> --- Makefile 16 Feb 2019 12:06:23 -0000 1.15
> +++ Makefile 10 Jun 2019 20:33:34 -0000
> @@ -3,28 +3,40 @@
>  COMMENT= tool to analyse \#includes in C and C++ source files
>  CATEGORIES= devel
>  DISTNAME= include-what-you-use-0.11.src
> -PKGNAME= include-what-you-use-0.11
> -REVISION= 0
> +PKGNAME= ${DISTNAME:.src=}
> +REVISION= 1
>  
> -HOMEPAGE= http://include-what-you-use.org
> +HOMEPAGE= https://include-what-you-use.org
>  MASTER_SITES= ${HOMEPAGE}/downloads/
>  WRKDIST= ${WRKDIR}/include-what-you-use
>  
>  MAINTAINER= Jonathan Gray <[hidden email]>
>  
>  # BSD
> -PERMIT_PACKAGE_CDROM= Yes
> +PERMIT_PACKAGE= Yes
>  
> -WANTLIB= c curses execinfo form m pthread z
> +WANTLIB= ${COMPILER_LIBCXX} c execinfo m pthread
>  LLVM_V= 7.0.1
>  BUILD_DEPENDS= devel/llvm>=${LLVM_V}
>  RUN_DEPENDS= devel/llvm>=${LLVM_V}
>  LIB_DEPENDS= devel/libexecinfo
>  
>  MODULES= devel/cmake lang/python
> +MODPY_BUILDDEP= No
> +MODPY_VERSION= ${MODPY_DEFAULT_VERSION_3}
> +MODPY_ADJ_FILES= *.py
> +
>  COMPILER= base-clang ports-gcc
>  COMPILER_LANGS= c++
>  
> -MODPY_ADJ_FILES = fix_includes.py iwyu_tool.py
> +DOCDIR= ${PREFIX}/share/doc/include-what-you-use
> +
> +do-test:
> + cd ${WRKSRC} && ./run_iwyu_tests.py
> +
> +post-install:
> + ${INSTALL_DATA_DIR} ${DOCDIR}/
> + ${INSTALL_DATA} ${WRKSRC}/docs/* ${DOCDIR}/
> + ${INSTALL_DATA} ${WRKSRC}/README.md ${PREFIX}/share/include-what-you-use/
>  
>  .include <bsd.port.mk>
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/devel/include-what-you-use/pkg/PLIST,v
> retrieving revision 1.2
> diff -u -p -r1.2 PLIST
> --- pkg/PLIST 1 Jan 2017 06:58:37 -0000 1.2
> +++ pkg/PLIST 10 Jun 2019 15:48:02 -0000
> @@ -2,9 +2,20 @@
>  bin/fix_includes.py
>  @bin bin/include-what-you-use
>  bin/iwyu_tool.py
> +share/doc/include-what-you-use/
> +share/doc/include-what-you-use/IWYUMappings.md
> +share/doc/include-what-you-use/IWYUPragmas.md
> +share/doc/include-what-you-use/WhatIsAUse.md
> +share/doc/include-what-you-use/WhyIWYU.md
> +share/doc/include-what-you-use/WhyIWYUIsDifficult.md
>  share/include-what-you-use/
> +share/include-what-you-use/README.md
> +share/include-what-you-use/boost-1.64-all-private.imp
> +share/include-what-you-use/boost-1.64-all.imp
>  share/include-what-you-use/boost-all-private.imp
>  share/include-what-you-use/boost-all.imp
> +share/include-what-you-use/clang-6.intrinsics.imp
> +share/include-what-you-use/gcc-8.intrinsics.imp
>  share/include-what-you-use/gcc.libc.imp
>  share/include-what-you-use/gcc.stl.headers.imp
>  share/include-what-you-use/gcc.symbols.imp
>

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Klemens Nanni-2
On Tue, Jun 11, 2019 at 04:16:04PM +1000, Jonathan Gray wrote:
> I don't see why you are removing libcurses and libz from wantlib
Because even after Stuart's reply and my revised diff, I rushed things
without looking around... `make port-lib-depends-check` lists those libs
as extra - I should check why it does that instead of blindly removing
them, sorry.

> Is there a push to move everything to python3 now?
No "official" or (internally) planned one, but moving steadily moving
ports off the old version which is officially deprecated in 2020 has
gone well so far - we'll have to ditch Python 2 eventually and IWYU
upstream has been supporting Python 3 since years, so that's that.

> Changing MODPY_ADJ_FILES to a glob seems a bit pointless.
I did this to avoid listing them all;  with tests enabled the list grows
and instead of amending them on future versions, globbing does the job
in a generic way.

> Should do-test explictly use ${MODPY_BIN} ?
Redundant as the shebang has been adjusted at this point;  if not, that
would be a bug in our framework or weird/bad porters usage.

That said, MODPY_BIN is more explicit and works regardless of the file's
execute bit.  I have no strong opinion, your call.

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Daniel Jakots-6
In reply to this post by Jonathan Gray-11
On Tue, 11 Jun 2019 16:16:04 +1000, Jonathan Gray <[hidden email]> wrote:

> Is there a push to move everything to python3 now?

I don't think we will be able to suddenly flip a switch and look at
what breaks as breakage will probably be at runtime. I think it's
easier to do what kn is doing, switching port by port.

And yes I think we should move our !py-* ports to python3 as it's easy
(when upstream supports it) so we'll eventually "only" have the py-*
flavored ports and the !py-* that doesn't support python3.

Cheers,
Daniel

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Stuart Henderson
In reply to this post by Jonathan Gray-11
On 2019/06/11 16:16, Jonathan Gray wrote:

> On Mon, Jun 10, 2019 at 10:34:21PM +0200, Klemens Nanni wrote:
> > On Mon, Jun 10, 2019 at 08:10:58PM +0100, Stuart Henderson wrote:
> > > Removing execinfo from WANTLIB nullifies the devel/libexecinfo LIB_DEPENDS ..
> > That... is a valid point.  I'll leave it in and double check tooling's
> > output before cooking diffs, thanks.
>
> I don't see why you are removing libcurses and libz from wantlib
>
> $ ldd /usr/local/bin/include-what-you-use  
> /usr/local/bin/include-what-you-use:
>         Start            End              Type  Open Ref GrpRef Name
>         0000050a920fd000 0000050a9352b000 exe   2    0   0      /usr/local/bin/include-what-you-use
>         0000050d4ff04000 0000050d4ff11000 rlib  0    2   0      /usr/lib/libpthread.so.26.1
>         0000050d8fd16000 0000050d939de000 rlib  0    1   0      /usr/local/lib/libLLVM-7.so
>         0000050d0ced0000 0000050d0cfc2000 rlib  0    2   0      /usr/lib/libc++.so.2.2
>         0000050d17810000 0000050d17853000 rlib  0    3   0      /usr/lib/libc++abi.so.0.1
>         0000050d68782000 0000050d687b1000 rlib  0    2   0      /usr/lib/libm.so.10.1
>         0000050d1e240000 0000050d1e336000 rlib  0    1   0      /usr/lib/libc.so.95.1
>         0000050d45d6c000 0000050d45da9000 rlib  0    1   0      /usr/lib/libedit.so.5.2
>         0000050d1cbec000 0000050d1cc07000 rlib  0    1   0      /usr/lib/libz.so.5.0
>         0000050d62d77000 0000050d62dd9000 rlib  0    1   0      /usr/lib/libcurses.so.14.0
>         0000050d1a310000 0000050d1a310000 ld.so 0    1   0      /usr/libexec/ld.so

Ports WANTLIB lines only list things linked directly to files in that port,
not things pulled in via library dependencies.

$ objdump -p /usr/local/bin/include-what-you-use | grep NEEDED
  NEEDED      libpthread.so.26.1
  NEEDED      libLLVM-7.so
  NEEDED      libc++.so.2.2
  NEEDED      libc++abi.so.0.1
  NEEDED      libm.so.10.1
  NEEDED      libc.so.95.1

I think it's correct to remove those extras.

libexecinfo is an extra specially annoying case because many ports are only
prepared to deal with Linux (execinfo.h header but the backtrace functions are
in libc). I'm not sure where it originally came from in the i-w-y-u port but
reviewing the source/build infrastructure there is nothing that uses it, so
we are ok to remove this from the port too (LIB_DEPENDS as well as the WANTLIB).

Reply | Threaded
Open this post in threaded view
|

Re: include-what-you-use: ship docs, use python 3, other nits

Klemens Nanni-2
On Wed, Jun 12, 2019 at 06:28:13PM +0100, Stuart Henderson wrote:
> I think it's correct to remove those extras.
>
> libexecinfo is an extra specially annoying case because many ports are only
> prepared to deal with Linux (execinfo.h header but the backtrace functions are
> in libc). I'm not sure where it originally came from in the i-w-y-u port but
> reviewing the source/build infrastructure there is nothing that uses it, so
> we are ok to remove this from the port too (LIB_DEPENDS as well as the WANTLIB).
Thanks for working this out.

Updated diff below stripping WANTLIB and LIB_DEPENDS, the README is now
installed besides the rest of the documentation.

OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/Makefile,v
retrieving revision 1.15
diff -u -p -r1.15 Makefile
--- Makefile 16 Feb 2019 12:06:23 -0000 1.15
+++ Makefile 17 Jun 2019 20:56:03 -0000
@@ -3,28 +3,38 @@
 COMMENT= tool to analyse \#includes in C and C++ source files
 CATEGORIES= devel
 DISTNAME= include-what-you-use-0.11.src
-PKGNAME= include-what-you-use-0.11
-REVISION= 0
+PKGNAME= ${DISTNAME:.src=}
+REVISION= 1
 
-HOMEPAGE= http://include-what-you-use.org
+HOMEPAGE= https://include-what-you-use.org
 MASTER_SITES= ${HOMEPAGE}/downloads/
 WRKDIST= ${WRKDIR}/include-what-you-use
 
 MAINTAINER= Jonathan Gray <[hidden email]>
 
 # BSD
-PERMIT_PACKAGE_CDROM= Yes
+PERMIT_PACKAGE= Yes
 
-WANTLIB= c curses execinfo form m pthread z
+WANTLIB= ${COMPILER_LIBCXX} c m pthread
 LLVM_V= 7.0.1
 BUILD_DEPENDS= devel/llvm>=${LLVM_V}
 RUN_DEPENDS= devel/llvm>=${LLVM_V}
-LIB_DEPENDS= devel/libexecinfo
 
 MODULES= devel/cmake lang/python
+MODPY_BUILDDEP= No
+MODPY_VERSION= ${MODPY_DEFAULT_VERSION_3}
+MODPY_ADJ_FILES= *.py
+
 COMPILER= base-clang ports-gcc
 COMPILER_LANGS= c++
 
-MODPY_ADJ_FILES = fix_includes.py iwyu_tool.py
+DOCDIR= ${PREFIX}/share/doc/include-what-you-use
+
+do-test:
+ cd ${WRKSRC} && ./run_iwyu_tests.py
+
+post-install:
+ ${INSTALL_DATA_DIR} ${DOCDIR}/
+ ${INSTALL_DATA} ${WRKSRC}/README.md ${WRKSRC}/docs/* ${DOCDIR}/
 
 .include <bsd.port.mk>
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/include-what-you-use/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST 1 Jan 2017 06:58:37 -0000 1.2
+++ pkg/PLIST 13 Jun 2019 23:21:13 -0000
@@ -2,9 +2,20 @@
 bin/fix_includes.py
 @bin bin/include-what-you-use
 bin/iwyu_tool.py
+share/doc/include-what-you-use/
+share/doc/include-what-you-use/IWYUMappings.md
+share/doc/include-what-you-use/IWYUPragmas.md
+share/doc/include-what-you-use/README.md
+share/doc/include-what-you-use/WhatIsAUse.md
+share/doc/include-what-you-use/WhyIWYU.md
+share/doc/include-what-you-use/WhyIWYUIsDifficult.md
 share/include-what-you-use/
+share/include-what-you-use/boost-1.64-all-private.imp
+share/include-what-you-use/boost-1.64-all.imp
 share/include-what-you-use/boost-all-private.imp
 share/include-what-you-use/boost-all.imp
+share/include-what-you-use/clang-6.intrinsics.imp
+share/include-what-you-use/gcc-8.intrinsics.imp
 share/include-what-you-use/gcc.libc.imp
 share/include-what-you-use/gcc.stl.headers.imp
 share/include-what-you-use/gcc.symbols.imp