unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] Add SimpleDSO.
@ 2016-05-01 16:22 Ricardo Wurmus
  2016-05-01 22:15 ` Leo Famulari
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2016-05-01 16:22 UTC (permalink / raw)
  To: guix-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 270 bytes --]

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


[-- Attachment #2: 0001-gnu-Add-python2-pyqt-4.patch --]
[-- Type: text/x-patch, Size: 1196 bytes --]

From 2ad0b4186e08f8e1e81fc8394ffebfd3f75afac8 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
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 <iyzsong@gmail.com>
 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; 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


[-- Attachment #3: 0002-gnu-Add-SimpleDSO.patch --]
[-- Type: text/x-patch, Size: 4694 bytes --]

From c18c67dd1817f3d32608e2841465745294a19ac7 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
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 <rekado@elephly.net>
+;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add SimpleDSO.
  2016-05-01 16:22 [PATCH] Add SimpleDSO Ricardo Wurmus
@ 2016-05-01 22:15 ` Leo Famulari
  2016-05-02  6:02   ` Ricardo Wurmus
  0 siblings, 1 reply; 4+ messages in thread
From: Leo Famulari @ 2016-05-01 22:15 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel@gnu.org

On Sun, May 01, 2016 at 06:22:17PM +0200, Ricardo Wurmus wrote:
> 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.

Does it really require qt-4? We removed python2-qt-4 in 3297deedd.

AFAICT qt-4 is abandoned by the Qt project and does not receive security
updates.

https://wiki.qt.io/Qt_project_security_policy

I didn't test the build yet, because Hydra doesn't have a qt-4
substitute available.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add SimpleDSO.
  2016-05-01 22:15 ` Leo Famulari
@ 2016-05-02  6:02   ` Ricardo Wurmus
  2016-05-02  7:01     ` Leo Famulari
  0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2016-05-02  6:02 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel@gnu.org


Leo Famulari <leo@famulari.name> writes:

> On Sun, May 01, 2016 at 06:22:17PM +0200, Ricardo Wurmus wrote:
>> 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.
>
> Does it really require qt-4? We removed python2-qt-4 in 3297deedd.

Oh, that’s where it’s gone.  Yes, it actually requires qt-4.

> AFAICT qt-4 is abandoned by the Qt project and does not receive security
> updates.
>
> https://wiki.qt.io/Qt_project_security_policy
>
> I didn't test the build yet, because Hydra doesn't have a qt-4
> substitute available.

How do other distributions handle this?  Do they backport fixes to Qt 4?

~~ Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add SimpleDSO.
  2016-05-02  6:02   ` Ricardo Wurmus
@ 2016-05-02  7:01     ` Leo Famulari
  0 siblings, 0 replies; 4+ messages in thread
From: Leo Famulari @ 2016-05-02  7:01 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel@gnu.org

On Mon, May 02, 2016 at 08:02:23AM +0200, Ricardo Wurmus wrote:
> How do other distributions handle this?  Do they backport fixes to Qt 4?

It looks like the Qt 4 repo has received some security updates, but
their policy on supporting old releases seems to be "maybe":

https://code.qt.io/cgit/qt/qt.git/

As compared to the current repo:

https://code.qt.io/cgit/qt/qt5.git/

I'm not sure how other distros handle it. I assume they backport as well
as they can if there are no patches in Qt 4 repo.

I think it's okay to keep using the old version, but that we should try
to use the current version where we can.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-05-02  7:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-01 16:22 [PATCH] Add SimpleDSO Ricardo Wurmus
2016-05-01 22:15 ` Leo Famulari
2016-05-02  6:02   ` Ricardo Wurmus
2016-05-02  7:01     ` Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).