Picoscope oscilloscope drivers and mono application

Hey there,

I started some work on packaging the drivers and the mono based oscilloscope application for picotech’s products.

I didn’t really expect there to be many other nix users using these but since I found a fellow nix user in their support forum, I just want report the state of things so far here.

Here is the main derivation in my nixpkgs fork and can be built with nix-build -A picoscope[-mono4].

The mono oscilloscope application ist starting and you can work with the demo device. Also the drivers can be loaded and their dependencies are found. However even though the picoscope_usbtest correctly identifies the connected device, enumerating it fails with an obscure Error: IsMVFailed message, which i reported and which seems to be related to the different mono version (see my picotech thread and this older one).

Some remarks concerning the derivation:

  • autoPatchelfHook: I had to overwrite the hook’s autoPatchelfFile function because the runtimeDepencency entries are only added to the rpath for executables and not for libraries and also there was no easy way to add the derivation itself (runtimeDependencies = ["$out"]; does not get expanded). The drivers load one of the other driver files using dlOpen. This should probably be fixed in autoPatchelfHook if there is no reason against it. The first issue is easy, but I’m not sure how to solve the adding $out can be generically added. The alternative would be to not use autoPatchelfHook but run patchelf manually.
  • Originally every driver is packaged as its own dpkg package. I put them all in a single derivation for ease of development and because else you would need some “withDrivers” attribute to the derivation to add all the drivers to the wrapper. This could be remodularized later, once everything is working.

The branch also contains work in progress gnuradio sources for the digitizers building on @doronbehar’s gnuradio modularization work. Because this gnuradio module needs a very old boost and only works with gnuradio 3.7 there is a separate nixpkgs attribute nixpkgs.gnuradio3_7Full for it.