From 8c0dcf3e89e0eb2a6094263efdbc5eaec0e8e9e8 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 6 Dec 2019 14:44:39 +0100 Subject: gnu: mes: Add patch to remove store name from binary. * gnu/packages/patches/mes-remove-store-name.patch: New file, from upstream. * gnu/packages/mes.scm (mes): Use it. Add `www.' to homepage. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/mes.scm | 3 +- gnu/packages/patches/mes-remove-store-name.patch | 121 +++++++++++++++++++++++ 3 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/mes-remove-store-name.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index d12b6b1878..fbea6dc78b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1133,6 +1133,7 @@ dist_patch_DATA = \ %D%/packages/patches/mcrypt-CVE-2012-4409.patch \ %D%/packages/patches/mcrypt-CVE-2012-4426.patch \ %D%/packages/patches/mcrypt-CVE-2012-4527.patch \ + %D%/packages/patches/mes-remove-store-name.patch \ %D%/packages/patches/mesa-skip-disk-cache-test.patch \ %D%/packages/patches/mesa-timespec-test-32bit.patch \ %D%/packages/patches/mescc-tools-boot.patch \ diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm index 59710c45ae..0a5863582a 100644 --- a/gnu/packages/mes.scm +++ b/gnu/packages/mes.scm @@ -134,7 +134,7 @@ (define-public mes-0.19 GNU/Linux distributions. It consists of a mutual self-hosting Scheme interpreter in C and a Nyacc-based C compiler in Scheme and is compatible with Guile.") - (home-page "https://gnu.org/software/mes") + (home-page "https://www.gnu.org/software/mes/") (license gpl3+))) (define-public mes @@ -145,6 +145,7 @@ (define-public mes (method url-fetch) (uri (string-append "mirror://gnu/mes/" "mes-" version ".tar.gz")) + (patches (search-patches "mes-remove-store-name.patch")) (sha256 (base32 "104qxngxyl7pql8vqrnli3wfyx0ayfaqg8gjfhmk4qzrafs46slm")))) diff --git a/gnu/packages/patches/mes-remove-store-name.patch b/gnu/packages/patches/mes-remove-store-name.patch new file mode 100644 index 0000000000..ad055c51f2 --- /dev/null +++ b/gnu/packages/patches/mes-remove-store-name.patch @@ -0,0 +1,121 @@ +From d8f361705325cf91fc6c2ec84f281cdcd6bfa8b1 Mon Sep 17 00:00:00 2001 +From: Jan Nieuwenhuizen +Date: Tue, 3 Dec 2019 21:23:24 +0100 +Subject: [PATCH] core: Remove MES_PKGDATADIR. + +* configure: Do not add MES_PKGDATADIR to config.h. +* configure.sh: Likewise. +* simple.sh: Likewise. +* src/mes.c (open_boot): Do not use MES_PKGDATADIR; rely on +MES_PREFIX or cwd. +--- + configure | 1 - + configure.sh | 1 - + simple.sh | 2 -- + src/mes.c | 13 ------------- + 4 files changed, 17 deletions(-) + +diff --git a/configure b/configure +index 8edb2ce7b..12d8323f2 100755 +--- a/configure ++++ b/configure +@@ -666,7 +666,6 @@ See \"Porting GNU Mes\" in the manual, or try --with-courage\n" mes-system) + ")) + (display (string-append " + #define MES_VERSION \"" VERSION "\" +-#define MES_PKGDATADIR \"" pkgdatadir "\" + "))))) + (substitute (string-append srcdest "build-aux/config.make.in") pairs #:target ".config.make")) + +diff --git a/configure.sh b/configure.sh +index 947ddd851..0139cbc36 100755 +--- a/configure.sh ++++ b/configure.sh +@@ -244,7 +244,6 @@ EOF + fi + cat >> include/mes/config.h < include/mes/config.h < include/mes/config.h < 1) +- { +- eputs (";;; pkgdatadir="); +- eputs (MES_PKGDATADIR); +- eputs ("\n"); +- } + if (getenv ("MES_BOOT")) + strcpy (boot, getenv ("MES_BOOT")); + else +@@ -1801,13 +1795,6 @@ open_boot () + __stdin = try_open_boot (file_name, boot, "MES_PREFIX/share/mes"); + } + } +- if (__stdin < 0) +- { +- strcpy (g_datadir, MES_PKGDATADIR); +- strcpy (file_name, g_datadir); +- strcpy (file_name + strlen (file_name), "/module/mes/"); +- __stdin = try_open_boot (file_name, boot, "pkgdatadir"); +- } + if (__stdin < 0) + { + g_datadir[0] = 0; +-- +2.24.0 + +commit 2f6fab05b3f09df02aba70c3e21d5fedb45dc567 +Author: Jan Nieuwenhuizen +Date: Sun Nov 24 23:12:29 2019 +0100 + + core: Throw instead of segfault on non-existing input file. WIP. + + Reported by theruran. + + * src/posix.c (open_input_file): Call error instead of failing silently. + +diff --git a/src/posix.c b/src/posix.c +index 7ba2e9915..fd753232d 100644 +--- a/src/posix.c ++++ b/src/posix.c +@@ -188,7 +188,10 @@ current_input_port () + SCM + open_input_file (SCM file_name) + { +- return MAKE_NUMBER (mes_open (CSTRING (file_name), O_RDONLY, 0)); ++ int filedes = mes_open (CSTRING (file_name), O_RDONLY, 0); ++ if (filedes == -1) ++ error (cell_symbol_system_error, cons (MAKE_STRING0 ("No such file or directory"), file_name)); ++ return MAKE_NUMBER (filedes); + } + + SCM -- cgit v1.2.3