summary refs log tree commit diff
path: root/gnu/packages/cpp.scm
diff options
context:
space:
mode:
authorSughosha <Sughosha@proton.me>2023-01-03 23:15:52 +0000
committerRicardo Wurmus <rekado@elephly.net>2023-01-04 11:22:03 +0100
commita8f15711508abab85cba3174f68a4343a15fb116 (patch)
tree8816e92ee8d4580ee9cd5cdf6a00473ad2be053f /gnu/packages/cpp.scm
parent3bb7c43a6ff5886ee700a602d89a192f09a1266a (diff)
downloadguix-a8f15711508abab85cba3174f68a4343a15fb116.tar.gz
gnu: Add wdl.
Alined and improved the definition, as per the chat in IRC.

* gnu/packages/cpp.scm (wdl): New public variable.
* gnu/packages/patches/wdl-link-libs-and-fix-jnetlib.patch: New file.
* gnu/local.mk: Register the patch file.
Diffstat (limited to 'gnu/packages/cpp.scm')
-rw-r--r--gnu/packages/cpp.scm114
1 files changed, 113 insertions, 1 deletions
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index a3df706f43..cc594e56c5 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -8,7 +8,7 @@
 ;;; Copyright © 2019 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
 ;;; Copyright © 2020, 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
 ;;; Copyright © 2020 Roel Janssen <roel@gnu.org>
-;;; Copyright © 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020, 2021, 2023 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
@@ -32,6 +32,7 @@
 ;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Sughosha <Sughosha@proton.me>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -63,6 +64,7 @@
   #:use-module (guix modules)
   #:use-module (guix gexp)
   #:use-module (gnu packages)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages build-tools)
@@ -73,7 +75,11 @@
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gcc)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages libevent)
   #:use-module (gnu packages libunwind)
   #:use-module (gnu packages linux)
@@ -91,6 +97,7 @@
   #:use-module (gnu packages tls)
   #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
+  #:use-module (gnu packages xorg)
   #:use-module (ice-9 match))
 
 (define-public argagg
@@ -2231,3 +2238,108 @@ also includes a C library that checks casting, multiplication, division,
 addition and subtraction for all combinations of signed and unsigned 32-bit and
 64-bit integers.")
     (license license:expat)))
+
+(define-public wdl
+  ;; No tag is available.
+  (let ((commit "da86a62d11e46e4ecd8b16f9775cb5188340a0e2")
+        (revision "0"))
+    (package
+      (name "wdl")
+      (version (git-version "0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/justinfrankel/WDL")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                ;; This patch fixes error of undefined functions, due to not
+                ;; linking libraries, and invalid object.
+                (patches
+                 (search-patches "wdl-link-libs-and-fix-jnetlib.patch"))
+                (sha256
+                 (base32
+                  "0hdb604szkbrlyffiw94rz8wx4nvmk3zdkycfirqgjs7mh0l6vbq"))
+                (modules '((guix build utils)))
+                ;; Unbundle third party libraries which are not needed.
+                (snippet
+                 '(with-directory-excursion "WDL"
+                    (for-each delete-file-recursively
+                              (list "cmath"
+                                    "libpng"
+                                    "lice/glew"
+                                    "giflib"
+                                    "jpeglib"
+                                    "zlib"))))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:test-target "test"
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-after 'unpack 'chdir
+              (lambda _ (chdir "WDL/swell")))
+            (delete 'configure)
+            (replace 'build
+              (lambda _
+                (with-directory-excursion ".."
+                  (invoke "make" "-Ceel2")     ;build eel2
+                  (invoke "make" "-Cjnetlib")) ;build jnetlib
+                (invoke "make" "SWELL_SUPPORT_GTK=true")
+                (invoke "make" "libSwell.colortheme")))
+            (replace 'install
+              (lambda _
+                (chdir "..")
+
+                ;; Do not install these directories
+                (delete-file-recursively "lice/test")
+                (delete-file-recursively "swell/sample_project")
+
+                ;; Install headers.
+                (let ((include (string-append #$output "/include/WDL")))
+                  (for-each
+                   (lambda (file)
+                     (install-file file
+                                   (string-append include "/"
+                                                  (dirname file))))
+                   (find-files "." "\\.h$")))
+                (install-file "swell/libSwell.so"
+                              (string-append #$output "/lib"))
+                (install-file "swell/libSwell.colortheme"
+                              (string-append #$output "/share/WDL"))
+                (install-file "eel2/loose_eel"
+                              (string-append #$output "/libexec"))
+                (install-file "jnetlib/jnl.a"
+                              (string-append #$output "/lib")))))))
+      (native-inputs (list pkg-config nasm))
+      (inputs
+       (list cairo
+             fontconfig
+             freetype
+             gdk-pixbuf
+             glib
+             gtk+
+             libxi
+             libx11
+             mesa
+             zlib))
+      (home-page "https://www.cockos.com/wdl/")
+      (synopsis "Modestly reusable C++ libraries")
+      (description
+       "WDL is a modestly reusable C++ library that offers the following:
+@itemize
+@item Inline classes for cleanly managing memory allocations, lists,
+queues, resource pools, strings, etc.
+@item File reading/writing wrappers
+@item Directory scanning API
+@item SHA-1 implementation
+@item Mergesort implementation
+@item Blowfish implementation
+@item Fast FFT implementation (based on DJBFFT)
+@item Audio tools
+@item LICE - Lightweight Image Compositing Engine
+@item WDL Virtual Window system
+@item Plush2 - Portable, lightweight software 3d rendering engine
+@item SWELL - Simple Windows Emulation Layer
+@item And more.
+@end itemize")
+      (license license:zlib))))