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

* Re: [PR PATCH] [Updated] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
@ 2022-02-12 22:55 ` TinfoilSubmarine
  2022-02-12 22:57 ` TinfoilSubmarine
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-12 22:55 UTC (permalink / raw)
  To: ml

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

There is an updated 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: /${XBPS_CROSS_BASE}/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: 7503 bytes --]

From 830fb01f43f925fa7e06f9e2a22dcead16c4ad12 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/append_flags.patch    | 15 ++++
 srcpkgs/pleroma/patches/no_include_erts.patch | 14 ++++
 .../patches/use_system_cacertfile.patch       | 13 +++
 srcpkgs/pleroma/template                      | 79 +++++++++++++++++++
 8 files changed, 134 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/no_include_erts.patch
 create mode 100644 srcpkgs/pleroma/patches/use_system_cacertfile.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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
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/patches/use_system_cacertfile.patch b/srcpkgs/pleroma/patches/use_system_cacertfile.patch
new file mode 100644
index 000000000000..a15a149237a5
--- /dev/null
+++ b/srcpkgs/pleroma/patches/use_system_cacertfile.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/pleroma/gun/conn.ex b/lib/pleroma/gun/conn.ex
+index a566256..7865704 100644
+--- a/lib/pleroma/gun/conn.ex
++++ b/lib/pleroma/gun/conn.ex
+@@ -25,7 +25,7 @@ defp maybe_add_tls_opts(opts, %URI{scheme: "http"}), do: opts
+   defp maybe_add_tls_opts(opts, %URI{scheme: "https"}) do
+     tls_opts = [
+       verify: :verify_peer,
+-      cacertfile: CAStore.file_path(),
++      cacertfile: /etc/ssl/certs.pem
+       depth: 20,
+       reuse_sessions: false,
+       log_level: :warning,
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..09931c46c927
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,79 @@
+# 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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	echo "import Mix.Config" > config/prod.secret.exs
+	echo "config :tzdata, :data_dir, \"/var/lib/pleroma/elixir_tzdata_data\"
+config :pleroma, :instance, static_dir: \"/etc/pleroma/static\"
+config :pleroma, Pleroma.Uploaders.Local, uploads: \"/var/lib/pleroma/uploads\"" \
+	 >> config/config.exs
+
+	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

* Re: [PR PATCH] [Updated] New package: pleroma-2.4.2
  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
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-12 22:57 UTC (permalink / raw)
  To: ml

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

There is an updated 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: /${XBPS_CROSS_BASE}/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: 7506 bytes --]

