FS#61462 - [wireshark] Switch to CMake, remove wireshark-gtk, PKGBUILD suggestions

Attached to Project: Community Packages
Opened by Peter Wu (Lekensteyn) - Saturday, 19 January 2019, 12:28 GMT
Last edited by Levente Polyak (anthraxx) - Thursday, 21 March 2019, 00:11 GMT
Task Type General Gripe
Category Packages
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Wireshark upstream has deprecated GTK+ long time ago. The next release has dropped this completely as well as autotools. Please switch to CMake and remove the wireshark-gtk package.
I maintain the wireshark-git package which could also be used for inspiration:
https://aur.archlinux.org/packages/wireshark-git/

Attached is a new PKGBUILD that updates dependencies, packages and build steps, prepared for 2.6.6. It should also work when 3.0 is released (note that current master which will become 3.0 has some known issues with RPATHs, I'm working on that).
There are also warnings about $srcdir being included in the binaries, as a workaround you can set -fmacro-prefix-map=$srcdir/= (though maybe I'll do this by default in the upstream scripts).
For reproducible builds caveats, see https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15163#c9

Suggestions:
Drop do_not_use_svn_version.patch (current versions will always use the version from the tarball in version.conf)

Drop all --with-xxx options, with CMake unavailable features will automatically be disabled (the current --with-ssl --with-maxmind options have no effect either).
The build function can be as simple as:

build() {
cd "$srcdir/wireshark"
mkdir -p build
cd build

cmake .. -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib
ninja
}

The following (make)depends can be dropped:
- portaudio and gtk3: was needed for GTK+
- bash: was needed for building documentation and the old test suite
- hicolor-icon-theme: I think this can be dropped, it could be a GTK thing. Not sure if it is still needed for Qt.

Extra dependencies:
- qt5-svg: needed for use of SVG resources in menu icons
- snappy, lz4: needed for decompression support in cql (since Wireshark 2.4). I do not know how many people need it, for now I have added -DENABLE_SNAPPY=OFF -DENABLE_LZ4=OFF.
- spandsp: optional for extra codec support. Could be added, I've not done this for now.
- bcg729 (AUR): optional for extra codec support. Not added.

The following package could be changed:
- wireshark-gtk: drop it
- wireshark-common: merge into wireshark-qt since only one GUI exists now.
   PKGBUILD (2.6 KiB)
This task depends upon

Closed by  Levente Polyak (anthraxx)
Thursday, 21 March 2019, 00:11 GMT
Reason for closing:  Implemented
Additional comments about closing:  3.0.0-1
Comment by Eli Schwartz (eschwartz) - Sunday, 20 January 2019, 05:20 GMT
  • Field changed: Task Type (Bug Report → General Gripe)
  • Field changed: Summary ([wireshark] Switch to CMake, remove wireshark-gtk → [wireshark] Switch to CMake, remove wireshark-gtk, PKGBUILD suggestions)
  • Field changed: Status (Unconfirmed → Assigned)
  • Task assigned to Levente Polyak (anthraxx)
Is there a good reason that autotools must be switched away from with such urgency as to do so via a rebuild instead of naturally when it is built for the very next release which as you say drops it anyway?

And I don't understand why a deprecated gtk version must not be built, but as you say, they're removing the code anyway next version so that would be getting dropped in due course from our packaging regardless.

On the topic of unavailable features: some maintainers prefer to explicitly enable feature switches in order to turn their lack into a configure failure rather than automagic *de*configuration. The "configure: WARNING: unrecognized options: --with-ssl, --with-maxmind" can of course be dropped regardless.
Comment by Peter Wu (Lekensteyn) - Sunday, 20 January 2019, 11:15 GMT
An immediate rebuild is not necessary, but as the next release (3.0) is at the end of this month, a switch to CMake will be necessary.

To enable GTK+ on the 2.6 build you have to explicitly pass -DBUILD_wireshark_gtk=ON, but do note that we do not support it anymore. Any bugs reported against the GTK+ GUI will likely go to void.

While autotools --with-foo overrides --with-foo=auto, in CMake it is either enabled or disabled. By default (almost) all features will be enabled when the package is available (see also CMakeOptions.txt). If not available, it will *not* error out but the output will inform you of missing packages:

- The following OPTIONAL packages have been found:
<elided for brevity>
-- The following REQUIRED packages have been found:
<elided for brevity>
-- The following OPTIONAL packages have not been found:

* BCG729, G.729 decoder, <https://www.linphone.org/technical-corner/bcg729/overview>
Support for G.729 codec in RTP player
* DOXYGEN
* Git
* SBC, Bluetooth low-complexity, subband codec (SBC) decoder, <https://git.kernel.org/pub/scm/bluetooth/sbc.git>
Support for playing SBC codec in RTP player
* SMI
* SNAPPY, A fast compressor/decompressor from Google, <http://google.github.io/snappy/>
Snappy decompression in CQL and Kafka dissectors
* SPANDSP, a library of many DSP functions for telephony, <http://www.soft-switch.org/>
Support for G.722 and G.726 codecs in RTP player
* Asciidoctor (required version >= 1.5)
* XSLTPROC

-- Configuring done

PS. if you do run into build or other issues, please let me know. I am an upstream developer, so could improve the build system as needed.
Comment by Peter Wu (Lekensteyn) - Sunday, 20 January 2019, 11:59 GMT
> An immediate rebuild is not necessary.

Though it would be interesting to see if this build would be fixed:
https://tests.reproducible-builds.org/archlinux/community/wireshark/build1.log
Comment by Eli Schwartz (eschwartz) - Sunday, 20 January 2019, 21:38 GMT
The tests.r-b.o build currently works, BTW, so not sure what specific issue you were curious about. It may have just been a temporary failure.
Comment by Peter Wu (Lekensteyn) - Sunday, 20 January 2019, 23:11 GMT
I should have copied the error message :( What I remember is that after "checking for lrelease-qt5... /usr/sbin/lrelease-qt5", it complained that "lrelease-qt5 -version" returned a non-zero exit code.
Comment by Peter Wu (Lekensteyn) - Friday, 01 February 2019, 14:54 GMT
An Arch Linux user in #wireshark asked for G.729 support, so please consider adding bcg729 as dependency (currently in AUR).
And before another VoIP analyst asks for G.722/G.726 support, spandsp could also be added.

As for the release timing, 3.0 has been pushed back to February 20th, see https://wiki.wireshark.org/Development/Roadmap

Should I open a new bug report for bcg729? Or could it be done as part of dropping wireshark-gtk and moving to CMake?
Comment by loqs (loqs) - Friday, 01 February 2019, 19:43 GMT
bcg729 was moved to AUR due to no maintainer interest see https://lists.archlinux.org/pipermail/arch-dev-public/2018-January/029081.html
Comment by Taz (Tazmain) - Monday, 04 February 2019, 12:48 GMT
If someone takes ownership of the bcg729 package can we then get wireshark to have this enabled?
Comment by Levente Polyak (anthraxx) - Monday, 04 February 2019, 12:49 GMT
i will move it back, just relax
Comment by Peter Wu (Lekensteyn) - Monday, 04 February 2019, 12:56 GMT
When you do move back bcg729, consider this version:
https://github.com/Lekensteyn/aur-bcg729/blob/master/PKGBUILD

Upstream bcg729 deprecated autotools (and in fact, the version number in autotools is wrong) but there are other issues, see also
https://gitlab.linphone.org/BC/public/bcg729/issues/2
Comment by Peter Wu (Lekensteyn) - Wednesday, 27 February 2019, 22:58 GMT
2.6.7 has just been released.
3.0.0 would originally be released today, but due to some pending features it might be delayed two days.
Comment by Peter Wu (Lekensteyn) - Friday, 01 March 2019, 00:24 GMT
Attached an updated PKGBUILD for 3.0.0 which has just been released. Changes over the original version:
- Updated to pkgver=3.0.0 and sha512sum
- Added lz4, snappy, spandsp, bcg729 dependencies
- move wireshark binary (instead of installing it directly) to ensure RPATH is stripped
- move icons and mime info to wireshark-qt package since it is only necessary for GUI.
- restored hicolor-icon-theme runtime dependency to satisfy namcap
- Adjusted cmake invocation accordingly to remove -DENABLE_{SNAPPY,LZ4}=OFF
- minor pkgdesc update

One of the new issues in 3.0 is not very important:
wireshark-cli E: Dependency python detected and not included (programs ['python'] needed in scripts ['usr/share/wireshark/help/faq.py'])
this is a bug in the 3.0 packaging, "faq.txt" should have been created and included. In the development version this file is completely gone in favor of an asciidoc file.
Reported here: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15543

Testing performed:

# 1. installed bcg729-1.0.4-3 and wireshark-cli, run tshark --version
# 2. run test suite on a live system (not supported outside the build dir, but I was curious), should pass
sudo pacman -S python3 python-pytest-xdist
sudo gpasswd -a $USER wireshark
bsdtar xf wireshark-3.0.0.tar.xz '*/test' '*/pytest.ini'
cd wireshark-3.0.0
sed /WIRESHARK_RUN_FROM_BUILD_DIRECTORY/d -i test/fixtures_ws.py
pytest . --program-path /usr/bin --skip-missing-programs wireshark,dftest -k "not suite_unittest and not suite_nameres"
# suite_unittest requires the "test-programs" target to be built, "suite_nameres" does not seem to work outside build dir)
# 3. install wireshark-qt, run wireshark --version
# 4. re-run above test suite, but "--skip-missing-programs dftest" only

The version output is ugly, I reported it here:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15544

Another proposal is to simplify the setcap invocation in wireshark.install (for easier copy&paste):
setcap cap_net_raw,cap_net_admin,cap_dac_override+eip usr/bin/dumpcap
   PKGBUILD (2.7 KiB)
Comment by Levente Polyak (anthraxx) - Friday, 01 March 2019, 00:29 GMT
Thanks a lot for your verbose and helpful contribution, i will in-cooperate the proposed changes in a timely manner
Comment by Peter Weber (hoschi) - Wednesday, 06 March 2019, 10:31 GMT
Hello!

Can we keep wireshark-gtk (or wireshark-legacy) in the repositories? I' have nothing against Qt, but the freedom of choice is more pleasant.
Comment by Jake Kreiger (Magali75) - Wednesday, 06 March 2019, 12:55 GMT
@hoschi

upstream doesn't provide wireshark-gtk anymore and Arch isn't supposed to host dead soft in their repos. luckily you have a total freedom of sticking to current version and refuse to update.
Comment by Peter Weber (hoschi) - Wednesday, 06 March 2019, 13:11 GMT
I hope, that some people take care about the source for 2.6-series upstream. Currently Wireshark itself provides 2.6.7(!) labeled as oldstable, which maybe indicates that it isn't dead and will receive fixes. If not I'm already thinking about AUR :)
Comment by Peter Wu (Lekensteyn) - Wednesday, 06 March 2019, 15:05 GMT
You could create a wireshark-26 or wireshark-gtk package in AUR, but I would not recommend it. We (Wireshark upstream) have disabled GTK+ by default in 2.4 and finally removed the last traces in 3.0 and will not provide more updates to the GTK UI. Maintaining two GUIs is no fun, it slows down addition of features/fixes as both GUI parts has to be modified. Each of them have their own quirks.

If you have any issues with the Qt UI, please report them upstream such that we can work on addressing it.

If you do decide to stick to 2.6, you are free to do, note that the EOL date is October 2020: https://wiki.wireshark.org/Development/LifeCycle
A custom package depends on gtk3 and optionally depends on portaudio for the RTP Player. To explicitly disable Qt and build GTK only, use cmake -DBUILD_wireshark=OFF -DBUILD_wireshark_gtk=ON.
(If it was not clear, Arch itself should stick to Qt and the 3.0 release.)
Comment by Peter Weber (hoschi) - Wednesday, 06 March 2019, 15:13 GMT
Thank you for the clarification and helping notes :)

Loading...