diff --git a/pkgs/geospatial/mapsoft/0002-fix-build.patch b/pkgs/geospatial/mapsoft/0002-fix-build.patch
index 03dad35e62e1be2913d0e8591607721744bd7f2c..2bd7d1ba14ee0dc69d31aa827c4c427ff4d3aacc 100644
--- a/pkgs/geospatial/mapsoft/0002-fix-build.patch
+++ b/pkgs/geospatial/mapsoft/0002-fix-build.patch
@@ -1,8 +1,7 @@
-Submodule modules contains modified content
-diff --git i/modules/pc/libdb.pc w/modules/pc/libdb.pc
+diff --git i/pc/libdb.pc w/pc/libdb.pc
 index 6a40e95..682c932 100644
---- i/modules/pc/libdb.pc
-+++ w/modules/pc/libdb.pc
+--- i/pc/libdb.pc
++++ w/pc/libdb.pc
 @@ -1,5 +1,11 @@
 +prefix=@db@
 +exec_prefix=${prefix}
@@ -16,10 +15,10 @@  Version: 1
 -Libs: -ldb
 +Libs: -L${libdir} -ldb
 +Cflags: -I${includedir}
-diff --git i/modules/pc/libgif.pc w/modules/pc/libgif.pc
+diff --git i/pc/libgif.pc w/pc/libgif.pc
 index cb154c9..24d8898 100644
---- i/modules/pc/libgif.pc
-+++ w/modules/pc/libgif.pc
+--- i/pc/libgif.pc
++++ w/pc/libgif.pc
 @@ -1,5 +1,11 @@
 +prefix=@giflib@
 +exec_prefix=${prefix}
@@ -33,10 +32,10 @@  Version: 1
 -Libs: -lgif
 +Libs: -L${libdir} -lgif
 +Cflags: -I${includedir}
-diff --git i/modules/tmpdir/Makefile w/modules/tmpdir/Makefile
+diff --git i/tmpdir/Makefile w/tmpdir/Makefile
 index d44adac..c0b361e 100644
---- i/modules/tmpdir/Makefile
-+++ w/modules/tmpdir/Makefile
+--- i/tmpdir/Makefile
++++ w/tmpdir/Makefile
 @@ -1,6 +1,6 @@
  MOD_HEADERS  := tmpdir.h
  MOD_SOURCES  := tmpdir.cpp
diff --git a/pkgs/geospatial/mapsoft/2.nix b/pkgs/geospatial/mapsoft/2.nix
index 7ab7907f1c0d0acce87ace9323f227035bfc221f..458161403442fec51966ad05cfeaf689aa60493f 100644
--- a/pkgs/geospatial/mapsoft/2.nix
+++ b/pkgs/geospatial/mapsoft/2.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , substituteAll
 , db
 , fig2dev
@@ -36,11 +37,39 @@     hash = "sha256-++v9rlBmH/65XwI7uz6Vdk8NAPOq5jwwqiKpzxD76A8=";
     fetchSubmodules = true;
   };
 
-  patches = (substituteAll {
-    src = ./0002-fix-build.patch;
-    db = db.dev;
-    giflib = giflib;
-  });
+  patches = [
+    (substituteAll {
+      src = ./0002-fix-build.patch;
+      db = db.dev;
+      inherit giflib;
+    })
+    # conv_geo: update test for libproj-9.2.0
+    (fetchpatch {
+      url = "https://github.com/slazav/mapsoft2-libs/commit/9300f93e171769bbf8710d9dfa5f2724b7b6142d.patch";
+      hash = "sha256-2rzjCwJ+BKJB7YFfZFprPjLn/MZO7sSoHcDKNTjhbT8=";
+    })
+    # filename: fix for macOS build
+    (fetchpatch {
+      url = "https://github.com/slazav/mapsoft2-libs/commit/0cda5141d29dd1a8f0e0a1f38211faac2fc7b297.patch";
+      hash = "sha256-ESnPAWKv4qtWHuqRt4XABret85BUMuAkcahEQPdkGfI=";
+    })
+    # tmpdir: include unistd.h for macOS build
+    (fetchpatch {
+      url = "https://github.com/slazav/mapsoft2-libs/commit/7805967a44498c430daa577615878218d14ae4a7.patch";
+      hash = "sha256-P8JRMhRkaRZZHxojhpfJTJ6vCC6TfXnOdB2KHzZy3eE=";
+    })
+    # geom: attempt to fix MacOS build
+    (fetchpatch {
+      url = "https://github.com/slazav/mapsoft2-libs/commit/256e16816e13e0f88a7442ef4e4e9a5533d5481b.patch";
+      hash = "sha256-gJrv3aTNe/lwuZ4mzcdEJzGWPFKEYPqIqKNKEKddNJ4=";
+    })
+    # iconv: try to fix MacOS build
+    (fetchpatch {
+      url = "https://github.com/slazav/mapsoft2-libs/commit/0f399a86dac9ff1a2d57a107264d749179bb2d05.patch";
+      hash = "sha256-lzYBBbCgTuWm1g2gGrbyn6PisHk/yBSIXOmknwTHosU=";
+    })
+  ];
+  patchFlags = [ "-p1" "-d modules" ];
 
   postPatch = ''
     substituteInPlace modules/get_deps \
@@ -54,16 +83,6 @@     substituteInPlace vmap_data/scripts/vmaps_out --replace "vmaps.sh" "$out/bin/vmaps.sh"
     substituteInPlace vmap_data/scripts/vmaps_get_fig --replace "vmaps.sh" "$out/bin/vmaps.sh"
     substituteInPlace vmap_data/scripts/vmaps_in --replace "vmaps.sh" "$out/bin/vmaps.sh"
     substituteInPlace vmap_data/scripts/vmaps.sh --replace "/usr" "$out"
-
-    # https://github.com/slazav/mapsoft2-libs/commit/9300f93e171769bbf8710d9dfa5f2724b7b6142d
-    substituteInPlace modules/geo_data/conv_geo.test.cpp \
-      --replace "PROJ_AT_LEAST_VERSION(9, 2, 1)" "PROJ_AT_LEAST_VERSION(9, 2, 0)"
-  '' + lib.optionalString stdenv.isDarwin ''
-    # https://github.com/slazav/mapsoft2/issues/65
-    substituteInPlace modules/geom/Makefile --replace "point " "" --replace "rect " ""
-    substituteInPlace modules/iconv/Makefile --replace "SIMPLE_TESTS" "#SIMPLE_TESTS"
-    substituteInPlace modules/filename/filename.cpp --replace "st_mtim" "st_mtimespec"
-    sed -i '1i #include <unistd.h>' modules/tmpdir/tmpdir.cpp
   '';
 
   nativeBuildInputs = [
