From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cMufHzlvU2StjQAASxT56A (envelope-from ) for ; Thu, 04 May 2023 10:39:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id OL6AHzlvU2TtrQAAauVa8A (envelope-from ) for ; Thu, 04 May 2023 10:39:21 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1FB3B3BC15 for ; Thu, 4 May 2023 10:39:21 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puUUU-0008Ps-Qe; Thu, 04 May 2023 04:39:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puUUR-0008PN-CG for guix-patches@gnu.org; Thu, 04 May 2023 04:39:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puUUQ-0002I1-5K for guix-patches@gnu.org; Thu, 04 May 2023 04:39:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puUUQ-00019y-1I for guix-patches@gnu.org; Thu, 04 May 2023 04:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63254] [PATCH v3 4/5] gnu: Add mruby-zest. References: In-Reply-To: Resent-From: Sughosha Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 May 2023 08:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63254 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "63254@debbugs.gnu.org" <63254@debbugs.gnu.org> Received: via spool by 63254-submit@debbugs.gnu.org id=B63254.16831894844379 (code B ref 63254); Thu, 04 May 2023 08:39:02 +0000 Received: (at 63254) by debbugs.gnu.org; 4 May 2023 08:38:04 +0000 Received: from localhost ([127.0.0.1]:48524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puUTT-00018Z-GR for submit@debbugs.gnu.org; Thu, 04 May 2023 04:38:04 -0400 Received: from mail-40130.protonmail.ch ([185.70.40.130]:59969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puUTR-00017q-JV for 63254@debbugs.gnu.org; Thu, 04 May 2023 04:38:02 -0400 Date: Thu, 04 May 2023 08:37:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1683189475; x=1683448675; bh=tow9qaP45caKeUEOxGNGpx6gTjF4N5MFDOxb3psDPc4=; h=Date:To:From:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=iYTCyFtUpBlurPsKRmLCDY2SfTmKWjsaVe/RVM4ASCnZmiuvlem2gEqqr7OXoBWl3 GVrRe1ha3lLpyY7WH2GTOumFWk/KU0i2cnYGN2hWe8MscdOMdyKdNyxYu/Vzfp6Vz1 jsNMf7f/g32YTBMepHhwAjQglQ/rCO8QNEBGh3K7QbX6mKMXETE7WILTjggB2C3sKI VAetvhOHaplemGq9sGlq/TOTMiUCkpbKdVsZcA3h3BRCOszRDeQsGZWRPUmAlRl7vO jEfgRQchNtDAoFOC8tQrCl4p+vELFVy7YiblXzbvFhcg30K2RvCq2T8fEPhjea+Khw c+xkxl5Dq95nA== Message-ID: <4UQSmfkT8PD3IZFQBYvYwM_cjtjE7zZZ3pvjsbRTsOBm25G-XvEHHZrKG1Z46Ew_dfuhzEl3fvi3kYBnV4U-STg6mwezJv88PkPtIk3fdTc=@proton.me> Feedback-ID: 45211691:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Reply-to: Sughosha X-ACL-Warn: , Sughosha via Guix-patches From: Sughosha via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683189561; a=rsa-sha256; cv=none; b=rp3+HRJM/5AJZ2dfPyrXjMRQoBZk7Gm/iVvPlhkKFU7O7YhyYeRiHU5gOW4LdpcPt8P6iX B2vRlFny9ovBjaG7aIoe8tOue8kOLNRX/+A0pV/XAn62wJsc+DcnBaSKDAVdmcZuprbNNH WTEF8cPwrRlG6LS802mld9MSylQLgk56OFqJIynIgmcX4mlqwrhDUUaxSTp2PbGQbWN2kD Y0PeCzR6v6RNyz1yyxuvCG+jED2ten9Tjr1bwl37ANhGx2ws/D36wFXIl79NeFGdaUjSHG bSHEcYMZ+Gk00CEpc8qPjyhJPXIqPU89PZYo5/Kdq7tu9DkC2Wf+Xh9BR8/0Iw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=proton.me header.s=protonmail header.b=iYTCyFtU; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683189561; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tow9qaP45caKeUEOxGNGpx6gTjF4N5MFDOxb3psDPc4=; b=Q11tzY6d+F/gNUD8fibFWgfJ9hUym1elVcgMwWc/hqPOb2MM7APSVTQ2+na62jwxjogL3+ e+U2yKLWIREAWs1dy/Z5SWD4waLZWT0VbLp9CSfkbrd7hZHPUCFyJM8b7PoRAEswHu75zK dpSmdM6EYsZdF5KT5EOAFC2f+qcG2U2lqyZmq/qYtO4Q2Z8xo1C5mG4eLI03+Q6IxIeN02 L/1r39L/RKyAq0tRK3sqUgcthOKqf/EjDUf/LKAcQDB8UP7BU5Xg5PP3wlMu7Vz0VfeZgf F7Oi0CfHInlo45FpveY4j4KQxpK3oW2hAX55M/lgijVToZtDUbR+MeqcSaWXNw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=proton.me header.s=protonmail header.b=iYTCyFtU; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.21 X-Spam-Score: -2.21 X-Migadu-Queue-Id: 1FB3B3BC15 X-TUID: OhDv6faQOfjb * gnu/packages/mruby-xyz.scm: New file. * gnu/local.mk: Register the file. --- gnu/local.mk | 1 + gnu/packages/mruby-xyz.scm | 176 +++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 gnu/packages/mruby-xyz.scm diff --git a/gnu/local.mk b/gnu/local.mk index aa50fc0465..6f213b2e7f 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -436,6 +436,7 @@ GNU_SYSTEM_MODULES =3D=09=09=09=09\ %D%/packages/mpd.scm=09=09=09=09\ %D%/packages/mp3.scm=09=09=09=09\ %D%/packages/mpi.scm=09=09=09=09\ + %D%/packages/mruby-xyz.scm=09=09=09\ %D%/packages/multiprecision.scm=09=09\ %D%/packages/music.scm=09=09=09\ %D%/packages/musl.scm=09=09=09=09\ diff --git a/gnu/packages/mruby-xyz.scm b/gnu/packages/mruby-xyz.scm new file mode 100644 index 0000000000..5524976dec --- /dev/null +++ b/gnu/packages/mruby-xyz.scm @@ -0,0 +1,176 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2023 +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages mruby-xyz) + #:use-module (guix packages) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix gexp) + #:use-module (guix utils) + #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages audio) + #:use-module (gnu packages bash) + #:use-module (gnu packages fonts) + #:use-module (gnu packages gl) + #:use-module (gnu packages libevent) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages ruby) + #:use-module (gnu packages xorg)) + +(define-public mruby-zest + (package + (name "mruby-zest") + (version "3.0.6") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mruby-zest/mruby-zest-build") + (commit version) + ;; Cloning recursively for and the required mruby sour= ces + ;; and gems. + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0dz4zv1km9805lji2q2qqdd8s8hgfd723dxdzcivbhm612szm1mc")) + (modules '((guix build utils))) + (snippet + ;; This packages contains a custom "pugl". Replacing it wit= h the + ;; system "pugl" fails to build. + ;; Delete the bundled "libuv", "nanovg" and "rtosc". + '(with-directory-excursion "deps" + (for-each delete-file-recursively + (list "libuv" "nanovg" "rtosc")))))) + (build-system gnu-build-system) + (arguments + (list #:tests? #f ;no test suite + #:make-flags + #~(list (string-append "CC=3D" #$(cc-for-target)) + "CONFIG_SHELL=3Dbash") + #:phases + #~(modify-phases %standard-phases + (delete 'configure) ;no configure script + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + ;; Do not compile "nanovg" and "libuv" and use the syst= em + ;; provided versions of them. + (substitute* "Makefile" + (("cd deps/nanovg") "#cd deps/nanovg") + (("\\$\\(AR\\) rc deps/libnanovg\\.a") + "#$(AR) rc deps/libnanovg.a") + (("\\./deps/libnanovg\\.a") + "-lnanovg") + (("cd deps/libuv") "#cd deps/libuv") + (("\\./deps/libuv/\\.libs/libuv\\.a") + "-luv") + (("\\./deps/libuv/\\.libs/libuv-win\\.a") + "-luv-win")) + (substitute* "build_config.rb" + (("#\\{`pwd`\\.strip\\}/\\.\\./deps/libnanovg\\.a") + "-lnanovg") + (("#\\{`pwd`\\.strip\\}/\\.\\./deps/libuv\\.a") + "-luv") + (("cc\\.include_paths.*\\./deps/nanovg/.*$") + "#") + (("cc\\.include_paths.*\\./deps/libuv/.*$") + "#")) + (substitute* "deps/mruby-nanovg/src/nvg_screenshot.c" + (("\\.\\./\\.\\./nanovg/.*/stb_image_write\\.h") + (search-input-file inputs "/example/stb_image_write.h= "))) + ;; Use the system provided "rtosc" headers. + (substitute* "src/mruby-widget-lib/src/gem.c" + (("\"\\.\\./\\.\\./\\.\\./deps/.*/rtosc\\.h\"") + "")) + ;; Fix missing fonts. + (substitute* + "src/mruby-widget-lib/mrblib/script.rb" + (("sans =3D \\[") + (string-append + "sans =3D [\"" + (search-input-file inputs + "/share/fonts/truetype/Roboto-Regular.ttf") + "\", ")) + (("bold =3D \\[") + (string-append + "bold =3D [\"" + (search-input-file inputs + "/share/fonts/truetype/Roboto-Bold.ttf") + "\", "))) + ;; Fix paths for zyn-fusion files. + (substitute* "src/osc-bridge/src/bridge.c" + (("fopen\\(\\\"schema/") + (string-append + "fopen(\"" #$output "/share/zyn-fusion/schema/"))) + (substitute* "test-libversion.c" + (("./libzest.so") + (string-append #$output "/lib/libzest.so"))) + (substitute* "src/mruby-widget-lib/src/api.c" + ((", \\\"\\./qml/") ", \"../share/zyn-fusion/qml/") + (("\\./qml/") + (string-append #$output "/share/zyn-fusion/qml"))))) + (replace 'install + (lambda _ + (rename-file "zest" "zyn-fusion") + (install-file "zyn-fusion" (string-append #$output "/bi= n")) + (install-file "libzest.so" (string-append #$output "/li= b")) + (for-each + (lambda (folder) + (for-each + (lambda (file) + (install-file file + (string-append #$output "/share/zyn-fusion/qml= "))) + (find-files folder "\\.qml$"))) + '("src/mruby-zest/qml" "src/mruby-zest/example")) + (install-file "src/osc-bridge/schema/test.json" + (string-append #$output "/share/zyn-fusion/schema")) + (install-file "completions/zyn-fusion" + (string-append + #$output "/share/bash-completion/completions"))))))) + (native-inputs + (list (package-source nanovg) ;for "stb_image_write.h" + pkg-config + ruby)) + (inputs + (list font-google-roboto + libuv + libx11 + mesa + ;; With the latest version of "nanovg" the contents are not + ;; displayed properly. + (let ((version "0") + (revision "0") + (commit "b83cf926525e7cea8d2483da2a75852b8c7b6d28")) + (package (inherit nanovg) + (version (git-version version revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/memononen/nanovg") + (commit commit))) + (sha256 + (base32 + "1zp355pw6xnb5mjarz67cxkglv7j1s0qzv705fz1wf0gl0sjhy8f"= )))))) + rtosc)) + (home-page "https://github.com/mruby-zest/mruby-zest-build") + (synopsis "Zyn-Fusion user interface") + (description + "This package provides user interface for Zyn-Fusion.") + (license + (list license:lgpl2.1)))) --=20 2.39.2