~mro/geohash

65a27b2f945e3bf690474784ff987be7fa77d451 — Marcus Rohrmoser 1 year, 7 months ago 73f0fda 0.1
release prep
A Change.txt => Change.txt +13 -0
@@ 0,0 1,13 @@

v0.1 2023-05-05 'Couscous'
--------------------------

* compute Geohash[1] character hash from wgs84[2] lat/lon
* compute wgs84 lat/lon/delta_lat/delta_lon from geohash character hash
* a RFC3875 CGI producing GPX[3]
* have a DOAP[4] rdf self-description

[1] https://en.wikipedia.org/wiki/Geohash
[2] https://en.wikipedia.org/wiki/WGS84
[3] http://www.topografix.com/gpx.asp
[4] https://en.wikipedia.org/wiki/DOAP

A Changelog.txt => Changelog.txt +0 -0
M bin/dune => bin/dune +22 -9
@@ 1,15 1,28 @@
;; https://discuss.ocaml.org/t/dune-how-to-link-statically-on-linux-not-on-others/8537/4?u=mro
(rule (with-stdout-to link_flags.sexp (run sh %{dep:gen_link_flags.sh})))
(rule (with-stdout-to version.ml (run echo "let git_sha = \""`git rev-parse --short HEAD`"\"")))

(rule
 (with-stdout-to
  link_flags.sexp
  (run sh %{dep:gen_link_flags.sh})))

(rule
 (with-stdout-to
  version.ml
  (run echo "let dune_project_num = \"%{version:geohash}\"")))

(rule
 (target res.ml)
 (deps (source_tree ../res))
 (action (with-stdout-to %{target}
  (run ocaml-crunch --mode=plain ../res))))
 (deps
  (source_tree ../res))
 (action
  (with-stdout-to
   %{target}
   (run ocaml-crunch --mode=plain ../res))))

; https://stackoverflow.com/a/53325230/349514

(executable
  (name main)
  (libraries lib geohash tyre)
  (link_flags (:include link_flags.sexp))
)
 (name main)
 (libraries lib geohash tyre)
 (link_flags
  (:include link_flags.sexp)))

M bin/shell.ml => bin/shell.ml +6 -2
@@ 2,7 2,7 @@
 * shell.ml
 *
 * Created by Marcus Rohrmoser on 16.05.20.
 * Copyright © 2020-2021 Marcus Rohrmoser mobile Software http://mro.name/~me. All rights reserved.
 * Copyright © The geohash developers. All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by


@@ 28,8 28,12 @@ let err i msgs =
let to_hash h = Ok [ h; "not implemented yet." ]

let print_version oc =
  (* not via dune-build-info dependency https://dune.readthedocs.io/en/stable/dune-libs.html#dune-build-info-library
   * but rather via a dune variable https://dune.readthedocs.io/en/stable/concepts.html#variables
   * written to Version.ml by a bin/dune stanza. *)
  let v = Version.dune_project_num in 
  let exe = Filename.basename Sys.executable_name in
  Printf.fprintf oc "%s: https://mro.name/%s/v%s\n" exe "geohash" Version.git_sha;
  Printf.fprintf oc "%s: https://mro.name/%s/v%s\n" exe "geohash" v;
  0

let print_help oc =

M doc/dune => doc/dune +2 -1
@@ 1,1 1,2 @@
(documentation (package geohash_bin))
(documentation
 (package geohash_bin))

M dune-project => dune-project +8 -8
@@ 1,12 1,15 @@
(lang dune 2.8)
(lang dune 3.0)
; https://dune.readthedocs.io/en/latest/opam.html#generating-opam-files

(name geohash)
(version 0.1)

(subst disabled)
(implicit_transitive_deps true)
(generate_opam_files true)
(formatting (enabled_for dune))

(license GPL-3.0-or-later)
(license GPL-3.0-only)
(maintainers "Marcus Rohrmoser <work@mro.name>")
(authors "The GeoHash# programmers")



