From patchwork Mon Aug 2 15:50:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 31729 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 6C91B27BC78; Mon, 2 Aug 2021 16:51:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 16F3227BC6B for ; Mon, 2 Aug 2021 16:51:23 +0100 (BST) Received: from localhost ([::1]:44160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAaDq-0002z2-2x for patchwork@mira.cbaines.net; Mon, 02 Aug 2021 11:51:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAaDX-0002M9-AE for guix-patches@gnu.org; Mon, 02 Aug 2021 11:51:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAaDX-0005Yt-28 for guix-patches@gnu.org; Mon, 02 Aug 2021 11:51:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mAaDX-00051d-25 for guix-patches@gnu.org; Mon, 02 Aug 2021 11:51:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49828] [PATCH 04/20] build-system: Add 'minetest-mod-build-system'. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 02 Aug 2021 15:51:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49828 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49828@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 49828-submit@debbugs.gnu.org id=B49828.162791943219147 (code B ref 49828); Mon, 02 Aug 2021 15:51:03 +0000 Received: (at 49828) by debbugs.gnu.org; 2 Aug 2021 15:50:32 +0000 Received: from localhost ([127.0.0.1]:39056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAaD2-0004yb-9s for submit@debbugs.gnu.org; Mon, 02 Aug 2021 11:50:32 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:51250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAaCw-0004wh-D7 for 49828@debbugs.gnu.org; Mon, 02 Aug 2021 11:50:27 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id cfqN2500C0mfAB401fqRxH; Mon, 02 Aug 2021 17:50:25 +0200 From: Maxime Devos Date: Mon, 2 Aug 2021 17:50:03 +0200 Message-Id: <20210802155019.6122-4-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802155019.6122-1-maximedevos@telenet.be> References: <20210802155019.6122-1-maximedevos@telenet.be> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1627919425; bh=XA0LCI+Jbd/kaqXJ9A9/x69M7EugKcwhav98mulZurQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GtX8YyBMZ8tZCU/O8ih/EXD1jq1dFUYCj5d+rBFa0L7UPDfp9gxT2Z9M09Au1pJoG gblX8+wuwRPJDMaZcIEKQBKWubTC3zMFhi/DUZw4u4s9JDq90PiSQXjP2IBoV++NZX Na7v9JfuZ/LwqdiePDb9E3mryD1ZYMhTvnhO2MChE6aml2Iy3ela8WNo/EEopspdU6 HfethE0RLWOpzuTvGUIhU3YfIMkeq8TBO/Y1srFsLHHz6Ypf0KaiiRiucAjQCpQsek 3udvbScLQDYJtQXqZubZLu47WEtiz6yqHM2JNfU/e6OKnUgR9tGmTM45MsW5v2USKY EHqycIYpUJDdw== 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" X-getmail-retrieved-from-mailbox: Patches * guix/build-system/minetest.scm: New module. * Makefile.am (MODULES): Add it. * doc/guix.texi (Build Systems): Document 'minetest-mod-build-system'. --- Makefile.am | 1 + doc/guix.texi | 7 +++++ guix/build-system/minetest.scm | 53 ++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 guix/build-system/minetest.scm diff --git a/Makefile.am b/Makefile.am index d5ec909213..f6fae09579 100644 --- a/Makefile.am +++ b/Makefile.am @@ -141,6 +141,7 @@ MODULES = \ guix/build-system/go.scm \ guix/build-system/meson.scm \ guix/build-system/minify.scm \ + guix/build-system/minetest.scm \ guix/build-system/asdf.scm \ guix/build-system/copy.scm \ guix/build-system/glib-or-gtk.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index b3c16e6507..43c248234d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7895,6 +7895,13 @@ declaration. Its default value is @code{(default-maven-plugins)} which is also exported. @end defvr +@defvr {Scheme Variable} minetest-mod-build-system +This variable is exported by @code{(guix build-system minetest)}. It +implements a build procedure for @uref{https://www.minetest.net, Minetest} +mods, which consists of copying lua code, images and other resources to +the location Minetest searches for mods. +@end defvr + @defvr {Scheme Variable} minify-build-system This variable is exported by @code{(guix build-system minify)}. It implements a minification procedure for simple JavaScript packages. diff --git a/guix/build-system/minetest.scm b/guix/build-system/minetest.scm new file mode 100644 index 0000000000..29866ced6d --- /dev/null +++ b/guix/build-system/minetest.scm @@ -0,0 +1,53 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Maxime Devos +;;; +;;; 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 (guix build-system minetest) + #:use-module (guix build-system copy) + #:use-module (guix build-system) + #:export (minetest-mod-build-system)) + +;; +;; Build procedure for minetest mods. This is implemented as an extension +;; of ‘copy-build-system’. +;; +;; Code: + +(define (guix-name->mod-name package-name) + ;; The "minetest-" prefix is useless. Don't make it appear in the + ;; ‘select mods’ menu when "modpack.conf" or "mod.conf" do not have + ;; the "name" field set. + (if (string-prefix? "minetest-" package-name) + (substring package-name 9) + package-name)) + +(define (lower-mod name . arguments) + (define lower (build-system-lower copy-build-system)) + (apply lower + name + #:install-plan + `'(("." ,(string-append "share/minetest/mods/" + (guix-name->mod-name name)))) + arguments)) + +(define minetest-mod-build-system + (build-system + (name 'minetest-mod) + (description "The build system for minetest mods") + (lower lower-mod))) + +;;; minetest.scm ends here