python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / gnuradio-modules / grnet / default.nix
blobfc12abd8cfa5c1df8ba30b9f21b3c217f2325089
1 { lib
2 , mkDerivation
3 , fetchFromGitHub
4 , fetchpatch
5 , gnuradio
6 , cmake
7 , pkg-config
8 , boost
9 , log4cpp
10 , python
11 , swig
12 , mpir
13 , gmp
14 , doxygen
15 , libpcap
16 , icu
17 , thrift
20 let
21   # Each GR major version requires us to pull a specific git revision of the repository
22   version = {
23     "3.7" = {
24       # Last git revision from the `maint-3.7` branch:
25       # https://github.com/ghostop14/gr-grnet/tree/maint-3.7
26       name = "unstable-2019-08-06";
27       gitHash = "beb1cd75d006a982c0a9536e923800c5a0575451";
28     };
29     "3.8" = {
30       # Last git revision from the `maint-3.8` branch:
31       # https://github.com/ghostop14/gr-grnet/tree/maint-3.8
32       name = "unstable-2020-11-20";
33       gitHash = "b02016043b67a15f27134a4f0b0d43f5d1b9ed6d";
34     };
35     "3.9" = {
36       # This revision is taken from the `master` branch.
37       name = "unstable-2020-12-30";
38       gitHash = "e6dfd140cfda715de9bcef4c1116fcacfeb0c606";
39     };
40   }.${gnuradio.versionAttr.major};
41   src = fetchFromGitHub {
42     owner = "ghostop14";
43     repo = "gr-grnet";
44     rev = "${version.gitHash}";
45     sha256 = {
46       "3.7" = "LLQ0Jf0Oapecu9gj4IgxOdK7O/OSbHnwNk000GlODxk=";
47       "3.8" = "vO8l8nV1/yEQf7pKqBbzIg4KkyCyWu+OkKgISyI3PaQ=";
48       "3.9" = "NsL7HCOQmGyexzpH2qbzv8Bq4bsfiDTNEUi96QDOA/g=";
49     }.${gnuradio.versionAttr.major};
50   };
52 mkDerivation {
53   pname = "gr-grnet";
54   version = version.name;
55   inherit src;
56   disabledForGRafter = "3.10";
58   patches = [
59     # Use cross platform struct ip instead of iphdr
60     # https://github.com/ghostop14/gr-grnet/pull/19
61     (fetchpatch {
62       name = "fix-compilation-on-darwin.patch";
63       url = "https://github.com/ghostop14/gr-grnet/commit/52c07daa9ba595b76ffa5dd90c0c96694d95d140.patch";
64       sha256 = "sha256-1gJaYLIn09blOhALMfBPROt5YBXaosG41Vsd3+5h518=";
65     })
66   ];
68   buildInputs = [
69     boost
70     log4cpp
71     doxygen
72     mpir
73     gmp
74     libpcap
75     icu
76   ] ++ (if lib.versionAtLeast gnuradio.versionAttr.major "3.9" then with python.pkgs; [
77     pybind11
78     numpy
79   ] else [
80     swig
81     thrift
82     python.pkgs.thrift
83   ]);
84   nativeBuildInputs = [
85     cmake
86     pkg-config
87   ];
89   meta = with lib; {
90     description = "GNURadio TCP/UDP source and sink blocks rewritten in C++/Boost";
91     homepage = "https://github.com/ghostop14/gr-grnet";
92     license = licenses.gpl3Plus;
93     maintainers = with maintainers; [ chuangzhu ];
94     platforms = platforms.unix;
95   };