mirror of
https://github.com/BioArchLinux/Packages.git
synced 2025-03-10 12:02:42 +00:00
minimap2: harden binaries and add libs to package (#192)
This commit is contained in:
parent
b5eb96dd0b
commit
01ba79589c
3 changed files with 80 additions and 9 deletions
|
@ -3,23 +3,44 @@
|
|||
|
||||
pkgname=minimap2
|
||||
pkgver=2.26
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc='A versatile pairwise aligner for genomic and spliced nucleotide sequences. https://doi.org/10.1093/bioinformatics/bty191'
|
||||
arch=('x86_64')
|
||||
url="https://github.com/lh3/${pkgname}"
|
||||
license=('MIT')
|
||||
depends=(zlib)
|
||||
provides=()
|
||||
source=("${pkgver}.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
|
||||
sha256sums=('f4c8c3459c7b87e9de6cbed7de019b48d9337c2e46b87ba81b9f72d889420b3c')
|
||||
depends=('zlib' 'glibc')
|
||||
provides=('minimap2-lite' 'sdust' 'libminimap2.so')
|
||||
source=("${pkgname}-${pkgver}.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz"
|
||||
"hardening.patch")
|
||||
sha256sums=('f4c8c3459c7b87e9de6cbed7de019b48d9337c2e46b87ba81b9f72d889420b3c'
|
||||
'ff10a6b715db2e08add52b371842778f855cb4edc9f7fc373c6e1b670ef1415f')
|
||||
|
||||
prepare() {
|
||||
cd "${pkgname}-${pkgver}"
|
||||
# Add hardening flags for binaries
|
||||
patch -p1 < "${srcdir}"/hardening.patch
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${pkgname}-${pkgver}"
|
||||
make
|
||||
# Build all binaries
|
||||
make extra
|
||||
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${pkgname}-${pkgver}"
|
||||
install -Dm644 LICENSE.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||
install -Dm644 ${pkgname} "${pkgdir}/usr/bin/${pkgname}"
|
||||
chmod +x "${pkgdir}/usr/bin/${pkgname}"
|
||||
install -Dm644 LICENSE.txt "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
|
||||
install -Dm755 libminimap2.so "${pkgdir}"/usr/lib/libminimap2.so
|
||||
install -Dm755 ${pkgname} "${pkgdir}"/usr/bin/${pkgname}
|
||||
install -Dm755 minimap2-lite "${pkgdir}"/usr/bin/minimap2-lite
|
||||
install -Dm755 sdust "${pkgdir}"/usr/bin/sdust
|
||||
# install Manpages
|
||||
install -Dm644 -t "$pkgdir/usr/share/man/man1" minimap2.1
|
||||
# install test Data
|
||||
install -d "${pkgdir}"/usr/share/${pkgname}/test
|
||||
cd test
|
||||
for file in *; do
|
||||
install -Dm644 "$file" "${pkgdir}"/usr/share/${pkgname}/test/"${file}"
|
||||
done
|
||||
}
|
||||
|
|
45
BioArchLinux/minimap2/hardening.patch
Normal file
45
BioArchLinux/minimap2/hardening.patch
Normal file
|
@ -0,0 +1,45 @@
|
|||
--- minimap2-2.26.orig/Makefile 2023-04-29 21:51:09.000000000 +0530
|
||||
+++ minimap2-2.26.new/Makefile 2023-10-21 16:56:41.816040016 +0530
|
||||
@@ -1,5 +1,6 @@
|
||||
-CFLAGS= -g -Wall -O2 -Wc++-compat #-Wextra
|
||||
-CPPFLAGS= -DHAVE_KALLOC
|
||||
+CFLAGS+= -g -Wall -fPIC -pie -O2 -Wc++-compat #-Wextra
|
||||
+CPPFLAGS+= -DHAVE_KALLOC
|
||||
+LDFLAGS += -pie
|
||||
INCLUDES=
|
||||
OBJS= kthread.o kalloc.o misc.o bseq.o sketch.o sdust.o options.o index.o \
|
||||
lchain.o align.o hit.o seed.o map.o format.o pe.o esterr.o splitidx.o \
|
||||
@@ -40,6 +41,8 @@
|
||||
|
||||
.PHONY:all extra clean depend
|
||||
.SUFFIXES:.c .o
|
||||
+NAME := minimap2
|
||||
+LIBRARY := lib$(NAME).so
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@
|
||||
@@ -48,17 +51,17 @@
|
||||
|
||||
extra:all $(PROG_EXTRA)
|
||||
|
||||
-minimap2:main.o libminimap2.a
|
||||
- $(CC) $(CFLAGS) main.o -o $@ -L. -lminimap2 $(LIBS)
|
||||
+$(LIBRARY): $(OBJS)
|
||||
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,lib$(NAME).so $^ -lm -lz -o $@
|
||||
|
||||
-minimap2-lite:example.o libminimap2.a
|
||||
- $(CC) $(CFLAGS) $< -o $@ -L. -lminimap2 $(LIBS)
|
||||
+minimap2:main.o libminimap2.so
|
||||
+ $(CC) $(LDFLAGS) main.o -o $@ -L. -lminimap2 $(LIBS)
|
||||
|
||||
-libminimap2.a:$(OBJS)
|
||||
- $(AR) -csru $@ $(OBJS)
|
||||
+minimap2-lite:example.o libminimap2.so
|
||||
+ $(CC) $(LDFLAGS) $< -o $@ -L. -lminimap2 $(LIBS)
|
||||
|
||||
sdust:sdust.c kalloc.o kalloc.h kdq.h kvec.h kseq.h ketopt.h sdust.h
|
||||
- $(CC) -D_SDUST_MAIN $(CFLAGS) $< kalloc.o -o $@ -lz
|
||||
+ $(CC) $(LDFLAGS) -D_SDUST_MAIN $(CFLAGS) $< kalloc.o -o $@ -lz
|
||||
|
||||
# SSE-specific targets on x86/x86_64
|
||||
|
|
@ -12,3 +12,8 @@ update_on:
|
|||
github: lh3/minimap2
|
||||
use_max_tag: true
|
||||
prefix: 'v'
|
||||
- source: alpm
|
||||
alpm: zlib
|
||||
repo: core
|
||||
provided: libz.so
|
||||
strip_release: true
|
||||
|
|
Loading…
Add table
Reference in a new issue