!jngDrdMgndWibPCYsR:nixos.org

Nix PHP

64 Members
A room for PHP developers running on Nix22 Servers

Load older messages


SenderMessageTime
19 Jun 2024
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzIk09:10:54
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz

.<

09:10:57
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzIt was such a pain getting the build process running. 09:11:08
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz * 09:11:24
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzDo we have a policy on this?09:11:46
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzBecause else I’ll switch to pulling the built tar file from their GitHub releases. 09:12:06
@drupol:matrix.orgPolI don't know anything about that, sorry :S09:15:08
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzI’ll ask on main. 09:15:16
@patka_123:matrix.orgpatka (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
@drupol:matrix.orgPolIf the translation has its own versionised URL, yes.09:30:52
@drupol:matrix.orgPolIf not, we're pucked.09:31:00
@patka_123:matrix.orgpatka (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@genghiz:talk.go7box.xyzHad 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@genghiz:talk.go7box.xyz * 09:32:24
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzThe 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_123:matrix.orgpatka (new account: @patka:envs.net)Yeah indeed, should've waited 10 seconds longer before pressing enter :)09:35:10
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzHeh no worries, all good :D09:38:34
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzLooks like it’s a more intractable problem than I had realised. Source build vs translations. 09:47:38
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzMy personal preference is to have localisations over striving for purity with a source build. 09:48:03
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzBut it’s a very mild preference. 09:48:19
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz Pol: What's the best way to do a composer install within, say, buildNpmPackage? 18:49:19
@drupol:matrix.orgPol 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@genghiz:talk.go7box.xyzI’ll check it out, thanks. 06:15:56
21 Jun 2024
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz Pol: you there? 18:08:18
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyzOkay never mind, I might have solved it.18:10:54
@genghiz:talk.go7box.xyz@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@genghiz:talk.go7box.xyzThis ought to build the package, even though it may not work.18:17:58
@genghiz:talk.go7box.xyz@genghiz:talk.go7box.xyz But I get Command "build-local-repo-lock" is not defined and the build errors 18:18:15
@drupol:matrix.orgPolLine 28, you need composerWithPlugin19:24:15
@drupol:matrix.orgPolCan't really help right now sorry :(19:24:27

Show newer messages


Back to Room ListRoom Version: 6