Subject: Re: bug#78011: [PATCH electronics-team] gnu: Add opensta.

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 25 Apr 2025 12:30:58 +0900

Hi,

Something like this:

--8<---------------cut here---------------start------------->8---
1 file changed, 11 insertions(+), 10 deletions(-)
gnu/packages/electronics.scm | 21 +++++++++++----------

modified   gnu/packages/electronics.scm
@@ -423,10 +423,12 @@ (define-public openboardview
     (license license:expat)))
 
 (define-public opensta
+  ;; There are no releases; use the latest commit.
   (let ((commit "400c473fe384773a4788ee8378238462b4291fe3")
         (revision "0"))
     (package
       (name "opensta")
+      ;; The version string is taken from the CMakeLists.txt.
       (version (git-version "2.6.2" revision commit))
       (source
        (origin
@@ -440,18 +442,17 @@ (define-public opensta
       (build-system cmake-build-system)
       (arguments
        (list
-        #:tests? #f ; no tests
-        #:out-of-source? #t
         #:configure-flags
         #~(list
-           (string-append "-DCUDD_DIR=" #$cudd)
-           (string-append "-DCMAKE_INSTALL_PREFIX=" #$output))
-        #:make-flags
-        #~(list (string-append "CC=" #$(cc-for-target))
-                (string-append "CXX=" #$(cxx-for-target))
-                (string-append "PREFIX=" #$output))))
-      (native-inputs (list swig bison flex))
-      (inputs (list tcl tcllib zlib cudd eigen))
+           (string-append "-DCUDD_DIR=" #$(this-package-input "cudd"))
+           (string-append "-DBUILD_SHARED_LIBS=YES"))
+        #:phases #~(modify-phases %standard-phases
+                     (replace 'check
+                       (lambda* (#:key tests? #:allow-other-keys)
+                         (when tests?
+                           (invoke "../source/test/regression")))))))
+      (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
--8<---------------cut here---------------end--------------->8---

I note that the package doesn't cross-build currently due to a problem
finding flex, but that's not the above definition's fault.

The BUILD_SHARED_LIBS=YES builds a .so library which cuts the space used
by half about.

The inputs are sorted lexicographically and some comments are added,
with the extraneous flags/arguments pruned.

Hope that helps,

-- 
Thanks,
Maxim