nixpkgs-suyu/pkgs/development/tools/abuild/default.nix

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

89 lines
1.9 KiB
Nix
Raw Normal View History

2021-08-29 11:20:13 +02:00
{ lib
, stdenv
, fetchFromGitLab
2022-03-08 03:53:33 +01:00
, makeWrapper
2021-08-29 11:20:13 +02:00
, pkg-config
2022-03-08 03:53:33 +01:00
, file
, scdoc
2021-08-29 11:20:13 +02:00
, openssl
, zlib
, busybox
2022-03-08 03:53:33 +01:00
, apk-tools
, perl
2021-08-29 11:20:13 +02:00
}:
stdenv.mkDerivation rec {
pname = "abuild";
2022-12-02 06:27:15 +01:00
version = "3.10.0";
2021-08-29 11:20:13 +02:00
src = fetchFromGitLab {
domain = "gitlab.alpinelinux.org";
owner = "alpine";
repo = pname;
2022-03-08 03:53:33 +01:00
rev = version;
2022-12-02 06:27:15 +01:00
sha256 = "sha256-pCimOI3pxlpd+yqKIRq6frbaX0s9bjZZf/eaDA4fd2M=";
2021-08-29 11:20:13 +02:00
};
buildInputs = [
openssl
zlib
busybox
2022-03-08 03:53:33 +01:00
# for $out/bin/apkbuild-cpan and $out/bin/apkbuild-pypi
(perl.withPackages (ps: with ps; [
LWP
JSON
ModuleBuildTiny
LWPProtocolHttps
IPCSystemSimple
]))
2021-08-29 11:20:13 +02:00
];
nativeBuildInputs = [
pkg-config
2022-03-08 03:53:33 +01:00
scdoc
makeWrapper
file
2021-08-29 11:20:13 +02:00
];
patchPhase = ''
substituteInPlace ./Makefile \
--replace 'chmod 4555' '#chmod 4555'
'';
makeFlags = [
"prefix=${placeholder "out"}"
"CFLAGS=-Wno-error"
];
installFlags = [
"sysconfdir=${placeholder "out"}/etc"
];
2022-03-08 03:53:33 +01:00
postInstall = ''
# this script requires unpackaged 'augeas' rubygem, no reason
# to ship it if we can't provide the dependencies for it
rm -f ${placeholder "out"}/bin/apkbuild-gem-resolver
# Find all executables that are not compiled binaries and wrap
# them, make `apk-tools` available in their PATH and also the
# $out directory since many of the binaries provided call into
# other binaries
for prog in \
$(find ${placeholder "out"}/bin -type f -exec ${file}/bin/file -i '{}' + \
| grep -v x-executable | cut -d : -f1); do
wrapProgram $prog \
--prefix PATH : "${lib.makeBinPath [ apk-tools ]}" \
--prefix PATH : "${placeholder "out"}/bin"
done
'';
2021-08-29 11:20:13 +02:00
meta = with lib; {
description = "Alpine Linux build tools";
homepage = "https://gitlab.alpinelinux.org/alpine/abuild";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ onny ];
platforms = platforms.unix;
};
}