app-editors/pulsar-bin: Support arm64

Tested ebuild on an arm64 prefix. Couldn't do a proper run test
because that machine is awfully slow.

Also removed the redundant chmods, if we could simply mv the files
into image instead of using doins, the modes from the original
tarball are kept and we don't need to chmod.

Signed-off-by: YiFei Zhu <zhuyifei1999@gmail.com>
This commit is contained in:
YiFei Zhu
2023-06-08 21:43:43 -07:00
parent a3a749f80d
commit b11268e393
2 changed files with 23 additions and 20 deletions

View File

@@ -1 +1,2 @@
DIST pulsar-bin-1.105.0.tar.gz 228995179 BLAKE2B b4b185a161374590b68e2efbd5b2f37ec59278f71cc30ef519c3a67ae546ea9b73f2e2e50eabd8b07855e291704f4d994428f58dca24e144713e4996fe053b03 SHA512 f2ed05bebe81735c21ac80ff82ec051aebc9ec54e8f2ffce0e4e17f0fc6b221992ca5909271f04334211e494647cfef9f1555f0f439ee77c63488585f255f810
DIST pulsar-bin-1.105.0-amd64.tar.gz 228995179 BLAKE2B b4b185a161374590b68e2efbd5b2f37ec59278f71cc30ef519c3a67ae546ea9b73f2e2e50eabd8b07855e291704f4d994428f58dca24e144713e4996fe053b03 SHA512 f2ed05bebe81735c21ac80ff82ec051aebc9ec54e8f2ffce0e4e17f0fc6b221992ca5909271f04334211e494647cfef9f1555f0f439ee77c63488585f255f810
DIST pulsar-bin-1.105.0-arm64.tar.gz 190376758 BLAKE2B 4901f01497f7a015f95f77126f91f7817ffa8bd82d10066f741dd53dd67ec6f43bec1f7a34d949f00f2efed9f36b0f19745fb71abbc6074ca248f08d4159062a SHA512 e201118befcc14308f1383309fd0a7a258f72d1aa31b59da8ffb863ab9a43b821b5285dfe4fde1ccdf8f92121c1898b8022f604362e7415dcf7d8fc05d8de512

View File

@@ -7,12 +7,14 @@ inherit desktop xdg
DESCRIPTION="A Community-led Hyper-Hackable Text Editor"
HOMEPAGE="https://pulsar-edit.dev/"
SRC_URI="https://github.com/pulsar-edit/pulsar/releases/download/v${PV}/Linux.pulsar-${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI="
amd64? ( https://github.com/pulsar-edit/pulsar/releases/download/v${PV}/Linux.pulsar-${PV}.tar.gz -> ${P}-amd64.tar.gz )
arm64? ( https://github.com/pulsar-edit/pulsar/releases/download/v${PV}/ARM.Linux.pulsar-${PV}-arm64.tar.gz -> ${P}-arm64.tar.gz )
"
LICENSE="MIT"
SLOT="0"
# Need different downloads for other architectures; untested
KEYWORDS="-* ~amd64"
KEYWORDS="-* ~amd64 ~arm64"
RESTRICT="test"
S="${WORKDIR}/pulsar-${PV}"
@@ -50,6 +52,14 @@ RDEPEND="
QA_PREBUILT="/opt/Pulsar/*"
QA_PRESTRIPPED="/opt/Pulsar/resources/*" # Files are already stripped
src_unpack(){
default
if use arm64; then
mv "pulsar-${PV}-arm64" "pulsar-${PV}" || die
fi
}
src_prepare(){
default
@@ -58,26 +68,18 @@ src_prepare(){
}
src_install(){
insinto /opt/Pulsar
doins -r "${S}"/*
dosym ../../opt/Pulsar/resources/pulsar.sh "${EPREFIX}"/usr/bin/pulsar
fperms +x /opt/Pulsar/resources/pulsar.sh
fperms +x /opt/Pulsar/pulsar
dodir /opt/Pulsar
mv "${S}"/* "${ED}"/opt/Pulsar
# I will use only npm provided with package itself
# as nodejs is not required to make it working (and it is really big).
fperms +x /opt/Pulsar/resources/app/ppm/bin/{apm,node,npm}
# Bug 798459
fperms +x /opt/Pulsar/resources/app.asar.unpacked/node_modules/{vscode-ripgrep/bin/rg,dugite/git/bin/git}
fperms +x /opt/Pulsar/resources/app.asar.unpacked/node_modules/fuzzy-finder/node_modules/vscode-ripgrep/bin/rg
fperms +x /opt/Pulsar/resources/app.asar.unpacked/node_modules/whats-my-line/node_modules/dugite/git/bin/git
dosym ../../opt/Pulsar/resources/pulsar.sh /usr/bin/pulsar
# Bug #906939
rm "${ED}"/opt/Pulsar/resources/app.asar.unpacked/node_modules/tree-sitter-bash/build/node_gyp_bins/python3
rmdir "${ED}"/opt/Pulsar/resources/app.asar.unpacked/node_modules/tree-sitter-bash/build/node_gyp_bins
if use amd64; then
rm "${ED}"/opt/Pulsar/resources/app.asar.unpacked/node_modules/tree-sitter-bash/build/node_gyp_bins/python3
rmdir "${ED}"/opt/Pulsar/resources/app.asar.unpacked/node_modules/tree-sitter-bash/build/node_gyp_bins
fi
doicon resources/pulsar.png
doicon "${ED}"/opt/Pulsar/resources/pulsar.png
make_desktop_entry "/usr/bin/pulsar %F" "Pulsar" "pulsar" \
"GNOME;GTK;Utility;TextEditor;Development;" \
"GenericName=Text Editor\nStartupNotify=true\nStartupWMClass=pulsar\n" \