Skip to content

Commit

Permalink
update d4tools and d4binding (#48077)
Browse files Browse the repository at this point in the history
* update build

* fix lint

* update build

* update path

* bump d4tools build number

* bump d4binding to 0.3.11

* clean up recipe

* clean up recipe

---------

Co-authored-by: Joshua Zhuang <[email protected]>
Co-authored-by: mencian <[email protected]>
  • Loading branch information
3 people authored Oct 23, 2024
1 parent e6b4521 commit cc53905
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 16 deletions.
3 changes: 0 additions & 3 deletions build-fail-blacklist
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,6 @@ recipes/perl-gd
# sha mismatch when downloading source
recipes/fmlrc2

# tries to download zlib itself, which fails
recipes/d4binding

# no matching package named `quickersort` found
recipes/mudskipper

Expand Down
6 changes: 4 additions & 2 deletions recipes/d4binding/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ set -x
# TODO: Remove the following export when pinning is updated and we use
# {{ compiler('rust') }} in the recipe.
export \
CARGO_NET_GIT_FETCH_WITH_CLI=true \
CARGO_HOME="${BUILD_PREFIX}/.cargo"
CARGO_NET_GIT_FETCH_WITH_CLI=true \
CARGO_HOME="${BUILD_PREFIX}/.cargo"

cp $RECIPE_DIR/build_htslib.sh d4-hts/build_htslib.sh

cd d4binding
./install.sh
63 changes: 63 additions & 0 deletions recipes/d4binding/build_htslib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

if [ "${DOCS_RS}" = "1" ]
then
exit 0
fi

set -ex

pushd ${OUT_DIR}

HTSLIB_VERSION=${1}

rm -rf ${OUT_DIR}/htslib

git clone -b ${HTSLIB_VERSION} http://github.com/samtools/htslib.git

cd htslib

cat > config.h << CONFIG_H
#define HAVE_LIBBZ2 1
#define HAVE_DRAND48 1
CONFIG_H

perl -i -pe 's/hfile_libcurl\.o//g' Makefile

function is_musl() {
if [ ! -z $(echo $TARGET | grep musl) ]; then
return 0
else
return 1
fi
}

is_musl && perl -i -pe 's/gcc/musl-gcc/g' Makefile


if [ "x${ZLIB_SRC}" != "x" ]
then
tar xz ${ZLIB_SRC}
else
curl -L 'http://github.com/madler/zlib/archive/refs/tags/v1.2.11.tar.gz' | tar xz
fi
cd zlib-1.2.11
is_musl && CC=musl-gcc ./configure || ./configure
make libz.a
cp libz.a ..
cd ..

#The original file in the repo is lacking -L in the curl command so it doen't work
curl -L http://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz | tar xz
cd bzip2-1.0.8
is_musl && perl -i -pe 's/gcc/musl-gcc/g' Makefile
is_musl || perl -i -pe 's/CFLAGS=/CFLAGS=-fPIC /g' Makefile
make
cp libbz2.a ..
cd ..

perl -i -pe 's/CPPFLAGS =/CPPFLAGS = -Izlib-1.2.11 -Ibzip2-1.0.8/g' Makefile

is_musl || perl -i -pe 's/CFLAGS *=/CFLAGS = -fPIC/g' Makefile

make -j8 lib-static
22 changes: 14 additions & 8 deletions recipes/d4binding/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,38 +1,44 @@
{% set version = "0.3.4" %}
{% set name = "d4binding" %}
{% set version = "0.3.11" %}

package:
name: d4binding
name: {{ name }}
version: {{ version }}

build:
number: 1
number: 0
run_exports:
- {{ pin_subpackage("d4binding", max_pin="x.x") }}

source:
# TODO: use formal release number when 0.3.5 is released
url: https://github.com/38/d4-format/archive/refs/tags/v{{ version }}-3.tar.gz
sha256: 05e1a410b77c34d7d188e69ef607eaa9f0babcc9817c558362203fc3f1f2219c
url: https://github.com/38/d4-format/archive/refs/tags/v{{ version }}.tar.gz
sha256: 376e61c93cfe2efc15f5e74b75214e065e278146555e67b8769818bf49594726

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- rust >=1.30
- gcc #[not osx]
- gcc # [not osx]
- clangdev
- pkg-config
- make
- cmake
run:
- starcode

test:
commands:
- "true"

about:
home: https://github.com/38/d4-format
license: MIT
license_family: MIT
summary: |
The C/C++ binding for the D4 file format
The C/C++ binding for the D4 file format.
dev_url: https://github.com/38/d4-format

extra:
recipe-maintainers:
- haohou
Expand Down
7 changes: 4 additions & 3 deletions recipes/d4tools/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{% set name = "d4tools" %}
{% set version = "0.3.11" %}

package:
name: d4tools
name: {{ name }}
version: {{ version }}

source:
url: https://github.com/38/d4-format/archive/refs/tags/v{{ version }}.tar.gz
sha256: 376e61c93cfe2efc15f5e74b75214e065e278146555e67b8769818bf49594726

build:
number: 0
number: 1
run_exports:
- {{ pin_subpackage('d4tools', max_pin="x.x") }}

Expand All @@ -35,7 +36,7 @@ about:
license: MIT
license_family: MIT
summary: |
The D4 command line utility program
The D4 command line utility program.
dev_url: https://github.com/38/d4-format

extra:
Expand Down

0 comments on commit cc53905

Please sign in to comment.