Added build_style and cross-profiles dirs from xbps-src.
This commit is contained in:
parent
6751bcd379
commit
074bb4d726
|
@ -0,0 +1,45 @@
|
|||
#
|
||||
# This helper is for templates using cmake.
|
||||
#
|
||||
do_configure() {
|
||||
[ ! -d build ] && mkdir build
|
||||
cd build
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
cat > cross_${XBPS_CROSS_TRIPLET}.cmake <<_EOF
|
||||
SET(CMAKE_SYSTEM_NAME Linux)
|
||||
SET(CMAKE_SYSTEM_VERSION 1)
|
||||
|
||||
SET(CMAKE_C_COMPILER ${XBPS_CROSS_TRIPLET}-gcc)
|
||||
SET(CMAKE_CXX_COMPILER ${XBPS_CROSS_TRIPLET}-g++)
|
||||
SET(CMAKE_CROSSCOMPILING TRUE)
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH ${XBPS_CROSS_BASE})
|
||||
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
_EOF
|
||||
configure_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
|
||||
fi
|
||||
configure_args+=" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_RPATH=ON"
|
||||
|
||||
cmake ${configure_args} ..
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
cd build
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
make_install_args+=" DESTDIR=${DESTDIR}"
|
||||
|
||||
cd build
|
||||
${make_cmd} ${make_install_args} ${make_install_target}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# This helper is for templates using configure scripts (not generated
|
||||
# by the GNU autotools).
|
||||
#
|
||||
do_configure() {
|
||||
: ${configure_script:=./configure}
|
||||
|
||||
${configure_script} ${configure_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
make_install_args+=" DESTDIR=${DESTDIR}"
|
||||
|
||||
${make_cmd} ${make_install_args} ${make_install_target}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
#
|
||||
# This helper is for templates using GNU configure scripts.
|
||||
#
|
||||
do_configure() {
|
||||
: ${configure_script:=./configure}
|
||||
|
||||
# Make sure that shared libraries are built with --as-needed.
|
||||
#
|
||||
# http://lists.gnu.org/archive/html/libtool-patches/2004-06/msg00002.html
|
||||
if [ -z "$broken_as_needed" ]; then
|
||||
sed -i "s/^\([ \t]*tmp_sharedflag\)='-shared'/\1='-shared -Wl,--as-needed'/" ${configure_script}
|
||||
fi
|
||||
# Automatically detect musl toolchains.
|
||||
for f in $(find ${wrksrc} -type f -name *config*.sub); do
|
||||
cp -f ${XBPS_CROSSPFDIR}/config.sub ${f}
|
||||
done
|
||||
${configure_script} ${configure_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
make_install_args+=" DESTDIR=${DESTDIR}"
|
||||
|
||||
${make_cmd} ${make_install_args} ${make_install_target}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
#
|
||||
# This helper is for templates using GNU Makefiles.
|
||||
#
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
${make_cmd} \
|
||||
CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" \
|
||||
CPP="$CPP" AS="$AS" OBJDUMP="$OBJDUMP" STRIP="$STRIP" \
|
||||
${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
make_install_args+=" PREFIX=/usr DESTDIR=${DESTDIR}"
|
||||
|
||||
${make_cmd} ${make_install_args} ${make_install_target}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
# meta pkg build style; do nothing.
|
||||
|
||||
do_fetch() {
|
||||
:
|
||||
}
|
||||
|
||||
do_extract() {
|
||||
:
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
:
|
||||
}
|
||||
|
||||
do_build() {
|
||||
:
|
||||
}
|
||||
|
||||
do_install() {
|
||||
:
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# This helper does the required steps to be able to build and install
|
||||
# perl modules with the Module::Build method into the correct location.
|
||||
#
|
||||
# Required vars to be set by a template:
|
||||
#
|
||||
# build_style=perl-ModuleBuild
|
||||
#
|
||||
do_configure() {
|
||||
if [ -f Build.PL ]; then
|
||||
PERL_MM_USE_DEFAULT=1 PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$DESTDIR'" \
|
||||
PERL_MB_OPT="--installdirs vendor --destdir '$DESTDIR'" \
|
||||
LD="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \
|
||||
perl Build.PL ${configure_args} INSTALLDIRS=vendor
|
||||
else
|
||||
msg_error "$pkgver: cannot find Build.PL for perl module!\n"
|
||||
fi
|
||||
}
|
||||
|
||||
do_build() {
|
||||
if [ ! -x ./Build ]; then
|
||||
msg_error "$pkgver: cannot find ./Build script!\n"
|
||||
fi
|
||||
LD="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ./Build ${make_build_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
if [ ! -x ./Build ]; then
|
||||
msg_error "$pkgver: cannot find ./Build script!\n"
|
||||
fi
|
||||
./Build ${make_install_args} install
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
#
|
||||
# This helper does the required steps to be able to build and install
|
||||
# perl modules that use MakeMaker into the correct location.
|
||||
#
|
||||
# Required vars to be set by a template:
|
||||
#
|
||||
# build_style=perl-module
|
||||
#
|
||||
# Optionally if the module needs more directories to be configured other
|
||||
# than $XBPS_BUILDDIR/$wrksrc, one can use (relative to $wrksrc):
|
||||
#
|
||||
# perl_configure_dirs="blob/bob foo/blah"
|
||||
#
|
||||
do_configure() {
|
||||
local perlmkf
|
||||
|
||||
if [ -z "$perl_configure_dirs" ]; then
|
||||
perlmkf="$wrksrc/Makefile.PL"
|
||||
if [ ! -f $perlmkf ]; then
|
||||
msg_error "*** ERROR couldn't find $perlmkf, aborting ***\n"
|
||||
fi
|
||||
|
||||
cd $wrksrc
|
||||
PERL_MM_USE_DEFAULT=1 LD="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \
|
||||
perl Makefile.PL ${configure_args} INSTALLDIRS=vendor
|
||||
fi
|
||||
|
||||
for i in "$perl_configure_dirs"; do
|
||||
perlmkf="$wrksrc/$i/Makefile.PL"
|
||||
if [ -f $perlmkf ]; then
|
||||
cd $wrksrc/$i
|
||||
PERL_MM_USE_DEFAULT=1 LD="$CC" CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" \
|
||||
perl Makefile.PL ${make_build_args} INSTALLDIRS=vendor
|
||||
else
|
||||
msg_error "*** ERROR: couldn't find $perlmkf, aborting **\n"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
do_build() {
|
||||
: ${make_cmd:=make}
|
||||
|
||||
${make_cmd} ${makejobs} ${make_build_args} ${make_build_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
: ${make_cmd:=make}
|
||||
: ${make_install_target:=install}
|
||||
|
||||
make_install_args+=" DESTDIR=${DESTDIR}"
|
||||
|
||||
${make_cmd} ${make_install_args} ${make_install_target}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
#
|
||||
# This helper is for templates installing python modules.
|
||||
#
|
||||
XBPS_PYVER="2.7" # currently 2.7 is the default python
|
||||
|
||||
do_build() {
|
||||
if [ -n "$CROSS_BUILD" ]; then
|
||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread"
|
||||
LDSHARED="${CC} -shared"
|
||||
PYPREFIX="$XBPS_CROSS_BASE"
|
||||
CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/include/python${XBPS_PYVER} -I${XBPS_CROSS_BASE}/usr/include"
|
||||
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/lib/python${XBPS_PYVER} -L${XBPS_CROSS_BASE}/lib"
|
||||
env CC="$CC" LDSHARED="$LDSHARED" \
|
||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||
LDFLAGS="$LDFLAGS" python setup.py build ${make_build_args}
|
||||
else
|
||||
python setup.py build ${make_build_args}
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
make_install_args+=" --prefix=/usr --root=$DESTDIR"
|
||||
|
||||
if [ -n "$CROSS_BUILD" ]; then
|
||||
CC="${XBPS_CROSS_TRIPLET}-gcc -pthread"
|
||||
LDSHARED="${CC} -shared"
|
||||
PYPREFIX="$XBPS_CROSS_BASE"
|
||||
CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/include/python${XBPS_PYVER} -I${XBPS_CROSS_BASE}/usr/include"
|
||||
LDFLAGS="$LDFLAGS -L${XBPS_CROSS_BASE}/lib/python${XBPS_PYVER} -L${XBPS_CROSS_BASE}/lib"
|
||||
env CC="$CC" LDSHARED="$LDSHARED" \
|
||||
PYPREFIX="$PYPREFIX" CFLAGS="$CFLAGS" \
|
||||
LDFLAGS="$LDFLAGS" python setup.py install ${make_install_args}
|
||||
else
|
||||
python setup.py install ${make_install_args}
|
||||
fi
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# This helper is for templates using WAF to build/install.
|
||||
#
|
||||
do_configure() {
|
||||
python waf configure --prefix=/usr ${configure_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
python waf build ${make_build_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
make_install_args+=" --destdir=${DESTDIR}"
|
||||
|
||||
python waf install ${make_install_args}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#
|
||||
# This helper is for templates using WAF with python3 to build/install.
|
||||
#
|
||||
do_configure() {
|
||||
PYTHON=python3 python3 waf configure --prefix=/usr ${configure_args}
|
||||
}
|
||||
|
||||
do_build() {
|
||||
PYTHON=python3 python3 waf build ${make_build_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
make_install_args+=" --destdir=$DESTDIR"
|
||||
|
||||
PYTHON=python3 python3 waf install ${make_install_args}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for ARM EABI5 Hard Float and Musl libc.
|
||||
|
||||
XBPS_TARGET_ARCH="armv6l"
|
||||
XBPS_CROSS_TRIPLET="arm-linux-musleabi"
|
||||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for ARM GNU EABI5 Hard Float.
|
||||
|
||||
XBPS_TARGET_ARCH="armv6l"
|
||||
XBPS_CROSS_TRIPLET="arm-linux-gnueabihf"
|
||||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for ARMv7 GNU EABI Hard Float.
|
||||
|
||||
XBPS_TARGET_ARCH="armv7l"
|
||||
XBPS_CROSS_TRIPLET="arm-linux-gnueabihf"
|
||||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-march=armv7 -mfpu=vfpv3 -mfloat-abi=hard"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for i686 and Musl libc.
|
||||
|
||||
XBPS_TARGET_ARCH="i686"
|
||||
XBPS_CROSS_TRIPLET="i686-linux-musl"
|
||||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-march=i686"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for i686 GNU.
|
||||
|
||||
XBPS_TARGET_ARCH="i686"
|
||||
XBPS_CROSS_TRIPLET="i686-pc-linux-gnu"
|
||||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-march=i686 -mtune=generic"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for MIPS BE soft float.
|
||||
|
||||
XBPS_TARGET_ARCH="mips"
|
||||
XBPS_CROSS_TRIPLET="mips-softfloat-linux-gnu"
|
||||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -msoft-float"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for MIPS LE soft float.
|
||||
|
||||
XBPS_TARGET_ARCH="mipsel"
|
||||
XBPS_CROSS_TRIPLET="mipsel-softfloat-linux-gnu"
|
||||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-mtune=mips32r2 -mabi=32 -msoft-float"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
|
@ -0,0 +1,8 @@
|
|||
# Cross build profile for x86_64 and Musl libc.
|
||||
|
||||
XBPS_TARGET_ARCH="x86_64"
|
||||
XBPS_CROSS_TRIPLET="x86_64-linux-musl"
|
||||
XBPS_CFLAGS="-O2 -pipe"
|
||||
XBPS_CXXFLAGS="$XBPS_CFLAGS"
|
||||
XBPS_CROSS_CFLAGS="-mtune=generic"
|
||||
XBPS_CROSS_CXXFLAGS="$XBPS_CROSS_CFLAGS"
|
Loading…
Reference in New Issue