all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sughosha via Guix-patches via <guix-patches@gnu.org>
To: "60201@debbugs.gnu.org" <60201@debbugs.gnu.org>
Subject: [bug#60201] [PATCH v8] gnu: Add wdl.
Date: Tue, 03 Jan 2023 22:09:01 +0000	[thread overview]
Message-ID: <VkI9iOlrCQ8xIGf-f80gHGENdl6ndijxNt0QRMfRnGLtuxVBUvkG-YtyTnSNTPjnJ_6QMhoRS2t8O2iGeXpRU70t1ULh8VpZdsamSUVNEh4=@proton.me> (raw)
In-Reply-To: <ChXlp6YIa5eQPVrAFeG2FC6o26Dc5gy7wqxPRhNRHBYQbA9_bSFj5eVJ54SNCY-PGGkKddEU6il-w16cEoGvT2mV_B3pyxlGo6yMrwzy0H8=@proton.me>

I finally moved the whole thing to cpp.scm and hope that this is the right place. I also changed the name to wdl and included header files, but I don't know if I should install .cpp files also, and if yes, I don't know where, so I left them.

* 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.
---
 gnu/local.mk                                             |   1 +
 gnu/packages/cpp.scm                                     | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gnu/packages/patches/wdl-link-libs-and-fix-jnetlib.patch |  53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 177 insertions(+)
 create mode 100644 gnu/packages/patches/wdl-link-libs-and-fix-jnetlib.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f0b1b3f..4b6ef75 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1987,6 +1987,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/wacomtablet-add-missing-includes.patch	\
   %D%/packages/patches/wacomtablet-qt5.15.patch			\
   %D%/packages/patches/warsow-qfusion-fix-bool-return-type.patch	\
+  %D%/packages/patches/wdl-link-libs-and-fix-jnetlib.patch	\
   %D%/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch	\
   %D%/packages/patches/webrtc-audio-processing-big-endian.patch	\
   %D%/packages/patches/webrtc-for-telegram-desktop-fix-gcc12-cstdint.patch   \
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index a3df706..f7254e2 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,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 +74,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 +96,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 +2237,120 @@ 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
+  (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))
+                (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 '(for-each (lambda (dir)
+                                      (delete-file-recursively (string-append
+                                                                "WDL/" dir)))
+                                    (list "cmath"
+                                          "libpng"
+                                          "lice/glew"
+                                          "giflib"
+                                          "jpeglib"
+                                          "zlib")))))
+      (build-system gnu-build-system)
+      (arguments
+       (list #:phases #~(modify-phases %standard-phases
+                          (delete 'configure)
+                          (replace 'build
+                            (lambda _
+                              (with-directory-excursion "WDL/swell"
+                                (invoke "make" "SWELL_SUPPORT_GTK=true")
+                                (invoke "make" "libSwell.colortheme"))
+                              (invoke "make" "-CWDL/eel2")
+                              (invoke "make" "-CWDL/jnetlib")))
+                          (replace 'check
+                            (lambda _
+                              (with-directory-excursion "WDL/swell"
+                                (invoke "make" "test"))))
+                          (replace 'install
+                            (lambda _
+                              (let ((include (string-append #$output
+                                                            "/include/WDL")))
+                                (with-directory-excursion "WDL"
+                                  (delete-file-recursively "lice/test")
+                                  (delete-file-recursively
+                                   "swell/sample_project")
+                                  (for-each (lambda (file)
+                                              (mkdir-p (string-append include
+                                                                      "/"
+                                                                      file)))
+                                            (list "eel2"
+                                                  "jnetlib"
+                                                  "lice"
+                                                  "localize"
+                                                  "plush2"
+                                                  "prvhash"
+                                                  "swell"
+                                                  "win32_curses"
+                                                  "wingui/scrollbar"))
+                                  (for-each (lambda (file)
+                                              (copy-file file
+                                                         (string-append
+                                                          include "/" file)))
+                                            (find-files "." "\\.h$")))
+                                (with-directory-excursion "WDL/swell"
+                                  (install-file "libSwell.so"
+                                                (string-append #$output
+                                                               "/lib"))
+                                  (install-file "libSwell.colortheme"
+                                                (string-append #$output
+                                                               "/share/WDL")))
+                                (install-file "WDL/eel2/loose_eel"
+                                              (string-append #$output
+                                                             "/libexec"))
+                                (install-file "WDL/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 C++ library that is designed to be easily used by other code.
+
+WDL includes 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))))
diff --git a/gnu/packages/patches/wdl-link-libs-and-fix-jnetlib.patch b/gnu/packages/patches/wdl-link-libs-and-fix-jnetlib.patch
new file mode 100644
index 0000000..29ec0f0
--- /dev/null
+++ b/gnu/packages/patches/wdl-link-libs-and-fix-jnetlib.patch
@@ -0,0 +1,53 @@
+From 2d129502354da4fe39dac13463ea742f8026ab91 Mon Sep 17 00:00:00 2001
+From: Sughosha <sughosha@proton.me>
+Date: Tue, 3 Jan 2023 22:15:09 +0100
+Subject: [PATCH] Link libs and fix jnetlib.
+
+---
+ WDL/eel2/Makefile    | 2 +-
+ WDL/jnetlib/Makefile | 2 +-
+ WDL/swell/Makefile   | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/WDL/eel2/Makefile b/WDL/eel2/Makefile
+index ac2e41f1..0ffca97a 100644
+--- a/WDL/eel2/Makefile
++++ b/WDL/eel2/Makefile
+@@ -153,7 +153,7 @@ gen-lex:  # the output of this, lex.nseel.c, is unused because we have a handwri
+ 	$(CXX) $(CXXFLAGS) -c -o $@ $^
+ 
+ loose_eel: loose_eel.o $(OBJS) $(OBJS2)
+-	g++ -o $@ $^ $(CXXFLAGS) $(LFLAGS)
++	g++ -o $@ $^ $(CXXFLAGS) $(LFLAGS) -lGL
+ 
+ clean:
+ 	-rm -f -- loose_eel loose_eel.o $(OBJS)
+diff --git a/WDL/jnetlib/Makefile b/WDL/jnetlib/Makefile
+index 10d9fe8a..85570c5a 100644
+--- a/WDL/jnetlib/Makefile
++++ b/WDL/jnetlib/Makefile
+@@ -7,7 +7,7 @@ CC = gcc
+ CPP = g++
+ CXX = g++
+ 
+-OBJS = asyncdns.o connection.o httpget.o httpserv.o listen.o util.o sercon.o
++OBJS = asyncdns.o connection.o httpget.o httpserv.o listen.o util.o
+ 
+ jnl.a: ${OBJS}
+ 	-rm -f jnl.a
+diff --git a/WDL/swell/Makefile b/WDL/swell/Makefile
+index 9e7e2d87..8e98a543 100644
+--- a/WDL/swell/Makefile
++++ b/WDL/swell/Makefile
+@@ -167,7 +167,7 @@ libSwell$(DLL_EXT): $(OBJS)
+ 	$(CXX) -shared -o $@ $(CFLAGS) $(LFLAGS) $^ $(LINKEXTRA)
+ 
+ test: $(OBJS) test.o
+-	$(CXX) -o test $(CFLAGS) $(LFLAGS) $^ $(LINKEXTRA)
++	$(CXX) -o test $(CFLAGS) $(LFLAGS) $^ $(LINKEXTRA) -lpthread -ldl $(shell $(PKG_CONFIG) --libs gtk+-3.0 freetype2) -lfontconfig -lGL -lXi -lX11
+ 
+ libSwell.colortheme: swell-gdi-generic.cpp $(SWELL_HEADERS)
+ 	$(CXX) $(CFLAGS) -o make-theme -DSWELL__MAKE_THEME swell-gdi-generic.cpp -lpthread
+-- 
+2.38.1
+
--
libgit2 1.4.3





  parent reply	other threads:[~2023-01-03 22:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 13:49 [bug#60201] [PATCH] gnu: Add libswell Sughosha via Guix-patches via
2022-12-19 14:04 ` [bug#60201] [PATCH v2] gnu: libswell: align properly Sughosha via Guix-patches via
2022-12-19 18:16 ` [bug#60201] [PATCH v3] gnu/packages/wdl.scm: Remove unused module Sughosha via Guix-patches via
2022-12-22 18:08 ` [bug#60201] [PATCH v4] gnu: libswell: Modify inputs Sughosha via Guix-patches via
2022-12-22 19:08 ` [bug#60201] [PATCH v5] gnu: libswell: Lint and fix mistakes Sughosha via Guix-patches via
2022-12-30 17:33 ` [bug#60201] [PATCH v6] gnu/local.mk: Register wdl.scm Sughosha via Guix-patches via
2022-12-30 18:16 ` [bug#60201] [PATCH v7] gnu: Add libswell Sughosha via Guix-patches via
2023-01-02 11:32 ` [bug#60201] [PATCH] " Ricardo Wurmus
2023-01-03 22:09 ` Sughosha via Guix-patches via [this message]
2023-01-03 23:15 ` [bug#60201] [PATCH v9] gnu: Add wdl Sughosha via Guix-patches via
2023-01-04 10:23 ` bug#60201: [PATCH] gnu: Add libswell Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='VkI9iOlrCQ8xIGf-f80gHGENdl6ndijxNt0QRMfRnGLtuxVBUvkG-YtyTnSNTPjnJ_6QMhoRS2t8O2iGeXpRU70t1ULh8VpZdsamSUVNEh4=@proton.me' \
    --to=guix-patches@gnu.org \
    --cc=60201@debbugs.gnu.org \
    --cc=Sughosha@proton.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.