nixpkgs/pkgs/by-name/li/libspatialite/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

79 lines
1.6 KiB
Nix

{ lib
, stdenv
, fetchurl
, pkg-config
, validatePkgConfig
, freexl
, geos
, librttopo
, libxml2
, minizip
, proj
, sqlite
, libiconv
, zlib
}:
stdenv.mkDerivation rec {
pname = "libspatialite";
version = "5.1.0";
outputs = [ "out" "dev" ];
src = fetchurl {
url = "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-${version}.tar.gz";
hash = "sha256-Q74t00na/+AW3RQAxdEShYKMIv6jXKUQnyHz7VBgUIA=";
};
patches = [
# Drop use of deprecated libxml2 HTTP API.
# From: https://www.gaia-gis.it/fossil/libspatialite/info/7c452740fe
# see also: https://github.com/NixOS/nixpkgs/issues/347085
./xmlNanoHTTPCleanup.patch
];
nativeBuildInputs = [
pkg-config
validatePkgConfig
geos # for geos-config
];
buildInputs = [
freexl
geos
librttopo
libxml2
minizip
proj
sqlite
zlib
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
];
enableParallelBuilding = true;
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
ln -s $out/lib/mod_spatialite.{so,dylib}
'';
# Failed tests (linux & darwin):
# - check_virtualtable6
# - check_drop_rename
doCheck = false;
preCheck = ''
export LD_LIBRARY_PATH=$(pwd)/src/.libs
export DYLD_LIBRARY_PATH=$(pwd)/src/.libs
'';
meta = with lib; {
description = "Extensible spatial index library in C++";
homepage = "https://www.gaia-gis.it/fossil/libspatialite";
# They allow any of these
license = with licenses; [ gpl2Plus lgpl21Plus mpl11 ];
platforms = platforms.unix;
maintainers = with maintainers; teams.geospatial.members ++ [ dotlambda ];
};
}