@@ 19,11 22,10 @@
 (synopsis "#🌐 geohash converter 🐫 library")
 (description "Convert WGS84 lat/lon pairs to [Gustavo Niemeyer](http://niemeyer.net/)s
[Geohash](http://en.wikipedia.org/wiki/Geohash) and back.")
 (tags (Social Web GeoHash CGI RFC3875))
 (tags (Social Web Geohash CGI RFC3875))
 (depends
   (optint (>= 0.3))
   (tyre (>= 0.5))
  (odoc :with-doc)
  (ocaml (>= 4.05))
))



@@ 33,7 35,5 @@
 (description "Convert WGS84 lat/lon pairs to [Gustavo Niemeyer](http://niemeyer.net/)s
[Geohash](http://en.wikipedia.org/wiki/Geohash) and back. Web and commandline, 🐪,
statically linked, single-file, zero-config.")
 (tags (Social Web GeoHash CGI RFC3875))
 (depends
   crunch
))
 (tags (Social Web Geohash CGI RFC3875))
 (depends crunch))

M geohash.opam => geohash.opam +5 -5
@@ 1,24 1,24 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1"
synopsis: "#🌐 geohash converter 🐫 library"
description: """
Convert WGS84 lat/lon pairs to [Gustavo Niemeyer](http://niemeyer.net/)s
[Geohash](http://en.wikipedia.org/wiki/Geohash) and back."""
maintainer: ["Marcus Rohrmoser <work@mro.name>"]
authors: ["The GeoHash# programmers"]
license: "GPL-3.0-or-later"
tags: ["Social" "Web" "GeoHash" "CGI" "RFC3875"]
license: "GPL-3.0-only"
tags: ["Social" "Web" "Geohash" "CGI" "RFC3875"]
homepage: "https://demo.mro.name/geohash.cgi"
bug-reports: "https://codeberg.org/mro/geohash/issues"
depends: [
  "dune" {>= "2.8"}
  "dune" {>= "3.0"}
  "optint" {>= "0.3"}
  "tyre" {>= "0.5"}
  "odoc" {with-doc}
  "ocaml" {>= "4.05"}
  "odoc" {with-doc}
]
build: [
  ["dune" "subst"] {dev}
  [
    "dune"
    "build"

M geohash_bin.opam => geohash_bin.opam +4 -4
@@ 1,5 1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1"
synopsis:
  "#🌐 geohash converter 🐫. Commandline and CGI. Zero-config, single-file"
description: """


@@ 8,17 9,16 @@ Convert WGS84 lat/lon pairs to [Gustavo Niemeyer](http://niemeyer.net/)s
statically linked, single-file, zero-config."""
maintainer: ["Marcus Rohrmoser <work@mro.name>"]
authors: ["The GeoHash# programmers"]
license: "GPL-3.0-or-later"
tags: ["Social" "Web" "GeoHash" "CGI" "RFC3875"]
license: "GPL-3.0-only"
tags: ["Social" "Web" "Geohash" "CGI" "RFC3875"]
homepage: "https://demo.mro.name/geohash.cgi"
bug-reports: "https://codeberg.org/mro/geohash/issues"
depends: [
  "dune" {>= "2.8"}
  "dune" {>= "3.0"}
  "crunch"
  "odoc" {with-doc}
]
build: [
  ["dune" "subst"] {dev}
  [
    "dune"
    "build"

M lib/dune => lib/dune +3 -4
@@ 1,5 1,4 @@
(library
  (name lib)
  (public_name geohash_bin.lib)
  (libraries tyre)
)
 (name lib)
 (public_name geohash_bin.lib)
 (libraries tyre))

M public/dune => public/dune +3 -4
@@ 1,5 1,4 @@
(library
  (name geohash)
  (public_name geohash)
  (libraries optint)
)
 (name geohash)
 (public_name geohash)
 (libraries optint))

A release.txt => release.txt +15 -0
@@ 0,0 1,15 @@

Mint a release:

https://opam.ocaml.org/doc/Packaging.html#Publishing

- proof-read Change.txt
- $ cat Change.txt >> Changelog.txt && git commit
- create the git tag with the version as in dune-project:
  
  $ git tag -F Change.txt 0.1
- create, sign and publish the tarball and evtl. binaries (e.g. to git repo hoster)
- $ opam publish <tarball> .
- 🎉
- edit version number in dune-project for next release, prepare Change.txt for the
  next release

M test/dune => test/dune +2 -5
@@ 1,8 1,5 @@
; http://cumulus.github.io/Syndic/syndic/Syndic__/Syndic_atom/

(tests
 (names
   geohash_test
   cgi_test
   route_test
 )
 (names geohash_test cgi_test route_test)
 (libraries geohash lib))

M test/geohash_test.ml => test/geohash_test.ml +1 -1
@@ 150,8 150,8 @@ let () =
  (* test_spread ();
     test_interleave ();
     test_deinterleave ();
     test_base32_encode ();
  *)
  test_base32_encode ();
  test_base32_decode ();
  test_quantize ();
  test_encode_a ();