mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-20 11:11:43 -04: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" ```
45 lines
1.4 KiB
Nix
45 lines
1.4 KiB
Nix
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, boost, lapack
|
|
, Accelerate, CoreGraphics, CoreVideo
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "1.6.2";
|
|
pname = "vmmlib";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "VMML";
|
|
repo = "vmmlib";
|
|
rev = "release-${version}";
|
|
sha256 = "0sn6jl1r5k6ka0vkjsdnn14hb95dqq8158dapby6jk72wqj9kdml";
|
|
};
|
|
|
|
patches = [
|
|
./disable-cpack.patch #disable the need of cpack/rpm
|
|
];
|
|
|
|
nativeBuildInputs = [ pkg-config cmake ];
|
|
buildInputs = [ boost lapack ]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ Accelerate CoreGraphics CoreVideo ];
|
|
|
|
doCheck = !stdenv.hostPlatform.isDarwin;
|
|
|
|
checkTarget = "test";
|
|
|
|
meta = with lib; {
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
description = "Vector and matrix math library implemented using C++ templates";
|
|
|
|
longDescription = ''vmmlib is a vector and matrix math library implemented
|
|
using C++ templates. Its basic functionality includes a vector
|
|
and a matrix class, with additional functionality for the
|
|
often-used 3d and 4d vectors and 3x3 and 4x4 matrices.
|
|
More advanced functionality include solvers, frustum
|
|
computations and frustum culling classes, and spatial data structures'';
|
|
|
|
license = licenses.bsd2;
|
|
homepage = "https://github.com/VMML/vmmlib/";
|
|
maintainers = [ maintainers.adev ];
|
|
platforms = platforms.all;
|
|
};
|
|
}
|