From patchwork Sun Oct 16 05:44:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: phodina X-Patchwork-Id: 43437 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CDC1A27BBEA; Sun, 16 Oct 2022 06:45:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1D67927BBE9 for ; Sun, 16 Oct 2022 06:45:28 +0100 (BST) Received: from localhost ([::1]:45828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojwSl-0007W8-9c for patchwork@mira.cbaines.net; Sun, 16 Oct 2022 01:45:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojwSP-0007Vf-1L for guix-patches@gnu.org; Sun, 16 Oct 2022 01:45:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojwSM-0000cz-0g for guix-patches@gnu.org; Sun, 16 Oct 2022 01:45:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ojwSL-00005h-RC for guix-patches@gnu.org; Sun, 16 Oct 2022 01:45:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54299] [PATCH v3] Build on Aarch64 Resent-From: phodina Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 16 Oct 2022 05:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54299 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "54299@debbugs.gnu.org" <54299@debbugs.gnu.org>, Efraim Flashner , Maxime Devos Received: via spool by 54299-submit@debbugs.gnu.org id=B54299.166589906432733 (code B ref 54299); Sun, 16 Oct 2022 05:45:01 +0000 Received: (at 54299) by debbugs.gnu.org; 16 Oct 2022 05:44:24 +0000 Received: from localhost ([127.0.0.1]:43119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojwRj-0008Vs-99 for submit@debbugs.gnu.org; Sun, 16 Oct 2022 01:44:23 -0400 Received: from mail-4316.protonmail.ch ([185.70.43.16]:58451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojwRf-0008VX-AH for 54299@debbugs.gnu.org; Sun, 16 Oct 2022 01:44:21 -0400 Date: Sun, 16 Oct 2022 05:44:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1665899052; x=1666158252; bh=cHlt3P9+YA/88yLDm0RpATc2Y7g3l462o6AxfvJRUTU=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=uBDGAJhSBlwkALbBR1nMm1L7MFykWI5MlvOT7NdkAJjt4GrdQRuPz+Ib1bzTeV+Cg rt1Bt8C2BLOzjVRH4EuyJDFdo0j83oeNgaUdEcbeVbFOOEGZQhCtMq1dIsmhCh74Jo 3m3bHNn3WWHR1mMFLnu4oqH0D6p50i8IHWPh5rBf9T4/KYtSqni7L4cSpZweaY1Knq mHk3AOyrGudsMmsy2qnA1Lp3aJxyWqgq8ohftE66rJl13ZKE2iGXEHP2JEOIuQXZqh pUMFO1BDSBM198x5DnvsdsArqVfA8tDDTykTTUST1665AlFtcAkjAGP47ovQab5ekU VgQecKjtWnHOQ== Message-ID: In-Reply-To: References: Feedback-ID: 14143818:user:proton MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: phodina X-ACL-Warn: , phodina via Guix-patches X-Patchwork-Original-From: phodina via Guix-patches via From: phodina X-getmail-retrieved-from-mailbox: Patches Sorry, incorrect target ("arch64" instead of "aarch64") got into second patch :-) ---- Petr ------- Original Message ------- On Saturday, October 15th, 2022 at 9:17 AM, phodina wrote: > Hi Maxime, > > could you please review the 2 patches for Alacritty? > > First one is to build it on Aarch64 (disables one failing test). > > The other enables HW support on devices like PineBook Pro - I remeber you use one Efraim. [1] > > The rest is just for newer version. > > I have to check the antioxidant system! It's been on my list for too long. > > 1 https://github.com/alacritty/alacritty/issues/128#issuecomment-880270507 > > Thanks! > > ---- > Petr commit 4035f329c2f5c8f05f0ada33afdac41981eee6dc Author: Petr Hodina Date: Sat Oct 15 08:42:17 2022 +0200 gnu: alacritty: Patch to run on OpenGL 3.1 on aarch64 target. * gnu/packages/terminals.scm (alacritty)[source]: Apply patch on aarch64 target. * gnu/packages/patches/alacritty-use-OpenGL-3.1-with-extensions-instead-of-OpenGL-3.3.patch: New file * gnu/local.mk: Add patch. diff --git a/gnu/local.mk b/gnu/local.mk index 78bdc113ac..15c62d5c7f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -865,6 +865,7 @@ dist_patch_DATA = \ %D%/packages/patches/akonadi-paths.patch \ %D%/packages/patches/akonadi-not-relocatable.patch \ %D%/packages/patches/akonadi-timestamps.patch \ + %D%/packages/patches/alacritty-use-OpenGL-3.1-with-extensions-instead-of-OpenGL-3.3.patch \ %D%/packages/patches/allegro-mesa-18.2.5-and-later.patch \ %D%/packages/patches/anki-mpv-args.patch \ %D%/packages/patches/antiword-CVE-2014-8123.patch \ diff --git a/gnu/packages/patches/alacritty-use-OpenGL-3.1-with-extensions-instead-of-OpenGL-3.3.patch b/gnu/packages/patches/alacritty-use-OpenGL-3.1-with-extensions-instead-of-OpenGL-3.3.patch new file mode 100644 index 0000000000..92d72a83e7 --- /dev/null +++ b/gnu/packages/patches/alacritty-use-OpenGL-3.1-with-extensions-instead-of-OpenGL-3.3.patch @@ -0,0 +1,86 @@ +From cc6f303100075e286d09ca77d31749f7adcdffc6 Mon Sep 17 00:00:00 2001 +From: Autumn +Date: Wed, 14 Jul 2021 04:37:03 -0700 +Subject: [PATCH] use OpenGL 3.1 with extensions instead of OpenGL 3.3 + +--- + alacritty/build.rs | 2 +- + alacritty/res/rect.f.glsl | 2 +- + alacritty/res/rect.v.glsl | 3 ++- + alacritty/res/text.f.glsl | 3 ++- + alacritty/res/text.v.glsl | 3 ++- + alacritty/src/renderer/mod.rs | 2 +- + 6 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/alacritty/build.rs b/alacritty/build.rs +index 48841ca..28c20e2 100644 +--- a/alacritty/build.rs ++++ b/alacritty/build.rs +@@ -11,7 +11,7 @@ fn main() { + let dest = env::var("OUT_DIR").unwrap(); + let mut file = File::create(&Path::new(&dest).join("gl_bindings.rs")).unwrap(); + +- Registry::new(Api::Gl, (3, 3), Profile::Core, Fallbacks::All, ["GL_ARB_blend_func_extended"]) ++ Registry::new(Api::Gl, (3, 1), Profile::Core, Fallbacks::All, ["GL_ARB_blend_func_extended", "GL_ARB_instanced_arrays", "GL_ARB_explicit_attrib_location"]) + .write_bindings(GlobalGenerator, &mut file) + .unwrap(); + +diff --git a/alacritty/res/rect.f.glsl b/alacritty/res/rect.f.glsl +index 945eaf2..9f84237 100644 +--- a/alacritty/res/rect.f.glsl ++++ b/alacritty/res/rect.f.glsl +@@ -1,4 +1,4 @@ +-#version 330 core ++#version 140 + + flat in vec4 color; + +diff --git a/alacritty/res/rect.v.glsl b/alacritty/res/rect.v.glsl +index bf9a97d..258bb36 100644 +--- a/alacritty/res/rect.v.glsl ++++ b/alacritty/res/rect.v.glsl +@@ -1,4 +1,5 @@ +-#version 330 core ++#version 140 ++#extension GL_ARB_explicit_attrib_location : require + layout (location = 0) in vec2 aPos; + layout (location = 1) in vec4 aColor; + +diff --git a/alacritty/res/text.f.glsl b/alacritty/res/text.f.glsl +index d5e2688..d4d559c 100644 +--- a/alacritty/res/text.f.glsl ++++ b/alacritty/res/text.f.glsl +@@ -1,4 +1,5 @@ +-#version 330 core ++#version 140 ++#extension GL_ARB_explicit_attrib_location : require + in vec2 TexCoords; + flat in vec4 fg; + flat in vec4 bg; +diff --git a/alacritty/res/text.v.glsl b/alacritty/res/text.v.glsl +index 31e6f93..09c477a 100644 +--- a/alacritty/res/text.v.glsl ++++ b/alacritty/res/text.v.glsl +@@ -1,4 +1,5 @@ +-#version 330 core ++#version 140 ++#extension GL_ARB_explicit_attrib_location : require + // Cell properties. + layout(location = 0) in vec2 gridCoords; + +diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs +index bac8225..3e170be 100644 +--- a/alacritty/src/renderer/mod.rs ++++ b/alacritty/src/renderer/mod.rs +@@ -600,7 +600,7 @@ impl QuadRenderer { + size as *const _, + ); + gl::EnableVertexAttribArray(index); +- gl::VertexAttribDivisor(index, 1); ++ gl::VertexAttribDivisorARB(index, 1); + + #[allow(unused_assignments)] + { +-- +2.32.0 + diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm index 1084cd2d7d..e74a664e7c 100644 --- a/gnu/packages/terminals.scm +++ b/gnu/packages/terminals.scm @@ -1341,6 +1341,14 @@ (define-public alacritty (url "https://github.com/jwilm/alacritty") (commit (string-append "v" version)))) (file-name (git-file-name name version)) + ;; This patch enables to run Alacritty on aarch64 targets such as + ;; PineBook Pro which run Panfrost driver and support OpenGL 3.1 + (patches + `,(if (string-prefix? "aarch64" (or (%current-system) + (%current-target-system))) + (search-patches + "alacritty-use-OpenGL-3.1-with-extensions-instead-of-OpenGL-3.3.patch") + '())) (sha256 (base32 "068y0b1a0m33r7a3j2xf6k602sc8062gm4d5568ynfx6w5n481lj")))) (build-system cargo-build-system)