mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +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" ```
65 lines
1.2 KiB
Nix
65 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, pkg-config
|
|
, libpng
|
|
, libtiff
|
|
, libjpeg
|
|
, SDL2
|
|
, gdal
|
|
, octave
|
|
, rustPlatform
|
|
, cargo
|
|
}:
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "vpv";
|
|
version = "0.8.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "kidanger";
|
|
repo = "vpv";
|
|
rev = "v${finalAttrs.version}";
|
|
sha256 = "sha256-mlBceYMfsAE7MI6J7xnkJHBJ8RInePooXH5YW9I47YM=";
|
|
};
|
|
|
|
cargoRoot = "src/fuzzy-finder";
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
src = finalAttrs.src;
|
|
sourceRoot = "${finalAttrs.src.name}/src/fuzzy-finder";
|
|
hash = "sha256-CDKlmwA2Wj78xPaSiYPmIJ7xmiE5Co+oGGejZU3v1zI=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
pkg-config
|
|
rustPlatform.cargoSetupHook
|
|
cargo
|
|
];
|
|
|
|
buildInputs = [
|
|
libpng
|
|
libtiff
|
|
libjpeg
|
|
SDL2
|
|
gdal
|
|
octave
|
|
];
|
|
|
|
cmakeFlags = [
|
|
"-DUSE_GDAL=ON"
|
|
"-DUSE_OCTAVE=ON"
|
|
"-DVPV_VERSION=v${finalAttrs.version}"
|
|
"-DBUILD_TESTING=ON"
|
|
];
|
|
|
|
meta = {
|
|
homepage = "https://github.com/kidanger/vpv";
|
|
description = "Image viewer for image processing experts";
|
|
maintainers = [ lib.maintainers.kidanger ];
|
|
license = lib.licenses.gpl3;
|
|
broken = stdenv.hostPlatform.isDarwin; # the CMake expects the SDL2::SDL2main target for darwin
|
|
mainProgram = "vpv";
|
|
};
|
|
})
|