nixpkgs/pkgs/by-name/da/darling-dmg/package.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

38 lines
995 B
Nix

{ lib, stdenv, fetchFromGitHub, cmake, fuse, zlib, bzip2, openssl, libxml2, icu, lzfse, libiconv
, nixosTests
}:
stdenv.mkDerivation {
pname = "darling-dmg";
version = "1.0.4-unstable-2023-07-26";
src = fetchFromGitHub {
owner = "darlinghq";
repo = "darling-dmg";
rev = "a36bf0c07b16675b446377890c5f6f74563f84dd";
hash = "sha256-QM75GuFHl2gRlRw1BmTexUE1d9YNnhG0qmTqmE9kMX4=";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ fuse openssl zlib bzip2 libxml2 icu lzfse ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
CXXFLAGS = [
"-DCOMPILE_WITH_LZFSE=1"
"-llzfse"
];
passthru.tests = {
inherit (nixosTests) darling-dmg;
};
meta = with lib; {
homepage = "https://www.darlinghq.org/";
description = "FUSE module for .dmg files (containing an HFS+ filesystem)";
mainProgram = "darling-dmg";
platforms = platforms.unix;
license = licenses.gpl3Only;
maintainers = with maintainers; [ Luflosi ];
};
}