diff options
author | Doron Behar <doron.behar@gmail.com> | 2021-10-21 15:45:38 +0300 |
---|---|---|
committer | Doron Behar <doron.behar@gmail.com> | 2021-10-23 23:02:21 +0300 |
commit | a7851a7a96558a9ec9c46642c78b884da045dd77 (patch) | |
tree | 698c0e314ec0704a5cdb06f073cbb9e12ca4b1c3 /pkgs/applications/radio/gnuradio | |
parent | d60a4a44924a1def6040cd9c71ca6807e15c31f7 (diff) |
gnuradio: Fix 2 upstream issues
Diffstat (limited to 'pkgs/applications/radio/gnuradio')
4 files changed, 60 insertions, 0 deletions
diff --git a/pkgs/applications/radio/gnuradio/3.8.nix b/pkgs/applications/radio/gnuradio/3.8.nix index f8f929110a86a..fa4db241692f0 100644 --- a/pkgs/applications/radio/gnuradio/3.8.nix +++ b/pkgs/applications/radio/gnuradio/3.8.nix @@ -1,5 +1,6 @@ { lib, stdenv , fetchFromGitHub +, fetchpatch , cmake # Remove gcc and python references , removeReferencesTo @@ -227,6 +228,15 @@ stdenv.mkDerivation rec { dontWrapQtApps meta ; + patches = [ + # Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227 + ./modtool-newmod-permissions.3_8.patch + (fetchpatch { + # https://github.com/gnuradio/gnuradio/pull/5226 + url = "https://github.com/gnuradio/gnuradio/commit/9d7343526dd793120b6425cd9a6969416ed32503.patch"; + sha256 = "sha256-usSoRDDuClUfdX4yFbQNu8wDzve6UEhZYTFj1oZbFic="; + }) + ]; passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must inherit boost volk; diff --git a/pkgs/applications/radio/gnuradio/default.nix b/pkgs/applications/radio/gnuradio/default.nix index a221e5444bbba..ff2b0a6278b91 100644 --- a/pkgs/applications/radio/gnuradio/default.nix +++ b/pkgs/applications/radio/gnuradio/default.nix @@ -252,6 +252,15 @@ stdenv.mkDerivation rec { dontWrapQtApps meta ; + patches = [ + # Not accepted upstream, see https://github.com/gnuradio/gnuradio/pull/5227 + ./modtool-newmod-permissions.patch + (fetchpatch { + # https://github.com/gnuradio/gnuradio/pull/5225 + url = "https://github.com/gnuradio/gnuradio/commit/4cef46e3ea0faf04e05ca1a5846cd1568fa51bb2.patch"; + sha256 = "sha256-6AlGbtD1S0c3I9JSoLTMP4YqwDU17i2j+XRkuR+QTuc="; + }) + ]; passthru = shared.passthru // { # Deps that are potentially overriden and are used inside GR plugins - the same version must inherit boost volk; diff --git a/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_8.patch b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_8.patch new file mode 100644 index 0000000000000..f6a6a06e89c47 --- /dev/null +++ b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.3_8.patch @@ -0,0 +1,26 @@ +commit bf870157e0a9c3d19e968afb276b4e7d96b4df30 +Author: Doron Behar <doron.behar@gmail.com> +Date: Thu Oct 21 13:10:42 2021 +0300 + + gr-modtool: Don't copy source permissions + + This is needed for systems such as NixOS, where the build tree isn't + writable and the files copied should be. + + Signed-off-by: Doron Behar <doron.behar@gmail.com> + +diff --git a/gr-utils/python/modtool/core/newmod.py b/gr-utils/python/modtool/core/newmod.py +index 123059907..0c734e7ae 100644 +--- a/gr-utils/python/modtool/core/newmod.py ++++ b/gr-utils/python/modtool/core/newmod.py +@@ -78,7 +78,9 @@ class ModToolNewModule(ModTool): + self._setup_scm(mode='new') + logger.info("Creating out-of-tree module in {}...".format(self.dir)) + try: +- shutil.copytree(self.srcdir, self.dir) ++ # https://stackoverflow.com/a/17022146/4935114 ++ shutil.copystat = lambda x, y: x ++ shutil.copytree(self.srcdir, self.dir, copy_function=shutil.copyfile) + os.chdir(self.dir) + except OSError: + raise ModToolException('Could not create directory {}.'.format(self.dir)) diff --git a/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.patch b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.patch new file mode 100644 index 0000000000000..7cab73fede0cc --- /dev/null +++ b/pkgs/applications/radio/gnuradio/modtool-newmod-permissions.patch @@ -0,0 +1,15 @@ +diff --git c/gr-utils/modtool/core/newmod.py w/gr-utils/modtool/core/newmod.py +index babebfcde..9a02f663e 100644 +--- c/gr-utils/modtool/core/newmod.py ++++ w/gr-utils/modtool/core/newmod.py +@@ -62,7 +62,9 @@ class ModToolNewModule(ModTool): + self._setup_scm(mode='new') + logger.info(f"Creating out-of-tree module in {self.dir}...") + try: +- shutil.copytree(self.srcdir, self.dir) ++ # https://stackoverflow.com/a/17022146/4935114 ++ shutil.copystat = lambda x, y: x ++ shutil.copytree(self.srcdir, self.dir, copy_function=shutil.copyfile) + try: + shutil.copyfile(os.path.join(gr.prefix(), 'share', 'gnuradio', 'clang-format.conf'), + os.path.join(self.dir, '.clang-format')) |