@@ -52,6 +52,7 @@ (define-module (gnu packages pretty-print)
#:use-module (gnu packages lua)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages qt)
#:use-module (gnu packages swig))
(define-public a2ps
@@ -404,3 +405,47 @@ (define-public highlight
TeX, SVG, BBCode and terminal escape sequences with colored syntax
highlighting. Language definitions and color themes are customizable.")
(license gpl3+)))
+
+(define-public highlight-gui
+ (package
+ (inherit highlight)
+ (name "highlight-gui")
+ (build-system gnu-build-system)
+ (arguments
+ (substitute-keyword-arguments (package-arguments highlight)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ (add-after 'unpack 'fix-paths
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let* ((highlight:out (assoc-ref inputs "highlight"))
+ (data (string-append highlight:out "/share/highlight/"))
+ (conf (string-append highlight:out "/etc/highlight/"))
+ (doc (string-append highlight:out
+ "/share/doc/highlight/")))
+ (substitute* "makefile"
+ (("HL_DATA_DIR=.* HL_CONFIG_DIR=.* HL_DOC_DIR=.* gui-qt")
+ (string-append "HL_DATA_DIR=\""
+ data
+ "\" HL_CONFIG_DIR=\""
+ conf
+ "\" HL_DOC_DIR=\""
+ doc
+ "\" gui-qt"))))))
+ (add-after 'fix-search-for-lua 'fix-search-for-lua/GUI
+ (lambda _
+ (substitute* "src/gui-qt/highlight.pro"
+ (("PKGCONFIG \\+= lua")
+ (string-append "PKGCONFIG += lua-"
+ #$(version-major+minor (package-version lua)))))))
+ (replace 'build
+ (lambda _
+ (invoke "make" "gui")))
+ (delete 'install-perl-bindings)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (mkdir-p (string-append out "/bin"))
+ (invoke "make" "install-gui"))))))))
+ (native-inputs (list pkg-config))
+ (inputs (list highlight lua boost qtbase-5))
+ (synopsis "Graphical user interface for highlight")))