19 Jun 2024 |
@genghiz:talk.go7box.xyz | Ik | 09:10:54 |
@genghiz:talk.go7box.xyz |
.<
| 09:10:57 |
@genghiz:talk.go7box.xyz | It was such a pain getting the build process running. | 09:11:08 |
@genghiz:talk.go7box.xyz | * | 09:11:24 |
@genghiz:talk.go7box.xyz | Do we have a policy on this? | 09:11:46 |
@genghiz:talk.go7box.xyz | Because else I’ll switch to pulling the built tar file from their GitHub releases. | 09:12:06 |
Pol | I don't know anything about that, sorry :S | 09:15:08 |
@genghiz:talk.go7box.xyz | I’ll ask on main. | 09:15:16 |
patka (new account: @patka:envs.net) | We can download the tarball during a prebuild step, take the localisation from it, install it in the correct place, continue the rest of the normal proces (with the crowdin step removed), right? | 09:30:22 |
Pol | If the translation has its own versionised URL, yes. | 09:30:52 |
Pol | If not, we're pucked. | 09:31:00 |
patka (new account: @patka:envs.net) | Nvm, I shouldnt think when doing other things... The initial tarball doesn't have the localisations lol. Thats the problem. | 09:31:44 |
@genghiz:talk.go7box.xyz | Had the initial tar all had the translations there would be no problem because there’s a script to install them in the correct place which we can use | 09:32:15 |
@genghiz:talk.go7box.xyz | * | 09:32:24 |
@genghiz:talk.go7box.xyz | The final tarball has the localisations but if we’re downloading it to get at them then let’s just use the final tarball, right? | 09:33:24 |
patka (new account: @patka:envs.net) | Yeah indeed, should've waited 10 seconds longer before pressing enter :) | 09:35:10 |
@genghiz:talk.go7box.xyz | Heh no worries, all good :D | 09:38:34 |
@genghiz:talk.go7box.xyz | Looks like it’s a more intractable problem than I had realised. Source build vs translations. | 09:47:38 |
@genghiz:talk.go7box.xyz | My personal preference is to have localisations over striving for purity with a source build. | 09:48:03 |
@genghiz:talk.go7box.xyz | But it’s a very mild preference. | 09:48:19 |
@genghiz:talk.go7box.xyz | Pol: What's the best way to do a composer install within, say, buildNpmPackage ? | 18:49:19 |
Pol | How about using mkComposerRepository ? (https://github.com/NixOS/nixpkgs/blob/de4fa967d9ce1535980cc9cae43db0766037201b/pkgs/build-support/php/builders/v1/build-composer-project.nix#L72) | 19:25:12 |
20 Jun 2024 |
@genghiz:talk.go7box.xyz | I’ll check it out, thanks. | 06:15:56 |
21 Jun 2024 |
@genghiz:talk.go7box.xyz | Pol: you there? | 18:08:18 |
@genghiz:talk.go7box.xyz | Okay never mind, I might have solved it. | 18:10:54 |
@genghiz:talk.go7box.xyz | Okay, so I haven't solved it. I'm using the file
{ lib
, fetchFromGitHub
, stdenvNoCC
, php83
, nixosTests
, dataDir ? "/var/lib/firefly-iii"
}:
let
pname = "firefly-iii";
version = "6.1.18";
phpPackage = php83;
src = fetchFromGitHub {
owner = "firefly-iii";
repo = "firefly-iii";
rev = "v${version}";
hash = "sha256-mA7gvKhHouUUz1Aix7253O/+VcufoEFwdcJeZxnazEo=";
};
in
stdenvNoCC.mkDerivation (finalAttrs: {
inherit pname src version;
buildInputs = [ phpPackage ];
nativeBuildInputs = [
phpPackage.packages.composer
phpPackage.composerHooks.composerInstallHook
];
composerRepository = phpPackage.mkComposerRepository {
inherit (finalAttrs) src pname version;
composerNoDev = true;
composerNoPlugins = true;
composerNoScripts = true;
composerStrictValidation = true;
# composerLock = null;
vendorHash = "sha256-EpMypgj6lZDz6T94bGoCUH9IVwh7VB4Ds08AcCsreRw=";
};
passthru = {
inherit phpPackage;
tests = nixosTests.firefly-iii;
};
# cp -a ${assets} $out/public
postInstall = ''
mv $out/share/php/${pname}/* $out/
rm -R $out/share $out/storage $out/bootstrap/cache $out/public
ln -s ${dataDir}/storage $out/storage
ln -s ${dataDir}/cache $out/bootstrap/cache
'';
meta = {
changelog = "https://github.com/firefly-iii/firefly-iii/releases/tag/v${version}";
description = "Firefly III: a personal finances manager";
homepage = "https://github.com/firefly-iii/firefly-iii";
license = lib.licenses.agpl3Only;
maintainers = [ lib.maintainers.savyajha ];
};
})
| 18:17:43 |
@genghiz:talk.go7box.xyz | This ought to build the package, even though it may not work. | 18:17:58 |
@genghiz:talk.go7box.xyz | But I get Command "build-local-repo-lock" is not defined and the build errors | 18:18:15 |
Pol | Line 28, you need composerWithPlugin | 19:24:15 |
Pol | Can't really help right now sorry :( | 19:24:27 |