snapgene-viewer: Add package (#203)

* snapgene: Add package

* Update BioArchLinux/snapgene-viewer/PKGBUILD

Co-authored-by: 依云 <lilydjwg@gmail.com>

* Update BioArchLinux/snapgene-viewer/PKGBUILD

Co-authored-by: 依云 <lilydjwg@gmail.com>

* Update BioArchLinux/snapgene-viewer/PKGBUILD

Co-authored-by: 依云 <lilydjwg@gmail.com>

* Update PKGBUILD

* Update PKGBUILD

* upload snapgene.sh

* upload snapgene-viewer.sh

* fix _pkgver_major_middle

* _pkgver_major_middle

* Delete BioArchLinux/snapgene directory

---------

Co-authored-by: 依云 <lilydjwg@gmail.com>
This commit is contained in:
Kiri 2024-04-05 13:43:40 +00:00 committed by GitHub
parent 3f7f216f49
commit c0c393f6f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 117 additions and 0 deletions

View file

@ -0,0 +1,97 @@
# Maintainer: Bitals <me at bitals dot xyz>
# Contributor: Matthijs Tadema <M dot J dot Tadema at gmail dot com>
# Contributor: Lorenzo Gaifas <brisvag at gmail dot com>
# Contributor: Antony Lee <anntzer dot lee at gmail dot com>
pkgname=snapgene-viewer
pkgver=7.2.0
_pkgver_major=${pkgver%%.*}
_pkgver_major_middle=${pkgver%.*}
pkgrel=1
pkgdesc='View plasmid maps, annotate features and share sequences (snapgene freeware edition)'
arch=('x86_64')
url='https://www.snapgene.com/snapgene-viewer'
license=('custom')
depends=('qt6-base'
'qt6-webchannel'
'qt6-5compat'
'qt6-declarative'
'qt6-positioning'
'qt6-svg'
'qt6-webengine'
'libsm'
'fontconfig'
'nspr'
'xz'
'expat'
'glibc'
'gcc-libs'
'libc++'
'libc++abi'
'dbus'
'krb5'
'libxcb'
'libxkbcommon-x11'
'xcb-util-image'
'xcb-util-wm'
'libx11'
'libxkbfile'
'xcb-util-keysyms'
'xcb-util-renderutil'
'nss'
'hicolor-icon-theme'
'libice'
'libglvnd'
'libxext'
'openssl-1.1'
'zlib'
'qca-qt6'
'freetype2'
'libxkbcommon'
'sh'
)
makedepends=('patchelf')
# A valid licence is required to use the full version of snapgene
source=("https://cdn.snapgene.com/downloads/SnapGeneViewer/"$_pkgver_major".x/"$_pkgver_major_middle"/"$pkgver"/snapgene_viewer_"$pkgver"_linux.rpm"
"snapgene-viewer.sh")
sha512sums=('df675f3e9c9696aa4c035e391a3eea1564e4ef5a623a88090385e509cf755bddc6e32561682b99a776dc74d6cc88a89fb960e89d0548e0d9b674403c8b8569b9'
'082c0fe6d8d5a6b8822d73589718d1baf9d4f651092c4beea8247e8a7af7ee9597858502124300111d020a07b3da612609caca21eb78fc889e6948d579ee7ea9')
package() {
cd "$pkgdir"
cp -r "$srcdir/opt" "$pkgdir"
cp -r "$srcdir/usr" "$pkgdir"
install -Dm 755 "$srcdir/snapgene-viewer.sh" "$pkgdir/usr/bin/snapgene-viewer"
install -Dm 664 "$pkgdir/opt/gslbiotech/snapgene-viewer/resources/licenseAgreement.html" "$pkgdir/usr/share/licenses/$pkgname/LICENSE.html"
sed -i 's|${INSTALLED_DIR}/snapgene-viewer "$@"|QT_QPA_PLATFORM="xcb" ${INSTALLED_DIR}/snapgene-viewer "$@"|' "$pkgdir/opt/gslbiotech/snapgene-viewer/snapgene-viewer.sh"
cd "${pkgdir}"
rm -rf usr/lib
# Fix rpath which cause "Insecure RUNPATH" or "outside of a valid path"
# Fix .so files using patchelf
cd "${pkgdir}/opt/gslbiotech/snapgene-viewer"
for file in *.so*; do
PATCHELF_OUTPUT=$(patchelf --print-rpath $file)
echo "Checking $file: $PATCHELF_OUTPUT"
# Skip file if PATCHELF_OUTPUT does not contain CURRENT_DIR
if [[ ! $PATCHELF_OUTPUT =~ "/home" ]]; then
echo "Skipping $file"
continue
fi
# Remove rpath if it not contain ORIGIN before
if [[ ! $PATCHELF_OUTPUT =~ 'ORIGIN' ]]; then
echo "Removing rpath for $file"
patchelf --remove-rpath $file
continue
fi
# Set rpath to ORIGIN if it contain ORIGIN before
echo "Setting ORIGIN rpath for $file"
patchelf --set-rpath '$ORIGIN' $file
done
# Remove rpath of snapgene
echo "Removing rpath for snapgene-viewer"
patchelf --remove-rpath snapgene-viewer
}

View file

@ -0,0 +1,16 @@
maintainers:
- github: kiri2002
email: kiri@vern.cc
build_prefix: extra-x86_64
pre_build_script: |
update_pkgver_and_pkgrel(_G.newver.strip('v'))
post_build_script: |
git_pkgbuild_commit()
update_on:
- source: regex
url: "https://www.snapgene.com/updates"
regex: '\"version\"\:\"(.*?)\"'

View file

@ -0,0 +1,4 @@
#!/bin/sh
# Snapgene Viewer is not localized and genbank exports are invalid in other
# locales, so we just set LANG=C.
LANG=C.UTF-8 /opt/gslbiotech/snapgene-viewer/snapgene-viewer.sh