diff options
-rw-r--r-- | binutils/build.sh | 40 | ||||
-rw-r--r-- | bzip2/build.sh | 6 | ||||
-rw-r--r-- | curl/build.sh | 4 | ||||
-rw-r--r-- | gcc/build.sh | 25 | ||||
-rw-r--r-- | gettext/build.sh | 16 | ||||
-rw-r--r-- | git/build.sh | 23 | ||||
-rw-r--r-- | gmp/build.sh | 10 | ||||
-rw-r--r-- | hstcal-git/build.sh | 51 | ||||
-rw-r--r-- | hstcal/build.sh | 21 | ||||
-rw-r--r-- | isl/build.sh | 32 | ||||
-rw-r--r-- | libiconv/build.sh | 31 | ||||
-rw-r--r-- | libxml2/build.sh | 23 | ||||
-rw-r--r-- | mpc/build.sh | 4 | ||||
-rw-r--r-- | mpfr/build.sh | 3 | ||||
-rw-r--r-- | python/build.sh | 18 | ||||
-rw-r--r-- | tcl/build.sh | 3 | ||||
-rw-r--r-- | tk/build.sh | 20 |
17 files changed, 280 insertions, 50 deletions
diff --git a/binutils/build.sh b/binutils/build.sh index 9743b96..635fdcb 100644 --- a/binutils/build.sh +++ b/binutils/build.sh @@ -25,27 +25,39 @@ function prepare() { tar xf ${name}-${version}.tar.gz mkdir -p ${blddir} cd "${blddir}" + + if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}/lib" + fi } function build() { - export LD_LIBRARY_PATH="${_runtime}/lib:${_prefix}/lib64" - export LDFLAGS="$LDFLAGS -L${_runtime}/lib64" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${_runtime}/lib64/pkgconfig" + opts=( + --enable-shared + --enable-lto + --enable-ld=default + --enable-plugins + --enable-threads + --disable-static + --disable-multilib + --with-system-zlib + --with-sysroot=/ + --with-tune=generic + ) + + if [[ $(uname -s) == Linux ]]; then + opts+=(--target=x86_64-pc-linux-gnu) + export LD_LIBRARY_PATH="${_runtime}/lib:${_prefix}/lib64" + export LDFLAGS="$LDFLAGS -L${_runtime}/lib64" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:${_runtime}/lib64/pkgconfig" + fi + ../${src}/configure \ --prefix=${_prefix} \ --libdir=${_prefix}/lib \ --with-lib-path=${_prefix}/lib:${_runtime}/lib:${_prefix}/lib64:${_runtime}/lib64:/lib64:/usr/lib64:/usr/local/lib:/usr/local/lib64 \ - --target=x86_64-pc-linux-gnu \ - --enable-shared \ - --enable-lto \ - --enable-ld=default \ - --enable-plugins \ - --enable-threads \ - --disable-static \ - --disable-multilib \ - --with-system-zlib \ - --with-sysroot=/ \ - --with-tune=generic + ${opts[@]} + make -j${_maxjobs} } diff --git a/bzip2/build.sh b/bzip2/build.sh index 4ddf384..fb9f438 100644 --- a/bzip2/build.sh +++ b/bzip2/build.sh @@ -34,7 +34,7 @@ function package() { lib_format_short=${lib_type}.${version%.*} if [[ $(uname -s) == Darwin ]]; then lib_format_darwin=${version}.${lib_type} - lib_format_darwin_short=${version%.*}.${lib_type} + lib_format_darwin_short="${version%.*}".${lib_type} mv libbz2.${lib_format} libbz2.${lib_format_darwin} # Remove remaining Linux-style shared libraries @@ -48,6 +48,10 @@ function package() { install_name_tool -id libbz2.${lib_format_darwin_short} \ libbz2.${lib_format_darwin} + # Reset LC_LOAD_DYLIB record to use expected naming conventions + install_name_tool -change libbz2.${lib_format_short} libbz2.${lib_format_darwin_short} \ + bzip2-shared + lib_format=${lib_format_darwin} lib_format_short=${lib_format_darwin_short} fi diff --git a/curl/build.sh b/curl/build.sh index a6b4562..9f4f48b 100644 --- a/curl/build.sh +++ b/curl/build.sh @@ -20,6 +20,10 @@ depends=( function prepare() { tar xf ${name}-${version}.tar.xz cd ${name}-${version} + + if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}/lib" + fi } function build() { diff --git a/gcc/build.sh b/gcc/build.sh index 30f3382..f9d3195 100644 --- a/gcc/build.sh +++ b/gcc/build.sh @@ -13,10 +13,13 @@ build_depends=( "zlib" ) depends=( - "binutils" + "isl" "mpc" + "mpfr" + "gmp" "zlib" ) +[[ $(uname -s) == Linux ]] && depends+=("binutils") src=${name}-${version} blddir=${src}_build @@ -26,7 +29,8 @@ function prepare() { tar xf cloog-${version_cloog}.tar.gz -C ${src} pushd ${src} ln -s cloog-${version_cloog} cloog - sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in + cp gcc/Makefile.in gcc/Makefile.in.orig + sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in #sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64 #./contrib/download_prerequisites popd @@ -40,6 +44,13 @@ function build() { unset CPPFLAGS unset LDFLAGS + opts=() + if [[ $(uname -s) == Darwin ]]; then + sdk_path=$(xcrun --sdk macosx --show-sdk-path) + opts+=(--with-native-system-header-dir=/usr/include) + opts+=(--with-sysroot="${sdk_path}") + fi + ../${src}/configure \ --prefix=${_prefix} \ --libdir=${_prefix}/lib \ @@ -50,6 +61,7 @@ function build() { --disable-werror \ --disable-libunwind-exceptions \ --disable-libstdcxx-pch \ + ${opts[@]} \ --with-system-zlib \ --with-tune=generic \ --with-gmp=${_runtime} \ @@ -69,9 +81,12 @@ function build() { function package() { mkdir -p "${_pkgdir}${_prefix}"/lib - pushd "${_pkgdir}${_prefix}" - ln -sfr lib lib64 - popd + + if [[ $(uname -s) == Linux ]]; then + pushd "${_pkgdir}${_prefix}" + ln -sf lib lib64 + popd + fi make install-strip DESTDIR="${_pkgdir}" diff --git a/gettext/build.sh b/gettext/build.sh index 6adab04..084dee6 100644 --- a/gettext/build.sh +++ b/gettext/build.sh @@ -18,7 +18,21 @@ function prepare() { } function build() { - ./configure --prefix=${_prefix} + conf=() + if [[ $(uname -s) == Darwin ]]; then + conf+=(--with-included-gettext) + conf+=(--with-included-glib) + conf+=(--with-included-libcroco) + conf+=(--with-included-libunistring) + conf+=(--disable-java) + conf+=(--disable-csharp) + conf+=(--without-git) + conf+=(--without-cvs) + conf+=(--without-xz) + fi + + ./configure --prefix=${_prefix} \ + ${conf[@]} make -j${_maxjobs} } diff --git a/git/build.sh b/git/build.sh index e056352..22a4aed 100644 --- a/git/build.sh +++ b/git/build.sh @@ -8,36 +8,41 @@ sources=( build_depends=( "autoconf" "automake" - "curl" - "gettext" "libtool" - "openssl" - "pcre" - "tk" - "zlib" + "pkgconf" ) depends=( "curl" + "gettext" + "libiconv" "openssl" "pcre" + "perl" + "python" "tk" "zlib" ) - function prepare() { tar xf v${version}.tar.gz cd ${name}-${version} + + if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}/lib" + fi } function build() { - export LDFLAGS="${LDFLAGS} -Wl,-rpath=${_prefix}/lib" make configure + spm_debug_shell ./configure --prefix=${_prefix} \ --libdir=${_prefix}/lib \ --with-curl \ --with-expat \ - --with-tcltk + --with-tcltk \ + --with-python=${_runtime} \ + --with-perl=${_runtime} \ + --with-zlib=${_runtime} make -j${_maxjobs} } diff --git a/gmp/build.sh b/gmp/build.sh index 661c87a..1b43661 100644 --- a/gmp/build.sh +++ b/gmp/build.sh @@ -17,7 +17,15 @@ function prepare() { } function build() { - ./configure --prefix=${_prefix} + opts=() + + if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}/lib" + opts+=(--disable-assembly) + fi + + ./configure --prefix=${_prefix} \ + ${opts[@]} make -j${_maxjobs} } diff --git a/hstcal-git/build.sh b/hstcal-git/build.sh new file mode 100644 index 0000000..32024eb --- /dev/null +++ b/hstcal-git/build.sh @@ -0,0 +1,51 @@ +#!/bin/bash +name=hstcal +version=2.3.2 +revision=0 +sources=() +build_depends=( + "git" + "python" + "gcc==8.4.0" +) +depends=( + "cfitsio" +) + +_waf_version=2.0.20 + +function use_git_version() { + version=$( set -o pipefail + git describe --long 2>/dev/null \ + | sed 's/^[v|V]-//;s/\([^-]*-g\)/r\1/;s/-/\+/g' \ + || printf "r%s+%s" \ + "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) + spm_build_update_metadata +} + +function prepare() { + curl -L https://waf.io/waf-${_waf_version} > waf + chmod +x waf + + git clone https://github.com/spacetelescope/${name} + cd ${name} + use_git_version + + if [[ $(uname -s) == Darwin ]]; then + CC="${_runtime}/bin/gcc" + LDFLAGS="-L${_runtime}/lib" + + export CC + fi +} + +function build() { + ./waf configure --prefix="${_prefix}" +} + +function package() { + ./waf install --destdir="${_pkgdir}" +} + + diff --git a/hstcal/build.sh b/hstcal/build.sh index 0e9f496..a83dff8 100644 --- a/hstcal/build.sh +++ b/hstcal/build.sh @@ -1,6 +1,6 @@ #!/bin/bash name=hstcal -version=2.3.1 +version=2.3.2 revision=0 sources=() build_depends=( @@ -12,7 +12,7 @@ depends=( "cfitsio" ) -_waf_version=2.0.18 +_waf_version=2.0.20 function prepare() { curl -L https://waf.io/waf-${_waf_version} > waf @@ -20,17 +20,24 @@ function prepare() { git clone https://github.com/spacetelescope/${name} cd ${name} - git checkout ${version} + + if [[ $(uname -s) == Darwin ]]; then + CC="${_runtime}/bin/gcc" + LDFLAGS="-L${_runtime}/lib" + + export CC + fi + + cp wscript ../wscript.orig + sed -E 's|platform.popen(.*)\.read\(\)|call\1|' ../wscript.orig > wscript } function build() { - ../waf configure --prefix=${_prefix} -echo debug -bash + ./waf configure --prefix="${_prefix}" } function package() { - ../waf install --destdir="${_pkgdir}" + ./waf install --destdir="${_pkgdir}" } diff --git a/isl/build.sh b/isl/build.sh new file mode 100644 index 0000000..86f843b --- /dev/null +++ b/isl/build.sh @@ -0,0 +1,32 @@ +#!/bin/bash +name=isl +version=0.18 +revision=0 +sources=( + "https://gcc.gnu.org/pub/gcc/infrastructure/${name}-${version}.tar.bz2" +) +build_depends=( + "bzip2" +) +depends=( + "gmp" + "mpfr" +) + +function prepare() { + tar xf ${name}-${version}.tar.bz2 + cd ${name}-${version} + + if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}/lib" + fi +} + +function build() { + ./configure --prefix=${_prefix} + make -j${_maxjobs} +} + +function package() { + make install DESTDIR="${_pkgdir}" +} diff --git a/libiconv/build.sh b/libiconv/build.sh new file mode 100644 index 0000000..b1ca840 --- /dev/null +++ b/libiconv/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash +name=libiconv +version=1.16 +revision=0 +sources=( + "http://mirror.rit.edu/gnu/${name}/${name}-${version}.tar.gz" +) +build_depends=( + "gettext" + "libtool" +) +depends=() + +function prepare() { + tar xf ${name}-${version}.tar.gz + cd ${name}-${version} + + if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}" + fi +} + +function build() { + ./configure --prefix=${_prefix} \ + --enable-shared + make -j${_maxjobs} +} + +function package() { + make install DESTDIR="${_pkgdir}" +} diff --git a/libxml2/build.sh b/libxml2/build.sh index 8bd6ca6..437a9dd 100644 --- a/libxml2/build.sh +++ b/libxml2/build.sh @@ -9,22 +9,43 @@ build_depends=( "automake" "autoconf" "libtool" + "pkgconf" ) depends=( "icu" + "libiconv" + "xz" + "zlib" ) +lib_type=so + function prepare() { tar xf v${version}.tar.gz cd ${name}-${version} + if [[ $(uname -s) == Darwin ]]; then + lib_type=dylib + LDFLAGS="-L${_runtime}" + fi } function build() { sh autogen.sh - ./configure --prefix="${_prefix}" + ./configure --prefix="${_prefix}" \ + --with-icu \ + --with-iconv="${_runtime}" \ + --with-libz="${_runtime}" \ + --with-lzma="${_runtime}" make -j${_maxjobs} } function package() { make install DESTDIR="${_pkgdir}" + if [[ $(uname -s) == Darwin ]]; then + pushd "${_pkgdir}${_prefix}" + for prog in bin/xmlcatalog bin/xmllint; do + install_name_tool -add_rpath "${_runtime}"/lib "$prog" + done + popd + fi } diff --git a/mpc/build.sh b/mpc/build.sh index a78d912..0e21ab5 100644 --- a/mpc/build.sh +++ b/mpc/build.sh @@ -14,6 +14,10 @@ depends=( function prepare() { tar xf ${name}-${version}.tar.gz cd ${name}-${version} + + if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}/lib" + fi } function build() { diff --git a/mpfr/build.sh b/mpfr/build.sh index 10b4572..25a0a61 100644 --- a/mpfr/build.sh +++ b/mpfr/build.sh @@ -15,6 +15,9 @@ depends=( function prepare() { tar xf ${name}-${version}.tar.bz2 cd ${name}-${version} + if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}/lib" + fi } function build() { diff --git a/python/build.sh b/python/build.sh index 1115cc7..f34ae31 100644 --- a/python/build.sh +++ b/python/build.sh @@ -15,7 +15,6 @@ build_depends=( ) depends=( "bzip2" - $([[ $(uname) == Linux ]] && echo "e2fsprogs") "gdbm" "gzip" "libexpat" @@ -28,6 +27,8 @@ depends=( "sqlite" "zlib" ) +[[ $(uname) == Linux ]] && depends+=("e2fsprogs") + lib_type=so @@ -41,18 +42,23 @@ function prepare() { } function build() { - #zlib="zlib zlibmodule.c ${CFLAGS} ${LDFLAGS} -lz" - #echo "${zlib/=/ }" >> Modules/Setup - export CFLAGS="${CFLAGS} -I${_runtime}/include/ncursesw" + + if [[ $(uname -s) == Darwin ]]; then + CFLAGS="${CFLAGS} -I/usr/X11/include" + LDFLAGS="${LDFLAGS} -L/usr/X11/lib" + darwin_opt="--disable-framework" + fi + ./configure \ --prefix="${_prefix}" \ --libdir="${_prefix}/lib" \ + ${darwin_opt} \ --enable-ipv6 \ --enable-loadable-sqlite-extensions \ --enable-shared \ - $([[ $bootstrap == 0 ]] && echo --with-tcltk-includes="$(pkg-config --cflags tcl) $(pkg-config --cflags tk)") \ - $([[ $bootstrap == 0 ]] && echo --with-tcltk-libs="$(pkg-config --libs tcl) $(pkg-config --libs tk)") \ + --with-tcltk-includes="$(pkg-config --cflags tcl) $(pkg-config --cflags tk)" \ + --with-tcltk-libs="$(pkg-config --libs tcl) $(pkg-config --libs tk)" \ --with-computed-gotos \ --with-dbmliborder=gdbm:ndbm \ --with-pymalloc \ diff --git a/tcl/build.sh b/tcl/build.sh index a45ed26..2a2f8dc 100644 --- a/tcl/build.sh +++ b/tcl/build.sh @@ -31,5 +31,6 @@ function build() { function package() { make install DESTDIR="${_pkgdir}" - chmod 755 "${_pkgdir}/${_prefix}"/lib/*.${lib_type} + chmod 755 "${_pkgdir}${_prefix}"/lib/*.${lib_type} + ln -s tclsh${version%.*} "${_pkgdir}${_prefix}"/bin/tclsh } diff --git a/tk/build.sh b/tk/build.sh index 83be737..20f1075 100644 --- a/tk/build.sh +++ b/tk/build.sh @@ -12,9 +12,10 @@ build_depends=( "tcl==${version}" ) depends=( - $([[ $(uname -s) == Linux ]] && echo "libX11") "tcl==${version}" ) +[[ $(uname -s) == Linux ]] && depends+=("libX11") + lib_type=so function prepare() { @@ -22,13 +23,24 @@ function prepare() { cd ${name}${version} if [[ $(uname -s) == Darwin ]]; then + LDFLAGS="-L${_runtime}/lib" lib_type=dylib fi } function build() { cd unix + + # Patch bad library path (originally was, "path1:path2:path3:...") + cp -a Makefile.in Makefile.in.old + sed -e "s|^LIB_RUNTIME_DIR.*$|LIB_RUNTIME_DIR=${_runtime}/lib|" Makefile.in.old > Makefile.in + + if [[ $(uname -s) == Darwin ]]; then + opts="--disable-framework" + fi + ./configure --prefix=${_prefix} \ + ${opts} \ --with-tcl=${_runtime}/lib \ --with-x make -j${_maxjobs} @@ -36,8 +48,8 @@ function build() { function package() { make install DESTDIR="${_pkgdir}" - pushd "${_pkgdir}/${_prefix}"/bin - ln -s wish${version%.*} "${_pkgdir}/${_prefix}"/bin/wish + pushd "${_pkgdir}${_prefix}"/bin + ln -s wish${version%.*} "${_pkgdir}${_prefix}"/bin/wish popd - chmod 755 "${_pkgdir}/${_prefix}"/lib/*.${lib_type} + chmod 755 "${_pkgdir}${_prefix}"/lib/*.${lib_type} } |