1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 pkg-config,
6 scdoc,
7 openssl,
8 zlib,
9 luaSupport ? stdenv.hostPlatform == stdenv.buildPlatform,
10 lua,
11}:
12
13stdenv.mkDerivation rec {
14 pname = "apk-tools";
15 version = "2.14.10";
16
17 src = fetchFromGitLab {
18 domain = "gitlab.alpinelinux.org";
19 owner = "alpine";
20 repo = "apk-tools";
21 rev = "v${version}";
22 sha256 = "sha256-9TSkcJe7FVdTtfcCmwp+IWMYa/OL9OXJwPcKLyj5AAA=";
23 };
24
25 nativeBuildInputs = [
26 pkg-config
27 scdoc
28 ]
29 ++ lib.optionals luaSupport [
30 lua
31 lua.pkgs.lua-zlib
32 ];
33 buildInputs = [
34 openssl
35 zlib
36 ]
37 ++ lib.optional luaSupport lua;
38 strictDeps = true;
39
40 makeFlags = [
41 "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
42 "SBINDIR=$(out)/bin"
43 "LIBDIR=$(out)/lib"
44 "LUA=${if luaSupport then "lua" else "no"}"
45 "LUA_LIBDIR=$(out)/lib/lua/${lib.versions.majorMinor lua.version}"
46 "MANDIR=$(out)/share/man"
47 "DOCDIR=$(out)/share/doc/apk"
48 "INCLUDEDIR=$(out)/include"
49 "PKGCONFIGDIR=$(out)/lib/pkgconfig"
50 ];
51
52 env.NIX_CFLAGS_COMPILE = toString [
53 "-Wno-error=unused-result"
54 "-Wno-error=deprecated-declarations"
55 ];
56
57 enableParallelBuilding = true;
58
59 meta = with lib; {
60 homepage = "https://gitlab.alpinelinux.org/alpine/apk-tools";
61 description = "Alpine Package Keeper";
62 maintainers = with maintainers; [ ];
63 license = licenses.gpl2Only;
64 platforms = platforms.linux;
65 mainProgram = "apk";
66 };
67}