summary refs log tree commit diff
path: root/gnu/packages/gstreamer.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-17 10:09:17 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-03-17 10:40:02 -0400
commit2dc2722dc022974684c5f5add577d2241b0b996d (patch)
tree60bc12747d92b882e0f339ecc11a7eaa0870e7c7 /gnu/packages/gstreamer.scm
parent8832acc24eb8996f0b26988cbe5c456751af79d7 (diff)
downloadguix-2dc2722dc022974684c5f5add577d2241b0b996d.tar.gz
gnu: ccextractor: Update to 0.94 and fix build.
* gnu/packages/gstreamer.scm (ccextractor): Update to 0.94.
[source]: Apply patches.  Add FIXME comment.
[build-system]: Switch to gnu-build-system.
[arguments]: Delete #tests? argument.  Delete trailing #t and use gexps.
Adjust configure flags accordingly, removing WITH_SHARING (doesn't exist for
Autoconf) and adding '--without-rust'.  Override check phase.
[native-inputs]: Remove labels.  Remove python-wrapper and perl.
[propagated-inputs]: Remove labels.  Remove nanomsg and zlib.  Replace
leptonica with leptonica-1.80.  replace tesseract-ocr with tesseract-ocr-4.
* gnu/packages/patches/ccextractor-add-missing-header.patch: New file.
* gnu/packages/patches/ccextractor-autoconf-tesseract.patch: Likewise.
* gnu/packages/patches/ccextractor-fix-ocr.patch: Likewise.
* gnu/local.mk (dist_patch_DATA): Register them.
Diffstat (limited to 'gnu/packages/gstreamer.scm')
-rw-r--r--gnu/packages/gstreamer.scm75
1 files changed, 37 insertions, 38 deletions
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index 2bb4d48991..f33a30a02b 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
+;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,7 +33,6 @@
   #:use-module (guix gexp)
   #:use-module (guix download)
   #:use-module (guix git-download)
-  #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system trivial)
@@ -171,49 +171,48 @@ module for the DMA capture of the video flow.")
 (define-public ccextractor
   (package
     (name "ccextractor")
-    (version "0.88")
+    (version "0.94")
     (source
      (origin
        (method git-fetch)
-       (uri
-        (git-reference
-         (url "https://github.com/CCExtractor/ccextractor")
-         (commit (string-append "v" version))))
+       (uri (git-reference
+             (url "https://github.com/CCExtractor/ccextractor")
+             (commit (string-append "v" version))))
        (file-name (git-file-name name version))
+       ;; FIXME: Delete the 'src/thirdparty directory and unbundle the
+       ;; libraries it contains, such as freetype, libpng, zlib, and others.
+       (patches (search-patches "ccextractor-add-missing-header.patch"
+                                "ccextractor-autoconf-tesseract.patch"
+                                "ccextractor-fix-ocr.patch"))
        (sha256
-        (base32 "1sya45hvv4d46bk7541yimmafgvgyhkpsvwfz9kv6pm4yi1lz6nb"))))
-    (build-system cmake-build-system)
+        (base32 "1hrk4xlzkvk9pnv0yr4whcsh8h4fzk42mrf30dsr3xzh1lgpfslg"))))
+    (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f                      ; No target
-       #:configure-flags
-       (list
-        "-DWITH_FFMPEG=ON"
-        "-DWITH_OCR=ON"
-        "-DWITH_SHARING=ON"
-        "-DWITH_HARDSUBX=ON")
-       #:phases
-       (modify-phases %standard-phases
-         ;; The package is in a sub-dir of this repo.
-         (add-after 'unpack 'chdir
-           (lambda _
-             (chdir "src")
-             #t))
-         (add-after 'chdir 'fix-build-errors
-           (lambda _
-             (substitute* "CMakeLists.txt"
-               (("libnanomsg")
-                "nanomsg"))
-             #t)))))
-    (native-inputs
-     `(("perl" ,perl)
-       ("pkg-config" ,pkg-config)
-       ("python" ,python-wrapper)))
-    (inputs
-     `(("ffmeg" ,ffmpeg-3.4)
-       ("nanomsg" ,nanomsg)
-       ("leptonica" ,leptonica)
-       ("ocr" ,tesseract-ocr)
-       ("zlib" ,zlib)))
+     (list #:configure-flags
+           #~(list "--enable-ffmpeg"
+                   "--enable-ocr"
+                   "--enable-hardsubx"
+                   ;; Disable Rust support, as there's no rust source included
+                   ;; and cargo wants to fetch the crates from the network
+                   ;; (see:
+                   ;; https://github.com/CCExtractor/ccextractor/issues/1502).
+                   "--without-rust")
+           #:phases #~(modify-phases %standard-phases
+                        (add-after 'unpack 'chdir
+                          (lambda _
+                            (chdir "linux")))
+                        (add-after 'chdir 'patch-pre-build.sh
+                          (lambda _
+                            (substitute* "pre-build.sh"
+                              (("/usr/bin/env") (which "env")))))
+                        (replace 'check
+                          (lambda* (#:key tests? #:allow-other-keys)
+                            (when tests?
+                              ;; There is no test suite; simply run the binary
+                              ;; to validate there are no obvious problems.
+                              (invoke "./ccextractor" "--help")))))))
+    (native-inputs (list autoconf automake pkg-config))
+    (inputs (list ffmpeg-3.4 leptonica-1.80 tesseract-ocr-4))
     (synopsis "Closed Caption Extractor")
     (description "CCExtractor is a tool that analyzes video files and produces
 independent subtitle files from the closed captions data.  It is portable, small,