nixpkgs/pkgs/applications/gis/spatialite-gui/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

79 lines
1.4 KiB
Nix

{ lib
, stdenv
, fetchurl
, pkg-config
, desktopToDarwinBundle
, curl
, freexl
, geos
, librasterlite2
, librttopo
, libspatialite
, libwebp
, libxlsxwriter
, libxml2
, lz4
, minizip
, openjpeg
, postgresql
, proj
, sqlite
, virtualpg
, wxGTK
, xz
, zstd
, Carbon
, Cocoa
, IOKit
}:
stdenv.mkDerivation rec {
pname = "spatialite-gui";
version = "2.1.0-beta1";
src = fetchurl {
url = "https://www.gaia-gis.it/gaia-sins/spatialite-gui-sources/spatialite_gui-${version}.tar.gz";
hash = "sha256-ukjZbfGM68P/I/aXlyB64VgszmL0WWtpuuMAyjwj2zM=";
};
nativeBuildInputs = [ pkg-config ]
++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
buildInputs = [
curl
freexl
geos
librasterlite2
librttopo
libspatialite
libwebp
libxlsxwriter
libxml2
lz4
minizip
openjpeg
postgresql
proj
sqlite
virtualpg
wxGTK
xz
zstd
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa IOKit ];
enableParallelBuilding = true;
postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
rm -fr $out/share
'';
meta = with lib; {
description = "Graphical user interface for SpatiaLite";
homepage = "https://www.gaia-gis.it/fossil/spatialite_gui";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = teams.geospatial.members;
mainProgram = "spatialite_gui";
};
}