|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Copyright (c) 2021 The Toltec Contributors |
| 3 | +# SPDX-License-Identifier: MIT |
| 4 | +pkgnames=(reterm) |
| 5 | +pkgdesc="Landscape terminal support for the Remarkable 2 + type cover" |
| 6 | +section="admin" |
| 7 | +pkgver="20230628.1927-1" |
| 8 | +timestamp="2023-06-28T19:28:06Z" |
| 9 | +maintainer="Eeems <eeems@eeems.email>" |
| 10 | +url="https://github.com/i-am-shodan/ReTerm" |
| 11 | +license=MIT |
| 12 | +_gitcommit="5730f56cf25642b9752fb9d7987a40f6af6b5f59" |
| 13 | +source=(https://github.com/i-am-shodan/ReTerm/archive/refs/tags/release_20230628_1927.tar.gz) |
| 14 | +sha256sums=(3a6db39cfb83606c4ac5153fe2ac0319ab5c8322c73172178534c047a15c635b) |
| 15 | +image=dotnet6:latest |
| 16 | +makedepends=(build:gawk build:git) |
| 17 | + |
| 18 | +prepare() { |
| 19 | + cd "$srcdir" |
| 20 | + git config --global --add safe.directory /src |
| 21 | + git init |
| 22 | + git remote add origin https://github.com/i-am-shodan/ReTerm.git |
| 23 | + git fetch --depth=1 origin "$_gitcommit" |
| 24 | + git checkout -f "$_gitcommit" |
| 25 | + git submodule update --init --force |
| 26 | +} |
| 27 | + |
| 28 | +build() { |
| 29 | + dotnet publish \ |
| 30 | + -r linux-arm \ |
| 31 | + --self-contained true \ |
| 32 | + -p:PublishSingleFile=true \ |
| 33 | + -p:PublishedTrimmed=true \ |
| 34 | + -p:PublishReadyToRun=true \ |
| 35 | + -p:Configuration=Release \ |
| 36 | + -p:PublishReadyToRunShowWarnings=true \ |
| 37 | + src/ReTerm/ReTerm.csproj |
| 38 | +} |
| 39 | + |
| 40 | +package() { |
| 41 | + local pubdir |
| 42 | + pubdir="$srcdir"/src/ReTerm/bin/Release/net6.0/linux-arm/publish |
| 43 | + install -D -m 755 -t "$pkgdir"/opt/usr/lib/reterm "$pubdir"/ReTerm |
| 44 | + install -D -m 755 -T "$pubdir"/ReTerm.sh "$pkgdir"/opt/bin/ReTerm |
| 45 | + sed -i 's|/home/root/ReTerm/ReTerm|/opt/usr/lib/reterm/ReTerm|' "$pkgdir"/opt/bin/ReTerm |
| 46 | + install -D -m 644 -t "$pkgdir"/opt/etc/draft "$srcdir"/draft/reterm.draft |
| 47 | + sed -i 's|/home/root/ReTerm/ReTerm.sh|/opt/bin/ReTerm|' "$pkgdir"/opt/etc/draft/reterm.draft |
| 48 | + sed -i 's|killall -9 dotnet|killall ReTerm|' "$pkgdir"/opt/etc/draft/reterm.draft |
| 49 | + install -D -m 644 -t "$pkgdir"/opt/etc/draft/icons "$srcdir"/draft/reterm.png |
| 50 | + install -D -m 644 -t "$pkgdir"/opt/usr/share/applications "$srcdir"/oxide/reterm.oxide |
| 51 | +} |
| 52 | + |
| 53 | +configure() { |
| 54 | + if is-active "tarnish.service"; then |
| 55 | + type update-desktop-database &> /dev/null && update-desktop-database |
| 56 | + fi |
| 57 | +} |
0 commit comments