From c4bd7d6c3888ea835c98ec20de2ffd7ba74dd988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Mon, 23 Dec 2024 12:13:42 -0800 Subject: [PATCH 1/8] Add `pdb2fasta` --- recipes/pdb2fasta/build.sh | 4 ++++ recipes/pdb2fasta/meta.yaml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 recipes/pdb2fasta/build.sh create mode 100644 recipes/pdb2fasta/meta.yaml diff --git a/recipes/pdb2fasta/build.sh b/recipes/pdb2fasta/build.sh new file mode 100644 index 0000000000000..43a72037a8c87 --- /dev/null +++ b/recipes/pdb2fasta/build.sh @@ -0,0 +1,4 @@ +#!/bin/bash -euo + +g++ -O3 pdb2fasta.cpp -o pdb2fasta -static +mv pdb2fasta ${PREFIX}/bin diff --git a/recipes/pdb2fasta/meta.yaml b/recipes/pdb2fasta/meta.yaml new file mode 100644 index 0000000000000..1f966cda7ecd4 --- /dev/null +++ b/recipes/pdb2fasta/meta.yaml @@ -0,0 +1,36 @@ +{% set name = "pdb2fasta" %} +{% set version = "1.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + url: https://github.com/kad-ecoli/{{ name }}/archive/refs/tags/{{ version }}.tar.gz + sha256: 63c22998df75c0a1ee9c00051d4d401e45b13651a09b98bb2885a86bc342b7bf + +build: + number: 0 + run_exports: + - {{ pin_subpackage('pdb2fasta', max_pin="x") }} + +requirements: + build: + - {{ compiler('cxx') }} + +test: + commands: + - pdb2fasta + +about: + home: "https://github.com/kad-ecoli/pdb2fasta" + license: "GPL-2-only" + license_family: GPL2 + license_file: License.txt + summary: "Convert PDB structures to FASTA sequences." + dev_url: "https://github.com/kad-ecoli/pdb2fasta" + +extra: + additional-platforms: + - linux-aarch64 + - osx-arm64 From 8f1cca6b3ceef10d874054a3238236ee132b4f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Mon, 23 Dec 2024 15:02:25 -0800 Subject: [PATCH 2/8] Use ${CXX} --- recipes/pdb2fasta/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/pdb2fasta/build.sh b/recipes/pdb2fasta/build.sh index 43a72037a8c87..0f8270df52e27 100644 --- a/recipes/pdb2fasta/build.sh +++ b/recipes/pdb2fasta/build.sh @@ -1,4 +1,4 @@ #!/bin/bash -euo -g++ -O3 pdb2fasta.cpp -o pdb2fasta -static +${CXX} -O3 pdb2fasta.cpp -o pdb2fasta -static mv pdb2fasta ${PREFIX}/bin From 368580be4a442271723d4271d07acb4167c8ac2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Mon, 23 Dec 2024 17:45:39 -0800 Subject: [PATCH 3/8] Use `CXXFLAGS` --- recipes/pdb2fasta/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/pdb2fasta/build.sh b/recipes/pdb2fasta/build.sh index 0f8270df52e27..323dd53499196 100644 --- a/recipes/pdb2fasta/build.sh +++ b/recipes/pdb2fasta/build.sh @@ -1,4 +1,5 @@ #!/bin/bash -euo -${CXX} -O3 pdb2fasta.cpp -o pdb2fasta -static +mkdir -p ${PREFIX}/bin +${CXX} ${CXXFLAGS} -static pdb2fasta.cpp -o pdb2fasta mv pdb2fasta ${PREFIX}/bin From 6cb9d6d85328c345a6404a9426b10aa4781285e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Mon, 23 Dec 2024 18:03:27 -0800 Subject: [PATCH 4/8] Patch stdlib --- recipes/pdb2fasta/build.sh | 2 +- recipes/pdb2fasta/meta.yaml | 2 ++ recipes/pdb2fasta/pdb2fasta.patch | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 recipes/pdb2fasta/pdb2fasta.patch diff --git a/recipes/pdb2fasta/build.sh b/recipes/pdb2fasta/build.sh index 323dd53499196..36f8ffb3ee0f0 100644 --- a/recipes/pdb2fasta/build.sh +++ b/recipes/pdb2fasta/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -euo mkdir -p ${PREFIX}/bin -${CXX} ${CXXFLAGS} -static pdb2fasta.cpp -o pdb2fasta +${CC} ${CFLAGS} pdb2fasta.cpp -o pdb2fasta mv pdb2fasta ${PREFIX}/bin diff --git a/recipes/pdb2fasta/meta.yaml b/recipes/pdb2fasta/meta.yaml index 1f966cda7ecd4..c6eb6eb29d547 100644 --- a/recipes/pdb2fasta/meta.yaml +++ b/recipes/pdb2fasta/meta.yaml @@ -8,6 +8,8 @@ package: source: url: https://github.com/kad-ecoli/{{ name }}/archive/refs/tags/{{ version }}.tar.gz sha256: 63c22998df75c0a1ee9c00051d4d401e45b13651a09b98bb2885a86bc342b7bf + patches: + - pdb2fasta.patch build: number: 0 diff --git a/recipes/pdb2fasta/pdb2fasta.patch b/recipes/pdb2fasta/pdb2fasta.patch new file mode 100644 index 0000000000000..e97d2f625cabd --- /dev/null +++ b/recipes/pdb2fasta/pdb2fasta.patch @@ -0,0 +1,8 @@ +diff --git a/pdb2fasta.c b/pdb2fasta.c +index 9642d03..f197f1f 100644 +--- a/pdb2fasta.c ++++ b/pdb2fasta.c +@@ -1,3 +1,4 @@ ++#include + #include + #include From 16703335e7f05f83130dc0923fdfa1daab63e262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Mon, 23 Dec 2024 18:09:25 -0800 Subject: [PATCH 5/8] Fix extension --- recipes/pdb2fasta/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/pdb2fasta/build.sh b/recipes/pdb2fasta/build.sh index 36f8ffb3ee0f0..6c43b17ac63ef 100644 --- a/recipes/pdb2fasta/build.sh +++ b/recipes/pdb2fasta/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -euo mkdir -p ${PREFIX}/bin -${CC} ${CFLAGS} pdb2fasta.cpp -o pdb2fasta +${CC} ${CFLAGS} pdb2fasta.c -o pdb2fasta mv pdb2fasta ${PREFIX}/bin From 79f3adddea77ad61699e57e4a3903858ca8d5fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B4nio=20Camargo?= Date: Mon, 23 Dec 2024 18:29:44 -0800 Subject: [PATCH 6/8] Test with help dialogue --- recipes/pdb2fasta/build.sh | 2 +- recipes/pdb2fasta/meta.yaml | 2 +- recipes/pdb2fasta/pdb2fasta.patch | 34 ++++++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/recipes/pdb2fasta/build.sh b/recipes/pdb2fasta/build.sh index 6c43b17ac63ef..6dfee62b849e2 100644 --- a/recipes/pdb2fasta/build.sh +++ b/recipes/pdb2fasta/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -euo mkdir -p ${PREFIX}/bin -${CC} ${CFLAGS} pdb2fasta.c -o pdb2fasta +${CC} -O2 pdb2fasta.c -o pdb2fasta mv pdb2fasta ${PREFIX}/bin diff --git a/recipes/pdb2fasta/meta.yaml b/recipes/pdb2fasta/meta.yaml index c6eb6eb29d547..f1a27eb513069 100644 --- a/recipes/pdb2fasta/meta.yaml +++ b/recipes/pdb2fasta/meta.yaml @@ -22,7 +22,7 @@ requirements: test: commands: - - pdb2fasta + - pdb2fasta --help about: home: "https://github.com/kad-ecoli/pdb2fasta" diff --git a/recipes/pdb2fasta/pdb2fasta.patch b/recipes/pdb2fasta/pdb2fasta.patch index e97d2f625cabd..d0cf696829648 100644 --- a/recipes/pdb2fasta/pdb2fasta.patch +++ b/recipes/pdb2fasta/pdb2fasta.patch @@ -1,8 +1,40 @@ diff --git a/pdb2fasta.c b/pdb2fasta.c -index 9642d03..f197f1f 100644 +index 9642d03..9e8eef1 100644 --- a/pdb2fasta.c +++ b/pdb2fasta.c @@ -1,3 +1,4 @@ +#include #include #include + +@@ -99,14 +100,24 @@ char *pdb2fasta(char *pdb_file){ + } + + int main(int argc, char** argv){ +- if (argc<2){ +- printf("pdb2fasta pdb.pdb > seq.fasta\n"); +- printf(" convert PDB file pdb.pdb to FASTA sequence file seq.fasta\n"); ++ if (argc < 2){ ++ printf("Usage: pdb2fasta pdb.pdb > seq.fasta\n"); ++ printf(" Convert PDB file pdb.pdb to FASTA sequence file seq.fasta\n"); + return argc; + } +- +- int i; +- for (i=1;i seq.fasta\n"); ++ return 0; ++ } ++ ++ for (int i=1; i Date: Mon, 23 Dec 2024 18:41:54 -0800 Subject: [PATCH 7/8] Fix patch --- recipes/pdb2fasta/meta.yaml | 2 +- recipes/pdb2fasta/pdb2fasta.patch | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/pdb2fasta/meta.yaml b/recipes/pdb2fasta/meta.yaml index f1a27eb513069..ac2cbe54733d3 100644 --- a/recipes/pdb2fasta/meta.yaml +++ b/recipes/pdb2fasta/meta.yaml @@ -14,7 +14,7 @@ source: build: number: 0 run_exports: - - {{ pin_subpackage('pdb2fasta', max_pin="x") }} + - {{ pin_subpackage('pdb2fasta', max_pin="x.x") }} requirements: build: diff --git a/recipes/pdb2fasta/pdb2fasta.patch b/recipes/pdb2fasta/pdb2fasta.patch index d0cf696829648..b9182ba172719 100644 --- a/recipes/pdb2fasta/pdb2fasta.patch +++ b/recipes/pdb2fasta/pdb2fasta.patch @@ -6,10 +6,10 @@ index 9642d03..9e8eef1 100644 +#include #include #include - + @@ -99,14 +100,24 @@ char *pdb2fasta(char *pdb_file){ } - + int main(int argc, char** argv){ - if (argc<2){ - printf("pdb2fasta pdb.pdb > seq.fasta\n"); @@ -19,7 +19,7 @@ index 9642d03..9e8eef1 100644 + printf(" Convert PDB file pdb.pdb to FASTA sequence file seq.fasta\n"); return argc; } -- +- - int i; - for (i=1;i Date: Tue, 24 Dec 2024 04:11:33 -0800 Subject: [PATCH 8/8] Update compiler --- recipes/pdb2fasta/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/pdb2fasta/meta.yaml b/recipes/pdb2fasta/meta.yaml index ac2cbe54733d3..593a3eadf9376 100644 --- a/recipes/pdb2fasta/meta.yaml +++ b/recipes/pdb2fasta/meta.yaml @@ -18,7 +18,7 @@ build: requirements: build: - - {{ compiler('cxx') }} + - {{ compiler('c') }} test: commands: