Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wireshark: Add Darwin support #36162

Merged
merged 1 commit into from Mar 3, 2018
Merged

wireshark: Add Darwin support #36162

merged 1 commit into from Mar 3, 2018

Conversation

Kaali
Copy link

@Kaali Kaali commented Mar 1, 2018

Motivation for this change

wireshark did not work for Darwin.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

I'm not sure why tshark plugins have correct dynamic library paths, but the Wireshark.app does not.

CMake patch fixes a problem where CMake cannot detect compiler features.

@GrahamcOfBorg GrahamcOfBorg added the 6.topic: darwin Running or building packages on Darwin label Mar 1, 2018
@globin
Copy link
Member

globin commented Mar 1, 2018

This PR is conflicting

@Mic92
Copy link
Member

Mic92 commented Mar 1, 2018

@GrahamcOfBorg build wireshark

# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#

+cmake_minimum_required(VERSION 3.7)
Copy link
Member

@Mic92 Mic92 Mar 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be merged as it is, but could you also try to send the patch upstream? This makes future updates easier.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this looks interesting too you? @alagoutte
It fixes compilation in nixpkgs on macOS for us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the problem here is that the minimum version must be defined before project. Otherwise it complains about clang.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Yes, you can propose the fix on upstream

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Partial log (click to expand)

/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4/Applications/Wireshark.app/Contents/Frameworks/libwireshark.10.1.4.dylib: fixing dylib
/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4/Applications/Wireshark.app/Contents/Frameworks/libwiretap.7.0.4.dylib: fixing dylib
/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4/Applications/Wireshark.app/Contents/Frameworks/libwscodecs.1.1.0.dylib: fixing dylib
/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4/Applications/Wireshark.app/Contents/Frameworks/libwsutil.8.0.0.dylib: fixing dylib
/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4/lib/libwireshark.10.1.4.dylib: fixing dylib
/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4/lib/libwiretap.7.0.4.dylib: fixing dylib
/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4/lib/libwscodecs.1.1.0.dylib: fixing dylib
/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4/lib/libwsutil.8.0.0.dylib: fixing dylib
postPatchMkspecs
/nix/store/jmsbd19ncx3i5sdbkc9bwd2m8z2aijv0-wireshark-qt-2.4.4

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

shrinking /nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4/lib/libwireshark.so.10.1.4
shrinking /nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4/lib/libwsutil.so.8.0.0
shrinking /nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4/lib/libwscodecs.so.1.1.0
gzipping man pages under /nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4/share/man/
strip is /nix/store/b0zlxla7dmy1iwc3g459rjznx59797xy-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4/lib  /nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4/bin 
patching script interpreter paths in /nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4
checking for references to /tmp/nix-build-wireshark-qt-2.4.4.drv-0 in /nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4...
postPatchMkspecs
/nix/store/gv05ax3ibk0d8banm1g5paaq76a6cppa-wireshark-qt-2.4.4

done

wrapProgram $out/Applications/Wireshark.app/Contents/MacOS/Wireshark \
--set QT_PLUGIN_PATH ${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ttuegel I don't how much you know about qt on macOS, but is this the canonical solution?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I copied it from another derivation. Still learning the ropes.

Copy link
Member

@Mic92 Mic92 Mar 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually it is read from your profile, for example ~/.nix-profile/lib/qt-5.10
But I am not sure about macOS.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have an example how that is done?

I browsed through different QT_PLUGIN_PATH styles. Some are the same as here, some use --prefix when adding to it. Some set it to be specific to the application in question.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is only set on nixos:

$ echo $QT_PLUGIN_PATH
/etc/profiles/per-user/joerg/lib/qt4/plugins:/etc/profiles/per-user/joerg/lib/kde4/plugins:/home/joerg/.nix-profile/lib/qt4/plugins:/home/joerg/.nix-profile/lib/kde4/plugins:/nix/var/nix/profiles/default/lib/qt4/plugins:/nix/var/nix/profiles/default/lib/kde4/plugins:/run/current-system/sw/lib/qt4/plugins:/run/current-system/sw/lib/kde4/plugins

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

shrinking /nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4/bin/tfshark
shrinking /nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4/bin/tshark
shrinking /nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4/bin/wireshark
gzipping man pages under /nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4/share/man/
strip is /nix/store/lvx1acn1ig1j2km8jds5x3ggh3f2wa8v-binutils-2.28.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4/lib  /nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4/bin
patching script interpreter paths in /nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4
checking for references to /build in /nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4...
postPatchMkspecs
/nix/store/n6x446sn4fmy4chf55flrv1xdy0g0rj4-wireshark-qt-2.4.4

@Mic92 Mic92 merged commit ab59aa7 into NixOS:master Mar 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants