mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 19:03:28 +00:00
stormlib: refactor
- finalAttrs - strictDeps - no nested with
This commit is contained in:
parent
37d8b499a0
commit
a630b7d254
@ -1,41 +1,61 @@
|
||||
{ lib, stdenv, fetchFromGitHub, cmake, bzip2, libtomcrypt, zlib, darwin }:
|
||||
{
|
||||
lib,
|
||||
bzip2,
|
||||
cmake,
|
||||
darwin,
|
||||
fetchFromGitHub,
|
||||
libtomcrypt,
|
||||
stdenv,
|
||||
zlib,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "stormlib";
|
||||
version = "9.22";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ladislav-zezula";
|
||||
repo = "StormLib";
|
||||
rev = "v${version}";
|
||||
sha256 = "1rcdl6ryrr8fss5z5qlpl4prrw8xpbcdgajg2hpp0i7fpk21ymcc";
|
||||
rev = "v${finalAttrs.version}";
|
||||
hash = "sha256-jFUfxLzuRHAvFE+q19i6HfGcL6GX4vKL1g7l7LOhjeU=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace "FRAMEWORK DESTINATION /Library/Frameworks" "FRAMEWORK DESTINATION Library/Frameworks"
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
"-DWITH_LIBTOMCRYPT=ON"
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ bzip2 libtomcrypt zlib ] ++
|
||||
lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Carbon ];
|
||||
buildInputs = [
|
||||
bzip2
|
||||
libtomcrypt
|
||||
zlib
|
||||
]
|
||||
++ lib.optionals stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Carbon
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
|
||||
(lib.cmakeBool "WITH_LIBTOMCRYPT" true)
|
||||
];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [
|
||||
"-Wno-implicit-function-declaration"
|
||||
"-Wno-int-conversion"
|
||||
]);
|
||||
|
||||
meta = with lib; {
|
||||
postPatch = ''
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace "FRAMEWORK DESTINATION /Library/Frameworks" "FRAMEWORK DESTINATION Library/Frameworks"
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/ladislav-zezula/StormLib";
|
||||
license = licenses.mit;
|
||||
description = "An open-source project that can work with Blizzard MPQ archives";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "storm_test";
|
||||
platforms = platforms.all;
|
||||
maintainers = with maintainers; [ aanderse karolchmist ];
|
||||
maintainers = with lib.maintainers; [ aanderse karolchmist ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user