mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
e0464e4788
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" ```
78 lines
1.4 KiB
Nix
78 lines
1.4 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitLab
|
|
, appstream-glib
|
|
, dblatex
|
|
, desktop-file-utils
|
|
, graphene
|
|
, gtk3
|
|
, gtk-mac-integration-gtk3
|
|
, intltool
|
|
, libxml2
|
|
, libxslt
|
|
, meson
|
|
, ninja
|
|
, pkg-config
|
|
, poppler
|
|
, python3
|
|
, wrapGAppsHook3
|
|
# Building with docs are still failing in unstable-2023-09-28
|
|
, withDocs ? false
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "dia";
|
|
version = "unstable-2023-09-28";
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "GNOME";
|
|
repo = "dia";
|
|
domain = "gitlab.gnome.org";
|
|
rev = "bd551bb2558dcc89bc0bf7b4dd85b38cd85ad322";
|
|
hash = "sha256-U+8TUE1ULt6MNxnvw9kFjCAVBecUy2Sarof6H9+kR7Q=";
|
|
};
|
|
|
|
# Required for the PDF plugin when building with clang.
|
|
CXXFLAGS = "-std=c++17";
|
|
|
|
preConfigure = ''
|
|
patchShebangs .
|
|
'';
|
|
|
|
buildInputs = [
|
|
graphene
|
|
gtk3
|
|
libxml2
|
|
python3
|
|
poppler
|
|
] ++
|
|
lib.optionals withDocs [
|
|
libxslt
|
|
] ++
|
|
lib.optionals stdenv.hostPlatform.isDarwin [
|
|
gtk-mac-integration-gtk3
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
appstream-glib
|
|
desktop-file-utils
|
|
intltool
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
wrapGAppsHook3
|
|
] ++
|
|
lib.optionals withDocs [
|
|
dblatex
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Gnome Diagram drawing software";
|
|
mainProgram = "dia";
|
|
homepage = "http://live.gnome.org/Dia";
|
|
maintainers = with maintainers; [ raskin ];
|
|
license = licenses.gpl2;
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|