Subject: [PATCH v3] gnu: Add opensta.

From: Cayetano Santos <[email-masked]>
Date: Sat, 26 Apr 2025 21:25:23 +0200

* gnu/packages/electronics.scm (opensta): New variable.

Change-Id: If753078958535971c8ab3fd7c934d19d24f0a2f7
---
 gnu/packages/electronics.scm | 44 ++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/electronics.scm b/gnu/packages/electronics.scm
index 12e44f234a..e32bad9c9d 100644
--- a/gnu/packages/electronics.scm
+++ b/gnu/packages/electronics.scm
@@ -38,6 +38,7 @@ (define-module (gnu packages electronics)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages c)
   #:use-module (gnu packages check)
@@ -45,6 +46,7 @@ (define-module (gnu packages electronics)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages embedded)
+  #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages glib)
@@ -53,6 +55,7 @@ (define-module (gnu packages electronics)
   #:use-module (gnu packages libftdi)
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -65,6 +68,7 @@ (define-module (gnu packages electronics)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages stb)
   #:use-module (gnu packages swig)
+  #:use-module (gnu packages tcl)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages toolkits)
   #:use-module (gnu packages version-control))
@@ -415,6 +419,46 @@ (define-public openboardview
 @end itemize")
     (license license:expat)))
 
+(define-public opensta
+  ;; There are no releases, we use last commit.
+  (let ((commit "eb8d39a7dd81b5ca2582ad9bbce0fb6e094b3e0f")
+        (revision "0"))
+    (package
+      (name "opensta")
+      ;; The version string is taken from the CMakeLists.txt.
+      (version (git-version "2.6.2" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/parallaxsw/OpenSTA/")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0bpc7fj4pd5713yny2vrh542jbag1kj20g0ji01c9scqb9av5qw5"))))
+      (build-system cmake-build-system)
+      (arguments
+       (list
+        #:phases
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (invoke "../source/test/regression")))))
+        #:configure-flags
+        #~(list
+           (string-append "-DCUDD_DIR=" #$(this-package-input "cudd"))
+           (string-append "-DBUILD_SHARED_LIBS=YES"))))
+      (native-inputs (list bison flex swig))
+      (inputs (list cudd eigen tcl tcllib zlib))
+      (synopsis "Parallax Static Timing Analyzer")
+      (description
+       "OpenSTA is a gate level static timing verifier.  As a stand-alone
+executable it can be used to verify the timing of a design using standard file
+formats.")
+      (home-page "https://github.com/parallaxsw/OpenSTA/")
+      (license license:gpl3+))))
+
 (define-public pulseview
   (package
     (name "pulseview")

base-commit: edeafb19c4a83eb81fe7e47a6a94f238db9cccf1
-- 
2.49.0