diff options
| author | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2025-11-29 17:21:49 +0100 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2025-12-07 07:57:25 +0100 |
| commit | a6c83120f26ee1c1bd8fe31ffe8357819d34d34a (patch) | |
| tree | 053034fee9fa1d187512e589a7f5a6ac548464f8 /gnu | |
| parent | 38bfd1d3aef3498c6d49d811cf92616c7f022da1 (diff) | |
gnu: renpy: Update to 8.5.
* gnu/packages/game-development.scm (renpy)[build-system]: Change to
pyproject-build-system.
[arguments]: Remove #:modules and #:imported-modules.
<#:phases>: Replace ‘fix-commands’ with ‘fix-launcher’.
Adjust ‘drop-game-from-paths’.
Move ‘build’ after ‘install’. Install launcher to “out”.
Remove ‘install-games’.
[outputs]: Drop other outputs.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/game-development.scm | 135 |
1 files changed, 48 insertions, 87 deletions
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm index ada748aebb1..ba540f25ea4 100644 --- a/gnu/packages/game-development.scm +++ b/gnu/packages/game-development.scm | |||
| @@ -1794,61 +1794,56 @@ are only used to bootstrap it.") | |||
| 1794 | (package | 1794 | (package |
| 1795 | (inherit python-renpy) | 1795 | (inherit python-renpy) |
| 1796 | (name "renpy") | 1796 | (name "renpy") |
| 1797 | (build-system python-build-system) | 1797 | (build-system pyproject-build-system) |
| 1798 | (arguments | 1798 | (arguments |
| 1799 | (list | 1799 | (list |
| 1800 | #:tests? #f ; see python-renpy | 1800 | #:tests? #f |
| 1801 | #:modules '((srfi srfi-1) | ||
| 1802 | (guix build python-build-system) | ||
| 1803 | (guix build utils)) | ||
| 1804 | #:imported-modules `((srfi srfi-1) ,@%python-build-system-modules) | ||
| 1805 | #:phases | 1801 | #:phases |
| 1806 | #~(modify-phases %standard-phases | 1802 | #~(modify-phases %standard-phases |
| 1807 | (add-after 'unpack 'fix-commands | 1803 | (add-after 'unpack 'fix-launcher |
| 1808 | (lambda* (#:key inputs outputs #:allow-other-keys) | 1804 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 1809 | (substitute* "launcher/game/choose_directory.rpy" | 1805 | (substitute* "launcher/game/gui7.rpy" |
| 1810 | (("/usr/bin/python") | 1806 | (("([ ]*)import gui7" all indent) |
| 1811 | (search-input-file inputs "/bin/python3"))) | 1807 | (string-append indent "import sys\n" |
| 1812 | (substitute* "launcher/game/front_page.rpy" | 1808 | indent "import os\n" |
| 1813 | (("xdg-open") | 1809 | indent "from store import config\n" |
| 1814 | (search-input-file inputs "/bin/xdg-open"))) | 1810 | indent "sys.path.insert(0, os.path.join" |
| 1811 | "(config.renpy_base, \"launcher\"))\n" | ||
| 1812 | all))) | ||
| 1815 | (substitute* "launcher/game/project.rpy" | 1813 | (substitute* "launcher/game/project.rpy" |
| 1816 | (("cmd = \\[ executable, \"-EO\", sys.argv\\[0\\] \\]") | 1814 | (("cmd = \\[ executable, sys.argv\\[0\\] \\]") |
| 1817 | (string-append "cmd = [ \"" (assoc-ref outputs "out") | 1815 | (string-append "cmd = [ \"" (assoc-ref outputs "out") |
| 1818 | "/bin/renpy\" ]")) | 1816 | "/bin/renpy\" ]")) |
| 1819 | ;; Projects are still created in the usual style, so we need | 1817 | ;; Projects are still created in the usual style, so we need |
| 1820 | ;; to adjust the path. | 1818 | ;; to adjust the path. |
| 1821 | (("cmd.append\\(self.path\\)") | 1819 | (("cmd.append\\(self.path\\)") |
| 1822 | "cmd.append(self.path + \"/game\")")))) | 1820 | "cmd.append(self.path + \"/game\")")) |
| 1821 | (substitute* "renpy/common/00action_other.rpy" | ||
| 1822 | (("xdg-open") (search-input-file inputs "bin/xdg-open"))))) | ||
| 1823 | (add-after 'unpack 'drop-game-from-paths | 1823 | (add-after 'unpack 'drop-game-from-paths |
| 1824 | (lambda _ | 1824 | (lambda _ |
| 1825 | (substitute* (list "launcher/game/gui7.rpy" | 1825 | (substitute* (list "launcher/game/gui7.rpy" |
| 1826 | "launcher/game/gui7/images.py") | 1826 | "launcher/game/gui7/images.py") |
| 1827 | ((", \"gui\", \"game\",") ", \"gui\",") | ||
| 1827 | ((", \"game\", \"gui7\",") ", \"gui7\",")) | 1828 | ((", \"game\", \"gui7\",") ", \"gui7\",")) |
| 1828 | #t)) | 1829 | (substitute* "gui/game/guisupport.rpy" |
| 1829 | (add-before 'build 'start-xserver | 1830 | ((", \"launcher\", \"game\"") ", \"launcher\"")))) |
| 1830 | (lambda* (#:key inputs native-inputs #:allow-other-keys) | 1831 | (delete 'build) |
| 1831 | (let ((Xvfb (search-input-file (or native-inputs inputs) | ||
| 1832 | "/bin/Xvfb"))) | ||
| 1833 | (setenv "HOME" (getcwd)) | ||
| 1834 | (system (format #f "~a :1 &" Xvfb)) | ||
| 1835 | (setenv "DISPLAY" ":1")))) | ||
| 1836 | (replace 'build | ||
| 1837 | (lambda _ | ||
| 1838 | (invoke "python" "renpy.py" "launcher" "quit") | ||
| 1839 | (invoke "python" "renpy.py" "the_question" "quit") | ||
| 1840 | (invoke "python" "renpy.py" "tutorial" "quit"))) | ||
| 1841 | (replace 'install | 1832 | (replace 'install |
| 1842 | (lambda* (#:key inputs outputs #:allow-other-keys) | 1833 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 1843 | ;; Here we install our custom renpy program. | 1834 | ;; Here we install our custom renpy program. |
| 1844 | ;; After finishing this step, "out" will have the following: | 1835 | ;; After finishing this step, "out" will have the following: |
| 1845 | ;; |-- bin/renpy | 1836 | ;; |-- bin |
| 1846 | ;; `-- share/renpy ; i.e. path_to_renpy_base() | 1837 | ;; | |-- renpy ; stupid launcher, requires game path |
| 1838 | ;; | `-- renpy-launcher ; upstream launcher | ||
| 1839 | ;; `-- share/renpy ; i.e. path_to_renpy_base() | ||
| 1847 | ;; |-- common | 1840 | ;; |-- common |
| 1848 | ;; `-- gui | 1841 | ;; |-- launcher |
| 1842 | ;; |-- gui | ||
| 1843 | ;; `-- sdk-fonts | ||
| 1849 | ;; | 1844 | ;; |
| 1850 | ;; Note that common shares the source files that would be installed | 1845 | ;; Note that common shares the source files that would be installed |
| 1851 | ;; by python2-renpy (which are instead deleted from that package), | 1846 | ;; by python-renpy (which are instead deleted from that package), |
| 1852 | ;; but also contains their byte-compiled versions. | 1847 | ;; but also contains their byte-compiled versions. |
| 1853 | ;; On other systems, renpy_base would point to site-packages or | 1848 | ;; On other systems, renpy_base would point to site-packages or |
| 1854 | ;; even somewhere in /opt. | 1849 | ;; even somewhere in /opt. |
| @@ -1870,71 +1865,38 @@ are only used to bootstrap it.") | |||
| 1870 | ;; |-- Super Awesome Game.py | 1865 | ;; |-- Super Awesome Game.py |
| 1871 | ;; `-- Super Awesome Game.sh | 1866 | ;; `-- Super Awesome Game.sh |
| 1872 | (let* ((out (assoc-ref outputs "out")) | 1867 | (let* ((out (assoc-ref outputs "out")) |
| 1873 | (bin/renpy (string-append out "/bin/renpy"))) | 1868 | (bin/renpy (string-append out "/bin/renpy")) |
| 1869 | (bin/renpy-launcher (string-append out "/bin/renpy-launcher"))) | ||
| 1874 | (copy-recursively "renpy/common" | 1870 | (copy-recursively "renpy/common" |
| 1875 | (string-append out "/share/renpy/common")) | 1871 | (string-append out "/share/renpy/common")) |
| 1876 | (copy-recursively "gui" | 1872 | (copy-recursively "launcher/game" |
| 1873 | (string-append out "/share/renpy/launcher")) | ||
| 1874 | (copy-recursively "gui/game" | ||
| 1877 | (string-append out "/share/renpy/gui")) | 1875 | (string-append out "/share/renpy/gui")) |
| 1878 | (copy-recursively "sdk-fonts" | 1876 | (copy-recursively "sdk-fonts" |
| 1879 | (string-append out "/share/renpy/sdk-fonts")) | 1877 | (string-append out "/share/renpy/sdk-fonts")) |
| 1880 | |||
| 1881 | (mkdir-p (string-append out "/bin")) | 1878 | (mkdir-p (string-append out "/bin")) |
| 1882 | (copy-file #$(local-file (search-auxiliary-file "renpy/renpy.in")) | 1879 | (copy-file #$(local-file (search-auxiliary-file "renpy/renpy.in")) |
| 1883 | bin/renpy) | 1880 | bin/renpy) |
| 1884 | (substitute* bin/renpy | 1881 | (substitute* bin/renpy |
| 1885 | (("@PYTHON@") (search-input-file inputs "bin/python3")) | 1882 | (("@PYTHON@") (search-input-file inputs "bin/python3")) |
| 1886 | (("@RENPY_BASE@") (string-append out "/share/renpy"))) | 1883 | (("@RENPY_BASE@") (string-append out "/share/renpy"))) |
| 1887 | (chmod bin/renpy #o755)))) | 1884 | (chmod bin/renpy #o755) |
| 1888 | 1885 | (with-output-to-file bin/renpy-launcher | |
| 1889 | (add-after 'install 'install-games | 1886 | (lambda _ |
| 1890 | (lambda* (#:key inputs outputs #:allow-other-keys) | 1887 | (format #t "#!~a~%exec ~a ~a \"$@\"" |
| 1891 | (define renpy (assoc-ref outputs "out")) | 1888 | (search-input-file inputs "/bin/bash") |
| 1892 | ;; TODO: We should offer a renpy-build-system to make the | 1889 | bin/renpy |
| 1893 | ;; installation of Ren'py games easier. | 1890 | (string-append out "/share/renpy/launcher")))) |
| 1894 | (define* (install-renpy-game #:key output game name (renpy renpy) | 1891 | (chmod bin/renpy-launcher #o755)))) |
| 1895 | #:allow-other-keys) | 1892 | (add-after 'install 'build |
| 1896 | (let* ((name (or name (basename game))) | 1893 | (lambda _ |
| 1897 | (launcher (string-append output "/bin/renpy-" name)) | 1894 | (let* ((bin/renpy (string-append #$output "/bin/renpy")) |
| 1898 | (share (string-append output "/share/renpy/" name))) | 1895 | (renpy-base (string-append #$output "/share/renpy"))) |
| 1899 | (copy-recursively (string-append game "/game") share) | 1896 | (for-each |
| 1900 | (mkdir-p (string-append output "/bin")) | 1897 | (lambda (dir) |
| 1901 | (with-output-to-file launcher | 1898 | (invoke bin/renpy (string-append renpy-base "/" dir) "quit")) |
| 1902 | (lambda () | 1899 | (list "common" "gui" "launcher")))))))) |
| 1903 | (format #t | ||
| 1904 | "#!~a~%~a ~a \"$@\"" | ||
| 1905 | (search-input-file inputs "/bin/bash") | ||
| 1906 | (string-append renpy "/bin/renpy") | ||
| 1907 | share))) | ||
| 1908 | (chmod launcher #o755))) | ||
| 1909 | |||
| 1910 | (install-renpy-game #:output (assoc-ref outputs "out") | ||
| 1911 | #:game "launcher") | ||
| 1912 | |||
| 1913 | (install-renpy-game #:output (assoc-ref outputs "the-question") | ||
| 1914 | #:game "the_question" | ||
| 1915 | #:name "the-question") | ||
| 1916 | |||
| 1917 | (install-renpy-game #:output (assoc-ref outputs "tutorial") | ||
| 1918 | #:game "tutorial"))) | ||
| 1919 | (replace 'wrap | ||
| 1920 | (lambda* (#:key inputs outputs #:allow-other-keys) | ||
| 1921 | (let ((out (assoc-ref outputs "out")) | ||
| 1922 | (site (string-append "/lib/python" | ||
| 1923 | (python-version | ||
| 1924 | (assoc-ref inputs "python")) | ||
| 1925 | "/site-packages"))) | ||
| 1926 | (wrap-program (string-append out "/bin/renpy") | ||
| 1927 | `("GUIX_PYTHONPATH" = | ||
| 1928 | (,@(delete-duplicates | ||
| 1929 | (map | ||
| 1930 | (lambda (store-path) | ||
| 1931 | (string-append store-path site)) | ||
| 1932 | (cons (assoc-ref outputs "out") | ||
| 1933 | (map cdr | ||
| 1934 | (filter | ||
| 1935 | (lambda (input) | ||
| 1936 | (string-prefix? "python" (car input))) | ||
| 1937 | inputs)))))))))))))) | ||
| 1938 | (inputs (list bash-minimal | 1900 | (inputs (list bash-minimal |
| 1939 | python | 1901 | python |
| 1940 | python-pefile | 1902 | python-pefile |
| @@ -1945,7 +1907,6 @@ are only used to bootstrap it.") | |||
| 1945 | xdg-utils)) | 1907 | xdg-utils)) |
| 1946 | (propagated-inputs '()) | 1908 | (propagated-inputs '()) |
| 1947 | (native-inputs (list xorg-server-for-tests)) | 1909 | (native-inputs (list xorg-server-for-tests)) |
| 1948 | (outputs (list "out" "tutorial" "the-question")) | ||
| 1949 | (home-page "https://www.renpy.org/") | 1910 | (home-page "https://www.renpy.org/") |
| 1950 | (synopsis "Visual Novel Engine") | 1911 | (synopsis "Visual Novel Engine") |
| 1951 | (description "Ren'Py is a visual novel engine that helps you use words, | 1912 | (description "Ren'Py is a visual novel engine that helps you use words, |
