guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Add SimpleDSO.


From: Ricardo Wurmus
Subject: [PATCH] Add SimpleDSO.
Date: Sun, 01 May 2016 18:22:17 +0200
User-agent: mu4e 0.9.13; emacs 24.5.1

Hi Guix,

this patch adds a tool to display waveforms from my digital storage
oscilloscope.  The package definition is a bit ugly because upstream
doesn’t really have a good build system.

It works fine for me and I hope it’s useful for others as well.

~~ Ricardo

>From 2ad0b4186e08f8e1e81fc8394ffebfd3f75afac8 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Tue, 29 Mar 2016 19:41:25 +0200
Subject: [PATCH 1/2] gnu: Add python2-pyqt-4.

* gnu/packages/qt.scm (python2-pyqt-4): New variable.
---
 gnu/packages/qt.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 7b2be4f..58e267f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2015 Sou Bunnbu <address@hidden>
 ;;; Copyright © 2015 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2015 Efraim Flashner <address@hidden>
+;;; Copyright © 2016 Ricardo Wurmus <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -540,6 +541,15 @@ contain over 620 classes.")
          %standard-phases)))
     (license (list gpl2 gpl3)))) ; choice of either license
 
+(define-public python2-pyqt-4
+  (package (inherit python-pyqt-4)
+    (name "python2-pyqt")
+    (native-inputs
+     `(("python-sip" ,python2-sip)
+       ("qt" ,qt-4)))
+    (inputs
+     `(("python" ,python-2)))))
+
 (define-public qtkeychain
   (package
     (name "qtkeychain")
-- 
2.7.3

>From c18c67dd1817f3d32608e2841465745294a19ac7 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
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 <address@hidden>
+;;; Copyright © 2015, 2016 Ricardo Wurmus <address@hidden>
 ;;; Copyright © 2015 Federico Beffa <address@hidden>
 ;;; Copyright © 2016 Efraim Flashner <address@hidden>
 ;;; Copyright © 2016 David Thompson <address@hidden>
@@ -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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]