From 940fa29c34da42cd045596c44b2d4702620e97f2 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Fri, 16 Jun 2023 10:09:22 -0400 Subject: [PATCH] New package: lemmy-ui-0.18.3 --- srcpkgs/lemmy-ui/files/lemmy-ui/run | 5 +++ srcpkgs/lemmy-ui/template | 58 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 srcpkgs/lemmy-ui/files/lemmy-ui/run create mode 100644 srcpkgs/lemmy-ui/template diff --git a/srcpkgs/lemmy-ui/files/lemmy-ui/run b/srcpkgs/lemmy-ui/files/lemmy-ui/run new file mode 100644 index 00000000000000..26535bea510c04 --- /dev/null +++ b/srcpkgs/lemmy-ui/files/lemmy-ui/run @@ -0,0 +1,5 @@ +#!/bin/sh +exec 2>&1 +[ -r ./conf ] && . ./conf +cd /usr/lib/lemmy-ui || exit 1 +exec chpst -u _lemmyui:_lemmyui node dist/js/server.js diff --git a/srcpkgs/lemmy-ui/template b/srcpkgs/lemmy-ui/template new file mode 100644 index 00000000000000..b79fb46c97e5fa --- /dev/null +++ b/srcpkgs/lemmy-ui/template @@ -0,0 +1,58 @@ +# Template file for 'lemmy-ui' +pkgname=lemmy-ui +version=0.18.3 +revision=1 +_translation_commit=153351ad2f2fbd03ca4c0b353a84f9d622a5ab91 +hostmakedepends="yarn pkg-config python3" +makedepends="libvips-devel" +depends="nodejs" +short_desc="Official web app for lemmy" +maintainer="Joel Beckmeyer " +license="AGPL-3.0-only" +homepage="https://join-lemmy.org/" +distfiles="https://github.com/LemmyNet/lemmy-ui/archive/refs/tags/${version}.tar.gz + https://github.com/LemmyNet/lemmy-translations/archive/${_translation_commit}.tar.gz" +checksum="746bdb85627aa1381a8e77176985b522a323b49a861347a68227e70948e54a49 + a91bc15aeb47d6612f7a73249c51f2bb8658f0ab460184e36a179ac1f02bcc6b" +python_version=3 +system_accounts="_lemmyui" + +export NODE_ENV=production +case "$XBPS_TARGET_MACHINE" in + aarch64*) export npm_config_arch=arm64;; + armv5*) export npm_config_arch=arm; export npm_config_arm_version=5;; + armv6*) export npm_config_arch=arm; export npm_config_arm_version=6;; + armv7*) export npm_config_arch=arm; export npm_config_arm_version=7;; + i686*) export npm_config_arch=ia32;; + x86_64*) export npm_config_arch=x64;; +esac +export npm_config_build_from_source=true +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + export npm_config_libc=musl +fi +export npm_config_platform=linux + +post_extract() { + cp -r lemmy-ui-${version}/. . + cp -r lemmy-translations-${_translation_commit}/. lemmy-translations + rm -rf lemmy-${version} lemmy-translations-${_translation_commit} + + yarn install --pure-lockfile +} + +post_patch() { + vsed -i "s/unknown version/$version/" src/shared/version.ts +} + +do_build() { + yarn build:prod +} + +do_install() { + npm prune + vmkdir usr/lib/lemmy-ui + vcopy dist usr/lib/lemmy-ui + vcopy node_modules usr/lib/lemmy-ui + vlicense LICENSE + vsv lemmy-ui +}