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

ettercap: fix pango not finding hb.h from harfbuzz #75789

Closed
wants to merge 1 commit into from

Conversation

mkg20001
Copy link
Member

Motivation for this change

It's broken, fixed it

The error message

In file included from /nix/store/6n6icd9pmmzdl7k39mdksv3k8y2z1bfn-pango-1.44.7-dev/include/pango-1.0/pango/pango-font.h:25,
                 from /nix/store/6n6icd9pmmzdl7k39mdksv3k8y2z1bfn-pango-1.44.7-dev/include/pango-1.0/pango/pango-attributes.h:25,
                 from /nix/store/6n6icd9pmmzdl7k39mdksv3k8y2z1bfn-pango-1.44.7-dev/include/pango-1.0/pango/pango.h:25,
                 from /nix/store/i1akaw2n7ryr3gms1yap6i463j9819xw-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdktypes.h:35,
                 from /nix/store/i1akaw2n7ryr3gms1yap6i463j9819xw-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30,
                 from /nix/store/i1akaw2n7ryr3gms1yap6i463j9819xw-gtk+3-3.24.12-dev/include/gtk-3.0/gdk/gdk.h:32,
                 from /nix/store/i1akaw2n7ryr3gms1yap6i463j9819xw-gtk+3-3.24.12-dev/include/gtk-3.0/gtk/gtk.h:30,
                 from /build/source/src/interfaces/gtk3/ec_gtk3.h:4,
                 from /build/source/src/ec_interfaces.c:31:
/nix/store/6n6icd9pmmzdl7k39mdksv3k8y2z1bfn-pango-1.44.7-dev/include/pango-1.0/pango/pango-coverage.h:28:10: fatal error: hb.h: No such file or directory
 #include <hb.h>
          ^~~~~~
compilation terminated.
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @pSub

@jonringer
Copy link
Contributor

I think the the main thing is that most documentation says to do:

#include<hb.h>

but they publish the headers as $dev/include/harfbuzz/hb*

In their defense, the harfbuzz.pc correctly states the includedir, but a lot of packages seem to disregard this.

@worldofpeace
Copy link
Contributor

I think this PR fixes it upstream https://github.com/Ettercap/ettercap/pull/969/files. Can you apply it here?

@mkg20001
Copy link
Member Author

Still the same

diff --git a/pkgs/applications/networking/sniffers/ettercap/default.nix b/pkgs/applications/networking/sniffers/ettercap/default.nix
index 164d11bd39f..5ca7aac7468 100644
--- a/pkgs/applications/networking/sniffers/ettercap/default.nix
+++ b/pkgs/applications/networking/sniffers/ettercap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libpcap, libnet, zlib, curl, pcre
+{ stdenv, fetchFromGitHub, fetchpatch, cmake, libpcap, libnet, zlib, curl, pcre
 , openssl, ncurses, glib, gtk3, atk, pango, flex, bison, geoip, harfbuzz
 , pkgconfig }:
 
@@ -13,6 +13,13 @@ stdenv.mkDerivation rec {
     sha256 = "0m40bmbrv9a8qlg54z3b5f8r541gl9vah5hm0bbqcgyyljpg39bz";
   };
 
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/Ettercap/ettercap/compare/ebc85131c656ea13907195b6e1981e0f8c121c50...78da46d1488fa9903344fc993555461f54ae9c6a.diff";
+      sha256 = "02nzps4ca3d20gvykyaz8qjnsgjvks2czfmq8ic9xk17v2pn19ji";
+    })
+  ];
+
   strictDeps = true;
   nativeBuildInputs = [ cmake flex bison pkgconfig ];
   buildInputs = [
@@ -31,8 +38,6 @@ stdenv.mkDerivation rec {
     "-DGTK3_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
   ];
 
-  NIX_CFLAGS_COMPILE = [ "-I${harfbuzz.dev}/include/harfbuzz" ];
-
   meta = with stdenv.lib; {
     description = "Comprehensive suite for man in the middle attacks";
     homepage = http://ettercap.github.io/ettercap/;

@primeos
Copy link
Member

primeos commented Feb 24, 2020

Thanks, I pushed this in b9f7819 (with an additional TODO).

It should work with the next release / Ettercap/ettercap@02960cb but NIX_CFLAGS_COMPILE should be fine for the meantime (it's hacky but definitely way better than a broken build and cherry-picking patches can sometimes also cause problems).

@primeos primeos closed this Feb 24, 2020
worldofpeace pushed a commit that referenced this pull request Feb 24, 2020
@worldofpeace
Copy link
Contributor

backported to 20.03 in 834841c

Atemu added a commit to Atemu/nixpkgs that referenced this pull request Aug 13, 2020
Atemu added a commit to Atemu/nixpkgs that referenced this pull request Aug 13, 2020
Atemu added a commit to Atemu/nixpkgs that referenced this pull request Aug 13, 2020
alyssais pushed a commit that referenced this pull request Aug 16, 2020
alyssais pushed a commit that referenced this pull request Aug 16, 2020
wchresta pushed a commit to wchresta/nixpkgs that referenced this pull request Aug 17, 2020
wchresta pushed a commit to wchresta/nixpkgs that referenced this pull request Aug 17, 2020
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

4 participants