btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / st / stormlib / package.nix
blob090ada0d89f79a7d1c20af2675c8410acbdb3cc4
2   lib,
3   bzip2,
4   cmake,
5   darwin,
6   fetchFromGitHub,
7   libtomcrypt,
8   stdenv,
9   zlib,
12 stdenv.mkDerivation (finalAttrs: {
13   pname = "stormlib";
14   version = "9.23";
16   src = fetchFromGitHub {
17     owner = "ladislav-zezula";
18     repo = "StormLib";
19     rev = "v${finalAttrs.version}";
20     hash = "sha256-8JDMqZ5BWslH4+Mfo5lnWTmD2QDaColwBOLzcuGZciY=";
21   };
23   nativeBuildInputs = [
24     cmake
25   ];
27   buildInputs = [
28     bzip2
29     libtomcrypt
30     zlib
31   ]
32   ++ lib.optionals stdenv.hostPlatform.isDarwin [
33     darwin.apple_sdk.frameworks.Carbon
34   ];
36   cmakeFlags = [
37     (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
38     (lib.cmakeBool "WITH_LIBTOMCRYPT" true)
39   ];
41   strictDeps = true;
43   env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [
44     "-Wno-implicit-function-declaration"
45     "-Wno-int-conversion"
46   ]);
48   postPatch = ''
49     substituteInPlace CMakeLists.txt \
50       --replace "FRAMEWORK DESTINATION /Library/Frameworks" "FRAMEWORK DESTINATION Library/Frameworks"
51   '';
53   meta = {
54     homepage = "https://github.com/ladislav-zezula/StormLib";
55     description = "Open-source project that can work with Blizzard MPQ archives";
56     license = lib.licenses.mit;
57     maintainers = with lib.maintainers; [ aanderse karolchmist ];
58     platforms = lib.platforms.all;
59     broken = stdenv.hostPlatform.isDarwin; # installation directory mismatch
60   };