mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 12:53:05 +00:00
firefly-iii: Streamlined derivation
- Removed firefly-iii-assets package and compressed build into one
- Added PatrickDaG as maintainer in addition to myself
- Added update script
(cherry picked from commit 42b1bc89a2
)
This commit is contained in:
parent
83bb0d311c
commit
14fdb8777a
@ -1,8 +1,12 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, buildNpmPackage
|
||||
, stdenvNoCC
|
||||
, nodejs
|
||||
, fetchNpmDeps
|
||||
, buildPackages
|
||||
, php83
|
||||
, nixosTests
|
||||
, nix-update-script
|
||||
, dataDir ? "/var/lib/firefly-iii"
|
||||
}:
|
||||
|
||||
@ -10,6 +14,7 @@ let
|
||||
pname = "firefly-iii";
|
||||
version = "6.1.18";
|
||||
phpPackage = php83;
|
||||
npmDepsHash = "sha256-MoxkNxfVeIFkiNVzfehQ9FpC65kBj8ZmvwaRf4MVRIg=";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "firefly-iii";
|
||||
@ -17,36 +22,62 @@ let
|
||||
rev = "v${version}";
|
||||
hash = "sha256-mA7gvKhHouUUz1Aix7253O/+VcufoEFwdcJeZxnazEo=";
|
||||
};
|
||||
|
||||
assets = buildNpmPackage {
|
||||
pname = "${pname}-assets";
|
||||
inherit version src;
|
||||
npmDepsHash = "sha256-MoxkNxfVeIFkiNVzfehQ9FpC65kBj8ZmvwaRf4MVRIg=";
|
||||
dontNpmBuild = true;
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
npm run prod --workspace=v1
|
||||
npm run build --workspace=v2
|
||||
cp -r ./public $out/
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
||||
phpPackage.buildComposerProject (finalAttrs: {
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
inherit pname src version;
|
||||
|
||||
buildInputs = [ phpPackage ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
nodejs.python
|
||||
buildPackages.npmHooks.npmConfigHook
|
||||
phpPackage.composerHooks.composerInstallHook
|
||||
phpPackage.packages.composer-local-repo-plugin
|
||||
];
|
||||
|
||||
composerNoDev = true;
|
||||
composerNoPlugins = true;
|
||||
composerNoScripts = true;
|
||||
composerStrictValidation = true;
|
||||
strictDeps = true;
|
||||
|
||||
vendorHash = "sha256-EpMypgj6lZDz6T94bGoCUH9IVwh7VB4Ds08AcCsreRw=";
|
||||
|
||||
npmDeps = fetchNpmDeps {
|
||||
inherit src;
|
||||
name = "${pname}-npm-deps";
|
||||
hash = npmDepsHash;
|
||||
};
|
||||
|
||||
composerRepository = phpPackage.mkComposerRepository {
|
||||
inherit (finalAttrs)
|
||||
pname
|
||||
src
|
||||
vendorHash
|
||||
version
|
||||
;
|
||||
composerNoDev = true;
|
||||
composerNoPlugins = true;
|
||||
composerNoScripts = true;
|
||||
composerStrictValidation = true;
|
||||
};
|
||||
|
||||
preInstall = ''
|
||||
npm run prod --workspace=v1
|
||||
npm run build --workspace=v2
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit phpPackage;
|
||||
tests = nixosTests.firefly-iii;
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
mv $out/share/php/${pname}/* $out/
|
||||
rm -R $out/share $out/storage $out/bootstrap/cache $out/public
|
||||
cp -a ${assets} $out/public
|
||||
rm -R $out/share $out/storage $out/bootstrap/cache $out/node_modules
|
||||
ln -s ${dataDir}/storage $out/storage
|
||||
ln -s ${dataDir}/cache $out/bootstrap/cache
|
||||
'';
|
||||
@ -56,6 +87,6 @@ phpPackage.buildComposerProject (finalAttrs: {
|
||||
description = "Firefly III: a personal finances manager";
|
||||
homepage = "https://github.com/firefly-iii/firefly-iii";
|
||||
license = lib.licenses.agpl3Only;
|
||||
maintainers = [ lib.maintainers.savyajha ];
|
||||
maintainers = [ lib.maintainers.savyajha lib.maintainers.patrickdag ];
|
||||
};
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user