diff mbox series

[bug#59765] Add Sourcetrail

Message ID ATA5SJyXZ9f6XKftIRk4OdQUebQ-1m-OweW3XZgoQEn_TiC_ShsXfwdZXwd66tIF_zIyIv2nkoDybLflXj3e-t7rhI1l8Fh0Yjpzu08hLTw=@protonmail.com
State New
Headers show
Series [bug#59765] Add Sourcetrail | expand

Commit Message

phodina Dec. 2, 2022, 7:18 a.m. UTC
Hello,

these patches add Sourcetrail code analysis tool, which unfortunately is not longer developed.

----
Petr

Comments

Nicolas Goaziou April 23, 2023, 2:27 p.m. UTC | #1
Hello,

phodina via Guix-patches via <guix-patches@gnu.org> writes:


> these patches add Sourcetrail code analysis tool,

Thank you.

> which unfortunately is not longer developed.

This doesn't sound too good. I notice there is a somewhat active fork at
<https://github.com/OpenSourceSourceTrail/Sourcetrail>. Would it make
sense to use it instead?

> +(define-public boost-for-sourcetrail
> +  ;; Older version for Sourcetrail 1.1.30.
> +  (package
> +    (name "boost")
> +    (version "1.67.0")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append
> +                    "mirror://sourceforge/boost/boost/" version "/boost_"
> +                    (string-map (lambda (x) (if (eq? x #\.) #\_ x)) version)
> +                    ".tar.bz2"))
> +              (sha256
> +               (base32
> +                "1fmdlmkzsrd46wwk834jsi2ypxj68w2by0rfcg2pzrafk5rck116"))
> +              (patches (search-patches "boost-fix-icu-build.patch"))))
> +    (build-system gnu-build-system)
> +    (inputs `(("icu4c" ,icu4c)
> +              ("zlib" ,zlib)))
> +    (native-inputs
> +     `(("perl" ,perl)
> +       ("python" ,python-2)

Guix has dropped support for Python 2, so this Boost package is not
really an option. Is it possible to use a more recent Boost library?

> +(define-public sourcetrail
> +(package
> +  (name "sourcetrail")
> +  (version "2021.1.30")
> +  (source (origin
> +            (method git-fetch)
> +            (uri (git-reference
> +             (url "https://github.com/CoatiSoftware/Sourcetrail")
> +             (commit version)))
> +            (file-name (git-file-name name version))
> +            (sha256
> +             (base32
> +              "0h0q2bfa6dv8hmc15rzj48bna1krzjwlcjm25dffbsi81xjcazb5"))))
> +  (build-system cmake-build-system)
> +  (arguments
> +    (list #:configure-flags #~(list "-DBoost_USE_STATIC_LIBS=OFF" (string-append
> +	"-DBOOST_ROOT=" #$(this-package-input "boost") "/lib"))

README mentions build process should also set Qt5_DIR configure flag.

> +      #:phases
> +      #~(modify-phases %standard-phases
> +       (replace 'install
> +        (lambda* (#:key outputs #:allow-other-keys)
> +		 (let* ((out #$output)
> +		       (prefix (string-append out "/opt/sourcetrail"))
> +			   (build (getcwd))
> +			   (share (string-append prefix "/share")))
> +		       (mkdir-p (string-append out "/bin"))
> +			   (install-file (string-append build "/app/Sourcetrail") (string-append
> +			   out "/bin"))
> +			   (install-file (string-append build
> +			   "/app/sourcetrail_indexer") (string-append
> +			   out "/bin"))))))))

Indentation is a bit off.

> +  (native-inputs (list pkg-config))
> +  (inputs (list boost-for-sourcetrail
> +            qtbase-5
> +            qtsvg-5))
> +  (synopsis "Interactive source explorer")
> +  (description "Offline source explorer that helps you get productive on unfamiliar source code with optional IDE integration.")

Description should consist of full sentences.

Although this review is a bit late, would you like to try sending an
updated patch?

Regards,
diff mbox series

Patch

From 015a65f27f46bbdad3e07dbabc5154609ae6ec2d Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Thu, 11 Nov 2021 19:21:44 +0100
Subject: [PATCH 2/2] gnu: Add sourcetrail.

* gnu/packages/qt.scm (sourcetrail): New variable.

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 30bf429897..540959bbbc 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -62,6 +62,7 @@  (define-module (gnu packages qt)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages check)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cups)
@@ -4261,6 +4262,46 @@  (define-public qhexedit
 data.")
     (license license:lgpl2.1)))
 
+(define-public sourcetrail
+(package
+  (name "sourcetrail")
+  (version "2021.1.30")
+  (source (origin
+            (method git-fetch)
+            (uri (git-reference
+             (url "https://github.com/CoatiSoftware/Sourcetrail")
+             (commit version)))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32
+              "0h0q2bfa6dv8hmc15rzj48bna1krzjwlcjm25dffbsi81xjcazb5"))))
+  (build-system cmake-build-system)
+  (arguments
+    (list #:configure-flags #~(list "-DBoost_USE_STATIC_LIBS=OFF" (string-append
+	"-DBOOST_ROOT=" #$(this-package-input "boost") "/lib"))
+      #:phases
+      #~(modify-phases %standard-phases
+       (replace 'install
+        (lambda* (#:key outputs #:allow-other-keys)
+		 (let* ((out #$output)
+		       (prefix (string-append out "/opt/sourcetrail"))
+			   (build (getcwd))
+			   (share (string-append prefix "/share")))
+		       (mkdir-p (string-append out "/bin"))
+			   (install-file (string-append build "/app/Sourcetrail") (string-append
+			   out "/bin"))
+			   (install-file (string-append build
+			   "/app/sourcetrail_indexer") (string-append
+			   out "/bin"))))))))
+  (native-inputs (list pkg-config))
+  (inputs (list boost-for-sourcetrail
+            qtbase-5
+            qtsvg-5))
+  (synopsis "Interactive source explorer")
+  (description "Offline source explorer that helps you get productive on unfamiliar source code with optional IDE integration.")
+  (home-page "https://www.sourcetrail.com")
+  (license license:gpl3)))
+
 (define-public soqt
   (let ((commit-ref "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d")
         (revision "1"))
-- 
2.38.1