all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 34086@debbugs.gnu.org
Subject: [bug#34086] [PATCH] Add StepMania
Date: Tue, 22 Jan 2019 09:33:00 +0100	[thread overview]
Message-ID: <871s55gkhv.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87o98bnquh.fsf@gnu.org> ("Ludovic Courtès"'s message of "Sun, 20 Jan 2019 19:09:26 +0100")

[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]

Hello,

Thank you for the review!

Ludovic Courtès <ludo@gnu.org> writes:

> Apparently you also tried using ffmpeg 2.8, but that didn’t work
> either?

It builds with FFmpeg 2.8, but a StepMania developer told me there was
no guarantee it wouldn't create runtime crashes. They apparently spend
quite some time to find a FFmpeg release that suits them, and use it for
a couple of years.

> Do you have an idea how different their own ffmpeg variant is?

Their variant is older (2.1.3), with some specific build flags. That is
all I can say.

> Could you move to video.scm, inherit from ‘ffmpeg’, and arrange to
> reduce duplication as much as possible?

But then, I have to make it public, and that would pollute namespace,
wouldn't it?

> (Even better would be to avoid it altogether but I’m assuming it won’t
> be that simple…)

There's a build flag to ignore FFmpeg altogether. I believe this would
disable playing background videos. It may be a bit opinionated for
a distributed package.

IMO, the safest way to go it to provide the FFmpeg the package expects.

I'm sending an updated patch. WDYT?

Regards,

-- 
Nicolas Goaziou

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Add StepMania --]
[-- Type: text/x-diff, Size: 7073 bytes --]

From 7e80ada7b842830f10107724286fe194c3c64a43 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Sun, 11 Nov 2018 00:43:34 +0100
Subject: [PATCH] gnu: Add stepmania.

* gnu/packages/games.scm (stepmania):
* gnu/packages/video.scm (ffmpeg-for-stepmania): New variables.
---
 gnu/packages/games.scm | 113 +++++++++++++++++++++++++++++++++++++++++
 gnu/packages/video.scm |  26 ++++++++++
 2 files changed, 139 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 317962bf6..b973641fe 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -70,6 +70,7 @@
   #:use-module (gnu packages admin)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages avahi)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
@@ -6011,3 +6012,115 @@ civilized than your own.")
                    license:cc-by-sa3.0
                    license:cc-by-sa4.0
                    license:public-domain))))