From 60824baf1577f4ca8aead8b23444aca4f1bd3426 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/append_flags.patch    | 15 ++++
 srcpkgs/pleroma/patches/no_include_erts.patch | 14 ++++
 .../patches/use_system_cacertfile.patch       | 13 +++
 srcpkgs/pleroma/template                      | 79 +++++++++++++++++++
 8 files changed, 134 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/no_include_erts.patch
 create mode 100644 srcpkgs/pleroma/patches/use_system_cacertfile.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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
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/patches/use_system_cacertfile.patch b/srcpkgs/pleroma/patches/use_system_cacertfile.patch
new file mode 100644
index 000000000000..867d10808632
--- /dev/null
+++ b/srcpkgs/pleroma/patches/use_system_cacertfile.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/pleroma/gun/conn.ex b/lib/pleroma/gun/conn.ex
+index a566256..7865704 100644
+--- a/lib/pleroma/gun/conn.ex
++++ b/lib/pleroma/gun/conn.ex
+@@ -25,7 +25,7 @@ defp maybe_add_tls_opts(opts, %URI{scheme: "http"}), do: opts
+   defp maybe_add_tls_opts(opts, %URI{scheme: "https"}) do
+     tls_opts = [
+       verify: :verify_peer,
+-      cacertfile: CAStore.file_path(),
++      cacertfile: "/etc/ssl/certs.pem",
+       depth: 20,
+       reuse_sessions: false,
+       log_level: :warning,
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..09931c46c927
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,79 @@
+# 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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	echo "import Mix.Config" > config/prod.secret.exs
+	echo "config :tzdata, :data_dir, \"/var/lib/pleroma/elixir_tzdata_data\"
+config :pleroma, :instance, static_dir: \"/etc/pleroma/static\"
+config :pleroma, Pleroma.Uploaders.Local, uploads: \"/var/lib/pleroma/uploads\"" \
+	 >> config/config.exs
+
+	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

* Re: [WIP] New package: pleroma-2.4.2
  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 ` TinfoilSubmarine
  2022-02-14 14:39 ` TinfoilSubmarine
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-12 23:05 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/35539#issuecomment-1037557623

Comment:
Trying to convert all of the `vsed`s I can into patches.

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

* Re: [WIP] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (2 preceding siblings ...)
  2022-02-12 23:05 ` [WIP] " TinfoilSubmarine
@ 2022-02-14 14:39 ` TinfoilSubmarine
  2022-02-14 14:44 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-14 14:39 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/35539#issuecomment-1039162935

Comment:
I think I'm just going to include ERTS in the package so that this package doesn't have to be rev-bumped every time there's an update to system ERTS. It also makes the installation of this package more lightweight (+2.0M package size, +4.0M installed) versus installing the entire erlang package and it's dependencies (+97M installed).

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

* Re: [PR PATCH] [Updated] [WIP] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (3 preceding siblings ...)
  2022-02-14 14:39 ` TinfoilSubmarine
@ 2022-02-14 14:44 ` TinfoilSubmarine
  2022-02-14 15:19 ` TinfoilSubmarine
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-14 14:44 UTC (permalink / raw)
  To: ml

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

There is an updated 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

[WIP] 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: /${XBPS_CROSS_BASE}/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: 7707 bytes --]

From 88506e41aa27efbf1b05e26e4bff688a6d51f670 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/append_flags.patch    | 15 ++++
 .../pleroma/patches/include_system_erts.patch | 14 ++++
 .../patches/use_system_cacertfile.patch       | 13 +++
 srcpkgs/pleroma/template                      | 81 +++++++++++++++++++
 8 files changed, 136 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/include_system_erts.patch
 create mode 100644 srcpkgs/pleroma/patches/use_system_cacertfile.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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
diff --git a/srcpkgs/pleroma/patches/include_system_erts.patch b/srcpkgs/pleroma/patches/include_system_erts.patch
new file mode 100644
index 000000000000..d91136e37adc
--- /dev/null
+++ b/srcpkgs/pleroma/patches/include_system_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: "/usr/lib/erlang/erts-12.2.1"
+         ]
+       ]
+     ]
diff --git a/srcpkgs/pleroma/patches/use_system_cacertfile.patch b/srcpkgs/pleroma/patches/use_system_cacertfile.patch
new file mode 100644
index 000000000000..867d10808632
--- /dev/null
+++ b/srcpkgs/pleroma/patches/use_system_cacertfile.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/pleroma/gun/conn.ex b/lib/pleroma/gun/conn.ex
+index a566256..7865704 100644
+--- a/lib/pleroma/gun/conn.ex
++++ b/lib/pleroma/gun/conn.ex
+@@ -25,7 +25,7 @@ defp maybe_add_tls_opts(opts, %URI{scheme: "http"}), do: opts
+   defp maybe_add_tls_opts(opts, %URI{scheme: "https"}) do
+     tls_opts = [
+       verify: :verify_peer,
+-      cacertfile: CAStore.file_path(),
++      cacertfile: "/etc/ssl/certs.pem",
+       depth: 20,
+       reuse_sessions: false,
+       log_level: :warning,
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..b057c40bed99
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,81 @@
+# 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"
+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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	echo "import Mix.Config" > config/prod.secret.exs
+	echo "config :tzdata, :data_dir, \"/var/lib/pleroma/elixir_tzdata_data\"
+config :pleroma, :instance, static_dir: \"/etc/pleroma/static\"
+config :pleroma, Pleroma.Uploaders.Local, uploads: \"/var/lib/pleroma/uploads\"" \
+	 >> config/config.exs
+
+	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
+		# additional adjustment to include target erts instead of host erts
+		vsed -i "s,include_erts: \"/usr,include_erts: \"${XBPS_CROSS_BASE}," mix.exs
+	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 erts-* 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 -s /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 -s /usr/lib/pleroma/bin/pleroma ${DESTDIR}/usr/bin/
+	ln -s /usr/lib/pleroma/bin/pleroma_ctl ${DESTDIR}/usr/bin/
+
+	vsconf installation/pleroma.nginx
+
+	vsv pleroma
+}

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

* Re: [PR PATCH] [Updated] [WIP] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (4 preceding siblings ...)
  2022-02-14 14:44 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-02-14 15:19 ` TinfoilSubmarine
  2022-02-15 18:45 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-14 15:19 UTC (permalink / raw)
  To: ml

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

There is an updated 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

[WIP] 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: /${XBPS_CROSS_BASE}/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: 6808 bytes --]

