Unverified Commit ccb42ee4 authored by rafaelrc7's avatar rafaelrc7
Browse files

gforth: 0.7.9_20230518 -> 0.7.9_20251001

Since the last update, the gforth code executed during build started to
use inaccessible directories during the nix build sandbox. Thus, I
patched the code to use working alternatives:

- Instead of using `/sys/devices/system/cpu/present` to get the number
  of cores, now it uses `nproc`
- Instead of creating a temporary dir in `~/.cache` it creates it on the
  current build directory
parent dd9009ff
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
  autoreconfHook,
  texinfo,
  libffi,
  writableTmpDirAsHomeHook,
}:

let
@@ -16,16 +17,19 @@ in
stdenv.mkDerivation rec {

  pname = "gforth";
  version = "0.7.9_20230518";
  version = "0.7.9_20251001";

  src = fetchFromGitHub {
    owner = "forthy42";
    repo = "gforth";
    rev = version;
    hash = "sha256-rXtmmENBt9RMdLPq8GDyndh4+CYnCmz6NYpe3kH5OwU=";
    hash = "sha256-u9snXcFa/YYvITgMBY8FRYyyLFhHCP6hWA5ljwdKGLk=";
  };

  patches = [ ./use-nproc-instead-of-fhs.patch ];

  nativeBuildInputs = [
    writableTmpDirAsHomeHook
    autoreconfHook
    texinfo
    bootForth
+16 −0
Original line number Diff line number Diff line
diff --git i/cilk.fs w/cilk.fs
index 9c675d06..df858f3d 100644
--- i/cilk.fs
+++ w/cilk.fs
@@ -25,9 +25,8 @@ e? os-type 2dup s" darwin" string-prefix? -rot s" openbsd" string-prefix? or [IF
     s>number drop
     r> free throw
 [ELSE] e? os-type s" linux" search nip nip [IF]
-	s" /sys/devices/system/cpu/present" slurp-file over >r
-	#lf -scan '-' $split 2nip
-	s>number drop 1+
+	s" nproc" r/o open-pipe throw slurp-fid over >r
+	s>number drop
 	r> free throw
     [ELSE]
 	1 \ we don't know