Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: pleroma-2.4.2
@ 2022-02-11 19:14 TinfoilSubmarine
  2022-02-12 22:55 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-11 19:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2066 bytes --]

There is a new pull request by TinfoilSubmarine against master on the void-packages repository

https://github.com/TinfoilSubmarine/void-packages pleroma
https://github.com/void-linux/void-packages/pull/35539

New package: pleroma-2.4.2
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**


#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**


<!-- Note: If the build is likely to take more than 2 hours, please [skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration)
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!-- 
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->

I've been running this successfully on my x86_64-glibc server, and just tested it briefly on armv7l-glibc (rpi2) and it worked great. 

This does require a PostgreSQL installation with the `postgresql*-contrib` package for it's version, but not a specific version, so I didn't want to enforce a specific version by putting it in depends.

I patched the release to not include ERTS and instead use the ERTS included in the `erlang` package, which is one way to deal with cross-builds. Another would be (I think) instead of patching it as `include_erts: false`, just do `include_erts: /usr/lib/erlang/erts-*` or something similar depending on whether it's a cross-build or not.

For the licenses, I included every license mentioned in COPYING. If this is too much, I think it would be possible to remove some of the assets without too much work.

A patch file from https://github.com/void-linux/void-packages/pull/35539.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pleroma-35539.patch --]
[-- Type: text/x-diff, Size: 5800 bytes --]

From cee7c512a2f066b319df51f5ee9318ead264cff2 Mon Sep 17 00:00:00 2001
From: Joel Beckmeyer <joel@beckmeyer.us>
Date: Fri, 11 Feb 2022 14:05:04 -0500
Subject: [PATCH] New package: pleroma-2.4.2

---
 srcpkgs/pleroma/INSTALL                       |  7 ++
 srcpkgs/pleroma/files/pleroma/finish          |  2 +
 srcpkgs/pleroma/files/pleroma/log/run         |  1 +
 srcpkgs/pleroma/files/pleroma/run             |  3 +
 srcpkgs/pleroma/patches/no_include_erts.patch | 14 ++++
 srcpkgs/pleroma/template                      | 83 +++++++++++++++++++
 6 files changed, 110 insertions(+)
 create mode 100644 srcpkgs/pleroma/INSTALL
 create mode 100755 srcpkgs/pleroma/files/pleroma/finish
 create mode 120000 srcpkgs/pleroma/files/pleroma/log/run
 create mode 100755 srcpkgs/pleroma/files/pleroma/run
 create mode 100644 srcpkgs/pleroma/patches/no_include_erts.patch
 create mode 100644 srcpkgs/pleroma/template

