[PATCH] gnu: Add slade.

  • Done
  • quality assurance status badge
Details
4 participants
  • James Smith
  • James Smith
  • Ludovic Courtès
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
James Smith
Severity
normal
J
J
James Smith wrote on 16 Oct 2020 20:43
(address . guix-patches@gnu.org)(name . James Smith)(address . jsubuntuxp@disroot.org)
20201016184333.1445-1-jsubuntuxp@disroot.org
* gnu/packages/game-development.scm (slade): New variable.
---
gnu/packages/game-development.scm | 56 ++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)

Toggle diff (87 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 96ed2f9da4..55d60d03a3 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2020 James Smith <jsubuntuxp@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -37,7 +38,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages game-development)
- #:use-module (srfi srfi-1)
+ #:use-module ((srfi srfi-1) #:hide (zip))
#:use-module (ice-9 match)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
@@ -94,6 +95,7 @@
#:use-module (gnu packages tls)
#:use-module (gnu packages video)
#:use-module (gnu packages web)
+ #:use-module (gnu packages wxwidgets)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xiph)
#:use-module (gnu packages xml)
@@ -2505,3 +2507,55 @@ fully dynamic omnidirectional shadows, global illumination, HDR lighting,
deferred shading, morphological / temporal / multisample anti-aliasing, and
much more.")
(license license:zlib))))
+
+(define-public slade
+ (package
+ (name "slade")
+ (version "3.1.12a")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/sirjuddington/SLADE")
+ (commit version)))
+ (sha256 (base32 "1q37pqibnrbdd7zjx7h2kfi0q9nc63cc96q9ya4x3fvsrf64n6yd"))
+ (file-name (git-file-name name version))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:configure-flags
+ (list "-DWX_GTK3=ON" "-DNO_WEBVIEW=ON"
+ (string-append "-DWITH_WXPATH="
+ (assoc-ref %build-inputs "wxwidgets") "/bin")
+ (string-append "-DwxWidgets_LIBRARIES="
+ (assoc-ref %build-inputs "wxwidgets") "/lib"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'patch-gdk-backend
+ ;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
+ ;; See https://github.com/sirjuddington/SLADE/issues/1097 for details.
+ (lambda* _
+ (wrap-program
+ (string-append (assoc-ref %outputs "out") "/bin/slade")
+ `("GDK_BACKEND" "" = (,"x11")))
+ #t)))
+ #:tests? #f))
+ (inputs
+ `(("curl" ,curl)
+ ("fluidsynth" ,fluidsynth)
+ ("freeimage" ,freeimage)
+ ("ftgl" ,ftgl)
+ ("glew" ,glew)
+ ("gtk+" ,gtk+)
+ ("sfml" ,sfml)
+ ("wxwidgets" ,wxwidgets-3.1)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("which" ,which)
+ ("zip" ,zip)))
+ (home-page "https://slade.mancubus.net")
+ (synopsis "Doom game data editor")
+ (description "SLADE3 is a modern editor for Doom-engine based games and
+source ports. It has the ability to view, modify, and write many different game-
+specific formats, and even convert between some of them, or from/to other generic
+formats such as PNG.")
+ (license license:gpl2)))
--
2.28.0
T
T
Tobias Geerinckx-Rice wrote on 16 Oct 2020 23:07
(name . James Smith)(address . jsubuntuxp@disroot.org)
87zh4lanh9.fsf@nckx
James,

Thanks for the patch!

James Smith ???
Toggle quote (2 lines)
> +(define-public slade

Let's keep modules vaguely alphabetical. Could you move this
above ‘tiled’?

Toggle quote (2 lines)
> + (add-after 'install 'patch-gdk-backend

Nitpick: it's not patching anything.

Toggle quote (6 lines)
> + ;; Set GDK_BACKEND to x11 to prevent crash on
> Wayland.
> + ;; See
> https://github.com/sirjuddington/SLADE/issues/1097 for details.
> + (lambda* _

No need for lambda* over lambda when you're not using any of its
extended features....

Toggle quote (3 lines)
> + (string-append (assoc-ref %outputs "out")
> "/bin/slade")

...however, you *could* use its keyword arguments to get rid of
this ugly %outputs pseudo-global. See below.

Toggle quote (2 lines)
> + `("GDK_BACKEND" "" = (,"x11")))

This works but the "" and , are redundant.

All in all, the phase can be rewritten as:

(add-after 'install 'wrap-with-x11-gdk-backend
;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
See
for details.
(lambda* (#:key outputs #:allow-other-keys)
(wrap-program
(string-append (assoc-ref outputs "out")
"/bin/slade")
'("GDK_BACKEND" = ("x11")))
#t)))

Toggle quote (2 lines)
> + #:tests? #f))

Are there no tests at all? If so, note in a comment:

#:tests? #f)) ; no test suite

Same if there are tests but they're broken or pointless (linting
etc.).

There's one more problem:

set(ZIP_COMMAND "${ZIPTOOL_ZIP_EXECUTABLE}" -X -UN=UTF8 -9 -r \
"${CMAKE_BINARY_DIR}/slade.pk3" .)

Even zip -X won't create an identical archive on every run. There
doesn't seem to be an option to do so. The result:

--- /gnu/store/aaa-slade-3.1.12a/share/slade3/slade.pk3
+++ /gnu/store/bbb-slade-3.1.12a/share/slade3/slade.pk3
Zip file size: 3624588 bytes, number of entries: 768
-drwxr-xr-x 3.0 unx 0 b- stor 20-Oct-16 19:17 html/
-drwxr-xr-x 3.0 unx 0 b- stor 20-Oct-16 19:17 config/
-drwxr-xr-x 3.0 unx 0 b- stor 20-Oct-16 19:17 config/colours/
+drwxr-xr-x 3.0 unx 0 b- stor 20-Oct-16 19:31 html/
+drwxr-xr-x 3.0 unx 0 b- stor 20-Oct-16 19:31 config/
+drwxr-xr-x 3.0 unx 0 b- stor 20-Oct-16 19:31 config/colours/

This is not ideal: Guix aims for reproducible builds.

The following made multiple builds on one machine identical, but
was not consistent between file systems, probably due to readdir
order:

+ (add-before 'build 'reset-slade.pk3-timestamps
+ ;; This appears sufficient to make slade.pk3 reproducible.
+ (lambda _
+ (invoke "find" "../source/dist/res" "-exec" "touch"
+ "--no-dereference" "-t" "197001010000.00" "{}"
"+")))

I suppose I could try using find to sort the files before invoking
zip, or something. Thoughts?

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX4oLog0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15rtQA/j60C81XRN19jxaTSDhaRVPAYtb+AGfLS60C8ppR
UZ13AP9gENWeHc6UhsPw0jtjxa+1lzdC7z3birrh9iXRDzW8AA==
=dJU1
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 16 Oct 2020 23:14
(name . Tobias Geerinckx-Rice via Guix-patches)(address . guix-patches@gnu.org)
87wnzpan5w.fsf@nckx
Tobias Geerinckx-Rice via Guix-patches via ???
Toggle quote (2 lines)
> All in all, the phase can be rewritten as:

Grumble:
(add-after 'install 'patch-gdk-backend
;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
See
for details.
(lambda* (#:key outputs #:allow-other-keys)
(wrap-program
(string-append (assoc-ref outputs "out")
"/bin/slade")
'("GDK_BACKEND" = ("x11")))
#t)))
Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX4oNOw0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15J3AA/3xVgYTpN/C2C1tMfGPx1YHuRm60pBLhYWRVaQTf
G5U9AP4pIQxehJSj0Mku6nHCKhE+B8JVgiwS87sA6A+J3HsXDw==
=QEKi
-----END PGP SIGNATURE-----

J
J
James Smith wrote on 17 Oct 2020 02:41
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
0f10b54f-81a1-4de4-af81-7cb06ac0c865@disroot.org
Tobias,

On Fri, 16 Oct 2020 14:07:46 -0700,
Tobias Geerinckx-Rice wrote:

Toggle quote (7 lines)
>
>> +(define-public slade
>>
> Let's keep modules vaguely alphabetical.  Could you move this above
>
> ‘tiled’?
>
Sure thing, I didn't see anything in the manual about sorting alphabetically and
other definitions weren't in order either.

Toggle quote (5 lines)
>
>> +         (add-after 'install 'patch-gdk-backend
>>
> Nitpick: it's not patching anything.
>
Now that you point that out, patch wasn't the word I was looking for.

Toggle quote (5 lines)
>
>> +               `("GDK_BACKEND" "" = (,"x11")))
>>
> This works but the "" and , are redundant.
>
Thanks for pointing that out, I didn't see any existing examples doing it that
way.

Toggle quote (24 lines)
> All in all, the phase can be rewritten as:
>
> (add-after 'install 'wrap-with-x11-gdk-backend
>
> ;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
>
> See
>
> ;; https://github.com/sirjuddington/SLADE/issues/1097
>
> for details.
>
> (lambda* (#:key outputs #:allow-other-keys)
>
> (wrap-program
>
> (string-append (assoc-ref outputs "out")
>
> "/bin/slade")
>
> '("GDK_BACKEND" = ("x11")))
>
> #t)))
>
Done.

Toggle quote (7 lines)
>
>> +       #:tests? #f))
>>
> Are there no tests at all?  If so, note in a comment:
>
> #:tests? #f))                    ; no test suite
>
Yeah, no tests.

Toggle quote (30 lines)
> There's one more problem:
>
> set(ZIP_COMMAND "${ZIPTOOL_ZIP_EXECUTABLE}" -X -UN=UTF8 -9 -r \
>
> "${CMAKE_BINARY_DIR}/slade.pk3" .)
>
> Even zip -X won't create an identical archive on every run.  There
>
> doesn't seem to be an option to do so.  The result:
>
> --- /gnu/store/aaa-slade-3.1.12a/share/slade3/slade.pk3
>
> +++ /gnu/store/bbb-slade-3.1.12a/share/slade3/slade.pk3
>
> Zip file size: 3624588 bytes, number of entries: 768
>
> -drwxr-xr-x  3.0 unx  0 b- stor 20-Oct-16 19:17 html/
>
> -drwxr-xr-x  3.0 unx  0 b- stor 20-Oct-16 19:17 config/
>
> -drwxr-xr-x  3.0 unx  0 b- stor 20-Oct-16 19:17 config/colours/
>
> +drwxr-xr-x  3.0 unx  0 b- stor 20-Oct-16 19:31 html/
>
> +drwxr-xr-x  3.0 unx  0 b- stor 20-Oct-16 19:31 config/
>
> +drwxr-xr-x  3.0 unx  0 b- stor 20-Oct-16 19:31 config/colours/
>
> This is not ideal: Guix aims for reproducible builds.
>
I didn't think to check zip-compressed files.

Toggle quote (18 lines)
> The following made multiple builds on one machine identical, but was
>
> not consistent between file systems, probably due to readdir order:
>
> + (add-before 'build 'reset-slade.pk3-timestamps
>
> +   ;; This appears sufficient to make slade.pk3 reproducible.
>
> +   (lambda _
>
> +     (invoke "find" "../source/dist/res" "-exec" "touch"
>
> +             "--no-dereference" "-t" "197001010000.00" "{}" "+")))
>
> I suppose I could try using find to sort the files before invoking
>
> zip, or something.  Thoughts?
>
Unless there's a better way, let's do that.

Thanks for your help,

James Smith
From 5035bc25a050ce6f81538000b59df05fb02b7e65 Mon Sep 17 00:00:00 2001
From: James Smith <jsubuntuxp@disroot.org>
Date: Fri, 16 Oct 2020 11:24:14 -0700
Subject: [PATCH v2] gnu: Add slade.

* gnu/packages/game-development.scm (slade): New variable.
---
gnu/packages/game-development.scm | 63 ++++++++++++++++++++++++++++++-
1 file changed, 62 insertions(+), 1 deletion(-)

Toggle diff (97 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 96ed2f9da4..807b37b4e6 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
+;;; Copyright © 2020 James Smith <jsubuntuxp@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -37,7 +38,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages game-development)
- #:use-module (srfi srfi-1)
+ #:use-module ((srfi srfi-1) #:hide (zip))
#:use-module (ice-9 match)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
@@ -94,6 +95,7 @@
#:use-module (gnu packages tls)
#:use-module (gnu packages video)
#:use-module (gnu packages web)
+ #:use-module (gnu packages wxwidgets)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xiph)
#:use-module (gnu packages xml)
@@ -441,6 +443,65 @@ GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
support.")
(license license:gpl3+)))
+(define-public slade
+ (package
+ (name "slade")
+ (version "3.1.12a")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/sirjuddington/SLADE")
+ (commit version)))
+ (sha256 (base32 "1q37pqibnrbdd7zjx7h2kfi0q9nc63cc96q9ya4x3fvsrf64n6yd"))
+ (file-name (git-file-name name version))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:configure-flags
+ (list "-DWX_GTK3=ON" "-DNO_WEBVIEW=ON"
+ (string-append "-DWITH_WXPATH="
+ (assoc-ref %build-inputs "wxwidgets") "/bin")
+ (string-append "-DwxWidgets_LIBRARIES="
+ (assoc-ref %build-inputs "wxwidgets") "/lib"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'reset-slade.pk3-timestamps
+ ;; This appears sufficient to make slade.pk3 reproducible.
+ (lambda _
+ (invoke "find" "../source/dist/res" "-exec" "touch"
+ "--no-dereference" "-t" "197001010000.00" "{}"
+ "+")))
+ (add-after 'install 'wrap-with-x11-gdk-backend
+ ;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
+ ;; See https://github.com/sirjuddington/SLADE/issues/1097 for details.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (wrap-program
+ (string-append (assoc-ref outputs "out")
+ "/bin/slade")
+ '("GDK_BACKEND" = ("x11")))
+ #t)))
+ #:tests? #f)) ;; No test suite.
+ (inputs
+ `(("curl" ,curl)
+ ("fluidsynth" ,fluidsynth)
+ ("freeimage" ,freeimage)
+ ("ftgl" ,ftgl)
+ ("glew" ,glew)
+ ("gtk+" ,gtk+)
+ ("sfml" ,sfml)
+ ("wxwidgets" ,wxwidgets-3.1)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("which" ,which)
+ ("zip" ,zip)))
+ (home-page "https://slade.mancubus.net")
+ (synopsis "Doom game data editor")
+ (description "SLADE3 is a modern editor for Doom-engine based games and
+source ports. It has the ability to view, modify, and write many different game-
+specific formats, and even convert between some of them, or from/to other generic
+formats such as PNG.")
+ (license license:gpl2)))
+
(define-public tiled
(package
(name "tiled")
--
2.28.0
L
L
Ludovic Courtès wrote on 28 Oct 2020 15:54
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87y2jq1jvc.fsf@gnu.org
Hi,

Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (9 lines)
> The following made multiple builds on one machine identical, but was
> not consistent between file systems, probably due to readdir order:
>
> + (add-before 'build 'reset-slade.pk3-timestamps
> + ;; This appears sufficient to make slade.pk3 reproducible.
> + (lambda _
> + (invoke "find" "../source/dist/res" "-exec" "touch"
> + "--no-dereference" "-t" "197001010000.00" "{}" "+")))

It’s surprising that this is necessary because the ‘unpack’ phase copies
the source directory preserving the mtime of files and since those files
are in the store, their mtime is 1:

;; Preserve timestamps (set to the Epoch) on the copied tree so that
;; things work deterministically.
(copy-recursively source "."
#:keep-mtime? #t)

Thoughts?

Anyhow, we can probably push v2.

Thanks,
Ludo’.
J
J
James Smith wrote on 29 Oct 2020 03:49
(name . Ludovic Courtès)(address . ludo@gnu.org)
d52a3e3d-a8c6-4d98-87d6-7d102f09015f@gmail.com
I have a couple of questions since I'm new to this sort of thing:
1. Do I need to rebase first?
2. If I do, are there any final changes needed?

James Smith
L
L
Ludovic Courtès wrote on 30 Oct 2020 00:39
(name . James Smith)(address . jsubuntuxp@gmail.com)
87v9esy52t.fsf@gnu.org
Hi,

James Smith <jsubuntuxp@gmail.com> skribis:

Toggle quote (4 lines)
> I have a couple of questions since I'm new to this sort of thing:
> 1. Do I need to rebase first?
> 2. If I do, are there any final changes needed?

Like I wrote, it seems that v2 mostly fits the bill. The only potential
issue as I see it is the new ‘reset-slade.pk3-timestamps’ phase: I don’t
see what effect it has, like I wrote, so I wonder if it’s necessary.

Tobias, WDYT?

Thanks,
Ludo’.
T
T
Tobias Geerinckx-Rice wrote on 30 Oct 2020 10:38
(name . Ludovic Courtès)(address . ludo@gnu.org)
87r1pgnjdp.fsf@nckx
Ludovic Courtès ???
Toggle quote (7 lines)
> Like I wrote, it seems that v2 mostly fits the bill. The only
> potential
> issue as I see it is the new ‘reset-slade.pk3-timestamps’ phase:
> I don’t
> see what effect it has, like I wrote, so I wonder if it’s
> necessary.

I need more information to have any opinion :-)

What are you looking at to gauge its effects? You seem to be
claiming it has none for you, is that correct?

I build on tmpfs BTW. Perhaps other file systems could introduce
more ‘fun’.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX5vfIg0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW155bUA/ig7vcWSEcmL1M+PYOmrkp/5KOqYdpWJQfP5zlBY
SGszAQDn/YDvCxt00e6jQInJ+ImejrV13cm3cTeCAxwwKeF+BA==
=k+Gx
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 31 Oct 2020 11:01
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87v9eqww73.fsf@gnu.org
Tobias Geerinckx-Rice <me@tobias.gr> skribis:

Toggle quote (12 lines)
> Ludovic Courtès ???
>> Like I wrote, it seems that v2 mostly fits the bill. The only
>> potential
>> issue as I see it is the new ‘reset-slade.pk3-timestamps’ phase: I
>> don’t
>> see what effect it has, like I wrote, so I wonder if it’s necessary.
>
> I need more information to have any opinion :-)
>
> What are you looking at to gauge its effects? You seem to be claiming
> it has none for you, is that correct?

I didn’t test it, I’m just noticing that (1) the checkout in the store
has timestamps set to 1, and (2) the ‘unpack’ phase preserves timestamps
when it copies it.

So this phase could only have an effect on files created between the
‘unpack’ phase and the ‘build’ phase I think, unless I’m overlooking
something.

Thanks,
Ludo’.
J
J
James Smith wrote on 15 May 2021 22:52
(address . 44039@debbugs.gnu.org)
868s4fk9d9.fsf@gmail.com
Hi,

Has it been decided on whether it's neccessary to use
'reset-slade.pk3-timestamps' yet?

Thanks,
James Smith
J
J
James Smith wrote on 18 Sep 2021 19:47
[PATCH v3] gnu: Add slade.
(address . 44039@debbugs.gnu.org)(name . James Smith)(address . jsubuntuxp@disroot.org)
20210918174712.27138-1-jsubuntuxp@disroot.org
* gnu/packages/game-development.scm (slade): New variable.
---
I noticed there was a new release for slade, so I updated the patch and made some minor tweaks to it.

James Smith

gnu/packages/game-development.scm | 64 ++++++++++++++++++++++++++++++-
1 file changed, 63 insertions(+), 1 deletion(-)

Toggle diff (105 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index 40807450ea..7e1f9f4b39 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -22,6 +22,7 @@
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2021 Alexandru-Sergiu Marton <brown121407@posteo.ro>
;;; Copyright © 2021 Dmitry Polyakov <polyakov@liltechdude.xyz>
+;;; Copyright © 2020-2021 James Smith <jsubuntuxp@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,7 +40,7 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages game-development)
- #:use-module (srfi srfi-1)
+ #:use-module ((srfi srfi-1) #:hide (zip))
#:use-module (ice-9 match)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
@@ -55,6 +56,7 @@
#:use-module (gnu packages audio)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages boost)
#:use-module (gnu packages compression)
#:use-module (gnu packages check)
@@ -99,6 +101,7 @@
#:use-module (gnu packages tls)
#:use-module (gnu packages video)
#:use-module (gnu packages web)
+ #:use-module (gnu packages wxwidgets)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xiph)
#:use-module (gnu packages xml)
@@ -447,6 +450,65 @@ GUI toolkit, lighting and physics frameworks and @code{Tiled} TMX format
support.")
(license license:gpl3+)))
+(define-public slade
+ (package
+ (name "slade")
+ (version "3.1.13")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/sirjuddington/SLADE")
+ (commit version)))
+ (sha256 (base32 "009yc5m6y074wfalvwbrnv2zsmaf9yhbi8hzgs973di0zqnqv011"))
+ (file-name (git-file-name name version))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:configure-flags
+ (list "-DWX_GTK3=ON" "-DNO_WEBVIEW=ON"
+ (string-append "-DWITH_WXPATH="
+ (assoc-ref %build-inputs "wxwidgets") "/bin")
+ (string-append "-DwxWidgets_LIBRARIES="
+ (assoc-ref %build-inputs "wxwidgets") "/lib"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'reset-slade.pk3-timestamps
+ ;; This is neccessary to make slade reproducible.
+ (lambda _
+ (invoke "find" "../source/dist/res" "-exec" "touch"
+ "--no-dereference" "-t" "197001010000.00" "{}"
+ "+")))
+ (add-after 'install 'wrap-with-x11-gdk-backend
+ ;; Set GDK_BACKEND to x11 to prevent crash on Wayland.
+ ;; See https://github.com/sirjuddington/SLADE/issues/1097 for details.
+ (lambda* (#:key outputs #:allow-other-keys)
+ (wrap-program
+ (string-append (assoc-ref outputs "out")
+ "/bin/slade")
+ '("GDK_BACKEND" = ("x11"))))))
+ #:tests? #f)) ;; No test suite.
+ (inputs
+ `(("bash" ,bash-minimal)
+ ("curl" ,curl)
+ ("fluidsynth" ,fluidsynth)
+ ("freeimage" ,freeimage)
+ ("ftgl" ,ftgl)
+ ("glew" ,glew)
+ ("gtk+" ,gtk+)
+ ("sfml" ,sfml)
+ ("wxwidgets" ,wxwidgets-3.1)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("which" ,which)
+ ("zip" ,zip)))
+ (home-page "https://slade.mancubus.net")
+ (synopsis "Doom game data editor")
+ (description "SLADE3 is a modern editor for Doom-engine based games and
+source ports. It has the ability to view, modify, and write many different game-
+specific formats, and even convert between some of them, or from/to other generic
+formats such as PNG.")
+ (license license:gpl2)))
+
(define-public tiled
(package
(name "tiled")
--
2.33.0
L
L
Ludovic Courtès wrote on 22 Sep 2021 16:21
Re: bug#44039: [PATCH] gnu: Add slade.
(name . James Smith)(address . jsubuntuxp@disroot.org)(address . 44039-done@debbugs.gnu.org)
87zgs4g08f.fsf_-_@gnu.org
Hi,

James Smith <jsubuntuxp@disroot.org> skribis:

Toggle quote (2 lines)
> * gnu/packages/game-development.scm (slade): New variable.

Applied, thanks!

After investigating, I found that the ‘reset-slade.pk3-timestamps’ was
necessary due to https://bugs.gnu.org/44741, fixed on ‘core-updates’,
so I added a comment mentioning it.

BTW, note that we’d normally use ‘find-files’ & co. instead of invoking
the ‘find’ command.

Ludo’.
Closed
?