[PATCH] gnu: Add libswell

  • Done
  • quality assurance status badge
Details
2 participants
  • Sughosha
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Sughosha
Severity
normal
S
S
Sughosha wrote on 19 Dec 2022 14:49
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
ChXlp6YIa5eQPVrAFeG2FC6o26Dc5gy7wqxPRhNRHBYQbA9_bSFj5eVJ54SNCY-PGGkKddEU6il-w16cEoGvT2mV_B3pyxlGo6yMrwzy0H8=@proton.me
* gnu/packages/wdl.scm (libswell): New variable.
---
gnu/packages/wdl.scm | 75 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
create mode 100644 gnu/packages/wdl.scm

Toggle diff (84 lines)
diff --git a/gnu/packages/wdl.scm b/gnu/packages/wdl.scm
new file mode 100644
index 0000000000..e0a7ea8fac
--- /dev/null
+++ b/gnu/packages/wdl.scm
@@ -0,0 +1,75 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2022 Sughosha <sughosha@proton.me>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages wdl)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (guix gexp)
+ #:use-module (guix git-download)
+ #:use-module (guix build-system gnu)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages gtk)
+ #:use-module (gnu packages pkg-config))
+
+(define %wdl-commit "60ef0b41d520813c63303046531c78ec95e64d5c")
+
+(define %wdl-origin
+ (origin
+ (method git-fetch)
+ (uri (git-reference (url "https://github.com/justinfrankel/WDL.git")
+ (commit %wdl-commit)))
+ (sha256 (base32 "0br0b4d230vhib5qm39ggf6m5pfipkjs4xqxkjxjnba7g0bdz7iv"))
+ (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 "jnetlib"
+ "libpng"
+ "giflib"
+ "jpeglib"
+ "zlib")))))
+
+(define-public libswell
+ (package
+ (name "libswell")
+ (version (git-version "0" "0" %wdl-commit))
+ (source %wdl-origin)
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (delete 'configure) ;no configure script
+ (replace 'build
+ (lambda _
+ (chdir "WDL")
+ (invoke "make" "-Cswell")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (install-file "swell/libSwell.so"
+ (string-append (assoc-ref outputs
+ "out")
+ "/lib")))))))
+ (native-inputs (list pkg-config))
+ (inputs (list gtk+))
+ (home-page "http://www.cockos.com/wdl")
+ (synopsis "Reasonable subset of the win32 API")
+ (description
+ "SWELL is Simple Windows Emulation Layer with support for automatic
+(PHP-based) dialog and menu resource conversion and SWELL-specific win32-style
+extensions.")
+ (license license:zlib)))

--
2.38.1
S
S
Sughosha wrote on 19 Dec 2022 15:04
[PATCH v2] gnu: libswell: align properly
(name . 60201@debbugs.gnu.org)(address . 60201@debbugs.gnu.org)
ksIz80tJQEl3kOX8H2zbbi0V-PE6OjRU2feipV2IcNqe9pbk18719uLuPOg8dVSzcHg-aCf8xAiCB7Kq4zpheEvRWjW_pDJqxgEQ2d8gtVc=@proton.me
* gnu/packages/wdl.scm (libswell): Align properly.
---
gnu/packages/wdl.scm | 52 ++++++++++++++++++++++----------------------
1 file changed, 26 insertions(+), 26 deletions(-)

