diff mbox series

[bug#64510,v1] gnu: Add simtrace-1

Message ID ff689141cb75d35ed673a6867b2551db3cfe9368.1688738697.git.GNUtoo@cyberdimension.org
State New
Headers show
Series [bug#64510,v1] gnu: Add simtrace-1 | expand

Commit Message

Denis 'GNUtoo' Carikli July 7, 2023, 2:09 p.m. UTC
* gnu/packages/telephony.scm (simtrace-1): New variable.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
 gnu/packages/telephony.scm | 72 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)


base-commit: 961ffca1c75141cbb351d143b22b673638e9659d

Comments

Christopher Baines Oct. 5, 2023, 10:12 a.m. UTC | #1
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> writes:

> * gnu/packages/telephony.scm (simtrace-1): New variable.
>
> Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
> ---
>  gnu/packages/telephony.scm | 72 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 72 insertions(+)
>

...

> +    (build-system gnu-build-system)
> +    (native-inputs (list dblatex docbook-xml-4.2 libfaketime pkg-config
> +                         texlive))

./pre-inst-env guix build simtrace-1
gnu/packages/telephony.scm:1035:25: In procedure native-inputs:
error: texlive: unbound variable
hint: Did you forget `(use-modules (gnu packages texlive))'?

Maybe this broke with some of the texlive changes being made, would you
be able to take a look?

Thanks,

Chris
Denis 'GNUtoo' Carikli Oct. 6, 2023, 12:53 p.m. UTC | #2
Hi,

On Thu, 05 Oct 2023 11:12:26 +0100
Christopher Baines <mail@cbaines.net> wrote:

> ./pre-inst-env guix build simtrace-1
> gnu/packages/telephony.scm:1035:25: In procedure native-inputs:
> error: texlive: unbound variable
> hint: Did you forget `(use-modules (gnu packages texlive))'?

Thanks for spotting that. This issue is really interesting.

When I tested the package it worked fine and the texlive package came
from the tex module (and telephony.scm had and still has '#:use-module
(gnu packages tex)').

But since that time the following commit made it in Guix:
> 0421160f4a350de72422f4a51d7fd101b3764376 ("gnu:
>     texlive: Reinstate the monolithic texlive package.")
and that moved texlive package from tex.scm to texlive.scm.

So we need to add '#:use-module (gnu packages texlive)' to fix that.

Denis.
Denis 'GNUtoo' Carikli Oct. 6, 2023, 1:07 p.m. UTC | #3
On Fri, 6 Oct 2023 14:53:23 +0200
Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> wrote:

> So we need to add '#:use-module (gnu packages texlive)' to fix that.
Sorry my patch added '#:use-module (gnu packages texlive)', so we need
to change tex in texlive.

Denis.
diff mbox series

Patch

diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index aa65c4eaad..b00a2971c7 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -87,6 +87,7 @@  (define-module (gnu packages telephony)
   #:use-module (gnu packages security-token)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages speech)
+  #:use-module (gnu packages tex)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages upnp)
   #:use-module (gnu packages video)
@@ -989,6 +990,77 @@  (define-public libosmocore
     (home-page "https://osmocom.org/projects/libosmocore/wiki/Libosmocore")
     (license license:gpl2+)))
 
+(define-public simtrace-1
+  (package
+    (name "simtrace-1")
+    (version "1.5")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitea.osmocom.org/sim-card/simtrace")
+                    (commit (string-append "v" version))))
+              (sha256
+               (base32
+                "03wjdavp7fbr7jzzhqx6di9v87yvfi19i3kpn798vlpbw7iwkjry"))))
+    (arguments
+     (list #:tests? #f ;no tests
+           #:make-flags #~(list (string-append "CC="
+                                               #$(cc-for-target))
+                                (string-append "DESTDIR="
+                                               #$output))
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'chdir
+                          (lambda _
+                            (chdir "host")))
+                        (add-after 'chdir 'fix-makefile
+                          (lambda _
+                            (substitute* "Makefile"
+                              (("/usr")
+                               ""))))
+                        (delete 'configure)
+                        (add-after 'build 'build-usermanual
+                          (lambda* (#:key inputs native-inputs
+                                    #:allow-other-keys)
+                            (substitute* "../docs/usermanual.xml"
+                              (("http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd")
+                               (string-append (assoc-ref inputs "docbook-xml")
+                                              "/xml/dtd/docbook/docbookx.dtd")))
+                            ;; At the beginning of the document, a table is
+                            ;; constructed with the build time in it. This
+                            ;; comes from '\newcommand{\DBKdate}{\today}' in
+                            ;; share/dblatex/latex/contrib/db2latex/db2latex.sty
+                            ;; in /gnu/store/[...]-dblatex-[...]. We used the
+                            ;; commit time for the date instead.
+                            (invoke (which "faketime") "2019-10-01"
+                                    (which "dblatex") "../docs/usermanual.xml")))
+                        (add-after 'build-usermanual 'install-usermanual
+                          (lambda _
+                            (install-file "../docs/usermanual.pdf"
+                                          (string-append #$output
+                                           "/share/doc/simtrace-1/"))))
+                        (add-after 'install 'install-man
+                          (lambda _
+                            (install-file "simtrace.1"
+                                          (string-append #$output "/man/man1/")))))))
+    (build-system gnu-build-system)
+    (native-inputs (list dblatex docbook-xml-4.2 libfaketime pkg-config
+                         texlive))
+    (inputs (list libosmocore libusb lksctp-tools talloc))
+    (synopsis
+     "Sniff the communication between phones and SIM cards with SIMtrace 1")
+    (description
+     "This contains the simtrace utility.
+It is compatible with the SIMtrace 1 hardware that contains an Atmel AT91SAM7S
+micro-controller.  It is not compatible with the SIMtrace 2 hardware that uses
+an Atmel ATSAM3S micro-controller instead.  The simtrace utility can display
+the SIM PDUs directly and/or send them to a given IP address to enable users
+to view SIM PDUs in Wireshark.  It also contains a complete user manual for
+the SIMtrace 1 hardware.")
+    (home-page "https://osmocom.org/projects/simtrace/wiki/SIMtrace")
+    ;; The utility is GPLv2-only according to the source files headers, and the
+    ;; manual is under the cc-by-sa 3.0
+    (license (list license:gpl2 license:cc-by-sa3.0))))
+
 (define-public xgoldmon
   ;; There are no releases nor tags.
   (let ((revision "1")