Bug 200829 - [PATCH] devel/avr-gdb: Add PYTHON option to make dependency explicit
Summary: [PATCH] devel/avr-gdb: Add PYTHON option to make dependency explicit
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Joerg Wunsch
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-06-12 22:48 UTC by Craig Leres
Modified: 2018-03-04 22:15 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (joerg)


Attachments
Patchset for devel/avr-gdb (794 bytes, text/plain)
2015-06-12 22:48 UTC, Craig Leres
no flags Details
poudriere build log (324.30 KB, text/plain)
2015-06-12 22:51 UTC, Craig Leres
no flags Details
poudriere build log (9.3-RELEASE) (324.30 KB, text/plain)
2015-06-12 22:52 UTC, Craig Leres
no flags Details
poudriere build log (10.1-RELEASE) (622.16 KB, text/plain)
2015-06-12 22:52 UTC, Craig Leres
no flags Details
patch (972 bytes, patch)
2015-12-21 02:47 UTC, Craig Leres
no flags Details | Diff
poudriere build log (10.1-RELEASE) (621.28 KB, text/plain)
2015-12-21 02:49 UTC, Craig Leres
no flags Details
revised patch (855 bytes, patch)
2016-09-17 23:39 UTC, Craig Leres
no flags Details | Diff
poudriere build log (10.3-RELEASE) (625.24 KB, text/plain)
2016-09-17 23:40 UTC, Craig Leres
no flags Details
revised patch (1.43 KB, patch)
2017-12-06 03:09 UTC, Craig Leres
no flags Details | Diff
poudriere build log (10.3-RELEASE) (43.41 KB, text/plain)
2017-12-06 03:09 UTC, Craig Leres
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Leres freebsd_committer 2015-06-12 22:48:38 UTC
Created attachment 157692 [details]
Patchset for devel/avr-gdb

The avr-gdb package enables python support if it finds a python binary at configure time. This means an avr-gdb package built on a system with python will not run on a system that doesn't have python.

Make the dependency on python explicit by adding an option for it.
Comment 1 Craig Leres freebsd_committer 2015-06-12 22:51:49 UTC
Created attachment 157693 [details]
poudriere build log
Comment 2 Craig Leres freebsd_committer 2015-06-12 22:52:22 UTC
Created attachment 157694 [details]
poudriere build log (9.3-RELEASE)
Comment 3 Craig Leres freebsd_committer 2015-06-12 22:52:45 UTC
Created attachment 157695 [details]
poudriere build log (10.1-RELEASE)
Comment 4 Craig Leres freebsd_committer 2015-12-21 02:46:16 UTC
I was in the process of filing a new PR to fix this problem when I noticed that I already did so back in June.

Attached is an updated patch:

    - Make the dependency on python explicit by adding an option for it

    - Fix some portlint complaints
Comment 5 Craig Leres freebsd_committer 2015-12-21 02:47:23 UTC
Created attachment 164440 [details]
patch
Comment 6 Craig Leres freebsd_committer 2015-12-21 02:49:03 UTC
Created attachment 164441 [details]
poudriere build log (10.1-RELEASE)
Comment 7 Craig Leres freebsd_committer 2016-09-17 23:39:43 UTC
Created attachment 174894 [details]
revised patch

This is still an issue.

Here's an updated patch that uses newer OPTIONS features. It also quiets some portlint complaints and eliminates pkg-plist (which should be removed).
Comment 8 Craig Leres freebsd_committer 2016-09-17 23:40:29 UTC
Created attachment 174895 [details]
poudriere build log (10.3-RELEASE)
Comment 9 Craig Leres freebsd_committer 2017-12-06 03:09:14 UTC
Created attachment 188573 [details]
revised patch

Here's the latest version of the patch:

 - Add LICENSE
 - Convert pkg-plist to use PLIST_FILES
 - Add PYTHON option to add USES=python:2.7

Note that my testing shows that gdb 7.3.1 does not build with python 3.

It might be better to default to PYTHON off since I believe that's what you get if you use poudriere to build the current devel/avr-gdb port (since python is not installed in this case and thus not auto-detected).
Comment 10 Craig Leres freebsd_committer 2017-12-06 03:09:57 UTC
Created attachment 188574 [details]
poudriere build log (10.3-RELEASE)
Comment 11 w.schwarzenfeld freebsd_triage 2018-03-04 08:44:58 UTC
Maintainer feedback, please!
Comment 12 Craig Leres freebsd_committer 2018-03-04 21:43:30 UTC
Here's some more info.

If I use poudriere to build/install avr-gdb (note -i) avr-gdb works normally:

    # poudriere testport -i -j 10lbl -p current-patched devel/avr-gdb
    @ avr-gdb --version
    GNU gdb (GDB) 7.3.1
    [...]

While in the same poudriere jail: install python, uninstall avr-gdb, remove the work directory and rebuild/reinstall avr-gdb. Then uninstall python and avr-gdb fails to run:

    @ rm -rf /wrkdirs/usr/ports/devel/avr-gdb/work
    @ pkg delete -fy avr-gdb
    @ pkg install python27 python
    @ cd /usr/ports/devel/avr-gdb && make install
    @ pkg delete -fy python27 python
    @ avr-gdb --version
    Shared object "libpython2.7.so.1" not found, required by "avr-gdb"
Comment 13 w.schwarzenfeld freebsd_triage 2018-03-04 22:15:30 UTC
I got another error:
ibgdb.a(charset.o): In function `convert_between_encodings':
charset.c:(.text+0x2b8): undefined reference to `libiconv_open'
charset.c:(.text+0x360): undefined reference to `libiconv'
libgdb.a(charset.o): In function `cleanup_iconv':
charset.c:(.text+0x4f9): undefined reference to `libiconv_close'
libgdb.a(charset.o): In function `make_wchar_iterator':
charset.c:(.text+0x520): undefined reference to `libiconv_open'
libgdb.a(charset.o): In function `do_cleanup_iterator':
charset.c:(.text+0x5ad): undefined reference to `libiconv_close'
libgdb.a(charset.o): In function `wchar_iterate':
charset.c:(.text+0x64a): undefined reference to `libiconv'
libgdb.a(charset.o): In function `_initialize_charset':
charset.c:(.text+0x820): undefined reference to `libiconvlist'
libgdb.a(charset.o): In function `validate':
charset.c:(.text+0xd39): undefined reference to `libiconv_open'
charset.c:(.text+0xd47): undefined reference to `libiconv_close'
charset.c:(.text+0xd52): undefined libgdb.a(charset.o):r eIn fferunectnicoen ` toconvert_between_encodings '`:
libiconv_open'charset.c:
(.text+charset.c:0(x.text+2b80): xundd60e)f: uindnefiend reed freerfeenrceen cteo  t`o libiconv_open`'


solved with added USES=iconv to the Makefile.