Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

valhalla: 3.4.0 -> 3.5.1 #375449

Merged
merged 2 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions pkgs/by-name/li/libspatialite/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
sqlite,
libiconv,
zlib,
testers,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "libspatialite";
version = "5.1.0";

Expand All @@ -25,7 +26,7 @@ stdenv.mkDerivation rec {
];

src = fetchurl {
url = "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-${version}.tar.gz";
url = "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-${finalAttrs.version}.tar.gz";
hash = "sha256-Q74t00na/+AW3RQAxdEShYKMIv6jXKUQnyHz7VBgUIA=";
};

Expand All @@ -36,6 +37,11 @@ stdenv.mkDerivation rec {
./xmlNanoHTTPCleanup.patch
];

postPatch = lib.optionalString (!stdenv.hostPlatform.isStatic) ''
substituteInPlace spatialite.pc.in \
--replace-fail "@LIBS@ @LIBXML2_LIBS@ @SQLITE3_LIBS@ -lm" ""
'';

nativeBuildInputs = [
pkg-config
validatePkgConfig
Expand Down Expand Up @@ -73,16 +79,21 @@ stdenv.mkDerivation rec {
export DYLD_LIBRARY_PATH=$(pwd)/src/.libs
'';

meta = with lib; {
passthru.tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};

meta = {
description = "Extensible spatial index library in C++";
homepage = "https://www.gaia-gis.it/fossil/libspatialite";
# They allow any of these
license = with licenses; [
license = with lib.licenses; [
gpl2Plus
lgpl21Plus
mpl11
];
platforms = platforms.unix;
maintainers = with maintainers; teams.geospatial.members ++ [ dotlambda ];
pkgConfigModules = [ "spatialite" ];
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; lib.teams.geospatial.members ++ [ dotlambda ];
};
}
})
59 changes: 23 additions & 36 deletions pkgs/development/libraries/valhalla/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
pkg-config,
boost,
curl,
cxxopts,
gdal,
geos,
libspatialite,
luajit,
lz4,
prime-server,
protobuf,
python3,
rapidjson,
sqlite,
zeromq,
zlib,
Expand All @@ -21,35 +24,21 @@

stdenv.mkDerivation (finalAttrs: {
pname = "valhalla";
version = "3.4.0";
version = "3.5.1";

src = fetchFromGitHub {
owner = "valhalla";
repo = "valhalla";
rev = finalAttrs.version;
hash = "sha256-1X9vsWsgnzmXn7bCMhN2PNwtfV0RRdzRFZIrQN2PLfA=";
tag = finalAttrs.version;
hash = "sha256-v/EwoJA1j8PuF9jOsmxQL6i+MT0rXbyLUE4HvBHUWDo=";
fetchSubmodules = true;
};

patches = [
# Fix build
(fetchpatch {
url = "https://github.com/valhalla/valhalla/commit/e4845b68e8ef8de9eabb359b23bf34c879e21f2b.patch";
hash = "sha256-xCufmXHGj1JxaMwm64JT9FPY+o0+x4glfJSYLdvHI8U=";
})

# Fix gcc-13 build:
# https://github.com/valhalla/valhalla/pull/4154
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/valhalla/valhalla/commit/ed93f30272377cc6803533a1bb94fe81d14af81c.patch";
hash = "sha256-w4pnOqk/Jj3unVuesE64QSecrUIVSqwK69t9xNVc4GA=";
})
];

postPatch = ''
substituteInPlace src/bindings/python/CMakeLists.txt \
--replace "\''${Python_SITEARCH}" "${placeholder "out"}/${python3.sitePackages}"
--replace-fail "\''${Python_SITEARCH}" "${placeholder "out"}/${python3.sitePackages}"
substituteInPlace CMakeLists.txt \
--replace-fail "rapidjson_include_dir rapidjson" "rapidjson_include_dir RapidJSON"
'';

nativeBuildInputs = [
Expand All @@ -58,35 +47,33 @@ stdenv.mkDerivation (finalAttrs: {
];

cmakeFlags = [
"-DENABLE_TESTS=OFF"
"-DENABLE_BENCHMARKS=OFF"
];

env.NIX_CFLAGS_COMPILE = toString [
# Needed for date submodule with GCC 12 https://github.com/HowardHinnant/date/issues/750
"-Wno-error=stringop-overflow"
(lib.cmakeBool "BUILD_SHARED_LIBS" true)
(lib.cmakeBool "ENABLE_TESTS" false)
(lib.cmakeBool "ENABLE_SINGLE_FILES_WERROR" false)
(lib.cmakeBool "PREFER_EXTERNAL_DEPS" true)
];

buildInputs = [
boost
cxxopts
lz4
(python3.withPackages (ps: [ ps.pybind11 ]))
rapidjson
zeromq
];

propagatedBuildInputs = [
curl
gdal
geos
libspatialite
luajit
prime-server
protobuf
python3
sqlite
zeromq
zlib
];

postFixup = ''
substituteInPlace "$out"/lib/pkgconfig/libvalhalla.pc \
--replace '=''${prefix}//' '=/' \
--replace '=''${exec_prefix}//' '=/'
'';

passthru.tests = {
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
Expand Down