nixpkgs/pkgs/applications/science/misc/graphia/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

58 lines
1.3 KiB
Nix

{ stdenv
, lib
, cmake
, git
, fetchFromGitHub
, fetchpatch
, wrapQtAppsHook
, qtbase
, qtdeclarative
, qtsvg
, qtwebengine
}:
stdenv.mkDerivation rec {
pname = "graphia";
version = "4.2";
src = fetchFromGitHub {
owner = "graphia-app";
repo = "graphia";
rev = version;
sha256 = "sha256-8+tlQbTr6BGx+/gjviuNrQQWcxC/j6dJ+PxwB4fYmqQ=";
};
patches = [
# Fix gcc-13 build:
(fetchpatch {
name = "gcc-13.patch";
url = "https://github.com/graphia-app/graphia/commit/78fb55a4d73f96e9a182de433c7da60330bd5b5e.patch";
hash = "sha256-waI2ur3gOKMQvqB2Qnyz7oMOMConl3jLMVKKmOmTpJs=";
})
];
nativeBuildInputs = [
cmake
git # needs to define some hash as a version
wrapQtAppsHook
];
buildInputs = [
qtbase
qtdeclarative
qtsvg
qtwebengine
];
meta = with lib; {
# never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/graphia.x86_64-darwin
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) || stdenv.hostPlatform.isDarwin;
description = "Visualisation tool for the creation and analysis of graphs";
homepage = "https://graphia.app";
license = licenses.gpl3Only;
mainProgram = "Graphia";
maintainers = [ maintainers.bgamari ];
platforms = platforms.all;
};
}