From patchwork Sun Feb 26 16:13:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Konrad Hinsen X-Patchwork-Id: 47383 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 EDAD916BBF; Sun, 26 Feb 2023 16:14:36 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham 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 E2484168F8 for ; Sun, 26 Feb 2023 16:14:35 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWJf0-0001GG-SW; Sun, 26 Feb 2023 11:14:02 -0500 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 1pWJf0-0001G8-2F for guix-patches@gnu.org; Sun, 26 Feb 2023 11:14:02 -0500 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 1pWJez-0007IN-Qm for guix-patches@gnu.org; Sun, 26 Feb 2023 11:14:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pWJez-0004LS-L2 for guix-patches@gnu.org; Sun, 26 Feb 2023 11:14:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59997] [PATCH v4] gnu: add minimacy Resent-From: Konrad Hinsen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 26 Feb 2023 16:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59997@debbugs.gnu.org Received: via spool by 59997-submit@debbugs.gnu.org id=B59997.167742799916639 (code B ref 59997); Sun, 26 Feb 2023 16:14:01 +0000 Received: (at 59997) by debbugs.gnu.org; 26 Feb 2023 16:13:19 +0000 Received: from localhost ([127.0.0.1]:44887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWJeI-0004KI-P1 for submit@debbugs.gnu.org; Sun, 26 Feb 2023 11:13:19 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:57695) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pWJeF-0004K4-FQ for 59997@debbugs.gnu.org; Sun, 26 Feb 2023 11:13:16 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 5F4845C010B; Sun, 26 Feb 2023 11:13:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 26 Feb 2023 11:13:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.net; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1677427990; x= 1677514390; bh=pmwlnuQnSs9IBgoR4h8M/njcvcisl/P8+f3o6iUZd8E=; b=F KZfOBO2v+WKCKRB8zxQNA+5JibbsoT4BfyVkrN8hpEtZFHOTkhhmNX8PRn+ouJtG jTwhw4StTlp+zX5XLdrzhJpG05yM81vrNFA3Jp/H0+wti97u8X4e4G5vBy7WS5q9 uhtt8Ec/9gdos8JTQixHkQhyFkwdElBQ1/w4w8hFHC0By5/BAFTobc4CdkdPBZXl ljEXXy1xQo5baLv6c1vm9qryUg0/kqH+mg5n7h83fQfXsUcYqB1vuDJ+E4ju3tAe TBBPw7BETxxizS+E/LsuroWfpdY8mIuEe5mAW5L5ooqf26O7GHd8lGkLh4oPQrut IWVDJfK7sr6mzD5KYA/EA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1677427990; x=1677514390; bh=p mwlnuQnSs9IBgoR4h8M/njcvcisl/P8+f3o6iUZd8E=; b=BU/4kpaMPTHtqeqeP HJoXp0SCLKCbTwJpl9RJruIDUH8Li4kkuA6kR0bIrJKl+f/As9sfpxR5sK9PuHL+ Ij52wdoIksGq0bShaPuBOPxKoHDf+KjyWyEpvNPVjIZWoKRbyAbFfz38ITwQM5zQ zLpYprYn+nn1wi50kvgOp06slVyEPnw8p+JHO2+1vLl3KDg5i2iTJGj4XOzmitNo 5NokkUSdbx5ERhVZObegdJAzoHNobJxIkf+YNDP2ymrUNt2CNdbkVpDU12lzask6 p6jT6mD+QfCsiFfEFZM0hlQlYVtoC8DC5we1Q+jya/XVA/zhW1wANzTfPSn5Rq3B dfRbQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudekkedgiedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufhffjgfkfgggtgfgsehtqh ertddtreejnecuhfhrohhmpefmohhnrhgrugcujfhinhhsvghnuceokhhonhhrrggurdhh ihhnshgvnhesfhgrshhtmhgrihhlrdhnvghtqeenucggtffrrghtthgvrhhnpeefhedtie fgteehveelieetieekudekffeugfevvdehveegiefgvdefteetkedvleenucffohhmrghi nhepghhnuhdrohhrghdpghhithhhuhgsrdgtohhmpdhmihhnihhmrggthidrnhgvthenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehkohhnrhgr ugdrhhhinhhsvghnsehfrghsthhmrghilhdrnhgvth X-ME-Proxy: Feedback-ID: i184641e2:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Feb 2023 11:13:09 -0500 (EST) From: Konrad Hinsen References: <20230127192031.3142167-1-zimon.toutoune@gmail.com> Date: Sun, 26 Feb 2023 17:13:08 +0100 In-Reply-To: <20230127192031.3142167-1-zimon.toutoune@gmail.com> (Simon Tournier's message of "Fri, 27 Jan 2023 20:20:31 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/minimacy.scm: New file. * gnu/packages/patches/minimacy.patch: New patch. * gnu/local.mk: Add them. --- gnu/local.mk | 2 + gnu/packages/minimacy.scm | 103 ++++++++++++++++++++++++++++ gnu/packages/patches/minimacy.patch | 34 +++++++++ 3 files changed, 139 insertions(+) create mode 100644 gnu/packages/minimacy.scm create mode 100644 gnu/packages/patches/minimacy.patch diff --git a/gnu/local.mk b/gnu/local.mk index 4ccf015316..c72f14b685 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -423,6 +423,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/messaging.scm \ %D%/packages/minetest.scm \ %D%/packages/mingw.scm \ + %D%/packages/minimacy.scm \ %D%/packages/microcom.scm \ %D%/packages/moe.scm \ %D%/packages/mold.scm \ @@ -1548,6 +1549,7 @@ dist_patch_DATA = \ %D%/packages/patches/mingw-w64-reproducible-gendef.patch \ %D%/packages/patches/minisat-friend-declaration.patch \ %D%/packages/patches/minisat-install.patch \ + %D%/packages/patches/minimacy.patch \ %D%/packages/patches/mit-krb5-hurd.patch \ %D%/packages/patches/mixxx-link-qtscriptbytearray-qtscript.patch \ %D%/packages/patches/mixxx-system-googletest-benchmark.patch \ diff --git a/gnu/packages/minimacy.scm b/gnu/packages/minimacy.scm new file mode 100644 index 0000000000..2a04d7c117 --- /dev/null +++ b/gnu/packages/minimacy.scm @@ -0,0 +1,103 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Konrad Hinsen +;;; +;;; 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 minimacy) + #:use-module (gnu packages) + #:use-module (gnu packages xorg) + #:use-module (gnu packages gl) + #:use-module (gnu packages linux) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages)) + +(define-public minimacy + (package + (name "minimacy") + (version "0.6.2") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ambermind/minimacy/") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1x9i1spf79lq3kxms55dx7lf8pl84cyblq313sjyfpr9l187ailb")) + (patches (search-patches "minimacy.patch")) + (modules '((guix build utils))) + (snippet '(delete-file-recursively "windows")))) + (build-system gnu-build-system) + (inputs (list libx11 libxext alsa-lib mesa glu)) + (outputs '("out" ; core + "gui" ; for GUI programs, with X11 and ALSA + "opengl")) ; for GUI programs, with X11, OpenGL, and ALSA + (arguments + (list + #:tests? #f ; no tests + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-path + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "src/hw.c" + (("minimacy-in-gnu-store") + (assoc-ref outputs "out"))))) + (delete 'configure) + (replace 'build + (lambda _ + (chdir "unix") + (invoke "make" "nox") + (for-each delete-file + (find-files "../obj" "\\.o$")) + (invoke "make" "x11") + (for-each delete-file + (find-files "../obj" "\\.o$")) + (invoke "make" "x11gl") + (chdir ".."))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (gui (assoc-ref outputs "gui")) + (opengl (assoc-ref outputs "opengl"))) + (mkdir-p (string-append out "/rom")) + (mkdir-p (string-append out "/system")) + (copy-recursively "rom" + (string-append out "/rom")) + (copy-recursively "system" + (string-append out "/system")) + (install-file "bin/minimacy" + (string-append out "/bin")) + (install-file "bin/minimacyX11" + (string-append gui "/bin")) + (install-file "bin/minimacyX11GL" + (string-append opengl "/bin")))))))) + (synopsis "Minimalist computing system") + (description + "Minimacy is a minimalist computing technology. +It consists of a programming language (compiler plus virtual machine) +and a library, written such that the whole system can be fully +understood by a single person. An optional extension to the virtual +machine adds X11 and ALSA for user interfaces, another extension +adds OpenGL support.") + (home-page "https://minimacy.net/") + (license license:gpl2))) diff --git a/gnu/packages/patches/minimacy.patch b/gnu/packages/patches/minimacy.patch new file mode 100644 index 0000000000..eca49431c3 --- /dev/null +++ b/gnu/packages/patches/minimacy.patch @@ -0,0 +1,34 @@ +The Minimacy distribution is set up for being compiled and used from the +user's home directory. Running Minimacy as a Guix package requires adding +its store path as a search path for the virtual machine. That is done in +two steps: this patch, and a substitution of the actual store path in the +build process. + +--- minimacy/src/hw.c 2022-12-05 18:51:13.000000000 +0100 ++++ minimacy/src/hw.c 2022-12-09 15:55:47.122793826 +0100 +@@ -90,6 +90,13 @@ + #if defined ON_UNIX || defined ON_MACOS_CMDLINE || defined ON_RASPBERRY64 + void systemExecDir(char* path, int len) + { ++ char* p = "minimacy-in-gnu-store"; ++ if (strlen(p) < len - 2) ++ { ++ strcpy(path, p); ++ systemCleanDir(path); ++ return; ++ } + path[0] = 0; + } + #endif +@@ -583,8 +590,9 @@ + PRINTF(th, LOG_USER, "1- command line argument: -dir path\n"); + PRINTF(th, LOG_USER, "2- environment variable MINIMACY\n"); + PRINTF(th, LOG_USER, "3- grand parent of minimacy.exe (windows only)\n"); +- PRINTF(th, LOG_USER, "4- ~/minimacy (on Unix) or [user]/Documents/minimacy (on Windows)\n"); +- PRINTF(th, LOG_USER, "5- Working directory\n\n"); ++ PRINTF(th, LOG_USER, "4- the minimacy package under /gnu/store (Guix only)\n"); ++ PRINTF(th, LOG_USER, "5- ~/minimacy (on Unix) or [user]/Documents/minimacy (on Windows)\n"); ++ PRINTF(th, LOG_USER, "6- Working directory\n\n"); + } + int hwInit(Thread* th, int argc, char** argv, int standalone) + {