Skip to content

Commit

Permalink
NECAT: add arm64 builds (#52873)
Browse files Browse the repository at this point in the history
* NECAT: add aarch64/arm64 builds

* add patch
  • Loading branch information
mencian authored Dec 18, 2024
1 parent 8b3680b commit 0531e7e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
22 changes: 15 additions & 7 deletions recipes/necat/build.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
#!/bin/bash
set -ex

mkdir -p ${PREFIX}/bin

export LDFLAGS="${LDFLAGS} -L${PREFIX}/lib"
export CFLAGS="${CFLAGS} -O3 -I${PREFIX}/include"
export CFLAGS="${CFLAGS} -O3 -Wno-incompatible-function-pointer-types -Wno-implicit-function-declaration -L${PREFIX}/lib"
export CXXFLAGS="${CXXFLAGS} -O3 -I${PREFIX}/include"

BIN_ROOT="Linux-amd64/bin"
case $(uname -m) in
arm64|aarch64) BIN_ROOT="Linux-aarch64/bin" ;;
aarch64) BIN_ROOT="Linux-aarch64/bin" ;;
arm64) BIN_ROOT="Darwin-arm64/bin" ;;
x86_64) BIN_ROOT="Linux-amd64/bin" ;;
esac

if [[ "$(uname)" == "Darwin" && "$(uname -m)" == "x86_64" ]]; then
BIN_ROOT="Darwin-amd64/bin"
fi

# build
make -C src CFLAGS+="${CFLAGS}" LDFLAGS+="${LDFLAGS}" CXXFLAGS+="${CXXFLAGS}" -j"${CPU_COUNT}"

# create and populate binary file
mkdir -p $PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM/bin/
cp -rf $BIN_ROOT/* $PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM/bin/
mkdir -p $PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM/bin
cp -rf $BIN_ROOT/Plgd $PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM/bin && rm -rf $BIN_ROOT/Plgd
rm -rf $BIN_ROOT/trim_bases_accurate*
install -v -m 0755 $BIN_ROOT/* "${PREFIX}/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM/bin"

# create calling script
mkdir -p ${PREFIX}/bin/
cat <<EOF > $PREFIX/bin/necat
#!/bin/bash
PATH=\$PATH:$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM/bin/ necat.pl "\$@"
EOF

chmod 755 ${PREFIX}/bin/necat
chmod 0755 ${PREFIX}/bin/necat
5 changes: 3 additions & 2 deletions recipes/necat/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ source:
- src_fsa_rd_extract.mk.patch
- src_fsa_rd_stat.mk.patch
- src_fsa_rd_tools.mk.patch
- simple_align.patch # [linux]

build:
skip: True # [osx]
number: 5
number: 6
run_exports:
- {{ pin_subpackage("necat", max_pin="x.x") }}

Expand Down Expand Up @@ -83,6 +83,7 @@ about:
extra:
additional-platforms:
- linux-aarch64
- osx-arm64
identifiers:
- doi:10.1038/s41467-020-20236-7
- biotools:necat
Expand Down
12 changes: 12 additions & 0 deletions recipes/necat/simple_align.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/src/fsa/simple_align.hpp b/src/fsa/simple_align.hpp
index 7344707..33949ce 100644
--- a/src/fsa/simple_align.hpp
+++ b/src/fsa/simple_align.hpp
@@ -1,6 +1,7 @@
#ifndef FSA_ALIGN_SIMPLE_ALIGN_HPP
#define FSA_ALIGN_SIMPLE_ALIGN_HPP

+#include <stdint.h>
#include <array>
#include <string>
#include <unordered_map>

0 comments on commit 0531e7e

Please sign in to comment.