1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 which,
6 zstd,
7 pbzip2,
8 installShellFiles,
9}:
10
11stdenv.mkDerivation rec {
12 version = "2.4.5";
13 pname = "makeself";
14
15 src = fetchFromGitHub {
16 owner = "megastep";
17 repo = "makeself";
18 rev = "release-${version}";
19 fetchSubmodules = true;
20 hash = "sha256-15lUtErGsbXF2Gn0f0rvA18mMuVMmkKrGO2poeYZU9g=";
21 };
22
23 nativeBuildInputs = [ installShellFiles ];
24
25 postPatch = "patchShebangs test";
26
27 # Issue #110149: our default /bin/sh apparently has 32-bit math only
28 # (attribute busybox-sandbox-shell), and that causes problems
29 # when running these tests inside build, based on free disk space.
30 doCheck = false;
31 checkTarget = "test";
32 nativeCheckInputs = [
33 which
34 zstd
35 pbzip2
36 ];
37
38 sharePath = "$out/share/${pname}";
39
40 installPhase = ''
41 runHook preInstall
42 installManPage makeself.1
43 install -Dm555 makeself.sh $out/bin/makeself
44 install -Dm444 -t ${sharePath}/ makeself.lsm README.md makeself-header.sh
45 runHook postInstall
46 '';
47
48 fixupPhase = ''
49 sed -e "s|^HEADER=.*|HEADER=${sharePath}/makeself-header.sh|" -i $out/bin/makeself
50 '';
51
52 meta = with lib; {
53 homepage = "https://makeself.io";
54 description = "Utility to create self-extracting packages";
55 license = licenses.gpl2;
56 maintainers = [ maintainers.wmertens ];
57 platforms = platforms.all;
58 mainProgram = "makeself";
59 };
60}