Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build dialign2 on OSX #51262

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion recipes/dialign2/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ mkdir -p ${PREFIX}/bin
mkdir -p ${PREFIX}/share
mkdir -p ${PREFIX}/share/dialign2

export INCLUDE_PATH="${PREFIX}/include"
export LIBRARY_PATH="${PREFIX}/lib"
export CFLAGS="${CFLAGS} -O3 -L${PREFIX}/lib"

if [[ `uname` == "Darwin" ]]; then
export CFLAGS="${CFLAGS} -Wno-implicit-int -Wno-implicit-function-declaration"
else
export CFLAGS="${CFLAGS}"
fi

cd src

sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \""${PREFIX}"/share/dialign2\" );|g" dialign.c
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Good improvement for installation flexibility, but watch out for quoting.

The use of ${PREFIX} in the sed command allows for a more flexible installation path, which is good practice and aligns with conda build conventions.

However, the static analysis tool flagged a potential issue with quoting. The surrounding quotes are actually unquoting the inner quotes, which may lead to unexpected behavior. To fix this, you can escape the inner quotes:

-sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \""${PREFIX}"/share/dialign2\" );|g" dialign.c
+sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \"${PREFIX}/share/dialign2\" );|g" dialign.c
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \""${PREFIX}"/share/dialign2\" );|g" dialign.c
sed -i.bak "s|strcpy ( dialign_dir , \"DIALIGN2_DIR\" );|strcpy ( par_dir , \"${PREFIX}/share/dialign2\" );|g" dialign.c
🧰 Tools
🪛 Shellcheck

[warning] 20-20: The surrounding quotes actually unquote this. Remove or escape them.

(SC2027)

rm -rf *.bak

make CC="${CC}"
make CC="${CC}" CFLAGS="${CFLAGS}" -j"${CPU_COUNT}"
chmod 0755 dialign2-2
mv dialign2-2 ${PREFIX}/bin/dialign2-2

cd ../dialign2_dir
Expand Down
19 changes: 11 additions & 8 deletions recipes/dialign2/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ package:
version: {{ version }}

source:
url: http://dialign.gobics.de/download/dialign_package.tgz
url: https://dialign.gobics.de/download/dialign_package.tgz
sha256: {{ sha256 }}
patches:
- patches/patchdialign.txt

build:
number: 7
skip: True # [osx]
number: 8
run_exports:
- {{ pin_subpackage('dialign2', max_pin="x") }}

requirements:
build:
Expand All @@ -22,14 +23,16 @@ requirements:

test:
commands:
- dialign2-2 |grep usage
- dialign2-2 | grep "usage"

about:
home: http://dialign.gobics.de
home: "https://dialign.gobics.de"
license: LGPL
license_file: license/LICENSE.TXT
summary: DIALIGN multiple sequence alignment using various sources of external information
license_file: "license/LICENSE.TXT"
summary: "DIALIGN multiple sequence alignment using various sources of external information."
doc_url: "https://dialign.gobics.de"

extra:
identifiers:
- DOI:10.1093/nar/gkt283
- doi:10.1093/nar/gkt283
- biotools:dialign
4 changes: 2 additions & 2 deletions recipes/dialign2/patches/patchdialign.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- dialign_package/src/dialign.c 2005-02-21 17:32:55.000000000 +0100
+++ dialign_package/src/dialign.c 2018-07-26 16:46:41.962909610 +0200
--- a/src/dialign.c 2005-02-21 17:32:55.000000000 +0100
+++ b/src/dialign.c 2018-07-26 16:46:41.962909610 +0200
@@ -294,16 +294,16 @@

strcpy ( dialign_dir , "DIALIGN2_DIR" );
Expand Down
Loading