nixpkgs/pkgs/tools/package-management/apk-tools/default.nix
Artturin f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00

49 lines
1.3 KiB
Nix

{ lib, stdenv, fetchFromGitLab, pkg-config, scdoc, openssl, zlib
, luaSupport ? stdenv.hostPlatform == stdenv.buildPlatform, lua
}:
stdenv.mkDerivation rec {
pname = "apk-tools";
version = "2.12.11";
src = fetchFromGitLab {
domain = "gitlab.alpinelinux.org";
owner = "alpine";
repo = "apk-tools";
rev = "v${version}";
sha256 = "sha256-vhEjzCuMvMZmzkCQK25JG3tT33KnX2fJbqdaTaeuhgo=";
};
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"
];
env.NIX_CFLAGS_COMPILE = toString [
"-Wno-error=unused-result"
"-Wno-error=deprecated-declarations"
];
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.linux;
};
}