From 6c3d57a7158a1777b432815d061080c55ffa3ff0 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/append_flags.patch    | 15 ++++
 .../pleroma/patches/include_system_erts.patch | 14 ++++
 srcpkgs/pleroma/template                      | 81 +++++++++++++++++++
 7 files changed, 123 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/include_system_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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
diff --git a/srcpkgs/pleroma/patches/include_system_erts.patch b/srcpkgs/pleroma/patches/include_system_erts.patch
new file mode 100644
index 000000000000..d91136e37adc
--- /dev/null
+++ b/srcpkgs/pleroma/patches/include_system_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: "/usr/lib/erlang/erts-12.2.1"
+         ]
+       ]
+     ]
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..b057c40bed99
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,81 @@
+# 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"
+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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	echo "import Mix.Config" > config/prod.secret.exs
+	echo "config :tzdata, :data_dir, \"/var/lib/pleroma/elixir_tzdata_data\"
+config :pleroma, :instance, static_dir: \"/etc/pleroma/static\"
+config :pleroma, Pleroma.Uploaders.Local, uploads: \"/var/lib/pleroma/uploads\"" \
+	 >> config/config.exs
+
+	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
+		# additional adjustment to include target erts instead of host erts
+		vsed -i "s,include_erts: \"/usr,include_erts: \"${XBPS_CROSS_BASE}," mix.exs
+	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 erts-* 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 -s /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 -s /usr/lib/pleroma/bin/pleroma ${DESTDIR}/usr/bin/
+	ln -s /usr/lib/pleroma/bin/pleroma_ctl ${DESTDIR}/usr/bin/
+
+	vsconf installation/pleroma.nginx
+
+	vsv pleroma
+}

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

