summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2021-08-16 13:48:00 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2021-08-16 19:15:37 +0000
commit268946d9ca84ee0826f663fa108cc0a0a1ac9652 (patch)
tree3f294f9c15e8f9b2350185f2b748e772ec32795a
parentRevert "matrix-synapse: fix homeserver script" (diff)
downloadnixpkgs-origin/backport-132559-to-release-21.05.tar.gz
matrix-synapse: fix startuporigin/backport-132559-to-release-21.05
(cherry picked from commit 5a01d3ac1f1ea31b9b2635eb2ae1d9f6cd860230)
-rw-r--r--pkgs/servers/matrix-synapse/0001-setup-add-homeserver-as-console-script.patch33
-rw-r--r--pkgs/servers/matrix-synapse/default.nix3
-rw-r--r--pkgs/servers/matrix-synapse/homeserver-script.patch23
3 files changed, 34 insertions, 25 deletions
diff --git a/pkgs/servers/matrix-synapse/0001-setup-add-homeserver-as-console-script.patch b/pkgs/servers/matrix-synapse/0001-setup-add-homeserver-as-console-script.patch
new file mode 100644
index 000000000000..eb70d21ed5cb
--- /dev/null
+++ b/pkgs/servers/matrix-synapse/0001-setup-add-homeserver-as-console-script.patch
@@ -0,0 +1,33 @@
+From 36ffbb7ad2c535180cae473b470a43f9db4fbdcd Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+Date: Mon, 16 Aug 2021 13:27:28 +0200
+Subject: [PATCH] setup: add homeserver as console script
+
+With this change, it will be added to `$out/bin` in `nixpkgs` directly.
+This became necessary since our old workaround, calling it as script,
+doesn't work anymore since the shebangs were removed[1].
+
+[1] https://github.com/matrix-org/synapse/pull/10415
+---
+ setup.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/setup.py b/setup.py
+index c47856351..27f1d842c 100755
+--- a/setup.py
++++ b/setup.py
+@@ -133,6 +133,11 @@ setup(
+ long_description=long_description,
+ long_description_content_type="text/x-rst",
+ python_requires="~=3.6",
++ entry_points={
++ 'console_scripts': [
++ 'homeserver = synapse.app.homeserver:main'
++ ]
++ },
+ classifiers=[
+ "Development Status :: 5 - Production/Stable",
+ "Topic :: Communications :: Chat",
+--
+2.31.1
+
diff --git a/pkgs/servers/matrix-synapse/default.nix b/pkgs/servers/matrix-synapse/default.nix
index d27079399d9c..0eefbbb11472 100644
--- a/pkgs/servers/matrix-synapse/default.nix
+++ b/pkgs/servers/matrix-synapse/default.nix
@@ -20,8 +20,7 @@ buildPythonApplication rec {
};
patches = [
- # adds an entry point for the service
- ./homeserver-script.patch
+ ./0001-setup-add-homeserver-as-console-script.patch
];
buildInputs = [ openssl ];
diff --git a/pkgs/servers/matrix-synapse/homeserver-script.patch b/pkgs/servers/matrix-synapse/homeserver-script.patch
deleted file mode 100644
index 554a2c5f66c1..000000000000
--- a/pkgs/servers/matrix-synapse/homeserver-script.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff --git a/homeserver b/homeserver
-new file mode 120000
-index 000000000..2f1d41351
---- /dev/null
-+++ b/homeserver
-@@ -0,0 +1 @@
-+synapse/app/homeserver.py
-\ No newline at end of file
-diff --git a/setup.py b/setup.py
-index 5ce06c898..f1ccd95bc 100755
---- a/setup.py
-+++ b/setup.py
-@@ -115,6 +115,6 @@ setup(
- "Programming Language :: Python :: 3.6",
- "Programming Language :: Python :: 3.7",
- ],
-- scripts=["synctl"] + glob.glob("scripts/*"),
-+ scripts=["synctl", "homeserver"] + glob.glob("scripts/*"),
- cmdclass={"test": TestCommand},
- )
---
-2.22.0
-