From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KIAOI/gc1GOzDAAAbAwnHQ (envelope-from ) for ; Fri, 27 Jan 2023 19:50:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YP4BIvgc1GMsgwEAauVa8A (envelope-from ) for ; Fri, 27 Jan 2023 19:50:32 +0100 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 13F6CF5F8 for ; Fri, 27 Jan 2023 19:50:32 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLTns-0000mu-Ln; Fri, 27 Jan 2023 13:50:24 -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 1pLTnq-0000mY-8P for guix-patches@gnu.org; Fri, 27 Jan 2023 13:50:22 -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 1pLTnW-0004wi-SX for guix-patches@gnu.org; Fri, 27 Jan 2023 13:50:21 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pLTnW-0003W4-9I for guix-patches@gnu.org; Fri, 27 Jan 2023 13:50:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59997] [PATCH v2] gnu: Add minimacy. References: In-Reply-To: Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 27 Jan 2023 18:50:02 +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 Cc: Konrad Hinsen Received: via spool by 59997-submit@debbugs.gnu.org id=B59997.167484538113484 (code B ref 59997); Fri, 27 Jan 2023 18:50:02 +0000 Received: (at 59997) by debbugs.gnu.org; 27 Jan 2023 18:49:41 +0000 Received: from localhost ([127.0.0.1]:38441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLTnA-0003VQ-MW for submit@debbugs.gnu.org; Fri, 27 Jan 2023 13:49:41 -0500 Received: from mail-wr1-f52.google.com ([209.85.221.52]:40905) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLTn8-0003V9-FN for 59997@debbugs.gnu.org; Fri, 27 Jan 2023 13:49:39 -0500 Received: by mail-wr1-f52.google.com with SMTP id r2so5787444wrv.7 for <59997@debbugs.gnu.org>; Fri, 27 Jan 2023 10:49:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RNpgC34sTpnBzBNkNoX1QbNy1QfoHYs70p3Paenmjnc=; b=W/WucigwrOxrsh6YYjcCh31J35bwcIe1+FTMlIeKVLkmVMxGg2IOIily/HHD7/KLWU v5lTZ/88r9xAHS9QtC7di8AhK0ELSmqj/AvBJs0A+t9WMeA9Dsu1jeWsh9wjOGlM3lfo v8n/R01d0iJTKmK5VlcMtD/gUWS+kLvmLkxB4FChj+OG0JFLYyltw92ft4HjPwXSOwWf KvfsKNKecsoTSlYTQO7/eacJagOaO7NJ0QqubED7iOUFxaRRK3j34/N4Dqk9XTAwj2VV 2oXV90P15ZWLfjU16VPsH6bKg7557v8L2yaTQm+t+n3q7AyZMGambqmrMcKiIkYk116I eTwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RNpgC34sTpnBzBNkNoX1QbNy1QfoHYs70p3Paenmjnc=; b=AQ+XHZWHxooyZyw3F7uZMmbBVcG3dk3RfE/4d6sGGvHLCf60nUCUJXA96HCSOYwQuD YFL/NEhZ3YZgnTK1pLQu53Jssxk6HVAuGgkYTBeA8U3Hqtpz50T2lFNOsCYy7jVZEcYj KDsn4RhWufJbjXwdw9uqj/Ue+8KAb+kAw2bm+U6y3JqLbE9yM7echzrQ5IEBaO/evfEH 36DoGgSr982DSCu5oj7gFAhWyHBEwBnrewqNuVyNQpCBv37J/yJQTixmBmYf62PyzvDZ 5U69TBmaksNNbrS7WKoonKug1ScEpWa0mCvYLU5itCPns3RdjTo4oZ3/u8d5fTNTWeKT FGog== X-Gm-Message-State: AO0yUKWYgKsHdJAdYrxsxekEh0IwsVf/VRt2gOB26n8MBW8/iKrlId5b zkniYIOck38EeBwM99A2KHiYBNXM4mg= X-Google-Smtp-Source: AK7set/YvxzhXMEJcK/p80lr9zY1Di7eZgXhqv6lUtoUXAqJspY9O0RVFZ1y00CxvOirKonk3Mt5rQ== X-Received: by 2002:adf:f390:0:b0:2bf:d2b9:41e6 with SMTP id m16-20020adff390000000b002bfd2b941e6mr629093wro.0.1674845372296; Fri, 27 Jan 2023 10:49:32 -0800 (PST) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id j2-20020a5d4482000000b002be063f6820sm5451961wrq.81.2023.01.27.10.49.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Jan 2023 10:49:31 -0800 (PST) From: Simon Tournier Date: Fri, 27 Jan 2023 19:49:25 +0100 Message-Id: <20230127184925.3126904-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674845432; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=RNpgC34sTpnBzBNkNoX1QbNy1QfoHYs70p3Paenmjnc=; b=BzUL3LizaF1pts6fJdGyOfRP7k52PMIXW6qsqyGZjSkGufWk/1pzyGbKlbu51pUUbjqDdo UPEAr7akucQy4Hqrw3dzfKA3Tug18oi4n5XXpyuXm2C1U6LhAgEscKAfO6s3pBbBgffUB+ +phAf84uOIqNe9qplMrAW5wI/0ruG8oqoMvuMRpB5wri9PVaSc7MQpdR1epMCEbgcU8yRh NSD8x/Q2hbyoIMkMFzdWLJWEzoOEO2iRfcjGbHs7HNfuNF3grv7uqow20sxr8cWD53K61d KWKp0vS8dVvCOEN6WYU4p4p6DuVoYoK2d6mC1M5ZYh69CsKzs8yud1ev+cxQYA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="W/Wucigw"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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-Seal: i=1; s=key1; d=yhetil.org; t=1674845432; a=rsa-sha256; cv=none; b=fuQpS7mC4ng3OTHOAN+7kBTILMq0aRGUEyuBxDiZMWZq6FZlEo3nVY7xXV0yZShBrD1Bxv too+fJ02p/imE0yrJi7wfArxx9o+zYiwldxCDnFKnZ/7tB090xDjIIx6HGMXrA0luRxAgp hVyYp190o6+RTuQifjbhBp6jQmeSqozNVhvkkI1fq7GmNKUi8q5AimdpEX8L7Nyuk0jlR5 tHKbfH7KN8e5ZO8DtRJNKQ9C+RXxnuiORxe5T/43HgBMkeXi4Ovc6xEX+bZTvCQpnXlJce tKMPCW0tj4JL5o6l0psYXHGamXKIS8DexunC9kMcow4VbnHNMCAZKPpaJm22xw== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b="W/Wucigw"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.47 X-Spam-Score: -1.47 X-Migadu-Queue-Id: 13F6CF5F8 X-TUID: p7LCWMhCR5PG From: Konrad Hinsen * 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 | 97 +++++++++++++++++++++++++++++ gnu/packages/patches/minimacy.patch | 34 ++++++++++ 3 files changed, 133 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 29237b1138..212c95c98b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -424,6 +424,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/motti.scm \ @@ -1540,6 +1541,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..6d8e6a3f75 --- /dev/null +++ b/gnu/packages/minimacy.scm @@ -0,0 +1,97 @@ +;;; 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 git-download) + #:use-module (guix build-system gnu) + #: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 + "X11" ;for GUI programs, with X11 and ALSA + "X11GL")) ;for GUI programs, with X11, OpenGL, and ALSA + (arguments + `(#: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")) + (x11 (assoc-ref outputs "X11")) + (x11gl (assoc-ref outputs "X11GL"))) + (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 x11 "/bin")) + (install-file "bin/minimacyX11GL" + (string-append x11gl "/bin"))))) + (delete 'check)))) + (synopsis "Minimalist computing system") + (description + "Minimacy is an open-source 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) + { base-commit: 8e1cca32b938cef0812ce042c6c2e8bccb326ec7 -- 2.38.1