* Re: [PR PATCH] [Updated] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (5 preceding siblings ...)
  2022-02-14 15:19 ` TinfoilSubmarine
@ 2022-02-15 18:45 ` TinfoilSubmarine
  2022-02-16 21:45 ` [PR REVIEW] " notthewave
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-15 18:45 UTC (permalink / raw)
  To: ml

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

There is an updated 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: /${XBPS_CROSS_BASE}/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: 7521 bytes --]

From 85aee035c6e3a845f8b02346ec08dcbbdddad5fd 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/append_flags.patch    | 15 ++++
 srcpkgs/pleroma/patches/config.patch          | 20 +++++
 .../pleroma/patches/include_system_erts.patch | 14 ++++
 srcpkgs/pleroma/template                      | 75 +++++++++++++++++++
 8 files changed, 137 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/config.patch
 create mode 100644 srcpkgs/pleroma/patches/include_system_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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
diff --git a/srcpkgs/pleroma/patches/config.patch b/srcpkgs/pleroma/patches/config.patch
new file mode 100644
index 000000000000..a51bc10fc19c
--- /dev/null
+++ b/srcpkgs/pleroma/patches/config.patch
@@ -0,0 +1,20 @@
+diff --git a/config/config.exs b/config/config.exs
+index b50c910..9cf622b 100644
+--- a/config/config.exs
++++ b/config/config.exs
+@@ -852,6 +852,8 @@
+   {Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, [max_running: 5, max_waiting: 5]}
+ ]
+ 
++config :tzdata, :data_dir, "/var/lib/pleroma/elixir_tzdata_data"
++
+ # Import environment specific config. This must remain at the bottom
+ # of this file so it overrides the configuration defined above.
+ import_config "#{Mix.env()}.exs"
+diff --git a/config/prod.secret.exs b/config/prod.secret.exs
+new file mode 100644
+index 0000000..23fd9f1
+--- /dev/null
++++ b/config/prod.secret.exs
+@@ -0,0 +1 @@
++import Mix.Config
diff --git a/srcpkgs/pleroma/patches/include_system_erts.patch b/srcpkgs/pleroma/patches/include_system_erts.patch
new file mode 100644
index 000000000000..d91136e37adc
--- /dev/null
+++ b/srcpkgs/pleroma/patches/include_system_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: "/usr/lib/erlang/erts-12.2.1"
+         ]
+       ]
+     ]
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..c77beb7037e7
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,75 @@
+# 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"
+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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	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
+		# additional adjustment to include target erts instead of host erts
+		vsed -i "s,include_erts: \"/usr,include_erts: \"${XBPS_CROSS_BASE}," mix.exs
+	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 erts-* 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 -s /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 -s /usr/lib/pleroma/bin/pleroma ${DESTDIR}/usr/bin/
+	ln -s /usr/lib/pleroma/bin/pleroma_ctl ${DESTDIR}/usr/bin/
+
+	vsconf installation/pleroma.nginx
+
+	vsv pleroma
+}

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

* Re: [PR REVIEW] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (6 preceding siblings ...)
  2022-02-15 18:45 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-02-16 21:45 ` notthewave
  2022-02-16 22:04 ` TinfoilSubmarine
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: notthewave @ 2022-02-16 21:45 UTC (permalink / raw)
  To: ml

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

New review comment by notthewave on void-packages repository

https://github.com/void-linux/void-packages/pull/35539#discussion_r808480237

Comment:
I don't see a diffrence

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

* Re: [PR REVIEW] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (7 preceding siblings ...)
  2022-02-16 21:45 ` [PR REVIEW] " notthewave
@ 2022-02-16 22:04 ` TinfoilSubmarine
  2022-02-16 22:05 ` notthewave
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-02-16 22:04 UTC (permalink / raw)
  To: ml

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

New review comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/35539#discussion_r808492065

Comment:
`?=` vs `+=`

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

* Re: [PR REVIEW] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (8 preceding siblings ...)
  2022-02-16 22:04 ` TinfoilSubmarine
@ 2022-02-16 22:05 ` notthewave
  2022-04-20 18:29 ` [PR PATCH] [Updated] " TinfoilSubmarine
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: notthewave @ 2022-02-16 22:05 UTC (permalink / raw)
  To: ml

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

New review comment by notthewave on void-packages repository

https://github.com/void-linux/void-packages/pull/35539#discussion_r808492842

Comment:
oh

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

* Re: [PR PATCH] [Updated] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (9 preceding siblings ...)
  2022-02-16 22:05 ` notthewave
@ 2022-04-20 18:29 ` TinfoilSubmarine
  2022-04-21 12:38 ` TinfoilSubmarine
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-04-20 18:29 UTC (permalink / raw)
  To: ml

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

There is an updated 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: /${XBPS_CROSS_BASE}/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: 8667 bytes --]

