about summary refs log tree commit diff
path: root/pkgs/development/compilers/uasm
diff options
context:
space:
mode:
authorThiago Kenji Okada <thiagokokada@gmail.com>2022-04-18 22:33:05 +0100
committerThiago Kenji Okada <thiagokokada@gmail.com>2022-04-18 22:33:05 +0100
commitce602086b5994df8496516e4e74b6eb0fc282ee8 (patch)
treea7cc9e60d6945f7c1092693556d3520ac106a466 /pkgs/development/compilers/uasm
parent91771f3b50f85c1d56401bca8faeca1c4b117a49 (diff)
uasm: fix compilation on darwin
Diffstat (limited to 'pkgs/development/compilers/uasm')
-rw-r--r--pkgs/development/compilers/uasm/default.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/development/compilers/uasm/default.nix b/pkgs/development/compilers/uasm/default.nix
index bd4d61d698cb2..a08e232c962e9 100644
--- a/pkgs/development/compilers/uasm/default.nix
+++ b/pkgs/development/compilers/uasm/default.nix
@@ -14,9 +14,23 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-CIbHPKJa60SyJeFgF1Tux7RfJZBChhUVXR7HGa+gCtQ=";
   };
 
+  patches = lib.optionals stdenv.isDarwin [
+    (fetchpatch {
+      name = "fix-v2_55-compilation-on-macos.patch";
+      url = "https://github.com/Terraspace/UASM/commit/b50c430cc3083c7f32e288a9f64fe1cafb03091d.patch";
+      sha256 = "sha256-FGFB282LSEKtGD1cIRH+Qi5bye5Gx4xb0Ty4J03xjCU";
+    })
+  ];
+
   enableParallelBuilding = true;
 
-  makefile = "gccLinux64.mak";
+  makefile =
+    if stdenv.isDarwin then
+      "ClangOSX64.mak"
+    else
+      "gccLinux64.mak";
+
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
 
   installPhase = ''
     runHook preInstall
@@ -30,7 +44,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     homepage = "http://www.terraspace.co.uk/uasm.html";
     description = "A free MASM-compatible assembler based on JWasm";
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ thiagokokada ];
     license = licenses.watcom;
   };