summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2021-08-12 12:37:33 +0200
committertalyz <kim.lindberger@gmail.com>2021-08-17 23:16:28 +0200
commitaf15cbe6b0df1fd6a7942542087349208b2bd0d7 (patch)
tree9eaa56fed84346db3607036079437279a6797f7a
parentdiscourse.tests: Test the appropriate discourse package (diff)
downloadnixpkgs-af15cbe6b0df1fd6a7942542087349208b2bd0d7.tar.gz
discourse: Change the path to the auto generated plugin assets
Change the path to the auto generated plugin assets, which defaults to the plugin's directory and isn't writable at the time of asset generation. (cherry picked from commit 443b318ee9c614d480a2ecb0120b52806d6fbb3b)
-rw-r--r--pkgs/servers/web-apps/discourse/auto_generated_path.patch13
-rw-r--r--pkgs/servers/web-apps/discourse/default.nix10
2 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/servers/web-apps/discourse/auto_generated_path.patch b/pkgs/servers/web-apps/discourse/auto_generated_path.patch
new file mode 100644
index 000000000000..9dcb1cb5595e
--- /dev/null
+++ b/pkgs/servers/web-apps/discourse/auto_generated_path.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rb
+index 380a63e987..b2ce7fa982 100644
+--- a/lib/plugin/instance.rb
++++ b/lib/plugin/instance.rb
+@@ -403,7 +403,7 @@ class Plugin::Instance
+ end
+
+ def auto_generated_path
+- File.dirname(path) << "/auto_generated"
++ "#{Rails.root}/public/assets/auto_generated_plugin_assets/#{name}"
+ end
+
+ def after_initialize(&block)
diff --git a/pkgs/servers/web-apps/discourse/default.nix b/pkgs/servers/web-apps/discourse/default.nix
index abe12fe0d8cf..41f0bf915033 100644
--- a/pkgs/servers/web-apps/discourse/default.nix
+++ b/pkgs/servers/web-apps/discourse/default.nix
@@ -157,6 +157,11 @@ let
# Use the Ruby API version in the plugin gem path, to match the
# one constructed by bundlerEnv
./plugin_gem_api_version.patch
+
+ # Change the path to the auto generated plugin assets, which
+ # defaults to the plugin's directory and isn't writable at the
+ # time of asset generation
+ ./auto_generated_path.patch
];
# We have to set up an environment that is close enough to
@@ -243,6 +248,11 @@ let
# Use mv instead of rename, since rename doesn't work across
# device boundaries
./use_mv_instead_of_rename.patch
+
+ # Change the path to the auto generated plugin assets, which
+ # defaults to the plugin's directory and isn't writable at the
+ # time of asset generation
+ ./auto_generated_path.patch
];
postPatch = ''