commit efb847ca8dcb62496df577495c729b73b35d1d3b
parent 19ff6f87eda8f6ad1ad3abcca7851d08c268beb6
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Sun, 13 Aug 2023 21:41:34 +0400
mapsoft2: add patches
Diffstat:
2 files changed, 43 insertions(+), 25 deletions(-)
diff --git 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 @@ index 6a40e95..682c932 100644
-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 @@ index cb154c9..24d8898 100644
-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
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
+, fetchpatch
, substituteAll
, db
, fig2dev
@@ -36,11 +37,39 @@ stdenv.mkDerivation (finalAttrs: {
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 @@ stdenv.mkDerivation (finalAttrs: {
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 = [