Merge pull request #191706 from sikmir/gaia-sins

spatialite_tools: enable on darwin, fix cross-compilation
This commit is contained in:
Robert Scott 2022-09-19 15:38:27 +01:00 committed by GitHub
commit 94d8deeb8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 84 additions and 22 deletions

View file

@ -2,6 +2,7 @@
, stdenv , stdenv
, fetchurl , fetchurl
, pkg-config , pkg-config
, freexl
, geos , geos
, expat , expat
, librttopo , librttopo
@ -11,6 +12,8 @@
, proj , proj
, readosm , readosm
, sqlite , sqlite
, testers
, spatialite_tools
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -18,14 +21,15 @@ stdenv.mkDerivation rec {
version = "5.0.1"; version = "5.0.1";
src = fetchurl { src = fetchurl {
url = "https://www.gaia-gis.it/gaia-sins/spatialite-tools-sources/${pname}-${version}.tar.gz"; url = "https://www.gaia-gis.it/gaia-sins/spatialite-tools-${version}.tar.gz";
sha256 = "sha256-lgTCBeh/A3eJvFIwLGbM0TccPpjHTo7E4psHUt41Fxw="; hash = "sha256-lgTCBeh/A3eJvFIwLGbM0TccPpjHTo7E4psHUt41Fxw=";
}; };
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [ pkg-config ];
buildInputs = [ buildInputs = [
expat expat
freexl
geos geos
librttopo librttopo
libspatialite libspatialite
@ -36,17 +40,20 @@ stdenv.mkDerivation rec {
sqlite sqlite
]; ];
configureFlags = [ "--disable-freexl" ];
enableParallelBuilding = true; enableParallelBuilding = true;
NIX_LDFLAGS = "-lsqlite3"; passthru.tests.version = testers.testVersion {
package = spatialite_tools;
command = "! spatialite_tool --version";
version = "${libspatialite.version}";
};
meta = with lib; { meta = with lib; {
description = "A complete sqlite3-compatible CLI front-end for libspatialite"; description = "A complete sqlite3-compatible CLI front-end for libspatialite";
homepage = "https://www.gaia-gis.it/fossil/spatialite-tools"; homepage = "https://www.gaia-gis.it/fossil/spatialite-tools";
license = with licenses; [ mpl11 gpl2Plus lgpl21Plus ]; license = with licenses; [ mpl11 gpl2Plus lgpl21Plus ];
platforms = platforms.linux; platforms = platforms.unix;
maintainers = with maintainers; [ dotlambda ]; maintainers = with maintainers; [ dotlambda ];
mainProgram = "spatialite_tool";
}; };
} }

View file

@ -0,0 +1,28 @@
{ lib, stdenv, fetchurl, validatePkgConfig, libiconv }:
stdenv.mkDerivation rec {
pname = "freexl";
version = "1.0.6";
src = fetchurl {
url = "https://www.gaia-gis.it/gaia-sins/freexl-${version}.tar.gz";
hash = "sha256-Pei1ej0TDLKIHqUtOqnOH+7bG1e32qTrN/dRQE+Q/CI=";
};
nativeBuildInputs = [ validatePkgConfig ];
buildInputs = lib.optional stdenv.isDarwin libiconv;
enableParallelBuilding = true;
doCheck = true;
meta = with lib; {
description = "A library to extract valid data from within an Excel (.xls) spreadsheet";
homepage = "https://www.gaia-gis.it/fossil/freexl";
# They allow any of these
license = with licenses; [ gpl2Plus lgpl21Plus mpl11 ];
platforms = platforms.unix;
maintainers = with maintainers; [ sikmir ];
};
}

View file

@ -2,6 +2,7 @@
, stdenv , stdenv
, fetchFromGitea , fetchFromGitea
, autoreconfHook , autoreconfHook
, validatePkgConfig
, geos , geos
}: }:
@ -19,14 +20,21 @@ stdenv.mkDerivation rec {
sha256 = "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"; sha256 = "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p";
}; };
nativeBuildInputs = [ autoreconfHook ]; nativeBuildInputs = [
autoreconfHook
validatePkgConfig
geos # for geos-config
];
buildInputs = [ geos ]; buildInputs = [ geos ];
enableParallelBuilding = true;
meta = with lib; { meta = with lib; {
description = "RT Topology Library"; description = "RT Topology Library";
homepage = "https://git.osgeo.org/gitea/rttopo/librttopo"; homepage = "https://git.osgeo.org/gitea/rttopo/librttopo";
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
maintainers = with maintainers; [ dotlambda ]; maintainers = with maintainers; [ dotlambda ];
platforms = platforms.unix;
}; };
} }

View file

