nixpkgs/pkgs/development/libraries/wxSVG/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

60 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchurl
, cairo
, expat
, ffmpeg
, libexif
, pango
, pkg-config
, wxGTK
, darwin
}:
let
inherit (darwin.apple_sdk.frameworks) Cocoa;
in
stdenv.mkDerivation rec {
pname = "wxSVG";
version = "1.5.25";
src = fetchurl {
url = "mirror://sourceforge/project/wxsvg/wxsvg/${version}/wxsvg-${version}.tar.bz2";
hash = "sha256-W/asaDG1S9Ga70jN6PoFctu2PzCu6dUyP2vms/MmU0s=";
};
postPatch = ''
# Apply upstream patch for gcc-13 support:
# https://sourceforge.net/p/wxsvg/git/ci/7b17fe365fb522618fb3520d7c5c1109b138358f/
sed -i src/cairo/SVGCanvasCairo.cpp -e '1i #include <cstdint>'
'';
nativeBuildInputs = [
pkg-config
];
buildInputs = [
cairo
expat
ffmpeg
libexif
pango
wxGTK
] ++ lib.optional stdenv.hostPlatform.isDarwin Cocoa;
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://wxsvg.sourceforge.net/";
description = "SVG manipulation library built with wxWidgets";
mainProgram = "svgview";
longDescription = ''
wxSVG is C++ library to create, manipulate and render Scalable Vector
Graphics (SVG) files with the wxWidgets toolkit.
'';
license = licenses.gpl2Plus;
maintainers = [ maintainers.AndersonTorres ];
inherit (wxGTK.meta) platforms;
};
}