From f4fd98bbe51732ee23e817ca2049a278caf39ab0 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/append_flags.patch    | 15 ++++
 srcpkgs/pleroma/patches/config.patch          | 20 +++++
 .../pleroma/patches/include_system_erts.patch | 14 ++++
 srcpkgs/pleroma/patches/latest_castore.patch  | 13 ++++
 srcpkgs/pleroma/template                      | 75 +++++++++++++++++++
 srcpkgs/pleroma/update                        |  1 +
 10 files changed, 151 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/config.patch
 create mode 100644 srcpkgs/pleroma/patches/include_system_erts.patch
 create mode 100644 srcpkgs/pleroma/patches/latest_castore.patch
 create mode 100644 srcpkgs/pleroma/template
 create mode 100644 srcpkgs/pleroma/update

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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
diff --git a/srcpkgs/pleroma/patches/config.patch b/srcpkgs/pleroma/patches/config.patch
new file mode 100644
index 000000000000..a51bc10fc19c
--- /dev/null
+++ b/srcpkgs/pleroma/patches/config.patch
@@ -0,0 +1,20 @@
+diff --git a/config/config.exs b/config/config.exs
+index b50c910..9cf622b 100644
+--- a/config/config.exs
++++ b/config/config.exs
+@@ -852,6 +852,8 @@
+   {Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, [max_running: 5, max_waiting: 5]}
+ ]
+ 
++config :tzdata, :data_dir, "/var/lib/pleroma/elixir_tzdata_data"
++
+ # Import environment specific config. This must remain at the bottom
+ # of this file so it overrides the configuration defined above.
+ import_config "#{Mix.env()}.exs"
+diff --git a/config/prod.secret.exs b/config/prod.secret.exs
+new file mode 100644
+index 0000000..23fd9f1
+--- /dev/null
++++ b/config/prod.secret.exs
+@@ -0,0 +1 @@
++import Mix.Config
diff --git a/srcpkgs/pleroma/patches/include_system_erts.patch b/srcpkgs/pleroma/patches/include_system_erts.patch
new file mode 100644
index 000000000000..d91136e37adc
--- /dev/null
+++ b/srcpkgs/pleroma/patches/include_system_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: "/usr/lib/erlang/erts-12.2.1"
+         ]
+       ]
+     ]
diff --git a/srcpkgs/pleroma/patches/latest_castore.patch b/srcpkgs/pleroma/patches/latest_castore.patch
new file mode 100644
index 000000000000..0fe5b7057ccb
--- /dev/null
+++ b/srcpkgs/pleroma/patches/latest_castore.patch
@@ -0,0 +1,13 @@
+diff --git a/mix.exs b/mix.exs
+index 4387cb0aa..21489ebac 100644
+--- a/mix.exs
++++ b/mix.exs
+@@ -134,7 +134,7 @@ defp deps do
+       {:cachex, "~> 3.2"},
+       {:poison, "~> 3.0", override: true},
+       {:tesla, "~> 1.4.0", override: true},
+-      {:castore, "~> 0.1"},
++      {:castore, "~> 0.1.15, override: true"},
+       {:cowlib, "~> 2.9", override: true},
+       {:gun, "~> 2.0.0-rc.1", override: true},
+       {:finch, "~> 0.10.0"},
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..c77beb7037e7
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,75 @@
+# 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"
+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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	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
+		# additional adjustment to include target erts instead of host erts
+		vsed -i "s,include_erts: \"/usr,include_erts: \"${XBPS_CROSS_BASE}," mix.exs
+	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 erts-* 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 -s /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 -s /usr/lib/pleroma/bin/pleroma ${DESTDIR}/usr/bin/
+	ln -s /usr/lib/pleroma/bin/pleroma_ctl ${DESTDIR}/usr/bin/
+
+	vsconf installation/pleroma.nginx
+
+	vsv pleroma
+}
diff --git a/srcpkgs/pleroma/update b/srcpkgs/pleroma/update
new file mode 100644
index 000000000000..5186b45dd6b3
--- /dev/null
+++ b/srcpkgs/pleroma/update
@@ -0,0 +1 @@
+site="https://git.pleroma.social/pleroma/pleroma/-/tags"

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

