From c18c67dd1817f3d32608e2841465745294a19ac7 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 29 Mar 2016 19:43:00 +0200 Subject: [PATCH 2/2] gnu: Add SimpleDSO. * gnu/packages/engineering.scm (simpledso): New variable. --- gnu/packages/engineering.scm | 75 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index c519ca5..fca12d6 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015 Ricardo Wurmus +;;; Copyright © 2015, 2016 Ricardo Wurmus ;;; Copyright © 2015 Federico Beffa ;;; Copyright © 2016 Efraim Flashner ;;; Copyright © 2016 David Thompson @@ -45,11 +45,13 @@ #:use-module (gnu packages gnome) #:use-module (gnu packages gtk) #:use-module (gnu packages guile) + #:use-module (gnu packages libusb) #:use-module (gnu packages linux) ;FIXME: for pcb #:use-module (gnu packages m4) #:use-module (gnu packages maths) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) #:use-module (gnu packages qt) #:use-module (gnu packages tcl) #:use-module (gnu packages texlive) @@ -416,6 +418,77 @@ ready for production.") ;; released under GPLv3+. (license (list license:gpl3+ license:cc-by-sa3.0)))) +(define-public simpledso + (package + (name "simpledso") + (version "0.3") + (source (origin + (method url-fetch/tarbomb) + (file-name (string-append name "-" version ".tar.gz")) + (uri (string-append "mirror://sourceforge/simpledso/simpleDSO_v" + version "_source.tar.gz")) + (sha256 + (base32 + "0rczxwjfq649hra8d3xnvpwarabs2c823zln4kikczyzqjaqkyjg")) + (modules '((guix build utils))) + ;; Remove pre-compiled files. + (snippet + '(for-each delete-file (find-files "." "\\.pyc$"))))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; no tests + #:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-26)) + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (share (string-append out "/share/simpledso")) + (bin (string-append out "/bin")) + (wrapper (string-append bin "/simpleDSO"))) + (mkdir-p share) + (for-each (lambda (file) (install-file file share)) + `("vid_pid.txt" + "utils.py" + "icon.ico" + "simpleDSO.py" + "graphic.py")) + (for-each (lambda (dir) + (let ((target (string-append share "/" dir))) + (mkdir-p target) + (for-each (cut install-file <> target) + (find-files dir ".*")))) + '("ut2XXX" "doc" "UI")) + (mkdir-p bin) + (with-output-to-file wrapper + (lambda () + (display + (string-append + "#!" (which "bash") "\n" + "PYTHONPATH=" share ":" (getenv "PYTHONPATH") "\n" + "export PYTHONPATH\n" + "exec " share "/simpleDSO.py" "\n")))) + (chmod wrapper #o755)) + #t))))) + (inputs + `(("python2-pyqt-4" ,python2-pyqt-4) + ("python2-sip" ,python2-sip) + ("python2-pyusb" ,python2-pyusb) + ("python2" ,python-2) + ("qt" ,qt-4))) + (home-page "https://github.com/dnet/SimpleDSO") + (synopsis "Capture data from digital storage oscilloscope") + (description + "SimpleDSO is a tool to capture screenshots or raw data from UNI-T +digital storage oscilloscopes via USB. The following features are +implemented: take a screenshot from the oscilloscope; generate waveform from +raw data; save data as CSV.") + (license license:gpl2+))) + (define-public gerbv (package (name "gerbv") -- 2.7.3