Merge branch 'next' into dev

This commit is contained in:
Ryan Volz 2022-02-24 15:06:48 -05:00
commit 8e9b2f4aac
6 changed files with 126 additions and 16 deletions

View File

@ -17,14 +17,16 @@ and support for the following SDR devices and device libraries:
| [ADALM-PLUTO][1] | libiio ([setup](#iio-pluto-sdr)) |
| [Airspy R2/Mini/HF+][2] | airspy/airspyhf ([setup](#airspy-r2-mini-hf)) |
| [Ettus USRPs][3] | UHD ([setup](#uhd-ettus-usrp)) |
| [HackRF][4] | HackRF ([setup](#hackrf)) |
| [LimeSDR][4] | Lime Suite ([setup](#limesdr)) |
| [RTL-SDR][5] | rtl-sdr ([setup](#rtl-sdr)) |
[1]: https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/adalm-pluto.html
[2]: https://airspy.com/
[3]: https://www.ettus.com/products/
[4]: https://limemicro.com/products/boards/
[5]: https://www.rtl-sdr.com/buy-rtl-sdr-dvb-t-dongles/
[4]: https://greatscottgadgets.com/hackrf/
[5]: https://limemicro.com/products/boards/
[6]: https://www.rtl-sdr.com/buy-rtl-sdr-dvb-t-dongles/
The complete list of packages can be found [here](https://github.com/ryanvolz/radioconda/blob/master/radioconda.yaml). You can [**suggest additional software to include**](https://github.com/ryanvolz/radioconda/issues) by filing an [issue](https://github.com/ryanvolz/radioconda/issues). If you've built additional software from source on top of radioconda, [**document your results**](https://github.com/ryanvolz/radioconda/issues) in an [issue](https://github.com/ryanvolz/radioconda/issues) to help others (and help me in packaging it!).
@ -103,19 +105,7 @@ Once you have radioconda installed, you can stay up to date for all packages wit
To install the latest release in particular, run
mamba install -c ryanvolz --only-deps radioconda python
(You need to add `python` to the package list so that it can be upgraded if necessary.)
### Install a particular release
To install a particular release version, substitute the desired version number and run
mamba install -c ryanvolz --only-deps radioconda=20NN.NN.NN python
### Install from environment lock file
You can also install from the released environment lock file (on Windows):
(on Windows):
mamba install --file https://github.com/ryanvolz/radioconda/releases/latest/download/radioconda-win-64.lock
@ -123,6 +113,28 @@ You can also install from the released environment lock file (on Windows):
mamba install --file https://github.com/ryanvolz/radioconda/releases/latest/download/radioconda-$(conda info | sed -n -e 's/^.*platform : //p').lock
### Install a particular release
To install a particular release version, substitute the desired version number and run
(on Windows):
mamba install --file https://github.com/ryanvolz/radioconda/releases/download/20NN.NN.NN/radioconda-win-64.lock
(on Linux/macOS):
mamba install --file https://github.com/ryanvolz/radioconda/releases/download/20NN.NN.NN/radioconda-$(conda info | sed -n -e 's/^.*platform : //p').lock
### Install from radioconda metapackage
If you're starting with a fresh environment or are comfortable dealing with package conflicts, you can install the latest release using the `radioconda` metapackage from the `ryanvolz` channel:
mamba install -c ryanvolz --only-deps radioconda
To install a particular release version, substitute the desired version number and run
mamba install -c ryanvolz --only-deps radioconda=20NN.NN.NN
## Additional Installation for Device Support
To use particular software radio devices, it might be necessary to install additional drivers or firmware. Find your device below and follow the instructions. (Help add to this section by filing an issue if the instructions don't work or you have additional instructions to add!)
@ -187,6 +199,26 @@ Then, make sure your user account belongs to the plugdev group in order to be ab
You may have to restart for this change to take effect.
### HackRF
##### Windows users
[Install the WinUSB driver with Zadig](#installing-the-winusb-driver-with-zadig), selecting your HackRF device.
##### Linux users
Install a udev rule by creating a link into your radioconda installation:
sudo ln -s $CONDA_PREFIX/lib/udev/rules.d/53-hackrf.rules /etc/udev/rules.d/53-radioconda-hackrf.rules
sudo udevadm control --reload
sudo udevadm trigger
Then, make sure your user account belongs to the plugdev group in order to be able to access your device:
sudo usermod -a -G plugdev <user>
You may have to restart for this change to take effect.
### LimeSDR
##### Windows users

View File

@ -70,6 +70,19 @@ if __name__ == "__main__":
platform = spec_dir_extract_platform(args.installer_spec_dir)
if platform.startswith("win"):
# patch constructor's nsis template
import patch
pset = patch.fromfile(
"static/0001-Customize-Windows-NSIS-installer-script.patch"
)
pset.write_hunks(
pathlib.Path(constructor_main.__file__).parent / "nsis" / "main.nsi.tmpl",
args.installer_spec_dir / "main.nsi.tmpl",
pset.items[0].hunks,
)
args.output_dir.mkdir(parents=True, exist_ok=True)
constructor_cmdline = [

View File

@ -5,3 +5,4 @@ dependencies:
- anaconda-client
- conda-build
- constructor
- python-patch

View File

@ -1,2 +1,3 @@
echo {"env_vars": {"GR_PREFIX": "", "GRC_BLOCKS_PATH": "", "UHD_PKG_PATH": "", "VOLK_PREFIX": ""}}>%PREFIX%\conda-meta\state
del /q %PREFIX%\pkgs\*.tar.bz2
exit 0

View File

@ -38,6 +38,7 @@ def write_env_file(
file_path: pathlib.Path,
name: Optional[str] = None,
version: Optional[str] = None,
variables: Optional[dict] = None,
):
env_dict = dict(
name=name,
@ -50,6 +51,8 @@ def write_env_file(
env_dict["name"] = name
if version:
env_dict["version"] = version
if variables:
env_dict["variables"] = variables
with file_path.open("w") as f:
yaml.safe_dump(env_dict, stream=f)
@ -106,6 +109,8 @@ def render_constructor(
)
if platform.startswith("win"):
construct_dict["post_install"] = "post_install.bat"
# point to template that we generate at build time with a patch over default
construct_dict["nsis_template"] = "main.nsi.tmpl"
else:
construct_dict["post_install"] = "post_install.sh"
@ -120,7 +125,16 @@ def render_constructor(
# write the post_install scripts referenced in the construct dict
if platform.startswith("win"):
with (constructor_dir / "post_install.bat").open("w") as f:
f.write("\n".join((r"del /q %PREFIX%\pkgs\*.tar.bz2", "exit 0", "")))
f.write(
"\n".join(
(
r'echo {"env_vars": {"GR_PREFIX": "", "GRC_BLOCKS_PATH": "", "UHD_PKG_PATH": "", "VOLK_PREFIX": ""}}>%PREFIX%\conda-meta\state',
r"del /q %PREFIX%\pkgs\*.tar.bz2",
"exit 0",
"",
)
)
)
else:
with (constructor_dir / "post_install.sh").open("w") as f:
f.write(
@ -177,12 +191,20 @@ def render_platforms(
# lock the full environment specification to specific versions and builds
locked_env_spec = lock_env_spec(env_spec, conda_exe)
if platform.startswith("win"):
variables = dict(
GR_PREFIX="", GRC_BLOCKS_PATH="", UHD_PKG_PATH="", VOLK_PREFIX=""
)
else:
variables = None
# write the full environment specification to a yaml file (to build metapackage)
locked_env_dict = write_env_file(
env_spec=locked_env_spec,
file_path=output_dir / f"{output_name}.yml",
name=env_name,
version=version,
variables=variables,
)
# write the full environment specification to a lock file (to install from file)

View File

@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ryan Volz <ryan.volz@gmail.com>
Date: Wed, 23 Feb 2022 18:11:22 -0500
Subject: [PATCH] Customize Windows NSIS installer script.
1. Never clear the full pkg dir
2. Delete environment variables set in registry by PothosSDR
---
constructor/nsis/main.nsi.tmpl | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/constructor/nsis/main.nsi.tmpl b/constructor/nsis/main.nsi.tmpl
index 2426248..9ea05cf 100644
--- a/constructor/nsis/main.nsi.tmpl
+++ b/constructor/nsis/main.nsi.tmpl
@@ -933,7 +933,7 @@ Section "Install"
${If} $Ana_ClearPkgCache_State = ${BST_CHECKED}
DetailPrint "Clearing package cache..."
- push '"$INSTDIR\_conda.exe" clean --all --force-pkgs-dirs --yes'
+ push '"$INSTDIR\_conda.exe" clean --all --yes'
push 'Failed to clear package cache'
call AbortRetryNSExecWait
${EndIf}
@@ -964,6 +964,13 @@ Section "Install"
${EndIf}
${If} $ARGV_NoRegistry == "0"
+ # Delete registry entries for environment variables set by PothosSDR
+ DeleteRegValue HKEY_LOCAL_MACHINE "System\CurrentControlSet\Control\Session Manager\Environment" "GR_PREFIX"
+ DeleteRegValue HKEY_LOCAL_MACHINE "System\CurrentControlSet\Control\Session Manager\Environment" "GRC_BLOCKS_PATH"
+ DeleteRegValue HKEY_LOCAL_MACHINE "System\CurrentControlSet\Control\Session Manager\Environment" "UHD_PKG_PATH"
+ DeleteRegValue HKEY_LOCAL_MACHINE "System\CurrentControlSet\Control\Session Manager\Environment" "VOLK_PREFIX"
+ ClearErrors
+
# Registry uninstall info
WriteRegStr SHCTX "${UNINSTREG}" "DisplayName" "${UNINSTALL_NAME}"
WriteRegStr SHCTX "${UNINSTREG}" "DisplayVersion" "${VERSION}"
--
2.35.0