From d058732f46c3fbed749db35b6f8d536c88d2565f Mon Sep 17 00:00:00 2001 From: Kuoi Date: Sun, 14 May 2023 20:11:25 +0800 Subject: [PATCH] artemis: build from source as pre-build not work --- BioArchLinux/artemis/PKGBUILD | 90 ++++++++++++++----- {prepare => BioArchLinux}/artemis/act.desktop | 0 .../artemis/artemis.desktop | 0 .../artemis/bamview.desktop | 0 .../artemis/dnaplotter.desktop | 0 .../artemis/fix_bin.patch | 0 BioArchLinux/artemis/lilac.py | 11 --- BioArchLinux/artemis/lilac.yaml | 7 ++ {prepare => BioArchLinux}/artemis/readme | 0 prepare/artemis/PKGBUILD | 80 ++++------------- 10 files changed, 92 insertions(+), 96 deletions(-) rename {prepare => BioArchLinux}/artemis/act.desktop (100%) rename {prepare => BioArchLinux}/artemis/artemis.desktop (100%) rename {prepare => BioArchLinux}/artemis/bamview.desktop (100%) rename {prepare => BioArchLinux}/artemis/dnaplotter.desktop (100%) rename {prepare => BioArchLinux}/artemis/fix_bin.patch (100%) delete mode 100644 BioArchLinux/artemis/lilac.py rename {prepare => BioArchLinux}/artemis/readme (100%) diff --git a/BioArchLinux/artemis/PKGBUILD b/BioArchLinux/artemis/PKGBUILD index fcda9d3fb7..2f98117576 100644 --- a/BioArchLinux/artemis/PKGBUILD +++ b/BioArchLinux/artemis/PKGBUILD @@ -1,31 +1,75 @@ -# Maintainer: Clint Valentine +# Maintainer: Guoyi Zhang +# Contributor: Clint Valentine -pkgname='artemis' +pkgname=artemis +_pkgname=Artemis pkgver=18.2.0 pkgrel=5 pkgdesc='A genome viewer and annotation tool that visualizes biological sequence features' arch=('x86_64') url=https://www.sanger.ac.uk/science/tools/"${pkgname}" license=('GPL2') -depends=('java-runtime>=1.6') -source=("${pkgname}"-"${pkgver}".tar.gz::https://github.com/sanger-pathogens/Artemis/releases/download/v${pkgver}/artemis-unix-release-${pkgver}.tar.gz) -sha256sums=('06441e1abab139cb0a09d5844cb1b84ae727ace53a6c0efdd1eea8d8cfab8382') - -package() { - cd "${srcdir}"/"${pkgname}" - - sed -i 's#ARTEMIS_HOME=`dirname "$PRG"`/.#ARTEMIS_HOME=/opt/artemis/#' art - sed -i 's#ACT_HOME=`dirname "$PRG"`/.#ACT_HOME=/opt/artemis/#' act - sed -i 's#ARTEMIS_HOME=`dirname "$PRG"`/.#ARTEMIS_HOME=/opt/artemis/#' dnaplotter - - mkdir -p "${pkgdir}"/opt/"${pkgname}"/ - cp -a * "${pkgdir}"/opt/"${pkgname}"/ - - scripts=('act' 'art' 'dnaplotter') - for script in "${scripts[@]}"; do - install -Dm775 "${script}" "${pkgdir}"/usr/bin/"${script}" - rm "${pkgdir}"/opt/"${pkgname}"/"${script}" - done - - install -Dm644 README.md "${pkgdir}"/usr/share/doc/"${pkgname}"/README.md +depends=('java-runtime') +makedepends=('java-environment' 'maven') +source=($pkgname-$pkgver.tar.gz::https://github.com/sanger-pathogens/Artemis/archive/refs/tags/v${pkgver}.tar.gz + act.desktop + artemis.desktop + bamview.desktop + dnaplotter.desktop) +sha256sums=('842c055f5cce021adbaea4f076b2ea80335ab1e44fbaa34b2ab608df6314a18e' + 'a7dda77f6518c98af6df88ba5d725f1b89d86aca125240f63a9c6e08afeb2a24' + 'dea9a1cc47b110c4f6ebe17c1b698866082997ffd9e6008d89847ddf745a0789' + '3ca519b00ffac02d635a62884996ad5b8c4580d8ffe8fcd427ee4edee1562f00' + 'ef584b45f9c92da15511779f20a1a1449915315066662e4c142ea4cd92dd717c') +#prepare() { +#scripts=('act' 'art' 'bamview' 'dnaplotter') +# cd $srcdir/$_pkgname-$pkgver +# patch -N -i $srcdir/fix_bin.patch +#} +build() { + cd $srcdir/$_pkgname-$pkgver + mvn validate + mvn package +} +package() { +bina=('act' 'art' 'bamview' 'dnaplotter') +scripts=('act' 'artemis' 'bamview' 'dnaplotter') + + # desktop + cd $srcdir/ + for des in ${scripts[@]} +do + install -Dm 755 $des.desktop $pkgdir/usr/share/applications/$des.desktop +done + + # bin + cd $srcdir/$_pkgname-$pkgver + for bin in ${bina[@]} +do + install -Dm 775 $bin $pkgdir/usr/share/$pkgname/$bin +done + + # jar + cd $srcdir/$_pkgname-$pkgver/target/jars + for jar in $(ls *.jar) +do + install -Dm 755 $jar $pkgdir/usr/share/$pkgname/target/jars/$jar +done + + # icons + cd $srcdir/$_pkgname-$pkgver/target/classes/images + for icn in ${scripts[@]} +do + mv ${icn}_icon.png ${icn}.png + install -Dm 644 ${icn}.png $pkgdir/usr/share/pixmaps/${icn}.png +done + + # link bin + cd $srcdir/$_pkgname-$pkgver + mkdir -p $pkgdir/usr/bin + for bin in ${bina[@]} +do + ln -s /usr/share/$pkgname/$bin $pkgdir/usr/bin/$bin +done + } diff --git a/prepare/artemis/act.desktop b/BioArchLinux/artemis/act.desktop similarity index 100% rename from prepare/artemis/act.desktop rename to BioArchLinux/artemis/act.desktop diff --git a/prepare/artemis/artemis.desktop b/BioArchLinux/artemis/artemis.desktop similarity index 100% rename from prepare/artemis/artemis.desktop rename to BioArchLinux/artemis/artemis.desktop diff --git a/prepare/artemis/bamview.desktop b/BioArchLinux/artemis/bamview.desktop similarity index 100% rename from prepare/artemis/bamview.desktop rename to BioArchLinux/artemis/bamview.desktop diff --git a/prepare/artemis/dnaplotter.desktop b/BioArchLinux/artemis/dnaplotter.desktop similarity index 100% rename from prepare/artemis/dnaplotter.desktop rename to BioArchLinux/artemis/dnaplotter.desktop diff --git a/prepare/artemis/fix_bin.patch b/BioArchLinux/artemis/fix_bin.patch similarity index 100% rename from prepare/artemis/fix_bin.patch rename to BioArchLinux/artemis/fix_bin.patch diff --git a/BioArchLinux/artemis/lilac.py b/BioArchLinux/artemis/lilac.py deleted file mode 100644 index 95588104e1..0000000000 --- a/BioArchLinux/artemis/lilac.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python3 -from lilaclib import * - -def pre_build(): - update_pkgver_and_pkgrel(_G.newver.lstrip('v')) - run_cmd(['updpkgsums']) - -def post_build(): - git_add_files('PKGBUILD') - git_commit() - update_aur_repo() diff --git a/BioArchLinux/artemis/lilac.yaml b/BioArchLinux/artemis/lilac.yaml index 3d69955e4b..764c3eef20 100644 --- a/BioArchLinux/artemis/lilac.yaml +++ b/BioArchLinux/artemis/lilac.yaml @@ -2,6 +2,13 @@ build_prefix: extra-x86_64 maintainers: - github: starsareintherose email: kuoi@bioarchlinux.org +pre_build_script: | + update_pkgver_and_pkgrel(_G.newver.lstrip('v')) + run_cmd(['updpkgsums']) +post_build_script: | + git_add_files('PKGBUILD') + git_commit() + update_aur_repo() update_on: - source: github github: sanger-pathogens/Artemis diff --git a/prepare/artemis/readme b/BioArchLinux/artemis/readme similarity index 100% rename from prepare/artemis/readme rename to BioArchLinux/artemis/readme diff --git a/prepare/artemis/PKGBUILD b/prepare/artemis/PKGBUILD index 2f98117576..fcda9d3fb7 100644 --- a/prepare/artemis/PKGBUILD +++ b/prepare/artemis/PKGBUILD @@ -1,75 +1,31 @@ -# Maintainer: Guoyi Zhang -# Contributor: Clint Valentine +# Maintainer: Clint Valentine -pkgname=artemis -_pkgname=Artemis +pkgname='artemis' pkgver=18.2.0 pkgrel=5 pkgdesc='A genome viewer and annotation tool that visualizes biological sequence features' arch=('x86_64') url=https://www.sanger.ac.uk/science/tools/"${pkgname}" license=('GPL2') -depends=('java-runtime') -makedepends=('java-environment' 'maven') -source=($pkgname-$pkgver.tar.gz::https://github.com/sanger-pathogens/Artemis/archive/refs/tags/v${pkgver}.tar.gz - act.desktop - artemis.desktop - bamview.desktop - dnaplotter.desktop) -sha256sums=('842c055f5cce021adbaea4f076b2ea80335ab1e44fbaa34b2ab608df6314a18e' - 'a7dda77f6518c98af6df88ba5d725f1b89d86aca125240f63a9c6e08afeb2a24' - 'dea9a1cc47b110c4f6ebe17c1b698866082997ffd9e6008d89847ddf745a0789' - '3ca519b00ffac02d635a62884996ad5b8c4580d8ffe8fcd427ee4edee1562f00' - 'ef584b45f9c92da15511779f20a1a1449915315066662e4c142ea4cd92dd717c') -#prepare() { -#scripts=('act' 'art' 'bamview' 'dnaplotter') -# cd $srcdir/$_pkgname-$pkgver -# patch -N -i $srcdir/fix_bin.patch -#} -build() { - cd $srcdir/$_pkgname-$pkgver - mvn validate - mvn package -} +depends=('java-runtime>=1.6') +source=("${pkgname}"-"${pkgver}".tar.gz::https://github.com/sanger-pathogens/Artemis/releases/download/v${pkgver}/artemis-unix-release-${pkgver}.tar.gz) +sha256sums=('06441e1abab139cb0a09d5844cb1b84ae727ace53a6c0efdd1eea8d8cfab8382') + package() { -bina=('act' 'art' 'bamview' 'dnaplotter') -scripts=('act' 'artemis' 'bamview' 'dnaplotter') + cd "${srcdir}"/"${pkgname}" - # desktop - cd $srcdir/ - for des in ${scripts[@]} -do - install -Dm 755 $des.desktop $pkgdir/usr/share/applications/$des.desktop -done + sed -i 's#ARTEMIS_HOME=`dirname "$PRG"`/.#ARTEMIS_HOME=/opt/artemis/#' art + sed -i 's#ACT_HOME=`dirname "$PRG"`/.#ACT_HOME=/opt/artemis/#' act + sed -i 's#ARTEMIS_HOME=`dirname "$PRG"`/.#ARTEMIS_HOME=/opt/artemis/#' dnaplotter - # bin - cd $srcdir/$_pkgname-$pkgver - for bin in ${bina[@]} -do - install -Dm 775 $bin $pkgdir/usr/share/$pkgname/$bin -done + mkdir -p "${pkgdir}"/opt/"${pkgname}"/ + cp -a * "${pkgdir}"/opt/"${pkgname}"/ - # jar - cd $srcdir/$_pkgname-$pkgver/target/jars - for jar in $(ls *.jar) -do - install -Dm 755 $jar $pkgdir/usr/share/$pkgname/target/jars/$jar -done - - # icons - cd $srcdir/$_pkgname-$pkgver/target/classes/images - for icn in ${scripts[@]} -do - mv ${icn}_icon.png ${icn}.png - install -Dm 644 ${icn}.png $pkgdir/usr/share/pixmaps/${icn}.png -done - - # link bin - cd $srcdir/$_pkgname-$pkgver - mkdir -p $pkgdir/usr/bin - for bin in ${bina[@]} -do - ln -s /usr/share/$pkgname/$bin $pkgdir/usr/bin/$bin -done + scripts=('act' 'art' 'dnaplotter') + for script in "${scripts[@]}"; do + install -Dm775 "${script}" "${pkgdir}"/usr/bin/"${script}" + rm "${pkgdir}"/opt/"${pkgname}"/"${script}" + done + install -Dm644 README.md "${pkgdir}"/usr/share/doc/"${pkgname}"/README.md }