gnuradio: Fix 2 upstream issues

This commit is contained in:
Doron Behar 2021-10-21 15:45:38 +03:00
parent d60a4a4492
commit a7851a7a96
4 changed files with 60 additions and 0 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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))

View file

@ -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'))