Unverified Commit 62517063 authored by Kerstin's avatar Kerstin Committed by GitHub
Browse files

Merge pull request #209562 from andrew-d/andrew/mastodon-deps

mastodon: pass dependencies as environment variables
parents 11411791 5ff79caf
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
  # Putting the callPackage up in the arguments list also does not work.
  src = if srcOverride != null then srcOverride else callPackage ./source.nix {};

  mastodon-gems = bundlerEnv {
  mastodonGems = bundlerEnv {
    name = "${pname}-gems-${version}";
    inherit version;
    ruby = ruby_3_0;
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
    '';
  };

  mastodon-modules = stdenv.mkDerivation {
  mastodonModules = stdenv.mkDerivation {
    pname = "${pname}-modules";
    inherit src version;

@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
      sha256 = "sha256-fuU92fydoazSXBHwA+DG//gRgWVYQ1M3m2oNS2iwv4I=";
    };

    nativeBuildInputs = [ fixup_yarn_lock nodejs-slim yarn mastodon-gems mastodon-gems.wrappedRuby ];
    nativeBuildInputs = [ fixup_yarn_lock nodejs-slim yarn mastodonGems mastodonGems.wrappedRuby ];

    RAILS_ENV = "production";
    NODE_ENV = "production";
@@ -79,19 +79,19 @@ stdenv.mkDerivation rec {
    '';
  };

  propagatedBuildInputs = [ imagemagick ffmpeg file mastodon-gems.wrappedRuby ];
  buildInputs = [ mastodon-gems nodejs-slim ];
  propagatedBuildInputs = [ imagemagick ffmpeg file mastodonGems.wrappedRuby ];
  buildInputs = [ mastodonGems nodejs-slim ];

  buildPhase = ''
    ln -s ${mastodon-modules}/node_modules node_modules
    ln -s ${mastodon-modules}/public/assets public/assets
    ln -s ${mastodon-modules}/public/packs public/packs
    ln -s $mastodonModules/node_modules node_modules
    ln -s $mastodonModules/public/assets public/assets
    ln -s $mastodonModules/public/packs public/packs

    patchShebangs bin/
    for b in $(ls ${mastodon-gems}/bin/)
    for b in $(ls $mastodonGems/bin/)
    do
      if [ ! -f bin/$b ]; then
        ln -s ${mastodon-gems}/bin/$b bin/$b
        ln -s $mastodonGems/bin/$b bin/$b
      fi
    done