about summary refs log tree commit diff
path: root/pkgs/by-name
diff options
context:
space:
mode:
author7c6f434c <7c6f434c@mail.ru>2023-12-10 00:31:35 +0000
committerGitHub <noreply@github.com>2023-12-10 00:31:35 +0000
commit7ce1741192eb1095b479c8d0b6f198ccfd5f151f (patch)
tree088b66a2ee68c2ca0f7bb383a6f7e0199774d7fb /pkgs/by-name
parent852e0ea0e8e1bd174bf1af9706f6b855319a5f1d (diff)
parent1fda2b028bd4adb03ad41e20443cb66bc09b9b85 (diff)
downloadnixlib-7ce1741192eb1095b479c8d0b6f198ccfd5f151f.tar
nixlib-7ce1741192eb1095b479c8d0b6f198ccfd5f151f.tar.gz
nixlib-7ce1741192eb1095b479c8d0b6f198ccfd5f151f.tar.bz2
nixlib-7ce1741192eb1095b479c8d0b6f198ccfd5f151f.tar.lz
nixlib-7ce1741192eb1095b479c8d0b6f198ccfd5f151f.tar.xz
nixlib-7ce1741192eb1095b479c8d0b6f198ccfd5f151f.tar.zst
nixlib-7ce1741192eb1095b479c8d0b6f198ccfd5f151f.zip
Merge pull request #273167 from wegank/gosmore-refactor
gosmore: refactor
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/go/gosmore/package.nix38
-rw-r--r--pkgs/by-name/go/gosmore/pointer_int_comparison.patch11
2 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/by-name/go/gosmore/package.nix b/pkgs/by-name/go/gosmore/package.nix
new file mode 100644
index 000000000000..2bc778ff9cb2
--- /dev/null
+++ b/pkgs/by-name/go/gosmore/package.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, libxml2, gtk2, curl, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "gosmore";
+  version = "unstable-2014-03-17";
+
+  src = fetchFromGitHub {
+    owner = "openstreetmap";
+    repo = "svn-archive";
+    rev = "89b1fbfbc9e9a8b5e78795fd40bdfa60550322fc";
+    sparseCheckout = [ "applications/rendering/gosmore" ];
+    hash = "sha256-MfuJVsyGWspGNAFD6Ktbbyawb4bPwUITe7WkyFs6JxI=";
+  };
+
+  sourceRoot = "${src.name}/applications/rendering/gosmore";
+
+  buildInputs = [ libxml2 gtk2 curl ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  prePatch = ''
+    sed -e '/curl.types.h/d' -i *.{c,h,hpp,cpp}
+    sed -e "24i #include <ctime>" -e "s/data/dat/g" -i jni/libgosm.cpp
+  '';
+
+  patches = [ ./pointer_int_comparison.patch ];
+  patchFlags = [ "-p1" "--binary" ]; # patch has dos style eol
+
+  meta = with lib; {
+    description = "Open Street Map viewer";
+    homepage = "https://sourceforge.net/projects/gosmore/";
+    maintainers = with maintainers; [
+      raskin
+    ];
+    platforms = platforms.linux;
+    license = licenses.bsd2;
+  };
+}
diff --git a/pkgs/by-name/go/gosmore/pointer_int_comparison.patch b/pkgs/by-name/go/gosmore/pointer_int_comparison.patch
new file mode 100644
index 000000000000..4a715b6d8591
--- /dev/null
+++ b/pkgs/by-name/go/gosmore/pointer_int_comparison.patch
@@ -0,0 +1,11 @@
+--- blah_/jni/gosmore.cpp	1970-01-01 01:00:01.000000000 +0100

++++ /dev/stdin	2018-03-18 00:21:08.474217132 +0100

+@@ -1273,7 +1273,7 @@

+       if (deg[i] < -180 || deg[i] > 180) break;

+       if (i == 0 && (strncasecmp (t, "lat", 3) == 0 ||

+                      strncasecmp (t, "lon", 3) == 0)) { // lat=-25.7 lon=28.2

+-        for (t += 3; t != '\0' && !isalnum (*t); t++) {}

++        for (t += 3; *t != '\0' && !isalnum (*t); t++) {}

+       }

+       if (i == 1) { // Success !

+         //printf ("%lf %lf %u\n", deg[lonFirst ? 1 : 0], deg[lonFirst ? 0 : 1],