diff mbox series

[bug#53274,2/2] gnu: Add rofi-calc.

Message ID xlVPWkluEVPI1CHhWqLfS07-WiMMV0FrTIYDZQXO5G4zKJW0PMsC6d5yWZVJ0SeqaiVEBJttT9eICs4jJD_nCiaI8Q0Xe3TW4KAHMj2Jw-I=@protonmail.com
State Accepted
Headers show
Series Add rofi ROFI_PLUGIN_PATH search-path and rofi-calc | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

John Kehayias Jan. 14, 2022, 11:22 p.m. UTC
Empty Message
diff mbox series

Patch

From b7056b43e96109c907216ca1d17f68f2a1130d59 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Fri, 14 Jan 2022 18:13:08 -0500
Subject: [PATCH 2/2] gnu: Add rofi-calc.

* gnu/packages/xdisorg.scm (rofi-calc): New variable.
---
 gnu/packages/xdisorg.scm | 46 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/xdisorg.scm b/gnu/packages/xdisorg.scm
index 65cb1c947c..cb291f4634 100644
--- a/gnu/packages/xdisorg.scm
+++ b/gnu/packages/xdisorg.scm
@@ -78,6 +78,7 @@  (define-module (gnu packages xdisorg)
   #:use-module (guix build-system python)
   #:use-module (guix build-system scons)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix hg-download)
   #:use-module ((guix licenses) #:prefix license:)
@@ -1741,6 +1742,51 @@  (define-public rofi
 by name.")
     (license license:expat)))
 
+(define-public rofi-calc
+  (package
+    (name "rofi-calc")
+    (version "2.0.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/svenstaro/rofi-calc")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1j23xwa6s27wyx6r0yb85cby6dggrcb103nqcfxr5li1mcqrgd9m"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; Don't try to install directly to rofi, instead install
+          ;; to lib/rofi to match rofi's search-path ROFI_PLUGIN_PATH.
+          (add-after 'unpack 'patch-plugindir
+            (lambda _
+              (substitute* "Makefile.am"
+                (("plugindir=\\$\\{rofi_PLUGIN_INSTALL_DIR\\}\\/")
+                 "plugindir=${libdir}/rofi/"))))
+          (add-after 'unpack 'patch-qalc-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "src/calc.c"
+                (("\"qalc\"")
+                 (string-append "\""
+                                (search-input-file inputs "bin/qalc")
+                                "\""))))))))
+    (inputs
+     (list cairo libqalculate rofi))
+    (native-inputs
+     (list autoconf automake libtool pkg-config))
+    (home-page
+     "https://github.com/svenstaro/rofi-calc")
+    (synopsis "Do live calculations in rofi with qalc")
+    (description
+     "@code{rofi-calc} is a rofi plugin that uses qalculate's @code{qalc} to parse
+natural language input and provide results.")
+    (license license:expat)))
+
 (define-public tint2
   (package
     (name "tint2")
-- 
2.34.0