Merge pull request #197639 from jiegec/gnuradio-darwin
This commit is contained in:
@@ -271,11 +271,11 @@ stdenv.mkDerivation rec {
|
||||
# order to build, see https://github.com/qradiolink/qradiolink/issues/67
|
||||
++ lib.optionals (hasFeature "gr-vocoder") [
|
||||
"-DLIBCODEC2_FOUND=TRUE"
|
||||
"-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so"
|
||||
"-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
"-DLIBCODEC2_INCLUDE_DIRS=${codec2}/include"
|
||||
"-DLIBCODEC2_HAS_FREEDV_API=ON"
|
||||
"-DLIBGSM_FOUND=TRUE"
|
||||
"-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so"
|
||||
"-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
"-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm"
|
||||
]
|
||||
++ lib.optionals (hasFeature "volk" && volk != null) [
|
||||
|
||||
@@ -296,7 +296,7 @@ stdenv.mkDerivation rec {
|
||||
# This is the only python reference worth removing, if needed.
|
||||
+ lib.optionalString (!hasFeature "python-support") ''
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime.so)
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake
|
||||
''
|
||||
;
|
||||
|
||||
@@ -317,7 +317,7 @@ stdenv.mkDerivation rec {
|
||||
# This is the only python reference worth removing, if needed.
|
||||
+ lib.optionalString (!hasFeature "python-support") ''
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime.so)
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake
|
||||
''
|
||||
;
|
||||
|
||||
@@ -84,7 +84,11 @@ rec {
|
||||
postInstall = ""
|
||||
# Gcc references
|
||||
+ lib.optionalString (hasFeature "gnuradio-runtime") ''
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime.so)
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
|
||||
''
|
||||
# Clang references in InstalledDir
|
||||
+ lib.optionalString (hasFeature "gnuradio-runtime" && stdenv.isDarwin) ''
|
||||
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
|
||||
''
|
||||
;
|
||||
# NOTE: Outputs are disabled due to upstream not using GNU InstallDIrs cmake
|
||||
@@ -112,7 +116,6 @@ rec {
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
broken = stdenv.isDarwin;
|
||||
description = "Software Defined Radio (SDR) software";
|
||||
longDescription = ''
|
||||
GNU Radio is a free & open-source software development toolkit that
|
||||
@@ -126,6 +129,6 @@ rec {
|
||||
homepage = "https://www.gnuradio.org";
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ doronbehar bjornfor fpletz ];
|
||||
maintainers = with maintainers; [ doronbehar bjornfor fpletz jiegec ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -98,19 +98,21 @@ let
|
||||
"${
|
||||
lib.makeSearchPath
|
||||
unwrapped.qt.qtbase.qtPluginPrefix
|
||||
(builtins.map lib.getBin [
|
||||
(builtins.map lib.getBin ([
|
||||
unwrapped.qt.qtbase
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
unwrapped.qt.qtwayland
|
||||
])
|
||||
]))
|
||||
}"
|
||||
"--prefix" "QML2_IMPORT_PATH" ":"
|
||||
"${
|
||||
lib.makeSearchPath
|
||||
unwrapped.qt.qtbase.qtQmlPrefix
|
||||
(builtins.map lib.getBin [
|
||||
(builtins.map lib.getBin ([
|
||||
unwrapped.qt.qtbase
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
unwrapped.qt.qtwayland
|
||||
])
|
||||
]))
|
||||
}"
|
||||
]
|
||||
else
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{ lib
|
||||
, mkDerivation
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, gnuradio
|
||||
, cmake
|
||||
, pkg-config
|
||||
@@ -54,6 +55,16 @@ mkDerivation {
|
||||
inherit src;
|
||||
disabledForGRafter = "3.10";
|
||||
|
||||
patches = [
|
||||
# Use cross platform struct ip instead of iphdr
|
||||
# https://github.com/ghostop14/gr-grnet/pull/19
|
||||
(fetchpatch {
|
||||
name = "fix-compilation-on-darwin.patch";
|
||||
url = "https://github.com/ghostop14/gr-grnet/commit/52c07daa9ba595b76ffa5dd90c0c96694d95d140.patch";
|
||||
sha256 = "sha256-1gJaYLIn09blOhALMfBPROt5YBXaosG41Vsd3+5h518=";
|
||||
})
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
boost
|
||||
log4cpp
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, darwin
|
||||
, mkDerivation
|
||||
, fetchgit
|
||||
, gnuradio
|
||||
@@ -58,6 +60,9 @@ in mkDerivation {
|
||||
] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [
|
||||
thrift
|
||||
python.pkgs.thrift
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.IOKit
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
];
|
||||
cmakeFlags = [
|
||||
(if (gnuradio.hasFeature "python-support") then
|
||||
|
||||
@@ -15,11 +15,19 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ libiio ];
|
||||
|
||||
postPatch = lib.optionalString stdenv.isDarwin ''
|
||||
# Fix iio include path on darwin to match linux
|
||||
for i in test/*.c; do
|
||||
substituteInPlace $i \
|
||||
--replace 'iio/iio.h' 'iio.h'
|
||||
done
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "IIO AD9361 library for filter design and handling, multi-chip sync, etc";
|
||||
homepage = "http://analogdevicesinc.github.io/libad9361-iio/";
|
||||
license = licenses.lgpl21Plus;
|
||||
maintainers = with maintainers; [ sikmir ];
|
||||
platforms = platforms.linux;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,11 +10,14 @@
|
||||
, libaio
|
||||
, runtimeShell
|
||||
, lib
|
||||
, pkg-config
|
||||
, CFNetwork
|
||||
, CoreServices
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "libiio";
|
||||
version = "0.23";
|
||||
version = "0.24";
|
||||
|
||||
outputs = [ "out" "lib" "dev" "python" ];
|
||||
|
||||
@@ -22,7 +25,7 @@ stdenv.mkDerivation rec {
|
||||
owner = "analogdevicesinc";
|
||||
repo = "libiio";
|
||||
rev = "v${version}";
|
||||
sha256 = "0awny9zb43dcnxa5jpxay2zxswydblnbn4x6vi5mlw1r48pzhjf8";
|
||||
sha256 = "sha256-c5HsxCdp1cv5BGTQ/8dc8J893zk9ntbfAudLpqoQ1ow=";
|
||||
};
|
||||
|
||||
# Revert after https://github.com/NixOS/nixpkgs/issues/125008 is
|
||||
@@ -33,6 +36,7 @@ stdenv.mkDerivation rec {
|
||||
cmake
|
||||
flex
|
||||
bison
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
@@ -40,12 +44,17 @@ stdenv.mkDerivation rec {
|
||||
libxml2
|
||||
libusb1
|
||||
avahi
|
||||
libaio
|
||||
] ++ lib.optional python.isPy3k python.pkgs.setuptools;
|
||||
] ++ lib.optional python.isPy3k python.pkgs.setuptools
|
||||
++ lib.optional stdenv.isLinux libaio
|
||||
++ lib.optionals stdenv.isDarwin [ CFNetwork CoreServices ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DUDEV_RULES_INSTALL_DIR=${placeholder "out"}/lib/udev/rules.d"
|
||||
"-DPYTHON_BINDINGS=on"
|
||||
# osx framework is disabled,
|
||||
# the linux-like directory structure is used for proper output splitting
|
||||
"-DOSX_PACKAGE=off"
|
||||
"-DOSX_FRAMEWORK=off"
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
@@ -65,7 +74,7 @@ stdenv.mkDerivation rec {
|
||||
description = "API for interfacing with the Linux Industrial I/O Subsystem";
|
||||
homepage = "https://github.com/analogdevicesinc/libiio";
|
||||
license = licenses.lgpl21Plus;
|
||||
platforms = platforms.linux;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
maintainers = with maintainers; [ thoughtpolice ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchurl, qtbase, qtsvg, qttools, qmake }:
|
||||
{ lib, stdenv, fetchurl, qtbase, qtsvg, qttools, qmake, fixDarwinDylibNames }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "qwt";
|
||||
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ qtbase qtsvg qttools ];
|
||||
nativeBuildInputs = [ qmake ];
|
||||
nativeBuildInputs = [ qmake ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
postPatch = ''
|
||||
sed -e "s|QWT_INSTALL_PREFIX.*=.*|QWT_INSTALL_PREFIX = $out|g" -i qwtconfig.pri
|
||||
|
||||
@@ -20030,6 +20030,7 @@ with pkgs;
|
||||
libgxps = callPackage ../development/libraries/libgxps { };
|
||||
|
||||
libiio = callPackage ../development/libraries/libiio {
|
||||
inherit (darwin.apple_sdk.frameworks) CFNetwork CoreServices;
|
||||
python = python3;
|
||||
};
|
||||
|
||||
@@ -28265,7 +28266,7 @@ with pkgs;
|
||||
python = python3;
|
||||
};
|
||||
};
|
||||
gnuradio3_9Packages = lib.recurseIntoAttrs gnuradio.pkgs;
|
||||
gnuradio3_9Packages = lib.recurseIntoAttrs gnuradio3_9.pkgs;
|
||||
# A build without gui components and other utilites not needed for end user
|
||||
# libraries
|
||||
gnuradio3_9Minimal = gnuradio.override {
|
||||
|
||||
Reference in New Issue
Block a user