2024-01-02 11:29:13 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }:
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libpostal";
|
2021-03-15 08:37:03 +00:00
|
|
|
version = "1.1";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openvenues";
|
|
|
|
repo = "libpostal";
|
|
|
|
rev = "v${version}";
|
2021-03-15 08:37:03 +00:00
|
|
|
sha256 = "sha256-gQTD2LQibaB2TK0SbzoILAljAGExURvDcF3C/TfDXqk=";
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
# Fix darwin compilation with XCode 12 https://github.com/openvenues/libpostal/issues/511
|
|
|
|
(fetchpatch {
|
|
|
|
name = "Fix-C-compilation-macOS.patch";
|
|
|
|
url = "https://github.com/openvenues/libpostal/commit/9fcf066e38121b5c1439fc6bdc9a7e02234c8622.patch";
|
|
|
|
hash = "sha256-VpboGK+5sc1XrxMB051KWc8vP7Eu2g7zmTirzSaerns=";
|
|
|
|
})
|
|
|
|
# https://github.com/openvenues/libpostal/commit/bfdb6b8f87cc1cae9ba47870ff23deae0bb8ba51.patch
|
|
|
|
# with extra hunk removed so it applies
|
|
|
|
./0001-test-adding-header-to-fix-warning.patch
|
|
|
|
];
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--disable-data-download"
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "--disable-sse2" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A C library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data";
|
|
|
|
homepage = "https://github.com/openvenues/libpostal";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.Thra11 ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "libpostal_data";
|
2022-04-27 09:35:20 +00:00
|
|
|
platforms = platforms.unix;
|
2021-03-09 03:18:52 +00:00
|
|
|
};
|
|
|
|
}
|