@ -2,6 +2,8 @@
, stdenv , stdenv
, fetchurl , fetchurl
, pkg-config , pkg-config
, validatePkgConfig
, freexl
, geos , geos
, librttopo , librttopo
, libxml2 , libxml2
@ -18,13 +20,18 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ]; outputs = [ "out" "dev" ];
src = fetchurl { src = fetchurl {
url = "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/${pname}-${version}.tar.gz"; url = "https://www.gaia-gis.it/gaia-sins/libspatialite-${version}.tar.gz";
sha256 = "sha256-7svJQxHHgBLQWevA+uhupe9u7LEzA+boKzdTwbNAnpg="; hash = "sha256-7svJQxHHgBLQWevA+uhupe9u7LEzA+boKzdTwbNAnpg=";
}; };
nativeBuildInputs = [ pkg-config ]; nativeBuildInputs = [
pkg-config
validatePkgConfig
geos # for geos-config
];
buildInputs = [ buildInputs = [
freexl
geos geos
librttopo librttopo
libxml2 libxml2
@ -35,14 +42,22 @@ stdenv.mkDerivation rec {
libiconv libiconv
]; ];
configureFlags = [ "--disable-freexl" ];
enableParallelBuilding = true; enableParallelBuilding = true;
postInstall = lib.optionalString stdenv.isDarwin '' postInstall = lib.optionalString stdenv.isDarwin ''
ln -s $out/lib/mod_spatialite.{so,dylib} 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; { meta = with lib; {
description = "Extensible spatial index library in C++"; description = "Extensible spatial index library in C++";
homepage = "https://www.gaia-gis.it/fossil/libspatialite"; homepage = "https://www.gaia-gis.it/fossil/libspatialite";

View file

@ -1,24 +1,26 @@
{ lib, stdenv, fetchurl, expat, zlib, geos, libspatialite }: { lib, stdenv, fetchurl, expat, zlib, validatePkgConfig }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "readosm"; pname = "readosm";
version = "1.1.0a"; version = "1.1.0a";
src = fetchurl { src = fetchurl {
url = "https://www.gaia-gis.it/gaia-sins/readosm-sources/${pname}-${version}.tar.gz"; url = "https://www.gaia-gis.it/gaia-sins/readosm-${version}.tar.gz";
sha256 = "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"; hash = "sha256-23wFHSVs7H7NTDd1q5vIINpaS/cv/U6fQLkR15dw8UU=";
}; };
buildInputs = [ expat zlib geos libspatialite ]; nativeBuildInputs = [ validatePkgConfig ];
configureFlags = [ "--disable-freexl" ]; buildInputs = [ expat zlib ];
enableParallelBuilding = true; enableParallelBuilding = true;
meta = { doCheck = true;
meta = with lib; {
description = "An open source library to extract valid data from within an Open Street Map input file"; description = "An open source library to extract valid data from within an Open Street Map input file";
homepage = "https://www.gaia-gis.it/fossil/readosm"; homepage = "https://www.gaia-gis.it/fossil/readosm";
license = with lib.licenses; [ mpl11 gpl2Plus lgpl21Plus ]; license = with licenses; [ mpl11 gpl2Plus lgpl21Plus ];
platforms = lib.platforms.linux; platforms = platforms.unix;
}; };
} }

View file

@ -18315,6 +18315,8 @@ with pkgs;
freetype = callPackage ../development/libraries/freetype { }; freetype = callPackage ../development/libraries/freetype { };
freexl = callPackage ../development/libraries/freexl { };
frei0r = callPackage ../development/libraries/frei0r { }; frei0r = callPackage ../development/libraries/frei0r { };
fribidi = callPackage ../development/libraries/fribidi { }; fribidi = callPackage ../development/libraries/fribidi { };
@ -21837,8 +21839,6 @@ with pkgs;
spaceship-prompt = callPackage ../shells/zsh/spaceship-prompt {}; spaceship-prompt = callPackage ../shells/zsh/spaceship-prompt {};
spatialite_tools = callPackage ../development/libraries/spatialite-tools { };
spdk = callPackage ../development/libraries/spdk { }; spdk = callPackage ../development/libraries/spdk { };
speechd = callPackage ../development/libraries/speechd { }; speechd = callPackage ../development/libraries/speechd { };
@ -26472,6 +26472,8 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Cocoa; inherit (darwin.apple_sdk.frameworks) Cocoa;
}; };
spatialite_tools = callPackage ../applications/gis/spatialite-tools { };
udig = callPackage ../applications/gis/udig { }; udig = callPackage ../applications/gis/udig { };
whitebox-tools = callPackage ../applications/gis/whitebox-tools { whitebox-tools = callPackage ../applications/gis/whitebox-tools {