+
+(define-public stepmania
+  (package
+    (name "stepmania")
+    (version "5.1.0-b2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/stepmania/stepmania.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0a7y9l7xm510vgnpmj1is7p9m6d6yd0fcaxrjcickz295k5w3rdn"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           ;; Remove song files, which are licensed under a non-commercial
+           ;; clause, and a course pointing to them.
+           (for-each delete-file-recursively
+                     '("Songs/StepMania 5/Goin' Under"
+                       "Songs/StepMania 5/MechaTribe Assault"
+                       "Songs/StepMania 5/Springtime"))
+           (for-each delete-file '("Courses/Default/Jupiter.crs"
+                                   "Courses/Default/Jupiter.png"))
+           ;; Unbundle libpng.
+           (substitute* "extern/CMakeLists.txt"
+             (("include\\(CMakeProject-png.cmake\\)") ""))
+           (delete-file-recursively "extern/libpng")
+           #t))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:tests? #f                      ;FIXME: couldn't find how to run tests
+       #:build-type "Release"
+       #:out-of-source? #f              ;for the 'install-desktop' phase
+       #:configure-flags
+       (list "-DWITH_SYSTEM_FFMPEG=1"
+             ;; Configuration cannot find GTK2 without the two following
+             ;; flags.
+             (string-append "-DGTK2_GDKCONFIG_INCLUDE_DIR="
+                            (assoc-ref %build-inputs "gtk+")
+                            "/lib/gtk-2.0/include")
+             (string-append "-DGTK2_GLIBCONFIG_INCLUDE_DIR="
+                            (assoc-ref %build-inputs "glib")
+                            "/lib/glib-2.0/include"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-install-subdir
+           ;; Installation would be done in "%out/stepmania-X.Y", but we
+           ;; prefer the more common layout "%out/share/stepmania".
+           (lambda _
+             (substitute* "src/CMakeLists.txt"
+               (("\"stepmania-.*?\"") "\"share/stepmania\""))
+             #t))
+         (add-after 'unpack 'unbundle-libpng
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/CMakeLists.txt"
+               (("\\$\\{SM_EXTERN_DIR\\}/libpng/include")
+                (string-append (assoc-ref inputs "libpng") "/include")))))
+         (add-after 'install 'install-executable
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (exe (string-append out "/share/stepmania/stepmania")))
+               (mkdir-p bin)
+               (symlink exe (string-append bin "/stepmania"))
+               #t)))
+         (add-after 'install-executable 'install-desktop
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share"))
+                    (applications (string-append share "/applications"))
+                    (icons (string-append share "/icons")))
+               (install-file "stepmania.desktop" applications)
+               (mkdir-p icons)
+               (copy-recursively "icons" icons)
+               #t))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("yasm" ,yasm)))
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("ffmpeg" ,ffmpeg-for-stepmania)
+       ("glib" ,glib)
+       ("glew" ,glew)
+       ("gtk+" ,gtk+-2)
+       ("jsoncpp" ,jsoncpp)
+       ("libpng" ,libpng)
+       ("libjpeg" ,libjpeg-8)
+       ("libmad" ,libmad)
+       ("libogg" ,libogg)
+       ("libva" ,libva)
+       ("libvorbis" ,libvorbis)
+       ("libxinerama" ,libxinerama)
+       ("libxrandr" ,libxrandr)
+       ("mesa" ,mesa)
+       ("pcre" ,pcre)
+       ("pulseaudio" ,pulseaudio)
+       ("sdl" ,sdl2)
+       ("udev" ,eudev)
+       ("zlib" ,zlib)))
+    (synopsis "Advanced rhythm game designed for both home and arcade use")
+    (description "StepMania is a dance and rhythm game.  It features 3D
+graphics, keyboard and dance pad support, and an editor for creating your own
+steps.
+
+This package provides the core application, but no song is shipped.  You need
+to download and install them in @file{$HOME/.stepmania-X.Y/Songs} directory.")
+    (home-page "https://www.stepmania.com")
+    (license license:expat)))
+
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index fb0da6ae6..a483cb461 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -871,6 +871,32 @@ audio/video codec library.")
               (base32
                "0b59qk5wpc5ksiha76jbhb859g5gxa4w0k6afh3kgvgajiivs73l"))))))
 
+(define-public ffmpeg-for-stepmania
+  (package
+    (inherit ffmpeg)
+    (version "2.1.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/stepmania/ffmpeg.git")
+             (commit "eda6effcabcf9c238e4635eb058d72371336e09b")))
+       (sha256
+        (base32 "1by8rmbva8mfrivdbbkr2gx4kga89zqygkd4cfjl76nr8mdcdamb"))
+       (file-name (git-file-name "ffmpeg" version))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments ffmpeg)
+       ((#:configure-flags flags)
+        '(list "--disable-programs"
+               "--disable-doc"
+               "--disable-debug"
+               "--disable-avdevice"
+               "--disable-swresample"
+               "--disable-postproc"
+               "--disable-avfilter"
+               "--disable-shared"
+               "--enable-static"))))))
+
 (define-public ffmpegthumbnailer
   (package
     (name "ffmpegthumbnailer")
-- 
2.20.1


  reply	other threads:[~2019-01-22  8:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 18:10 [bug#34086] [PATCH] Add StepMania Nicolas Goaziou
2019-01-20 18:09 ` Ludovic Courtès
2019-01-22  8:33   ` Nicolas Goaziou [this message]
2019-01-22 19:24     ` Leo Famulari
2019-01-22 21:42       ` Nicolas Goaziou
2019-01-23  9:40         ` Ludovic Courtès
2019-01-25 17:10           ` Nicolas Goaziou
2019-01-23 21:34         ` Leo Famulari
2019-01-25 17:41           ` bug#34086: " Nicolas Goaziou

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=871s55gkhv.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=34086@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /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.