diff --git a/srcpkgs/pleroma/INSTALL b/srcpkgs/pleroma/INSTALL
new file mode 100644
index 000000000000..0db26c12be00
--- /dev/null
+++ b/srcpkgs/pleroma/INSTALL
@@ -0,0 +1,7 @@
+if [ "${UPDATE}" = "no" ] && [ "${ACTION}" = "post" ]; then
+	if [ ! -e /etc/pleroma/COOKIE ]; then
+		dd if=/dev/urandom bs=40 count=1 | base64 > /etc/pleroma/COOKIE
+	fi
+	chmod 600 /etc/pleroma/COOKIE
+	chown _pleroma:_pleroma /etc/pleroma/COOKIE
+fi
diff --git a/srcpkgs/pleroma/files/pleroma/finish b/srcpkgs/pleroma/files/pleroma/finish
new file mode 100755
index 000000000000..4a7de0a2c050
--- /dev/null
+++ b/srcpkgs/pleroma/files/pleroma/finish
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec chpst -u _pleroma:_pleroma pleroma stop
diff --git a/srcpkgs/pleroma/files/pleroma/log/run b/srcpkgs/pleroma/files/pleroma/log/run
new file mode 120000
index 000000000000..3a5b4a586051
--- /dev/null
+++ b/srcpkgs/pleroma/files/pleroma/log/run
@@ -0,0 +1 @@
+/usr/bin/vlogger
\ No newline at end of file
diff --git a/srcpkgs/pleroma/files/pleroma/run b/srcpkgs/pleroma/files/pleroma/run
new file mode 100755
index 000000000000..7e3dae4e67a5
--- /dev/null
+++ b/srcpkgs/pleroma/files/pleroma/run
@@ -0,0 +1,3 @@
+#!/bin/sh
+chpst -u _pleroma:_pleroma pleroma_ctl migrate
+exec chpst -u _pleroma:_pleroma pleroma start
diff --git a/srcpkgs/pleroma/patches/no_include_erts.patch b/srcpkgs/pleroma/patches/no_include_erts.patch
new file mode 100644
index 000000000000..ab3e56cd19a5
--- /dev/null
+++ b/srcpkgs/pleroma/patches/no_include_erts.patch
@@ -0,0 +1,14 @@
+diff --git a/mix.exs b/mix.exs
+index db2f1f0..115817c 100644
+--- a/mix.exs
++++ b/mix.exs
+@@ -38,7 +38,8 @@ def project do
+           include_executables_for: [:unix],
+           applications: [ex_syslogger: :load, syslog: :load, eldap: :transient],
+           steps: [:assemble, &put_otp_version/1, &copy_files/1, &copy_nginx_config/1],
+-          config_providers: [{Pleroma.Config.ReleaseRuntimeProvider, []}]
++          config_providers: [{Pleroma.Config.ReleaseRuntimeProvider, []}],
++          include_erts: false
+         ]
+       ]
+     ]
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..076de658a855
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,83 @@
+# Template file for 'pleroma'
+pkgname=pleroma
+version=2.4.2
+revision=1
+wrksrc="pleroma-v${version}"
+hostmakedepends="cmake elixir rebar3 git"
+makedepends="file-devel erlang"
+depends="erlang"
+short_desc="Social networking software compatible with other Fediverse software"
+maintainer="Joel Beckmeyer <joel@beckmeyer.us>"
+license="AGPL-3.0-only,CC-BY-4.0,CC-BY-SA-4.0,custom:Unsplash"
+homepage="https://pleroma.social"
+distfiles="https://git.pleroma.social/pleroma/pleroma/-/archive/v${version}/pleroma-v${version}.tar.gz"
+checksum=90f3d4a0490c17c972a562d8d47067b2316cf0115df4d289c2cddd2309b03274
+
+system_accounts="_pleroma"
+_pleroma_homedir="/var/lib/pleroma"
+
+make_dirs="/var/lib/pleroma 0700 _pleroma _pleroma
+ /etc/pleroma 0755 _pleroma _pleroma
+ /etc/pleroma/static 0755 _pleroma _pleroma"
+
+export MIX_ENV=prod
+export MIX_REBAR3=/usr/bin/rebar3
+
+if [ "$CROSS_BUILD" ]; then
+	# fixes linking syslog dependency
+	LDFLAGS+=" -L${XBPS_CROSS_BASE}/usr/lib/erlang/usr/lib"
+fi
+
+do_configure() {
+	echo "import Mix.Config" > config/prod.secret.exs
+	echo "config :tzdata, :data_dir, \"/var/lib/pleroma/elixir_tzdata_data\"" \
+	 >> config/config.exs
+	echo "config :pleroma, :instance, static_dir: \"/etc/pleroma/static\"" \
+	 >> config/config.exs
+	echo "config :pleroma, Pleroma.Uploaders.Local, uploads: \"/var/lib/pleroma/uploads\"" \
+	 >> config/config.exs
+
+	mix local.hex --force
+	mix deps.get --only prod
+
+	# fixes undefined symbol error
+	vsed -e 's,CFLAGS ?=,CFLAGS +=,' \
+	 -e 's,LDFLAGS ?=,LDFLAGS +=,' -i deps/crypt/c_src/Makefile
+
+	if [ "$CROSS_BUILD" ]; then
+		# fixes building fast_html
+		_erts_path="$(cd ${XBPS_CROSS_BASE}/usr/lib/erlang/erts-* && pwd)"
+		vsed -i "s,ERLANG_PATH =.*,ERLANG_PATH = ${_erts_path}," deps/fast_html/Makefile
+	fi
+}
+
+do_build() {
+	# without the DEBUG flag, mix gives unhelpful errors for diagnosing c library
+	# issues
+	DEBUG=1 mix release
+}
+
+do_install() {
+	vlicense COPYING
+	vlicense AGPL-3
+
+	cd _build/prod/rel/pleroma
+	vmkdir usr/lib/pleroma
+	vcopy lib usr/lib/pleroma
+	# the Erlang Distribution cookie needs to be unique to each installation
+	rm releases/COOKIE
+	vcopy releases usr/lib/pleroma
+	ln -sf /etc/pleroma/COOKIE ${DESTDIR}/usr/lib/pleroma/releases
+
+	# make entrypoint look in standard location instead of cwd
+	vsed -i 's,^RELEASE_ROOT=.*,RELEASE_ROOT="/usr/lib/pleroma",' bin/pleroma
+	vcopy bin usr/lib/pleroma
+
+	vmkdir usr/bin
+	ln -sf /usr/lib/pleroma/bin/pleroma ${DESTDIR}/usr/bin/
+	ln -sf /usr/lib/pleroma/bin/pleroma_ctl ${DESTDIR}/usr/bin/
+
+	vsconf installation/pleroma.nginx
+
+	vsv pleroma
+}

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-08-02 13:00 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
2022-02-12 22:55 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-02-12 22:57 ` TinfoilSubmarine
2022-02-12 23:05 ` [WIP] " TinfoilSubmarine
2022-02-14 14:39 ` TinfoilSubmarine
2022-02-14 14:44 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-02-14 15:19 ` TinfoilSubmarine
2022-02-15 18:45 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-02-16 21:45 ` [PR REVIEW] " notthewave
2022-02-16 22:04 ` TinfoilSubmarine
2022-02-16 22:05 ` notthewave
2022-04-20 18:29 ` [PR PATCH] [Updated] " TinfoilSubmarine
2022-04-21 12:38 ` TinfoilSubmarine
2022-04-21 12:58 ` TinfoilSubmarine
2022-05-06 12:01 ` TinfoilSubmarine
2022-08-02 13:00 ` [PR PATCH] [Closed]: New package: pleroma-2.4.3 TinfoilSubmarine
2022-08-02 13:00 ` TinfoilSubmarine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).