Bug 250023 - archivers/xarchiver fails to built with bsdgrep
Summary: archivers/xarchiver fails to built with bsdgrep
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Danilo Egea Gondolfo
Depends on:
Blocks: 230332
  Show dependency treegraph
Reported: 2020-10-01 10:35 UTC by Piotr Smyrak
Modified: 2023-03-03 04:01 UTC (History)
2 users (show)

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

configure patch (346 bytes, patch)
2020-10-19 13:55 UTC, Piotr Smyrak
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Smyrak 2020-10-01 10:35:45 UTC
When upgrading the port it ends up with the following error:

checking for perl... /usr/local/bin/perl
checking for perl >= 5.8.1... 5.28.3
configure: error: GNU gettext tools must be at least version 0.16
===>  Script "configure" failed unexpectedly.
Please report the problem to danilo@FreeBSD.org [maintainer] and attach the
"/usr/ports/archivers/xarchiver/work/xarchiver-" including
the output of the failure of your make command. Also, it might be a good idea
to provide an overview of all packages installed on your system (e.g. a
/usr/local/sbin/pkg-static info -g -Ea).
*** Error code 1

make[1]: stopped in /usr/ports/archivers/xarchiver
*** Error code 1

make: stopped in /usr/ports/archivers/xarchiver

The reason for the failure is that the configure script fails to fulfill its assumptions that only seem to work on gnugrep and fail when grep is bsdgrep:

$ gettext --version | head -1 | grep -o '[0-9.]\+$'

$ grep --version
grep (BSD grep) 2.6.0-FreeBSD

$ gettext --version | head -1 | /usr/local/bin/grep -o '[0-9.]\+$'

$ /usr/local/bin/grep --version
grep (GNU grep) 3.5
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others; see
Comment 1 Piotr Smyrak 2020-10-19 13:55:58 UTC
Created attachment 218888 [details]
configure patch

Adding a configure patch that changes the one liner used to return gettext version. Instead of using perl regexp unsupported by bsdgrep, it uses awk to print the latest column of the xgettext output.
Comment 2 Kyle Evans freebsd_committer freebsd_triage 2020-12-05 03:39:02 UTC
(In reply to Piotr Smyrak from comment #1)


This is actually a GNU extension to BREs rather than Perl -- I would recommend having your patch do:

-xgversion="`xgettext --version | head -1 | grep -o '[0-9.]\+$'`"	+xgversion="`xgettext --version | head -1 | grep -Eo '[0-9.]+$'`"

This may be more palatable to upstream as it's just POSIXifying their expression. bsdgrep in -CURRENT now enables GNU extensions by default and the original incantation works again, but 12.x will be broken until 12.3. IMO, it is worth it.
Comment 3 Piotr Smyrak 2020-12-05 17:47:24 UTC
(In reply to Kyle Evans from comment #2)
Nice! Thanks for looking into it. I will try to upstream the change then.
Comment 4 Piotr Smyrak 2020-12-08 13:49:10 UTC
The change suggested by Kyle has been upstreamed in https://github.com/ib/xarchiver/pull/106
Comment 5 Piotr Smyrak 2021-08-18 11:10:12 UTC
This bug has been fixed by bsdgrep improvements and an upstream fix added before of xarchiver has been released.
Comment 6 Alexey Dokuchaev freebsd_committer freebsd_triage 2023-03-03 04:01:11 UTC
Closing per comment #5.