From b71cff07a73fc7949c22d045bb74c7ef1e9bbb2d Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 28 May 2022 22:13:48 +0100 Subject: [PATCH 1/2] gforth: explicitly set lispdir otherwise in situations where we don't have a working sandbox (darwin), if /usr/share/emacs happens to exist, the install phase will try to put its lisp files there and fail due to permissions. --- pkgs/development/compilers/gforth/default.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/gforth/default.nix b/pkgs/development/compilers/gforth/default.nix index a57dea7b1b62..a926c4e8cf9f 100644 --- a/pkgs/development/compilers/gforth/default.nix +++ b/pkgs/development/compilers/gforth/default.nix @@ -5,6 +5,7 @@ let swig = callPackage ./swig.nix { }; bootForth = callPackage ./boot-forth.nix { }; + lispDir = "${placeholder "out"}/share/emacs/site-lisp"; in stdenv.mkDerivation rec { pname = "gforth"; @@ -26,11 +27,14 @@ in stdenv.mkDerivation rec { passthru = { inherit bootForth; }; - configureFlags = lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ]; + configureFlags = [ + "--with-lispdir=${lispDir}" + ] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [ + "--build=x86_64-apple-darwin" + ]; - postInstall = '' - mkdir -p $out/share/emacs/site-lisp - cp gforth.el $out/share/emacs/site-lisp/ + preConfigure = '' + mkdir -p ${lispDir} ''; meta = { From 27d4500b618468790febcdf7991f69bad94687e9 Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Mon, 30 May 2022 22:20:46 +0100 Subject: [PATCH 2/2] gforth: unmark broken on darwin --- pkgs/development/compilers/gforth/default.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/compilers/gforth/default.nix b/pkgs/development/compilers/gforth/default.nix index a926c4e8cf9f..c84fa5975abf 100644 --- a/pkgs/development/compilers/gforth/default.nix +++ b/pkgs/development/compilers/gforth/default.nix @@ -38,7 +38,6 @@ in stdenv.mkDerivation rec { ''; meta = { - broken = stdenv.isDarwin; description = "The Forth implementation of the GNU project"; homepage = "https://github.com/forthy42/gforth"; license = lib.licenses.gpl3;