summary refs log tree commit diff
path: root/pkgs/development/interpreters/tinyscheme/default.nix
diff options
context:
space:
mode:
authorRahul Butani <rrbutani@users.noreply.github.com>2022-07-18 15:13:20 -0500
committerRahul Butani <rrbutani@users.noreply.github.com>2022-07-18 16:59:00 -0500
commit8f0ec8269639500be31b2bae37d515388f12b4d8 (patch)
tree00f032e41c71da3a65ade0eda4453253aea953db /pkgs/development/interpreters/tinyscheme/default.nix
parent17fb7518ffc2e9a13ec6c1ecec2be1d2cac9d0a6 (diff)
downloadnixpkgs-8f0ec8269639500be31b2bae37d515388f12b4d8.tar
nixpkgs-8f0ec8269639500be31b2bae37d515388f12b4d8.tar.gz
nixpkgs-8f0ec8269639500be31b2bae37d515388f12b4d8.tar.bz2
nixpkgs-8f0ec8269639500be31b2bae37d515388f12b4d8.tar.lz
nixpkgs-8f0ec8269639500be31b2bae37d515388f12b4d8.tar.xz
nixpkgs-8f0ec8269639500be31b2bae37d515388f12b4d8.tar.zst
nixpkgs-8f0ec8269639500be31b2bae37d515388f12b4d8.zip
tinyscheme: fix the build on macOS
Diffstat (limited to 'pkgs/development/interpreters/tinyscheme/default.nix')
-rw-r--r--pkgs/development/interpreters/tinyscheme/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/development/interpreters/tinyscheme/default.nix b/pkgs/development/interpreters/tinyscheme/default.nix
index 38b4cbe1ba8..7d064432a73 100644
--- a/pkgs/development/interpreters/tinyscheme/default.nix
+++ b/pkgs/development/interpreters/tinyscheme/default.nix
@@ -13,9 +13,19 @@ stdenv.mkDerivation rec {
 
   prePatch = "dos2unix makefile";
   patches = [
+    # The alternate macOS main makes use of `ccommand` which seems to be
+    # `MetroWerks CodeWarrier` specific:
+    # https://ptgmedia.pearsoncmg.com/imprint_downloads/informit/downloads/9780201703535/macfix.html
+    #
+    # In any case, this is not needed to build on macOS.
+    ./01-remove-macOS-main.patch
+
     # We want to have the makefile pick up $CC, etc. so that we don't have
     # to unnecessarily tie this package to the GCC stdenv.
     ./02-use-toolchain-env-vars.patch
+  ] ++ lib.optionals stdenv.targetPlatform.isDarwin [
+    # On macOS the library suffix is .dylib:
+    ./03-macOS-SOsuf.patch
   ];
   postPatch = ''
     substituteInPlace scheme.c --replace "init.scm" "$out/lib/init.scm"
@@ -29,7 +39,6 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
     description = "Lightweight Scheme implementation";
     longDescription = ''
       TinyScheme is a lightweight Scheme interpreter that implements as large a
@@ -40,6 +49,5 @@ stdenv.mkDerivation rec {
     license = licenses.bsdOriginal;
     maintainers = [ maintainers.ebzzry ];
     platforms = platforms.unix;
-    badPlatforms = [ "aarch64-darwin" ];
   };
 }