File: build.sh

package info (click to toggle)
pbbam 1.6.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,812 kB
  • sloc: cpp: 57,023; xml: 2,749; ansic: 869; python: 534; sh: 277; makefile: 187
file content (69 lines) | stat: -rwxr-xr-x 2,104 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env bash
set -vex

#########
# BUILD #
#########

# on PA, need to first build pbcopper+htslib
if [[ ${GCC_VERSION} == PA ]]; then
  pushd _deps/pbcopper
    meson \
      --default-library static \
      --libdir lib \
      --wrap-mode nofallback \
      --prefix "${bamboo_build_working_directory}/staging" \
      -Dtests=false \
      build .
    ninja -C build -v install
  popd

  wget https://github.com/samtools/htslib/releases/download/1.10.2/htslib-1.10.2.tar.bz2
  tar -xjf htslib-1.10.2.tar.bz2
  pushd htslib-1.10.2
    CFLAGS="-O3" ./configure \
      --prefix="${bamboo_build_working_directory}/staging" \
      --libdir="${bamboo_build_working_directory}/staging/lib" \
      --disable-bz2 \
      --disable-gcs \
      --disable-libcurl \
      --disable-lzma \
      --disable-plugins \
      --disable-s3

    make -j install

    # clean out unneeded cruft and shared libs,
    # as -lhts will prefer shared libraries
    rm -rf ${bamboo_build_working_directory}/staging/{bin,share}
    rm -f ${bamboo_build_working_directory}/staging/lib/*.so*

    # set pkg-config variables
    export PKG_CONFIG_LIBDIR+=":${bamboo_build_working_directory}/staging/lib/pkgconfig"

    # convert `-I` to `-isystem` in pkg-config file in order not to trigger -Werror
    sed -e 's/-I/-isystem/g' -i "${bamboo_build_working_directory}/staging/lib/pkgconfig/htslib.pc"
  popd
fi

# configure
# '--wrap-mode nofallback' prevents meson from downloading
# stuff from the internet or using subprojects.
meson \
  --werror \
  --buildtype "${BUILDTYPE:-release}" \
  --default-library "${LIBRARYTYPE:-shared}" \
  --libdir lib \
  --unity "${ENABLED_UNITY_BUILD:-off}" \
  --wrap-mode "${ENABLED_WRAP_MODE:-nofallback}" \
  --prefix "${PREFIX_ARG:-/}" \
  -Db_coverage="${ENABLED_COVERAGE:-false}" \
  -Db_lto="${ENABLED_LTO:-false}" \
  -Db_sanitize="${ENABLED_SANITIZERS:-none}" \
  -Db_lundef="${ENABLED_LUNDEF:-true}" \
  -Dcpp_debugstl="${ENABLED_DEBUGSTL:-false}" \
  -Dtests="${ENABLED_TESTS:-false}" \
  "${CURRENT_BUILD_DIR:-build}" .

# build
ninja -C "${CURRENT_BUILD_DIR:-build}" -v