php.packages.box: Build from source

This commit is contained in:
Elis Hirwing 2023-09-17 20:42:32 +02:00
parent d84cc41f8b
commit 60c81d33d7
No known key found for this signature in database
GPG key ID: D57EFA625C9A925F

View file

@ -1,35 +1,24 @@
{ mkDerivation, fetchurl, makeWrapper, lib, php }:
{ lib, php, fetchFromGitHub }:
let
php.buildComposerProject (finalAttrs: {
pname = "box";
version = "4.3.8";
in
mkDerivation {
inherit pname version;
src = fetchurl {
url = "https://github.com/box-project/box/releases/download/${version}/box.phar";
sha256 = "sha256-g9Y92yTsyXU4NWuQwyB3PRrKJxLRSBO9J77jumXPOxg=";
src = fetchFromGitHub {
owner = "box-project";
repo = "box";
rev = finalAttrs.version;
hash = "sha256-v1J84nqaX36DrLLH5kld+8NIymqtt5/5nJWJNCBVFRE=";
};
dontUnpack = true;
vendorHash = "sha256-LWggAUBMKljxa7HNdJMqOD/sx3IWCOQSqbYEnGntjN0=";
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
install -D $src $out/libexec/box/box.phar
makeWrapper ${php}/bin/php $out/bin/box \
--add-flags "-d phar.readonly=0 $out/libexec/box/box.phar"
runHook postInstall
'';
meta = with lib; {
changelog = "https://github.com/box-project/box/releases/tag/${version}";
meta = {
changelog = "https://github.com/box-project/box/releases/tag/${finalAttrs.version}";
description = "An application for building and managing Phars";
license = licenses.mit;
license = lib.licenses.mit;
homepage = "https://github.com/box-project/box";
maintainers = with maintainers; [ ] ++ teams.php.members;
maintainers = lib.teams.php.members;
mainProgram = "box";
};
}
})