* Re: [PR PATCH] [Updated] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (10 preceding siblings ...)
  2022-04-20 18:29 ` [PR PATCH] [Updated] " TinfoilSubmarine
@ 2022-04-21 12:38 ` TinfoilSubmarine
  2022-04-21 12:58 ` TinfoilSubmarine
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-04-21 12:38 UTC (permalink / raw)
  To: ml

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

There is an updated 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: /${XBPS_CROSS_BASE}/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: 7848 bytes --]

From 59cd746ab3b7c5e1d2a341c68dfe5d9192a28f9b 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/append_flags.patch    | 15 ++++
 srcpkgs/pleroma/patches/config.patch          | 20 +++++
 .../pleroma/patches/include_system_erts.patch | 14 ++++
 srcpkgs/pleroma/template                      | 75 +++++++++++++++++++
 srcpkgs/pleroma/update                        |  1 +
 9 files changed, 138 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/config.patch
 create mode 100644 srcpkgs/pleroma/patches/include_system_erts.patch
 create mode 100644 srcpkgs/pleroma/template
 create mode 100644 srcpkgs/pleroma/update

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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
diff --git a/srcpkgs/pleroma/patches/config.patch b/srcpkgs/pleroma/patches/config.patch
new file mode 100644
index 000000000000..a51bc10fc19c
--- /dev/null
+++ b/srcpkgs/pleroma/patches/config.patch
@@ -0,0 +1,20 @@
+diff --git a/config/config.exs b/config/config.exs
+index b50c910..9cf622b 100644
+--- a/config/config.exs
++++ b/config/config.exs
+@@ -852,6 +852,8 @@
+   {Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, [max_running: 5, max_waiting: 5]}
+ ]
+ 
++config :tzdata, :data_dir, "/var/lib/pleroma/elixir_tzdata_data"
++
+ # Import environment specific config. This must remain at the bottom
+ # of this file so it overrides the configuration defined above.
+ import_config "#{Mix.env()}.exs"
+diff --git a/config/prod.secret.exs b/config/prod.secret.exs
+new file mode 100644
+index 0000000..23fd9f1
+--- /dev/null
++++ b/config/prod.secret.exs
+@@ -0,0 +1 @@
++import Mix.Config
diff --git a/srcpkgs/pleroma/patches/include_system_erts.patch b/srcpkgs/pleroma/patches/include_system_erts.patch
new file mode 100644
index 000000000000..d91136e37adc
--- /dev/null
+++ b/srcpkgs/pleroma/patches/include_system_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: "/usr/lib/erlang/erts-12.2.1"
+         ]
+       ]
+     ]
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..c77beb7037e7
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,75 @@
+# 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"
+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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	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
+		# additional adjustment to include target erts instead of host erts
+		vsed -i "s,include_erts: \"/usr,include_erts: \"${XBPS_CROSS_BASE}," mix.exs
+	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 erts-* 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 -s /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 -s /usr/lib/pleroma/bin/pleroma ${DESTDIR}/usr/bin/
+	ln -s /usr/lib/pleroma/bin/pleroma_ctl ${DESTDIR}/usr/bin/
+
+	vsconf installation/pleroma.nginx
+
+	vsv pleroma
+}
diff --git a/srcpkgs/pleroma/update b/srcpkgs/pleroma/update
new file mode 100644
index 000000000000..5186b45dd6b3
--- /dev/null
+++ b/srcpkgs/pleroma/update
@@ -0,0 +1 @@
+site="https://git.pleroma.social/pleroma/pleroma/-/tags"

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

* Re: [PR PATCH] [Updated] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (11 preceding siblings ...)
  2022-04-21 12:38 ` TinfoilSubmarine
@ 2022-04-21 12:58 ` TinfoilSubmarine
  2022-05-06 12:01 ` TinfoilSubmarine
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-04-21 12:58 UTC (permalink / raw)
  To: ml

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

There is an updated 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: /${XBPS_CROSS_BASE}/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: 7846 bytes --]