Toggle diff (64 lines)
diff --git a/gnu/packages/wdl.scm b/gnu/packages/wdl.scm
index e0a7ea8fac..8cdea46103 100644
--- a/gnu/packages/wdl.scm
+++ b/gnu/packages/wdl.scm
@@ -45,31 +45,31 @@ (define %wdl-origin
"zlib")))))
(define-public libswell
- (package
- (name "libswell")
- (version (git-version "0" "0" %wdl-commit))
- (source %wdl-origin)
- (build-system gnu-build-system)
- (arguments
- `(#:tests? #f
- #:phases (modify-phases %standard-phases
- (delete 'configure) ;no configure script
- (replace 'build
- (lambda _
- (chdir "WDL")
- (invoke "make" "-Cswell")))
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (install-file "swell/libSwell.so"
- (string-append (assoc-ref outputs
- "out")
- "/lib")))))))
- (native-inputs (list pkg-config))
- (inputs (list gtk+))
- (home-page "http://www.cockos.com/wdl")
- (synopsis "Reasonable subset of the win32 API")
- (description
- "SWELL is Simple Windows Emulation Layer with support for automatic
+ (package
+ (name "libswell")
+ (version (git-version "0" "0" %wdl-commit))
+ (source %wdl-origin)
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (delete 'configure) ;no configure script
+ (replace 'build
+ (lambda _
+ (chdir "WDL")
+ (invoke "make" "-Cswell")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (install-file "swell/libSwell.so"
+ (string-append (assoc-ref outputs
+ "out")
+ "/lib")))))))
+ (native-inputs (list pkg-config))
+ (inputs (list gtk+))
+ (home-page "http://www.cockos.com/wdl")
+ (synopsis "Reasonable subset of the win32 API")
+ (description
+ "SWELL is Simple Windows Emulation Layer with support for automatic
(PHP-based) dialog and menu resource conversion and SWELL-specific win32-style
extensions.")
- (license license:zlib)))
+ (license license:zlib)))
--
2.38.1
S
S
Sughosha wrote on 19 Dec 2022 19:16
[PATCH v3] gnu/packages/wdl.scm: Remove unused module
(name . 60201@debbugs.gnu.org)(address . 60201@debbugs.gnu.org)
MjVRgtpD9K15mTi_wqLOGBriHXo3UpQR9-dPa5D722WAcJUITaQVEj8QkY0dcHb-e99O9yxWkHicJJbQEy5sqB84PPFHzUpqnJ19sMFq9uw=@proton.me
* gnu/packages/wdl.scm: Remove gexp module since it is not used.
---
gnu/packages/wdl.scm | 1 -
1 file changed, 1 deletion(-)

Toggle diff (14 lines)
diff --git a/gnu/packages/wdl.scm b/gnu/packages/wdl.scm
index 8cdea46103..d6d03bf568 100644
--- a/gnu/packages/wdl.scm
+++ b/gnu/packages/wdl.scm
@@ -19,7 +19,6 @@
(define-module (gnu packages wdl)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
- #:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
--
2.38.1
S
S
Sughosha wrote on 22 Dec 2022 19:08
[PATCH v4] gnu: libswell: Modify inputs
(name . 60201@debbugs.gnu.org)(address . 60201@debbugs.gnu.org)
IWa35JgfJKthEO3MG3XHRdCJ9T1jsb5A65GbKvOEn3gUEuDlPgBu9m3oGnUbv6d7SFbnQsqNfncwmnghxDfWoB8ffP7dsCLC2IFf_EqY08Q=@proton.me
* gnu/packages/wdl.scm (libswell)[inputs]: Add more required packages.
---
gnu/packages/wdl.scm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Toggle diff (21 lines)
diff --git a/gnu/packages/wdl.scm b/gnu/packages/wdl.scm
index d6d03bf568..f08566f150 100644
--- a/gnu/packages/wdl.scm
+++ b/gnu/packages/wdl.scm
@@ -64,7 +64,15 @@ (define-public libswell
"out")
"/lib")))))))
(native-inputs (list pkg-config))
- (inputs (list gtk+))
+ (inputs (list cairo
+ fonyconfig
+ freetype
+ gdk-pixbuf
+ glib
+ gobject-introspection
+ gtk+
+ mesa
+ pango))
(home-page "http://www.cockos.com/wdl")
(synopsis "Reasonable subset of the win32 API")
(description
--
2.38.1
S
S
Sughosha wrote on 22 Dec 2022 20:08
[PATCH v5] gnu: libswell: Lint and fix mistakes.
(name . 60201@debbugs.gnu.org)(address . 60201@debbugs.gnu.org)
gmjH7rxkpzufgknjd7zBcE4zKP6foG7lMBkxY70rUlJcct8tqTw2kQA8aSD7bHiE1IHlTNkpY6nQk4Tc-_0YPee0PS_vY6KyT0svyniqAW8=@proton.me
* gnu/packages/wdl.scm: Add required modules.
(%wdl-origin): Modify URL.
(libswell)[inputs]: Fix typo.
---
gnu/packages/wdl.scm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/wdl.scm b/gnu/packages/wdl.scm
index f08566f150..afb8000e78 100644
--- a/gnu/packages/wdl.scm
+++ b/gnu/packages/wdl.scm
@@ -22,6 +22,9 @@ (define-module (gnu packages wdl)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module (gnu packages)
+ #:use-module (gnu packages fontutils)
+ #:use-module (gnu packages gl)
+ #:use-module (gnu packages glib)
#:use-module (gnu packages gtk)
#:use-module (gnu packages pkg-config))

@@ -30,7 +33,7 @@ (define %wdl-commit "60ef0b41d520813c63303046531c78ec95e64d5c")
(define %wdl-origin
(origin
(method git-fetch)
- (uri (git-reference (url "https://github.com/justinfrankel/WDL.git")
+ (uri (git-reference (url "https://github.com/justinfrankel/WDL")
(commit %wdl-commit)))
(sha256 (base32 "0br0b4d230vhib5qm39ggf6m5pfipkjs4xqxkjxjnba7g0bdz7iv"))
(modules '((guix build utils)))
@@ -65,7 +68,7 @@ (define-public libswell
"/lib")))))))
(native-inputs (list pkg-config))
(inputs (list cairo
- fonyconfig
+ fontconfig
freetype
gdk-pixbuf
glib
--
2.38.1
S
S
Sughosha wrote on 30 Dec 2022 18:33
[PATCH v6] gnu/local.mk: Register wdl.scm.
(name . 60201@debbugs.gnu.org)(address . 60201@debbugs.gnu.org)
gURXOpE2JTOAoDMbxCcxutrlOgMSXYqpH7fblUyT_HbAozVvBxUQe6XJSDu80ATG0jR4LDzQz-iZRgZeR54ZEgMMndHo2VQqKUEiLIv3ZDY=@proton.me
* gnu/local.mk: Register wdl.scm.
---
gnu/local.mk | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0d4028a161..823818accc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -623,6 +623,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/vulkan.scm \
%D%/packages/w3m.scm \
%D%/packages/wdiff.scm \
+ %D%/packages/wdl.scm \
%D%/packages/weather.scm \
%D%/packages/web.scm \
%D%/packages/web-browsers.scm \
--
2.38.1
S
S
Sughosha wrote on 30 Dec 2022 19:16
[PATCH v7] gnu: Add libswell.
(name . 60201@debbugs.gnu.org)(address . 60201@debbugs.gnu.org)
2HXsyBKXURVIdF2t0_b1EKzxtjGov3LB8BwE1J2mehqNTufGcWuk8fQHTIsNIEKc0D98lrmC3BdmB2eMf892j0Ndm_3NtKHHmw_TkSfJ7wc=@proton.me
* gnu/packages/wdl.scm: New file.
(libswell): New public variable.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add the new file.
---
gnu/local.mk | 1 +
gnu/packages/wdl.scm | 85 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 86 insertions(+)
create mode 100644 gnu/packages/wdl.scm

Toggle diff (105 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0d4028a161..823818accc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -623,6 +623,7 @@ GNU_SYSTEM_MODULES = \
%D%/packages/vulkan.scm \
%D%/packages/w3m.scm \
%D%/packages/wdiff.scm \
+ %D%/packages/wdl.scm \
%D%/packages/weather.scm \
%D%/packages/web.scm \
%D%/packages/web-browsers.scm \
diff --git a/gnu/packages/wdl.scm b/gnu/packages/wdl.scm
new file mode 100644
index 0000000000..afb8000e78
--- /dev/null
+++ b/gnu/packages/wdl.scm
@@ -0,0 +1,85 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2022 Sughosha <sughosha@proton.me>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages wdl)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (guix git-download)
+ #:use-module (guix build-system gnu)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages fontutils)
+ #:use-module (gnu packages gl)
+ #:use-module (gnu packages glib)
+ #:use-module (gnu packages gtk)
+ #:use-module (gnu packages pkg-config))
+
+(define %wdl-commit "60ef0b41d520813c63303046531c78ec95e64d5c")
+
+(define %wdl-origin
+ (origin
+ (method git-fetch)
+ (uri (git-reference (url "https://github.com/justinfrankel/WDL")
+ (commit %wdl-commit)))
+ (sha256 (base32 "0br0b4d230vhib5qm39ggf6m5pfipkjs4xqxkjxjnba7g0bdz7iv"))
+ (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 "jnetlib"
+ "libpng"
+ "giflib"
+ "jpeglib"
+ "zlib")))))
+
+(define-public libswell
+ (package
+ (name "libswell")
+ (version (git-version "0" "0" %wdl-commit))
+ (source %wdl-origin)
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (delete 'configure) ;no configure script
+ (replace 'build
+ (lambda _
+ (chdir "WDL")
+ (invoke "make" "-Cswell")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (install-file "swell/libSwell.so"
+ (string-append (assoc-ref outputs
+ "out")
+ "/lib")))))))
+ (native-inputs (list pkg-config))
+ (inputs (list cairo
+ fontconfig
+ freetype
+ gdk-pixbuf
+ glib
+ gobject-introspection
+ gtk+
+ mesa
+ pango))
+ (home-page "http://www.cockos.com/wdl")
+ (synopsis "Reasonable subset of the win32 API")
+ (description
+ "SWELL is Simple Windows Emulation Layer with support for automatic
+(PHP-based) dialog and menu resource conversion and SWELL-specific win32-style
+extensions.")
+ (license license:zlib)))
--
2.38.1
R
R
Ricardo Wurmus wrote on 2 Jan 2023 12:32
[PATCH] gnu: Add libswell
(address . 60201@debbugs.gnu.org)
87a6315fwx.fsf@elephly.net
Hi,

thank you for the patch!

Could you add a comment why tests are disabled?

I recommend using a gexp for the phases:

(arguments
(list
;; There are no tests.
#:tests? #false
#:phases
#~(modify-phases … )))

Then you can use #$output instead of binding the ‘outputs’ keyword
argument and looking up the output with label ‘out’.

Is it really enough to just install the .so? Shouldn’t the headers also
be installed?

Why are origin and commit separated as a global definition? That seems
unnecessary.

--
Ricardo
S
S
Sughosha wrote on 3 Jan 2023 23:09
[PATCH v8] gnu: Add wdl.
(name . 60201@debbugs.gnu.org)(address . 60201@debbugs.gnu.org)
VkI9iOlrCQ8xIGf-f80gHGENdl6ndijxNt0QRMfRnGLtuxVBUvkG-YtyTnSNTPjnJ_6QMhoRS2t8O2iGeXpRU70t1ULh8VpZdsamSUVNEh4=@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

Toggle diff (224 lines)
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
S
S
Sughosha wrote on 4 Jan 2023 00:15
[PATCH v9] gnu: Add wdl.
(name . 60201@debbugs.gnu.org)(address . 60201@debbugs.gnu.org)
R1VfpPoLdjd7ygcjBoKlU3laZKeVeA7wdyvux_zFhmj_nRYtmuDWOrfDkwvctI0VmxTlmv_dvVb0syjTGUBWPLDqZEeqwI3DDjE3eU22Cok=@proton.me
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.
---
gnu/local.mk | 1 +
gnu/packages/cpp.scm | 125 ++++++++++++++++++
.../wdl-link-libs-and-fix-jnetlib.patch | 53 ++++++++
3 files changed, 179 insertions(+)
create mode 100644 gnu/packages/patches/wdl-link-libs-and-fix-jnetlib.patch

Toggle diff (228 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index f0b1b3fd15..4b6ef757ad 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 a3df706f43..bcf234187e 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -63,6 +63,7 @@ (define-module (gnu packages cpp)
#: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 @@ (define-module (gnu packages cpp)
#: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 @@ (define-module (gnu packages cpp)
#: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,122 @@ (define-public safeint
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
+ '(for-each
+ (lambda (dir)
+ (with-directory-excursion "WDL"
+ (delete-file-recursively dir)))
+ (list "cmath"
+ "libpng"
+ "lice/glew"
+ "giflib"
+ "jpeglib"
+ "zlib")))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:test-target "test"
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda _
+ (chdir "WDL")
+ (invoke "make" "-Ceel2") ;build eel2
+ (invoke "make" "-Cjnetlib") ;build jnetlib
+
+ ;; Build swell.
+ (chdir "swell")
+ (invoke "make" "SWELL_SUPPORT_GTK=true")
+ (invoke "make" "libSwell.colortheme")))
+ (replace 'install
+ (lambda _
+ (let ((include (string-append #$output
+ "/include/WDL")))
+ (chdir "../")
+ (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 "swell"
+ (install-file "libSwell.so"
+ (string-append #$output
+ "/lib"))
+ (install-file "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))))
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 0000000000..29ec0f058c
--- /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
+
--
2.38.1
R
R
Ricardo Wurmus wrote on 4 Jan 2023 11:23
[PATCH] gnu: Add libswell
(address . 60201-done@debbugs.gnu.org)
87bkne4mtm.fsf@elephly.net
Thank you for your patience.
I took the liberty of making a few changes:

- minor indentation / formatting changes
- pulled out the “with-directory-excursion” to simplify the snippet
- used “with-directory-excursion” where possible to avoid stateful
behavior across build phases.
- removed the “mkdir-p” which would have only created empty directories
in $out/include, and simplified installation of all headers.
- added a copyright line for you

It’s all pushed to the “master” branch with commit
a8f15711508abab85cba3174f68a4343a15fb116.

Thanks!

--
Ricardo
Closed
?