nixpkgs/pkgs/by-name/st/stormlib/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

62 lines
1.3 KiB
Nix
Raw Normal View History

{
lib,
bzip2,
cmake,
darwin,
fetchFromGitHub,
libtomcrypt,
stdenv,
zlib,
}:
2021-11-04 02:01:03 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "stormlib";
2024-04-20 02:01:53 +00:00
version = "9.23";
2021-11-04 02:01:03 +00:00
src = fetchFromGitHub {
owner = "ladislav-zezula";
repo = "StormLib";
rev = "v${finalAttrs.version}";
2024-04-20 02:01:53 +00:00
hash = "sha256-8JDMqZ5BWslH4+Mfo5lnWTmD2QDaColwBOLzcuGZciY=";
2021-11-04 02:01:03 +00:00
};
nativeBuildInputs = [
cmake
];
buildInputs = [
bzip2
libtomcrypt
zlib
]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Carbon
];
2021-11-04 02:01:03 +00:00
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
(lib.cmakeBool "WITH_LIBTOMCRYPT" true)
2021-11-04 02:01:03 +00:00
];
strictDeps = true;
2021-11-04 02:01:03 +00:00
2024-01-21 18:22:58 +00:00
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [
"-Wno-implicit-function-declaration"
"-Wno-int-conversion"
]);
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "FRAMEWORK DESTINATION /Library/Frameworks" "FRAMEWORK DESTINATION Library/Frameworks"
'';
meta = {
2021-11-04 02:01:03 +00:00
homepage = "https://github.com/ladislav-zezula/StormLib";
description = "An open-source project that can work with Blizzard MPQ archives";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ aanderse karolchmist ];
platforms = lib.platforms.all;
2024-04-23 02:12:08 +00:00
broken = stdenv.isDarwin; # installation directory mismatch
2021-11-04 02:01:03 +00:00
};
})