From 8a2fb14e594a81921f0fa6afbaaf3c920ef65677 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/append_flags.patch    | 15 ++++
 srcpkgs/pleroma/patches/config.patch          | 20 +++++
 .../pleroma/patches/include_system_erts.patch | 14 ++++
 srcpkgs/pleroma/template                      | 75 +++++++++++++++++++
 srcpkgs/pleroma/update                        |  1 +
 9 files changed, 138 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/config.patch
 create mode 100644 srcpkgs/pleroma/patches/include_system_erts.patch
 create mode 100644 srcpkgs/pleroma/template
 create mode 100644 srcpkgs/pleroma/update

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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
diff --git a/srcpkgs/pleroma/patches/config.patch b/srcpkgs/pleroma/patches/config.patch
new file mode 100644
index 000000000000..a51bc10fc19c
--- /dev/null
+++ b/srcpkgs/pleroma/patches/config.patch
@@ -0,0 +1,20 @@
+diff --git a/config/config.exs b/config/config.exs
+index b50c910..9cf622b 100644
+--- a/config/config.exs
++++ b/config/config.exs
+@@ -852,6 +852,8 @@
+   {Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, [max_running: 5, max_waiting: 5]}
+ ]
+ 
++config :tzdata, :data_dir, "/var/lib/pleroma/elixir_tzdata_data"
++
+ # Import environment specific config. This must remain at the bottom
+ # of this file so it overrides the configuration defined above.
+ import_config "#{Mix.env()}.exs"
+diff --git a/config/prod.secret.exs b/config/prod.secret.exs
+new file mode 100644
+index 0000000..23fd9f1
+--- /dev/null
++++ b/config/prod.secret.exs
+@@ -0,0 +1 @@
++import Mix.Config
diff --git a/srcpkgs/pleroma/patches/include_system_erts.patch b/srcpkgs/pleroma/patches/include_system_erts.patch
new file mode 100644
index 000000000000..247de89c9625
--- /dev/null
+++ b/srcpkgs/pleroma/patches/include_system_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: "/usr/lib/erlang/erts-12.3"
+         ]
+       ]
+     ]
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..c77beb7037e7
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,75 @@
+# 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"
+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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	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
+		# additional adjustment to include target erts instead of host erts
+		vsed -i "s,include_erts: \"/usr,include_erts: \"${XBPS_CROSS_BASE}," mix.exs
+	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 erts-* 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 -s /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 -s /usr/lib/pleroma/bin/pleroma ${DESTDIR}/usr/bin/
+	ln -s /usr/lib/pleroma/bin/pleroma_ctl ${DESTDIR}/usr/bin/
+
+	vsconf installation/pleroma.nginx
+
+	vsv pleroma
+}
diff --git a/srcpkgs/pleroma/update b/srcpkgs/pleroma/update
new file mode 100644
index 000000000000..5186b45dd6b3
--- /dev/null
+++ b/srcpkgs/pleroma/update
@@ -0,0 +1 @@
+site="https://git.pleroma.social/pleroma/pleroma/-/tags"

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

* Re: [PR PATCH] [Updated] New package: pleroma-2.4.2
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (12 preceding siblings ...)
  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
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-05-06 12:01 UTC (permalink / raw)
  To: ml

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

There is an updated 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: /${XBPS_CROSS_BASE}/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: 7846 bytes --]

From 5d314a0325590aab96a9c2892b4c77e54777bedc 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.3

