summary refs log tree commit diff
path: root/pkgs/tools/package-management/apk-tools/default.nix
blob: b39c74dd57ceabf081e5b43a99628458610a6e6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ lib, stdenv, fetchFromGitLab, pkg-config, scdoc, openssl, zlib
, luaSupport ? stdenv.hostPlatform == stdenv.buildPlatform, lua
}:

stdenv.mkDerivation rec {
  pname = "apk-tools";
  version = "2.12.6";

  src = fetchFromGitLab {
    domain = "gitlab.alpinelinux.org";
    owner = "alpine";
    repo = "apk-tools";
    rev = "v${version}";
    sha256 = "0ki306k2ilwwg8ia302i62qa00f31g9g5q56xfbanyl7b620wd1f";
  };

  nativeBuildInputs = [ pkg-config scdoc ]
    ++ lib.optionals luaSupport [ lua lua.pkgs.lua-zlib ];
  buildInputs = [ openssl zlib ] ++ lib.optional luaSupport lua;
  strictDeps = true;

  makeFlags = [
    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
    "SBINDIR=$(out)/bin"
    "LIBDIR=$(out)/lib"
    "LUA=${if luaSupport then "lua" else "no"}"
    "LUA_LIBDIR=$(out)/lib/lua/${lib.versions.majorMinor lua.version}"
    "MANDIR=$(out)/share/man"
    "DOCDIR=$(out)/share/doc/apk"
    "INCLUDEDIR=$(out)/include"
    "PKGCONFIGDIR=$(out)/lib/pkgconfig"
  ];

  NIX_CFLAGS_COMPILE = [ "-Wno-error=unused-result" ];

  enableParallelBuilding = true;

  meta = with lib; {
    homepage = "https://gitlab.alpinelinux.org/alpine/apk-tools";
    description = "Alpine Package Keeper";
    maintainers = with maintainers; [ qyliss ];
    license = licenses.gpl2Only;
    platforms = platforms.unix;
    broken = stdenv.isDarwin;
  };
}