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

driftnet: 1.1.5 -> 1.3.0 #107870

Merged
merged 1 commit into from Jan 31, 2021
Merged

Conversation

siraben
Copy link
Member

@siraben siraben commented Dec 29, 2020

Motivation for this change

Would also be good if someone could unbreak the darwin build. Currently fails with log

layer2.c:22:14: fatal error: 'netinet/ether.h' file not found
    #include <netinet/ether.h>
             ^~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [Makefile:356: layer2.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/private/tmp/nix-build-driftnet-1.3.0.drv-0/source/src/network'
make[1]: *** [Makefile:456: all-recursive] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-driftnet-1.3.0.drv-0/source/src'
make: *** [Makefile:430: all-recursive] Error 1
builder for '/nix/store/5b9s1wav6arj2vr9fzz1mjsfmh1zhw73-driftnet-1.3.0.drv' failed with exit code 2
error: build of '/nix/store/5b9s1wav6arj2vr9fzz1mjsfmh1zhw73-driftnet-1.3.0.drv' failed
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 nixpkgs-review --run "nixpkgs-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.

@fabaff
Copy link
Member

fabaff commented Dec 29, 2020

Result of nixpkgs-review pr 107870 run on x86_64-linux 1

1 package built:
  • driftnet

Copy link
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

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

Sorry, I can't help with darwin.

Can you please update the license? gpl2 is a deprecated license, check if the project uses gpl2Plus or gpl2Only and change meta.license accordingly. At first glances it looks that it's gpl2Only.

@siraben
Copy link
Member Author

siraben commented Dec 29, 2020

Sorry, I can't help with darwin.

Can you please update the license? gpl2 is a deprecated license, check if the project uses gpl2Plus or gpl2Only and change meta.license accordingly. At first glances it looks that it's gpl2Only.

I opened an issue deiv/driftnet#32, hopefully the author sees it. If no response, I'll switch it to gpl2Only.

@mjlbach
Copy link
Contributor

mjlbach commented Dec 29, 2020

diff --git a/src/compat/compat.h b/src/compat/compat.h
index 6add422..ea80406 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -17,7 +17,7 @@
     #include <config.h>
 #endif
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
     #include <sys/types.h>
 #endif
 
diff --git a/src/network/layer2.c b/src/network/layer2.c
index 763f0ac..2497b72 100644
--- a/src/network/layer2.c
+++ b/src/network/layer2.c
@@ -14,7 +14,7 @@
 
 #include <string.h>
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
 #else
@@ -29,7 +29,7 @@
 /*
  * Freebsd and Cygwin doesn't define 'ethhdr'
  */
-#if defined(__FreeBSD__) || defined(__CYGWIN__)
+#if defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__APPLE__)
 
 #define ETH_ALEN	6			/* Octets in one ethernet addr	 */
 #define ETH_P_IP	0x0800		/* Internet Protocol packet	*/
diff --git a/src/network/layer3.c b/src/network/layer3.c
index 7864126..aae2041 100644
--- a/src/network/layer3.c
+++ b/src/network/layer3.c
@@ -15,7 +15,7 @@
 #include <string.h>
 #include <assert.h>
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
 #include <netinet/in_systm.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
diff --git a/src/pid.c b/src/pid.c
index 621834e..94e7dcc 100644
--- a/src/pid.c
+++ b/src/pid.c
@@ -14,7 +14,7 @@
 
 #include "compat/compat.h"
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__APPLE__)
 #include <sys/stat.h>
 #endif
 #include <fcntl.h>

Does this patch fix it?

@siraben
Copy link
Member Author

siraben commented Dec 29, 2020

Does this patch fix it?

Yep! Thanks!

@siraben
Copy link
Member Author

siraben commented Dec 29, 2020

Result of nixpkgs-review pr 107870 run on x86_64-darwin 1

1 package built:
  • driftnet

@mjlbach
Copy link
Contributor

mjlbach commented Dec 29, 2020

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 107870 run on x86_64-linux 1

1 package built:
  • driftnet

gpl2 is a deprecated license, check if project uses gpl2Plus or gpl2Only and change meta.license accordingly.

@SuperSandro2000
Copy link
Member

Result of nixpkgs-review pr 107870 run on x86_64-darwin 1

1 package built:
  • driftnet

@siraben siraben force-pushed the driftnet-update branch 2 times, most recently from bbd8c1a to 5641ed7 Compare January 8, 2021 03:01
@SuperSandro2000 SuperSandro2000 merged commit 78291d9 into NixOS:master Jan 31, 2021
@siraben siraben deleted the driftnet-update branch February 1, 2021 01:46
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