---
 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/append_flags.patch    | 15 ++++
 srcpkgs/pleroma/patches/config.patch          | 20 +++++
 .../pleroma/patches/include_system_erts.patch | 14 ++++
 srcpkgs/pleroma/template                      | 75 +++++++++++++++++++
 srcpkgs/pleroma/update                        |  1 +
 9 files changed, 138 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/append_flags.patch
 create mode 100644 srcpkgs/pleroma/patches/config.patch
 create mode 100644 srcpkgs/pleroma/patches/include_system_erts.patch
 create mode 100644 srcpkgs/pleroma/template
 create mode 100644 srcpkgs/pleroma/update

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/append_flags.patch b/srcpkgs/pleroma/patches/append_flags.patch
new file mode 100644
index 000000000000..558aefec4924
--- /dev/null
+++ b/srcpkgs/pleroma/patches/append_flags.patch
@@ -0,0 +1,15 @@
+diff --git a/deps/crypt/c_src/Makefile b/deps/crypt/c_src/Makefile
+index 9c7e70b..ab31c50 100644
+--- a/deps/crypt/c_src/Makefile
++++ b/deps/crypt/c_src/Makefile
+@@ -25,8 +25,8 @@ else ifeq ($(UNAME_SYS), Linux)
+ 		CFLAGS ?= -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+ 		LDFLAGS ?= -lcrypt
+   else
+-		CFLAGS ?= -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
+-		LDFLAGS ?= -lpthread -lcrypt
++		CFLAGS += -DHAVE_CRYPT_R -O3 -std=c99 -finline-functions -Wall -Wmissing-prototypes
++		LDFLAGS += -lpthread -lcrypt
+   endif
+ else ifneq (,$(wildcard /usr/lib/libcrypt.*))
+ 	CC ?= cc
diff --git a/srcpkgs/pleroma/patches/config.patch b/srcpkgs/pleroma/patches/config.patch
new file mode 100644
index 000000000000..a51bc10fc19c
--- /dev/null
+++ b/srcpkgs/pleroma/patches/config.patch
@@ -0,0 +1,20 @@
+diff --git a/config/config.exs b/config/config.exs
+index b50c910..9cf622b 100644
+--- a/config/config.exs
++++ b/config/config.exs
+@@ -852,6 +852,8 @@
+   {Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy, [max_running: 5, max_waiting: 5]}
+ ]
+ 
++config :tzdata, :data_dir, "/var/lib/pleroma/elixir_tzdata_data"
++
+ # Import environment specific config. This must remain at the bottom
+ # of this file so it overrides the configuration defined above.
+ import_config "#{Mix.env()}.exs"
+diff --git a/config/prod.secret.exs b/config/prod.secret.exs
+new file mode 100644
+index 0000000..23fd9f1
+--- /dev/null
++++ b/config/prod.secret.exs
+@@ -0,0 +1 @@
++import Mix.Config
diff --git a/srcpkgs/pleroma/patches/include_system_erts.patch b/srcpkgs/pleroma/patches/include_system_erts.patch
new file mode 100644
index 000000000000..247de89c9625
--- /dev/null
+++ b/srcpkgs/pleroma/patches/include_system_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: "/usr/lib/erlang/erts-12.3"
+         ]
+       ]
+     ]
diff --git a/srcpkgs/pleroma/template b/srcpkgs/pleroma/template
new file mode 100644
index 000000000000..5e74457612ee
--- /dev/null
+++ b/srcpkgs/pleroma/template
@@ -0,0 +1,75 @@
+# Template file for 'pleroma'
+pkgname=pleroma
+version=2.4.3
+revision=1
+wrksrc="pleroma-v${version}"
+hostmakedepends="cmake elixir rebar3 git"
+makedepends="file-devel 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=4362a8396f588fc611d9dae891e54e9473c34443eb718fe109dab09578809d78
+
+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
+
+post_extract() {
+	mix local.hex --force
+	mix deps.get --only prod
+}
+
+do_configure() {
+	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
+		# additional adjustment to include target erts instead of host erts
+		vsed -i "s,include_erts: \"/usr,include_erts: \"${XBPS_CROSS_BASE}," mix.exs
+	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 erts-* 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 -s /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 -s /usr/lib/pleroma/bin/pleroma ${DESTDIR}/usr/bin/
+	ln -s /usr/lib/pleroma/bin/pleroma_ctl ${DESTDIR}/usr/bin/
+
+	vsconf installation/pleroma.nginx
+
+	vsv pleroma
+}
diff --git a/srcpkgs/pleroma/update b/srcpkgs/pleroma/update
new file mode 100644
index 000000000000..5186b45dd6b3
--- /dev/null
+++ b/srcpkgs/pleroma/update
@@ -0,0 +1 @@
+site="https://git.pleroma.social/pleroma/pleroma/-/tags"

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

* Re: [PR PATCH] [Closed]: New package: pleroma-2.4.3
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (13 preceding siblings ...)
  2022-05-06 12:01 ` TinfoilSubmarine
@ 2022-08-02 13:00 ` TinfoilSubmarine
  2022-08-02 13:00 ` TinfoilSubmarine
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-08-02 13:00 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

New package: pleroma-2.4.3
https://github.com/void-linux/void-packages/pull/35539

Description:
<!-- 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: /${XBPS_CROSS_BASE}/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.

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

* Re: New package: pleroma-2.4.3
  2022-02-11 19:14 [PR PATCH] New package: pleroma-2.4.2 TinfoilSubmarine
                   ` (14 preceding siblings ...)
  2022-08-02 13:00 ` [PR PATCH] [Closed]: New package: pleroma-2.4.3 TinfoilSubmarine
@ 2022-08-02 13:00 ` TinfoilSubmarine
  15 siblings, 0 replies; 17+ messages in thread
From: TinfoilSubmarine @ 2022-08-02 13:00 UTC (permalink / raw)
  To: ml

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

New comment by TinfoilSubmarine on void-packages repository

https://github.com/void-linux/void-packages/pull/35539#issuecomment-1202495876

Comment:
I no longer use this, I switched to a fork.

^ 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).