diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix index f3a56cfdb055..301193a65785 100644 --- a/pkgs/applications/radio/gnuradio/3.8.nix +++ b/pkgs/applications/radio/gnuradio/3.8.nix @@ -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) [ diff --git a/pkgs/applications/radio/gnuradio/3.9.nix b/pkgs/applications/radio/gnuradio/3.9.nix index 29998fb2097a..e54c502060a2 100644 --- a/pkgs/applications/radio/gnuradio/3.9.nix +++ b/pkgs/applications/radio/gnuradio/3.9.nix @@ -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 '' ; diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index 01fa40ebcf3c..39aa9336aec9 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -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 '' ; diff --git a/pkgs/applications/radio/gnuradio/shared.nix b/pkgs/applications/radio/gnuradio/shared.nix index acb13cc1e2a3..a5ae83eb3513 100644 --- a/pkgs/applications/radio/gnuradio/shared.nix +++ b/pkgs/applications/radio/gnuradio/shared.nix @@ -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 ]; }; } diff --git a/pkgs/applications/radio/gnuradio/wrapper.nix b/pkgs/applications/radio/gnuradio/wrapper.nix index 57d8f75320bb..926022353e41 100644 --- a/pkgs/applications/radio/gnuradio/wrapper.nix +++ b/pkgs/applications/radio/gnuradio/wrapper.nix @@ -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 diff --git a/pkgs/development/gnuradio-modules/grnet/default.nix b/pkgs/development/gnuradio-modules/grnet/default.nix index 6e8b72a6565b..fc12abd8cfa5 100644 --- a/pkgs/development/gnuradio-modules/grnet/default.nix +++ b/pkgs/development/gnuradio-modules/grnet/default.nix @@ -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 diff --git a/pkgs/development/gnuradio-modules/osmosdr/default.nix b/pkgs/development/gnuradio-modules/osmosdr/default.nix index b0c7a43c8e4c..20fe12826671 100644 --- a/pkgs/development/gnuradio-modules/osmosdr/default.nix +++ b/pkgs/development/gnuradio-modules/osmosdr/default.nix @@ -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 diff --git a/pkgs/development/libraries/libad9361/default.nix b/pkgs/development/libraries/libad9361/default.nix index 74707897bd0c..115f37161553 100644 --- a/pkgs/development/libraries/libad9361/default.nix +++ b/pkgs/development/libraries/libad9361/default.nix @@ -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; }; } diff --git a/pkgs/development/libraries/libiio/default.nix b/pkgs/development/libraries/libiio/default.nix index 400da08cab32..c495935e1402 100644 --- a/pkgs/development/libraries/libiio/default.nix +++ b/pkgs/development/libraries/libiio/default.nix @@ -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 ]; }; } diff --git a/pkgs/development/libraries/qwt/default.nix b/pkgs/development/libraries/qwt/default.nix index e74f8300bf72..9a2a53587e48 100644 --- a/pkgs/development/libraries/qwt/default.nix +++ b/pkgs/development/libraries/qwt/default.nix @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ac655751e7c3..5bb6ee76bac7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 {