Compare commits

...

10 commits

13 changed files with 794 additions and 117 deletions

30
artoria/packages.scm Normal file
View file

@ -0,0 +1,30 @@
(define-module (artoria packages)
#:use-module ((gnu packages) #:prefix gnu:)
#:use-module (guix diagnostics)
#:use-module (guix i18n)
#:use-module (srfi srfi-1)
#:export (search-patch
search-patches
%patch-path))
(define (search-patch file-name)
"Search the patch FILE-NAME. Raise an error if not found."
(or (search-path (%patch-path) file-name)
(raise (formatted-message (G_ "~a: patch not found")
file-name))))
(define-syntax-rule (search-patches file-name ...)
"Return the list of absolute file names corresponding to each
FILE-NAME found in %PATCH-PATH."
(list (search-patch file-name) ...))
(define %channel-root
(find (lambda (path)
(file-exists? (string-append path "/artoria/packages.scm")))
%load-path))
(define %patch-path
(make-parameter
(append
(list (string-append %channel-root "/artoria/packages/patches"))
(gnu:%patch-path))))

171
artoria/packages/games.scm Normal file
View file

@ -0,0 +1,171 @@
(define-module (artoria packages games)
#:use-module (guix build-system cmake)
#:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:use-module (gnu packages pulseaudio)
#:use-module (gnu packages qt)
#:use-module (gnu packages xorg)
#:use-module (gnu packages gl)
#:use-module (gnu packages java)
#:use-module (gnu packages kde-frameworks)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module ((guix licenses) :prefix license:)
;#:use-module ((nonguix licenses) :prefix non-license:)
)
(define-public multimc
(package
(name "multimc")
(version "0.6.12")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/MultiMC/MultiMC5.git")
(recursive? #t)
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32
"0a32c8hrccc1h89kqwmfhf299swm0pwdp03qhjbfkagbggdz8r47"))))
(build-system cmake-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
(arguments
`(#:tests? #f ; Tests require network access
#:configure-flags '("-DMultiMC_LAYOUT=lin-system")
#:phases
(modify-phases %standard-phases
(add-after 'install 'patch-paths
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
(exe (string-append bin "/multimc"))
(qtwayland (assoc-ref inputs "qtwayland"))
(xrandr (assoc-ref inputs "xrandr"))
(jdk (assoc-ref inputs "jdk")))
(wrap-program exe
`("PATH" ":" prefix (,(string-append xrandr "/bin")
,(string-append jdk "/bin")))
`("QT_PLUGIN_PATH" ":" prefix (,(string-append
qtwayland "/lib/qt5/plugins")))
`("GAME_LIBRARY_PATH" ":" prefix
(,@(map (lambda (dep)
(string-append (assoc-ref inputs dep)
"/lib"))
'("libx11" "libxext" "libxcursor"
"libxrandr" "libxxf86vm" "pulseaudio" "mesa")))))
#t)))
(add-after 'patch-paths 'install-desktop-entry
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(applications (string-append out "/share/applications"))
(app-icons (string-append out "/share/icons/hicolor/scalable/apps")))
(with-directory-excursion "../source"
(install-file "application/package/linux/multimc.desktop"
applications)
(install-file "application/resources/multimc/scalable/multimc.svg"
app-icons))
#t))))))
(inputs
`(("jdk" ,icedtea "jdk")
("zlib" ,zlib)
("qtbase" ,qtbase-5)
("qtwayland" ,qtwayland)
("xrandr" ,xrandr)
("libx11" ,libx11)
("libxext" ,libxext)
("libxcursor" ,libxcursor)
("libxrandr" ,libxrandr)
("libxxf86vm" ,libxxf86vm)
("pulseaudio" ,pulseaudio)
("mesa" ,mesa)))
(home-page "https://multimc.org/")
(synopsis "Launcher for Minecraft")
(description
"This package allows you to have multiple, separate instances of
Minecraft and helps you manage them and their associated options with
a simple interface.")
(license (list license:asl2.0 ; MultiMC
license:lgpl2.1 ; Qt 5
license:lgpl3+ ; libnbt++
license:gpl2+ ; rainbow (KGuiAddons), Quazip, Pack200
license:silofl1.1 ; Material Design Icons
license:expat ; lionshead, MinGW runtime
license:public-domain ; xz-minidec
license:isc ; Hoedown
license:bsd-3 ; ColumnResizer
;; Batch icon set:
;(non-license:nonfree "file://COPYING.md")
))))
(define-public prismlauncher
(package
(name "prismlauncher")
(version "5.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/PrismLauncher/PrismLauncher")
(recursive? #t)
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32
"1npvgiifjqsacimsv5vpj54qsbv638vvb1xgapky8fpk0f30v52k"))))
(build-system cmake-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-after 'install 'patch-paths
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin/prismlauncher"))
(xrandr (assoc-ref inputs "xrandr"))
(qtwayland (assoc-ref inputs "qtwayland")))
(wrap-program bin
`("PATH" ":" prefix (,(string-append xrandr "/bin")))
`("QT_PLUGIN_PATH" ":" prefix (,(string-append
qtwayland "/lib/qt5/plugins")))
`("LD_LIBRARY_PATH" ":" prefix
(,@(map (lambda (dep)
(string-append (assoc-ref inputs dep)
"/lib"))
'("libx11" "libxext" "libxcursor"
"libxrandr" "libxxf86vm" "pulseaudio" "mesa")))))
#t))))))
(native-inputs (list extra-cmake-modules))
(inputs (list bash-minimal ; for wrap-program
zlib
qtbase-5
qtwayland
xrandr
libx11
libxext
libxcursor
libxrandr
libxxf86vm
pulseaudio
mesa))
(propagated-inputs (list `(,openjdk17 "jdk")))
(home-page "https://prismlauncher.org/")
(synopsis "Free, open source launcher for Minecraft")
(description
"Allows you to have multiple, separate instances of Minecraft (each with
their own mods, texture packs, saves, etc), and helps you manage them and
their associated options with a simple interface.")
(license (list license:gpl3 ; PolyMC, launcher
license:expat ; MinGW runtime, lionshead, tomlc99
license:lgpl3 ; Qt 5/6
license:lgpl3+ ; libnbt++
license:lgpl2.1+ ; rainbow (KGuiAddons)
license:isc ; Hoedown
license:silofl1.1 ; Material Design Icons
license:lgpl2.1 ; Quazip
license:public-domain ; xz-minidec, murmur2, xz-embedded
license:bsd-3 ; ColumnResizer, O2 (Katabasis fork),
; gamemode, localpeer
license:asl2.0 ; classparser, systeminfo
;; Batch icon set:
;(non-license:nonfree "file://COPYING.md")
))))

134
artoria/packages/gl.scm Normal file
View file

@ -0,0 +1,134 @@
(define-module (artoria packages gl)
#:use-module (gnu packages kde-frameworks) ; extra-cmake-modules
#:use-module (gnu packages xdisorg) ; xkbcommon
#:use-module (gnu packages gl)
;; ^ for > 3.3.4 + glfw-wayland
#:use-module (gnu packages glib) ; for dbus
#:use-module (gnu packages cmake) ; for cmake
#:use-module (gnu packages gtk) ; for cairo
;; ^ for libdecor
#:use-module (gnu packages)
#:use-module (gnu packages autotools)
#:use-module (gnu packages bison)
#:use-module (gnu packages compression)
#:use-module (gnu packages documentation)
#:use-module (gnu packages elf)
#:use-module (gnu packages flex)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gettext)
#:use-module (gnu packages guile)
#:use-module (gnu packages image)
#:use-module (gnu packages linux)
#:use-module (gnu packages llvm)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages tls)
#:use-module (gnu packages video)
#:use-module (gnu packages vulkan)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix hg-download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system cmake)
#:use-module (guix build-system meson)
#:use-module (guix build-system waf)
#:use-module (guix packages)
#:use-module (guix utils)
#:use-module (ice-9 match)
#:use-module (artoria packages) ; patches
#:use-module ((srfi srfi-1) #:hide (zip))
#:use-module ((guix licenses) #:prefix license:))
;; derived from https://github.com/Admicos/minecraft-wayland/issues/18#issuecomment-1579562704
(define-public libdecor
(package
(name "libdecor")
(version "0.1.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://gitlab.gnome.org/jadahl/libdecor.git")
(recursive? #t)
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32
;; cd /tmp && rm -rf libdecor && git clone https://gitlab.gnome.org/jadahl/libdecor.git --recursive && cd libdecor && git checkout 0.1.0 && guix hash -rx .
"0qdg3r7k086wzszr969s0ljlqdvfqm31zpl8p5h397bw076zr6p2"))))
(build-system meson-build-system)
(native-inputs
(list wayland
wayland-protocols
dbus
pkg-config
cmake
cairo
pango
mesa ;; for libEGL.so
egl-wayland
libxkbcommon))
(home-page "https://gitlab.gnome.org/jadahl/libdecor.git")
(synopsis "TODO")
(description "TODO")
(license license:expat)))
(define-public glfw-wayland-minecraft
(package
(name "glfw-wayland-minecraft")
(version "3.4.0")
(source
(origin (method url-fetch)
(uri (string-append
"https://github.com/glfw/glfw/archive/"
"62e175ef9fae75335575964c845a302447c012c7" ;; commit
".tar.gz"))
(sha256
(base32
"1zlbc4jyxgpll8vnaq382fa92r98y84prcdk15bqi6fygb2rd3wq"))
(patches
(search-patches
;;"0003-Don-t-crash-on-calls-to-focus-or-icon.patch"
"0004-wayland-fix-broken-opengl-screenshots-on-mutter.patch"
"0005-Add-warning-about-being-an-unofficial-patch.patch"
"0007-Platform-Prefer-Wayland-over-X11.patch"))))
(build-system cmake-build-system)
(arguments
'(#:tests? #f ;; no test target
#:configure-flags
'("-DBUILD_SHARED_LIBS=ON"
"-DGLFW_USE_WAYLAND=ON"
"-DGLFW_USE_LIBDECOR=ON" ;; libdecoration
)))
(native-inputs
(list pkg-config
doxygen
unzip
mesa
extra-cmake-modules
wayland-protocols
libxrandr
libxi
libxinerama
libxcursor
libdecor))
(inputs
(list wayland
libxkbcommon))
(propagated-inputs
(list ;; These are in 'Requires.private' of 'glfw3.pc'.
;;openjdk
libx11
libxxf86vm))
(home-page "https://www.glfw.org")
(synopsis "OpenGL application development library")
(description
"GLFW is a library for OpenGL, OpenGL ES and Vulkan development for
desktop computers. It provides a simple API for creating windows, contexts
and surfaces, receiving input and events.")
(license license:zlib)))

View file

@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ecmel=20Berk=20Canl=C4=B1er?= <me@ecmelberk.com>
Date: Tue, 28 Dec 2021 19:41:19 +0300
Subject: Don't crash on calls to focus or icon
---
src/wl_window.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/wl_window.c b/src/wl_window.c
index ec4e60cd..b8fc39e4 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -1042,8 +1042,7 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
int count, const GLFWimage* images)
{
- _glfwInputError(GLFW_PLATFORM_ERROR,
- "Wayland: Setting window icon not supported");
+ fprintf(stderr, "!!! Ignoring Error: Wayland: Setting window icon not supported\n");
}
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
@@ -1231,8 +1230,7 @@ void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
void _glfwPlatformFocusWindow(_GLFWwindow* window)
{
- _glfwInputError(GLFW_PLATFORM_ERROR,
- "Wayland: Focusing a window requires user interaction");
+ fprintf(stderr, "!!! Ignoring Error: Wayland: Focusing a window requires user interaction\n");
}
void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,

View file

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: ninja- <ninja-@users.noreply.github.com>
Date: Tue, 30 Jun 2020 19:41:52 +0200
Subject: wayland: fix broken opengl screenshots on mutter
---
src/egl_context.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/egl_context.c b/src/egl_context.c
index 6b34f724..b0a810d8 100644
--- a/src/egl_context.c
+++ b/src/egl_context.c
@@ -175,6 +175,14 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
u->samples = getEGLConfigAttrib(n, EGL_SAMPLES);
u->doublebuffer = desired->doublebuffer;
+#if defined(_GLFW_WAYLAND)
+ // Avoid using transparent buffer on Wayland if transparency is not requested.
+ // Otherwise mutter will fail to properly screenshot OpenGL content.
+ if (u->alphaBits > 0 && !desired->transparent) {
+ continue;
+ }
+#endif // _GLFW_WAYLAND
+
u->handle = (uintptr_t) n;
usableCount++;
}

View file

@ -0,0 +1,28 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ecmel=20Berk=20Canl=C4=B1er?= <me@ecmelberk.com>
Date: Tue, 28 Dec 2021 19:25:30 +0300
Subject: Add warning about being an unofficial patch
This is just to help mod developers and other people who don't need to
care about this patchset to ignore any issues that are not their fault.
---
src/init.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/init.c b/src/init.c
index 52ade583..1d7ca5d5 100644
--- a/src/init.c
+++ b/src/init.c
@@ -249,6 +249,12 @@ GLFWAPI int glfwInit(void)
_glfw.timer.offset = _glfwPlatformGetTimerValue();
glfwDefaultWindowHints();
+
+ fprintf(stderr, "!!! Patched GLFW from https://github.com/Admicos/minecraft-wayland\n"
+ "!!! If any issues with the window, or some issues with rendering, occur, "
+ "first try with the built-in GLFW, and if that solves the issue, report there first.\n"
+ "!!! Use outside Minecraft is untested, and things might break.\n");
+
return GLFW_TRUE;
}

View file

@ -0,0 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ecmel=20Berk=20Canl=C4=B1er?= <me@ecmelberk.com>
Date: Tue, 28 Dec 2021 20:30:44 +0300
Subject: Don't crash getting scancode name
---
src/wl_window.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/wl_window.c b/src/wl_window.c
index c36b11cd..bf188e27 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -1205,8 +1205,7 @@ void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
const char* _glfwPlatformGetScancodeName(int scancode)
{
// TODO
- _glfwInputError(GLFW_FEATURE_UNIMPLEMENTED,
- "Wayland: Key names not yet implemented");
+ fprintf(stderr, "!!! Ignoring Error: Wayland: Key names not yet implemented\n");
return NULL;
}

View file

@ -0,0 +1,44 @@
From 352b3bb37d79ddc9b4a7afd9ca8ad26723f17821 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Florian=20H=C3=BClsmann?= <fh@cbix.de>
Date: Sun, 30 Jan 2022 00:36:32 +0100
Subject: [PATCH] Platform: Prefer Wayland over X11
When GLFW_ANY_PLATFORM is used (which is the default) native
Wayland would previously never be chosen if XWayland is also available.
---
README.md | 1 +
src/platform.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 4a3fb85c5a..9ba2994200 100644
--- a/README.md
+++ b/README.md
@@ -268,6 +268,7 @@ information on what to include when reporting a bug.
- [Wayland] Added dynamic loading of all Wayland libraries
- [Wayland] Added support for key names via xkbcommon
- [Wayland] Removed support for `wl_shell` (#1443)
+ - [Wayland] Prefer Wayland over X11 if both are available (#2035)
- [Wayland] Bugfix: The `GLFW_HAND_CURSOR` shape used the wrong image (#1432)
- [Wayland] Bugfix: `CLOCK_MONOTONIC` was not correctly enabled
- [Wayland] Bugfix: Repeated keys could be reported with `NULL` window (#1704)
diff --git a/src/platform.c b/src/platform.c
index d0bbd06df5..61d06787fb 100644
--- a/src/platform.c
+++ b/src/platform.c
@@ -45,12 +45,12 @@ static const struct
#if defined(_GLFW_COCOA)
{ GLFW_PLATFORM_COCOA, _glfwConnectCocoa },
#endif
-#if defined(_GLFW_X11)
- { GLFW_PLATFORM_X11, _glfwConnectX11 },
-#endif
#if defined(_GLFW_WAYLAND)
{ GLFW_PLATFORM_WAYLAND, _glfwConnectWayland },
#endif
+#if defined(_GLFW_X11)
+ { GLFW_PLATFORM_X11, _glfwConnectX11 },
+#endif
};
GLFWbool _glfwSelectPlatform(int desiredID, _GLFWplatform* platform)

View file

@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ecmel=20Berk=20Canl=C4=B1er?= <me@ecmelberk.com>
Date: Tue, 28 Dec 2021 22:01:03 +0300
Subject: Add libdecoration marker to stderr warning
---
src/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/init.c b/src/init.c
index c0ba6d31..803915bb 100644
--- a/src/init.c
+++ b/src/init.c
@@ -262,7 +262,7 @@ GLFWAPI int glfwInit(void)
glfwDefaultWindowHints();
- fprintf(stderr, "!!! Patched GLFW from https://github.com/Admicos/minecraft-wayland\n"
+ fprintf(stderr, "!!! Patched GLFW from https://github.com/Admicos/minecraft-wayland (libdecoration)\n"
"!!! If any issues with the window, or some issues with rendering, occur, "
"first try with the built-in GLFW, and if that solves the issue, report there first.\n"
"!!! Use outside Minecraft is untested, and things might break.\n");

View file

@ -0,0 +1,89 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Waris Boonyasiriwat <wboonyasiriwat@teradici.com>
Date: Wed, 12 May 2021 00:30:14 -0700
Subject: Wayland: Fix cursor offset when shape changes
The Wayland protocol spec[1] states that set_cursor must be called
with the serial number of the enter event. However, GLFW is passing in
the serial number of the latest received event, which does not meet the
protocol spec.
[1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_pointer
As a result, set_cursor calls were simply ignored by the compositor.
This fix complies with the protocol more closely by specifically caching
the enter event serial, and using it for all set_cursor calls.
Fixes #1706
Closes #1899
---
src/wl_init.c | 3 ++-
src/wl_platform.h | 1 +
src/wl_window.c | 6 +++---
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/wl_init.c b/src/wl_init.c
index f43a0f82..cc355136 100644
--- a/src/wl_init.c
+++ b/src/wl_init.c
@@ -130,6 +130,7 @@ static void pointerHandleEnter(void* data,
#endif
_glfw.wl.serial = serial;
+ _glfw.wl.pointerEnterSerial = serial;
_glfw.wl.pointerFocus = window;
window->wl.hovered = GLFW_TRUE;
@@ -189,7 +190,7 @@ static void setCursor(_GLFWwindow* window, const char* name)
buffer = wl_cursor_image_get_buffer(image);
if (!buffer)
return;
- wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.serial,
+ wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial,
surface,
image->hotspot_x / scale,
image->hotspot_y / scale);
diff --git a/src/wl_platform.h b/src/wl_platform.h
index b6b3392e..18dbd60a 100644
--- a/src/wl_platform.h
+++ b/src/wl_platform.h
@@ -262,6 +262,7 @@ typedef struct _GLFWlibraryWayland
const char* cursorPreviousName;
int cursorTimerfd;
uint32_t serial;
+ uint32_t pointerEnterSerial;
int32_t keyboardRepeatRate;
int32_t keyboardRepeatDelay;
diff --git a/src/wl_window.c b/src/wl_window.c
index ddf5ad37..23762e08 100644
--- a/src/wl_window.c
+++ b/src/wl_window.c
@@ -767,7 +767,7 @@ static void setCursorImage(_GLFWwindow* window,
cursorWayland->yhot = image->hotspot_y;
}
- wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.serial,
+ wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial,
surface,
cursorWayland->xhot / scale,
cursorWayland->yhot / scale);
@@ -1598,7 +1598,7 @@ static void lockPointer(_GLFWwindow* window)
window->wl.pointerLock.relativePointer = relativePointer;
window->wl.pointerLock.lockedPointer = lockedPointer;
- wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.serial,
+ wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial,
NULL, 0, 0);
}
@@ -1666,7 +1666,7 @@ void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
}
else if (window->cursorMode == GLFW_CURSOR_HIDDEN)
{
- wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.serial, NULL, 0, 0);
+ wl_pointer_set_cursor(_glfw.wl.pointer, _glfw.wl.pointerEnterSerial, NULL, 0, 0);
}
}

View file

@ -19,7 +19,7 @@
`(#:install-plan (list '("composer.phar" "bin/composer")) `(#:install-plan (list '("composer.phar" "bin/composer"))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'copy 'make-executable (add-after 'install 'make-executable
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(chmod (chmod
(string-append (string-append

75
artoria/packages/zig.scm Normal file
View file

@ -0,0 +1,75 @@
(define-module (artoria packages zig)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system copy)
#:use-module ((guix licenses) #:prefix license:))
(define-public zig-bin-next
(package
(name "zig-bin-next")
(version "0.14.0-dev.1550+4fba7336a")
(home-page "https://ziglang.org/")
(source (origin
(method url-fetch)
(uri (string-append "https://ziglang.org/download/0.13.0/zig-linux-x86_64-" version ".tar.xz"))
(sha256
(base32
"0f71b9l9i1si4v44davjjniif5yxfrra048gqqqicvj37gp4hdm2"))))
(build-system copy-build-system)
(arguments
`(#:install-plan '(("zig" "bin/zig")
("lib" "lib"))
#:phases
(modify-phases %standard-phases
(add-after 'install 'make-executable
(lambda* (#:key outputs #:allow-other-keys)
(chmod
(string-append
(assoc-ref %outputs "out") "/bin/zig") #o555))))))
(synopsis "General purpose programming language and toolchain")
(description "Zig is a general-purpose programming language and
toolchain. Among other features it provides
@itemize
@item an Optional type instead of null pointers,
@item manual memory management,
@item generic data structures and functions,
@item compile-time reflection and compile-time code execution,
@item integration with C using zig as acl C compiler, and
@item concurrency via async functions.
@end itemize")
(license license:expat)))
(define-public zig-bin-0.13
(package
(name "zig-bin")
(version "0.13.0")
(home-page "https://ziglang.org/")
(source (origin
(method url-fetch)
(uri (string-append "https://ziglang.org/download/0.13.0/zig-linux-x86_64-" version ".tar.xz"))
(sha256
(base32
"1sih28hni53cnqbd3ap42vx12p4isrzwzi3vnwr81i5w3vk14lyl"))))
(build-system copy-build-system)
(arguments
`(#:install-plan '(("zig" "bin/zig")
("lib" "lib"))
#:phases
(modify-phases %standard-phases
(add-after 'install 'make-executable
(lambda* (#:key outputs #:allow-other-keys)
(chmod
(string-append
(assoc-ref %outputs "out") "/bin/zig") #o555))))))
(synopsis "General purpose programming language and toolchain")
(description "Zig is a general-purpose programming language and
toolchain. Among other features it provides
@itemize
@item an Optional type instead of null pointers,
@item manual memory management,
@item generic data structures and functions,
@item compile-time reflection and compile-time code execution,
@item integration with C using zig as acl C compiler, and
@item concurrency via async functions.
@end itemize")
(license license:expat)))