code:
#!/bin/sh
[ -z "$CONFIG" ] && CONFIG=./config
. "$CONFIG"
export H="$PWD"
ret=0

if [ -z "$R" ] ; then
	echo 'no R environment var set, your config is broken'
	exit 1
fi

mkdir -p "$R"/src/tarballs
linux32=
if [ $(uname -m) = "x86_64" ] && [ "$A" = i386 ] ; then
	[ -x ./linux32 ] && linux32=./linux32 || {
		$CC KEEP/linux32.c -static -s -Os -o ./linux32 && linux32=./linux32 || \
		echo -ne "warning: trying to chroot into i386 rootfs on x86_64" \
		         "kernel and building linux32 command failed\n"
	}
fi

if [ ! -z "$SUPER" ] ; then
	CHROOT=./super_chroot
	if [ ! -x "$CHROOT" ] ; then
		if ! "$CC" "$K"/super_chroot.c -static -s -Os -o "$CHROOT" 2>/dev/null ; then
			echo "error: failed to build super_chroot!"
			echo "try: musl-gcc KEEP/super_chroot.c -o super_chroot"
			echo "or: unset SUPER and re-run ./enter-chroot as root."
			exit 1
		fi
	fi
else

	uid="$(id -u)"
	if [ "$uid" != "0" ]; then
	    printf -- "need to be root. please enter password.\n"
	    su -c "$0"
	    exit $?
	fi

	# prevent from mounting twice
	if [ ! -d "$R"/dev/pts ] ; then
		mount --bind /dev "$R"/dev
		mount --bind /dev/pts "$R"/dev/pts
		mount --bind /dev/shm "$R"/dev/shm
		mount --bind /proc "$R"/proc
		mount --bind "$C" "$R"/src/tarballs
	fi

	CHROOT=chroot
fi

set_title() {
	[ "$TERM" != "linux" ] && [ "$TERM" != "vt100" ] && \
	echo -en "\033]2;$1\007"
}

set_title "SABOTAGE CHROOT $(basename $R)"

echo "Entering chroot..."

$linux32 "$CHROOT" "$R" /bin/env -i \
    HOME=/root TERM="$TERM" PS1='\u:\w$ ' \
    /bin/sh --login || ret=1

tryumount() {
	dest="$1"
	if ! umount "$dest" 2>/dev/null; then
		echo "unmount failure ($dest), retrying in 1 sec..."
		sleep 1
		if ! umount -f "$dest" 2>/dev/null; then
		  echo "unmount -f failure ($dest), trying last resort umount -l"
		  umount -l "$dest"
		fi
	fi
}

if [ -z "$SUPER" ] && [ -d "$R"/dev/pts ] ; then
	tryumount "$R"/src/tarballs
	tryumount "$R"/dev/pts
	tryumount "$R"/dev/shm
	tryumount "$R"/dev
	tryumount "$R"/proc
fi

set_title "sabotage"

#echo empty line so we get a proper prompt back
echo
exit $ret

path: enter-chroot


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/915resolution-0.5.3.tar.bz2

[vars]
filesize=24203
sha512=d8282885cb6a42845bd98936f318c36872a7406781e943aa1b096f4752b074e1b5089f6be4c279770df00f4310da55fce865851aee342809b2e1a3b8a4f1713c
desc="Intel Video BIOS Hack to tweak the BIOS resolution list"

[deps]

[build]
patch -p1 < "$K"/915resolution-puppy-20120521.patch

[ -f 915resolution ] && rm -f 915resolution
[ -f 915resolution.o ] && rm -f 915resolution.o

gcc -o 915resolution $optcflags $optldflags 915resolution.c

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/bin
install -m755 -s 915resolution "$dest"/bin

repo_name: aarf/bkauler

license: unknown


code:
[deps]
musl
kernel-headers

[vars]
filesize=1045868
sha512=38108a94118b56c6f3982e692beb1068c52f9aecd74447d6b552b77fae5e365eab72b4781bdf07d9696ac89d54371c1cae8cc0363de510b53988302acef50dba

[mirrors]
http://dl.suckless.org/tools/9base-6.tar.gz

[build]
mbwc_fix() {
        local file=$1
        echo '#include "mbwc.h"' > $file
        cat troff/$file >> $file
        mv $file troff/$file
}
for i in n1.c t11.c n10.c mbwc.c ; do mbwc_fix $i ; done

echo "PREFIX = $butch_prefix" >>config.mk
# the dc calculator, called by bc, assumes a signed char,
# which is not true for ARM. it fails on "4 - 3" resp. "4 3 -ps."
# without -fsigned-char.
echo "CFLAGS += -fsigned-char -D_GNU_SOURCE -DPLAN9PORT -D__USE_MISC $optcflags" >>config.mk
echo "LDFLAGS += $optldflags" >> config.mk
echo "CC = $CC" >> config.mk
echo "STRIP = true" >> config.mk
if [ -n "$CROSS_COMPILE" ] ; then
	echo "YACC = yacc" >> config.mk
	patch -p1 < "$K"/9base-bc-yacc.patch
fi

for i in diff rc lib9 sam ; do sed -i 's@-I\${PREFIX}/include@@' $i/Makefile ; done
for i in std.mk diff/Makefile sam/Makefile ; do
  sed -i 's/@strip/$(STRIP)/' $i
done

sed -i 's/__linux__/__not_linux__/;s/__sun__/__linux__/' lib9/dirread.c
sed -i '/sys.termios.h/d' lib9/readcons.c
sed -i '/^.touch./d' Makefile  # we don't have futimes

# ed's getline clobbers the one defined in musl, and this causes problems
# when libc functions like getpwuid call getline.
patch -p1 < "$K"/9base-ed-getline.patch

stuff_to_build="yacc ascii bc cleanname dc ed factor fmt freq getflags hoc join \
look mk mtime pbd primes rc read sam troff unicode"

sed -i 's/SUBDIRS  =/FOO =/' Makefile
[ -n "$CROSS_COMPILE" ] && \
  stuff_to_build=$(echo "$stuff_to_build" | sed -e 's/hoc //' -e 's/yacc //')
echo "SUBDIRS=lib9 $stuff_to_build" >> config.mk

make -j$MAKE_THREADS

# only install things not sufficently well-provided by busybox
for f in ascii bc cleanname dc ed factor fmt freq getflags hoc join \
         look mk mtime pbd primes rc read sam troff unicode
do
  if [ "$f" = hoc ] && [ -n "$CROSS_COMPILE" ] ; then :
  # hoc.y depends on 9yacc which is not 100% yacc compatible
  else
  make -C $f DESTDIR="$butch_install_dir" install
  fi
done

cp "$K"/ssam "$butch_install_dir""$butch_prefix"/bin
ln -sf troff "$butch_install_dir""$butch_prefix"/bin/nroff


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/a52dec-0.7.4.tar.bz2

[deps]

[vars]
filesize=186097
sha512=95770bd7c63d2196c026ab5a96e68fc1041ab2be8f851da66367d7a0da14c80431b3f5c1570a274a0e5b1cc528104829532c74fac1811abf849f959441aea897
desc="liba52 is a free library for decoding ATSC A/52 audio streams."

[build]
#wants -fPIC to build a shared lib...
CFLAGS="$optcflags -fPIC" \
  LDFLAGS="$optldflags" \
    ./configure --prefix="$butch_prefix" $xconfflags \
      --enable-shared --disable-static
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[vars]
filesize=9218827
sha512=327ffa6da73f7a1b74d1bc374239ac087ee76672da590626da3a068f972684b0963c50641718c39a7fb2429a56c1076bdfd67e8f7f0eab0eda90b70cf846bbbd

[mirrors]
http://abisource.org/downloads/abiword/2.8.6/source/abiword-2.8.6.tar.gz

[deps]
librsvg
goffice
fribidi
glib
wv

[build]
patch -p1 < "$K"/abiword-png15.patch

[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
cp -f "$K"/config.sub .
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
   --disable-default-plugins
[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"
patch -p1 < "$K"/abiword-makefile.patch
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/abiword


code:
[vars]
filesize=386604
sha512=59973199d371cd0b2368e95bc829a1b47f04e808a174fefba4c6854e766158bd19a71d9dbcc8d6fdc1573a1f971cdda39c453f7fa243bce02c1ab97c6e7c72e7
tardir=acl-2.2.52

[mirrors]
http://download.savannah.gnu.org/releases/acl/acl-2.2.52.src.tar.gz

[deps]
attr

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="-static $optldflags" \
  ./configure -C --prefix="$butch_prefix" --disable-shared $xconfflags \
                 --enable-static --enable-gettext=no

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install install-lib install-dev

path: pkg/acl


code:
[mirrors]
http://lcamtuf.coredump.cx/afl/releases/afl-2.12b.tgz

[vars]
filesize=815854
sha512=76e5018cc7ece1e9d164e91ec3552925454b85bf9d981fc2eb6a718fdb06741796b323605ddba93d01df0d9512309ba89554735b7b08c5bf8ad69257b3665e64
desc='powerful instrumented binary fuzzer'

[deps]

[build]
patch -p0 < "$K"/afl-Makefile.patch

make V=1 -j$MAKE_THREADS PREFIX="$butch_prefix" USER_CFLAGS="$optcflags" \
     LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
     CC="$CC" DESTDIR="$butch_install_dir" all install

path: pkg/afl-fuzz


code:
[mirrors]
https://github.com/adventuregamestudio/ags/releases/download/v.3.3.5.4/ags_linux_v.3.3.5.4.tar.xz

[vars]
filesize=840440
sha512=a19392afe88552df03258a23b48ef70bc8ae67a7797456697eceb32fefa2d466947a04240d933d9b487887b1b22222df2dfdab6112d83440ad4c54b685ddd729
desc='adventure game studio engine to play several hundreds of free ags games'

[mirrors]

[deps]
freetype
allegro4
dumb
libtheora
libstdc++

[build]
mkdir -p bin
printf "#!/bin/sh\necho -lalleg -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib\n" > bin/allegro-config
chmod +x bin/allegro-config
export PATH="$PWD/bin:$PATH"

cd Engine
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
make V=1 -j$MAKE_THREADS
install -Dm 755 ags "$butch_install_dir"$butch_prefix/bin/ags

path: pkg/ags


code:
[vars]
filesize=928893
sha512=48591850f28f1a8f4b4986df14090ef7bd57cbfbad739cb0013db021f6f5bcb3c592b38e36774735499e27b9e99330504f8d9c6022158e25469cbc81d13f7463

[mirrors]
http://downloads.sourceforge.net/project/aiksaurus/aiksaurus/1.2.1/aiksaurus-1.2.1.tar.gz

[deps]
gtk+2

[build]
patch -p1 < "$K"/aiksaurus.patch

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags
[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/aiksaurus


code:
[mirrors]
http://download.aircrack-ng.org/aircrack-ng-1.2-rc1.tar.gz

[vars]
filesize=2046476
sha512=897427c535846c0ede58b2f99ed469bc01f50f9b38fc70d5711261fca7342339192cc0c71a724fc04c99114db7534d825a44f09e7bc5754286ec44933a33e40d
desc='cracking/monitoring/security assessment tool for wireless networks'

[deps]
libpcap
libressl
sqlite
libnl-tiny

[deps.run]
iw
procps
ethtool

[build]
[ -n "$CROSS_COMPILE" ] && export CC="$CC -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib"
make -j$MAKE_THREADS
make prefix="$butch_prefix" DESTDIR="$butch_install_dir" install
cp "$K"/aircrack-ng-frontend "$butch_install_dir""$butch_prefix"/bin

path: pkg/aircrack-ng


code:
[mirrors]
http://downloads.sourceforge.net/project/alleg/allegro/4.4.2/allegro-4.4.2.tar.gz
http://switch.dl.sourceforge.net/project/alleg/allegro/4.4.2/allegro-4.4.2.tar.gz
http://heanet.dl.sourceforge.net/project/alleg/allegro/4.4.2/allegro-4.4.2.tar.gz

[vars]
filesize=4674902
sha512=ad4bc1c15fc83bc8a019031fed82f37a793664bb6683cf023ec05fd9cd945f00f43764f3126892426036249c63afa5678fb4906407bb325ce5827b36aee0fa86

[deps.host]
cmake
make

[deps]
alsa-lib
libjpeg
mesalib
glu
libvorbis
libxcursor
libxpm
libpng

[build]
mkdir build && cd build
for i in ar ld nm objcopy objdump strip ; do
printf '#!/bin/sh\n%s%s "$@"\n' "$CROSS_COMPILE" "$i" > "$CROSS_COMPILE""$i"
chmod +x "$CROSS_COMPILE""$i"
done
xconfflags=
[ -n "$CROSS_COMPILE" ] && xconfflags="
-DCMAKE_FIND_ROOT_PATH=$butch_root_dir$butch_prefix \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_AR="$CROSS_COMPILE"ar \
-DCMAKE_LD="$CROSS_COMPILE"ld \
-DCMAKE_NM="$CROSS_COMPILE"nm \
-DCMAKE_OBJCOPY="$CROSS_COMPILE"objcopy \
-DCMAKE_OBJDUMP="$CROSS_COMPILE"objdump \
-DCMAKE_STRIP="$CROSS_COMPILE"strip \
"

cmake $xconfflags \
  -DCMAKE_INSTALL_PREFIX=$butch_prefix \
  -DMANDIR=share/man \
  -DCMAKE_C_FLAGS="-D_GNU_SOURCE $optcflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib -fno-strict-aliasing" \
  -DCMAKE_LD_FLAGS="$optldflags  -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  -DWANT_TESTS=OFF \
  -DWANT_DOCS=OFF \
  -DWANT_TOOLS=OFF \
..

mkdir -p docs
cp -r ../docs/txt docs/

make -j$MAKE_THREADS VERBOSE=1
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.1.tar.bz2
http://gentoo.netnitco.net/distfiles/alsa-lib-1.1.1.tar.bz2
http://alsa.cybermirror.org/lib/alsa-lib-1.1.1.tar.bz2
http://distfiles.lesslinux.org/alsa-lib-1.1.1.tar.bz2
http://distfiles.exherbo.org/distfiles/alsa-lib-1.1.1.tar.bz2

[vars]
filesize=932105
sha512=dacd0a74adc682ac0034cbeba2de3d1a141e0ac2e564c9e04dae202ffaf87ef3a1e01307afc2fd2d9cfe679e5b101c379f9b6ea5f7ccceeed14a427bd5232bc7

[deps]
kernel-headers

[build]
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > test/Makefile.in

patch -p1 < "$K"/alsa-lib_mask_inline.patch

sed -i 's,#if !defined(_POSIX_C_SOURCE) && !defined(_POSIX_SOURCE),#if 0,' include/global.h

THIS="$PWD"

debugcflags=
debugflags=
if [ "$DEBUGBUILD" = 1 ] ; then
	debugflags=--with-debug
	debugcflags="-O0 -g3"
fi

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"

# by default alsa-lib uses --with-versioned, which will create 2 sets of functions,
# one for the old ABI that was deprecated over 10 years ago, and the current one,
# with versioning symbols. since musl's symlinker previously didn't support
# symbol versioning at all, the effect was that we got the wrong (old) functions
# used instead of the new ones, which caused serious breakage.
# musl now implements the subset of symbol versioning needed to get the default
# symbol version, so this isn't strictly needed anymore - however using the versioned
# stuff still bloats up the library with obsolete ancient junk nobody uses.

CFLAGS="-include stdlib.h -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE -Os $debugcflags $optcflags" \
LDFLAGS="$optldflags" \
  ./configure -C \
	 --prefix="$butch_prefix" \
         --disable-python \
         --without-versioned \
         $debugflags $xconfflags

[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

find . -name Makefile -exec sed -i 's,STRIP = strip,STRIP = echo,' "{}" \;

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/alsa-lib


code:
[mirrors]
ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.1.1.tar.bz2
http://gentoo.netnitco.net/distfiles/alsa-utils-1.1.1.tar.bz2
http://alsa.cybermirror.org/utils/alsa-utils-1.1.1.tar.bz2
http://distfiles.lesslinux.org/alsa-utils-1.1.1.tar.bz2
http://distfiles.exherbo.org/distfiles/alsa-utils-1.1.1.tar.bz2

[vars]
filesize=1186408
sha512=3af1e43cb2eab7e5119d83036ab6f4eeb106b66b4a57122cc8df243b6dbda90d39a0290a2af3a904b4929e2d90e8fcded9eda2a38bae1fd8e371a6d7a043376e

[deps]
alsa-lib
curses

[build]
patch -p1 < "$K"/alsa-utils_mixer_widget.patch

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
LDFLAGS="$optldflags" \
CFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -D_LARGEFILE64_SOURCE $optcflags" \
  ./configure -C \
  --prefix="$butch_prefix" \
  --disable-xmlto --disable-alsatest --disable-nls $xconfflags

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/alsa-utils


code:
[mirrors]
http://rephial.org/downloads/3.5/angband-v3.5.0.tar.gz

[vars]
filesize=20907673
sha512=7400d567f11946286062121f3f677617b819d66ea354dade63ef49fb2f2a85ed6bad4d9474ff5fa7710a7866d65b537e604623e4a986e36ca06088ca0bded96c
desc="nethack-style dungeon exploration game, optional with graphics"

[deps]
curses

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
cat << EOF > ncursesw5-config
#!/bin/sh
echo -lcurses -lterminfo
EOF
chmod +x ncursesw5-config
CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  ac_cv_path_NCURSES_CONFIG=./ncursesw5-config

#prevent environment leakage breaking the build
sed -i 's/MKPATH=/CONFIG=\nMKPATH=/' Makefile

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

dest="$butch_install_dir""$butch_prefix"
mv "$dest"/games "$dest"/bin

path: pkg/angband


code:
[mirrors]
http://archive.apache.org/dist/httpd/httpd-2.4.10.tar.bz2

[vars]
filesize=5031834
sha512=e251f5b330da17a8920c589b9e0326d6dd45db28923167718db27b0af2edf769607e9ae6fbb859afbf0c345937fd59053423a2d74bd18ff2272a0f6a19a6496f

[deps]
apr
apr-util
pcre

[build]
patch -p1 < "$K"/apache-libressl.patch
CFLAGS=-D_GNU_SOURCE ./configure -C \
  --prefix="$butch_prefix" \
  --sysconfdir="$butch_prefix"/etc \
  --bindir="$butch_prefix"/bin \
  --mandir="$butch_prefix"/share/man \
  --localstatedir="$butch_prefix"/var \
  --datadir="$butch_prefix"/srv/www \
  --libexecdir="$butch_prefix"/libexec/apache \
  --exec-prefix="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/apache


code:
[deps]
musl

[deps.host]
pkgconf

[vars]
filesize=785724
sha512=1842e2dfc9315d9dd39acd4545d80fad45dcb419c9bfb4423453ca8727aa78d864fd48f43e68a696345b4c0ee2e9eb50b3eddd96d3eaf6ed3c5d48211831b8e4

[mirrors]
http://archive.apache.org/dist/apr/apr-1.4.6.tar.bz2

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
sizeof_iovec=0
for sz in 8 12 16 ; do
	printf "#include <sys/socket.h>\ntypedef int foo[(sizeof(struct iovec)==$sz) * 2 -1];\n" > tmp.$$.c
	if $CC -c tmp.$$.c ; then
		sizeof_iovec=$sz
		break
	fi
done
[ $sizeof_iovec = 0 ] && { echo "ERROR: could not determine sizeof(struct iovec)" ; exit 1 ; }
CFLAGS="$optcflags" \
LDFLAGS="$optldflags" \
CPPFLAGS="-include stdlib.h -include pwd.h -D_GNU_SOURCE -DSTDC_HEADERS" \
  ./configure -C $xconfflags \
  --prefix="$butch_prefix" --datadir="$butch_prefix"/share/apr \
  apr_cv_accept4=yes ac_cv_func_inet_addr=yes ac_cv_func_inet_network=yes \
  ac_cv_tcp_nodelay_inherited=yes ac_cv_o_nonblock_inherited=no \
  ac_cv_file__dev_zero=yes apr_cv_process_shared_works=yes \
  apr_cv_mutex_robust_shared=no apr_cv_tcp_nodelay_with_cork=yes \
  ac_cv_sizeof_struct_iovec=$sizeof_iovec \

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/apr


code:
[vars]
filesize=1233989
sha512=9d990569ea5c743967e308e4f09a1c2f64b0e87ed99acee29401c3b069ecb035c3dba4918f6aa2377070df90cc58ccb321fb856a339dd1faf74da38c2c785e3f

[mirrors]
http://apache.cu.be//apr/apr-iconv-1.2.1.tar.gz
http://www.eu.apache.org/dist/apr/apr-iconv-1.2.1.tar.gz
http://www.apache.org/dist/apr/apr-iconv-1.2.1.tar.gz

[deps]
apr
apr-util

[build]
CFLAGS="-include stdlib.h -include pwd.h -D_GNU_SOURCE -DSTDC_HEADERS" ./configure -C \
  --prefix="$butch_prefix" --with-apr="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/apr-iconv


code:
[deps]
apr
musl

[deps.host]
pkgconf

[vars]
filesize=635000
sha512=2893c8fc14e35d8016c69d36c05712f6f67acade2cf3079954a5626a15ad50ccf88b6e5d9a7458479fea8dfc9f4c8eaf53e5c343c80692208a4edb768d45a9ba

[mirrors]
http://archive.apache.org/dist/apr/apr-util-1.4.1.tar.bz2

[build]
cat << EOF > apr-1-config
#!/bin/sh
res=\$($butch_root_dir$butch_prefix/bin/apr-1-config "\$@")
rc=\$?
printf "%s\n" "\$res" | sed \
  -e 's,-I'$butch_prefix'/include,-I'"$butch_root_dir""$butch_prefix"/include',' \
  -e 's,-L'$butch_prefix'/lib,-L'"$butch_root_dir""$butch_prefix"/lib','
exit \$rc
EOF
chmod +x apr-1-config

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --with-apr="$PWD/apr-1-config" \
  --disable-util-dso
echo '#define APR_HAVE_CRYPT_H 1' >> include/private/apu_config.h
"$K"/libtool.cross.gen --sysroot="$butch_root_dir"
make CC="$CC" -j$MAKE_THREADS LIBTOOL=$PWD/libtool
make DESTDIR="$butch_install_dir" install

path: pkg/apr-util


code:
[mirrors]
http://downloads.sourceforge.net/project/aqemu/aqemu/0.8.2/aqemu-0.8.2.tar.bz2

[vars]
filesize=1025129
sha512=45f27f82ca307ffc50ea26a57631b47236fd04915274bb00a0720e65859e183d56c3243e0e31d71e5280d0941a9c80c1457b09d393e5c4d4deeb1fea4159459d

[deps]
qemu
qt4
cmake

[build]

sed -i 's@4.4.2@4.3.4@' CMakeLists.txt

mkdir build
cd build

CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
cmake -DCMAKE_INSTALL_PREFIX="$butch_prefix" -DWITHOUT_EMBEDDED_DISPLAY=on  ..

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

cd ..

path: pkg/aqemu


code:
[mirrors]
http://www.lysator.liu.se/~nisse/misc/argp-standalone-1.3.tar.gz
http://ftp.freebsd.org/pub/FreeBSD/ports/local-distfiles/sem/argp-standalone-1.3.tar.gz

[vars]
filesize=130255
sha512=58c3feb8852b90248fff39e49b5019bd0dcf646790c3eaf70c3262eb81dda31a61dc0a45963c7b4a010e80fc14b37288dcb3b3ef48d02f2d33dd72c1c62e62d9

[deps]

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags

make V=1 -j$MAKE_THREADS
dest="$butch_install_dir""$butch_prefix"
install -D -m 644 libargp.a "$dest"/lib/libargp.a
install -D -m 644 argp.h "$dest"/include/argp.h

path: pkg/argp


code:
[vars]
filesize=2155310
sha512=ba505b45f84266543cb403752cc3592469545dea806e77bd7b7fec1fbe7ed5baf14372cf6dea840ccbdd054cd0c92cdeb4516eb52b167aca03909000f02aec95
desc="bloated C++-11 download utility. supports torrents/magnet."

[mirrors]
http://downloads.sourceforge.net/project/aria2/stable/aria2-1.19.0/aria2-1.19.0.tar.bz2

[deps]
gnutls
libnettle
libgcrypt
gmp
libxml2

[deps.host]
pkgconf

[build]
patch -p1 < "$K"/aria2-logger.patch
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir --with-libgcrypt-prefix=$butch_root_dir$butch_prefix"

CFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
CXXFLAGS="$optcflags" \
CPPFLAGS="-DHAVE_GETTIMEOFDAY -DHAVE_GETADDRINFO -DHAVE_GETNAMEINFO -DHAVE_USLEEP -DHAVE_SLEEP" \
  ./configure  --prefix="$butch_prefix" $xconfflags
cat << EOF > src/getaddrinfo.h
#include <netdb.h>
#include <sys/socket.h>
#include <sys/types.h>
EOF
rm src/libgen.c ; touch src/libgen.c
make -j$MAKE_THREADS V=1
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
https://github.com/royhills/arp-scan/releases/download/1.9/arp-scan-1.9.tar.gz

[vars]
filesize=488442
sha512=5061ac82d1acad3dd5dab998e4e2d2d9d2dbf436a2839ee1f68dd2997278df7e77f5dda7e54bdb13c9200d7a714b8d82737c041cec8438571d1d14c9d7f936ac

[deps]
libpcap

[build]
patch -p1 < "$K"/arp-scan-ads.patch
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags \
  pgac_cv_snprintf_long_long_int_format="%lld"

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/arp-scan


code:
[mirrors]
http://downloads.sourceforge.net/project/asciidoc/asciidoc/8.6.8/asciidoc-8.6.8.tar.gz

[vars]
filesize=900422
sha512=74c5444124f138862a92a1884b8afe8f968c9a2bbe5a8bbaa9413b0fa4f29fb1ab2eab3c59a68e6c6ddd518866f504e34f43c81406a77c1b2033fbff79df7373

[deps.run]
python

[deps]
xmlto
docbook-xsl
docbook-xml

[build]

CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix"

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/asciidoc


code:
[mirrors]
http://www.littlesvr.ca/asunder/releases/asunder-2.8.tar.bz2

[vars]
filesize=269472
sha512=54f606e10a27cc73aa5c0f1dc74a2df87020562fb74f14ad7030dd1b5f4ab1a4f42477c7d23b5285a7b0cba00f75929f444bc63e18e8da545c3cbdd2c3330ebe
desc="Asunder is a graphical CD ripper and encoder"

[deps]
gtk+2
libflac
lame
libcddb
libcdio
libcdio-paranoia
libvorbis-aotuv
vorbis-tools

[build]
#actually, i am not sure if libcdio-paranoia can be used instead of cdparanoia.

CFLAGS="$optcflags" \
  LDFLAGS="$optldflags" \
    ./configure --prefix="$butch_prefix" $xconfflags \
      --enable-shared --disable-static
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/asunder


code:
[mirrors]
http://download.gnome.org/sources/atk/2.15/atk-2.15.1.tar.xz
http://ftp.acc.umu.se/pub/GNOME/sources/atk/2.15/atk-2.15.1.tar.xz

[vars]
filesize=695912
sha512=03769d6bea7210c34e54e1e58ea3d2c2139eb424d6f381026335d84d223713f25a96a7a1bd583c637925ce5e2f9b76e7a72f0c0c87570efa8eedf0949b17f00f
desc="gnome accessibility toolkit"

[deps]
glib

[deps.host]
perl

[build]
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > tests/Makefile.in
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) --with-sysroot=$butch_root_dir"
CFLAGS="$optcflags -D_GNU_SOURCE" LDFLAGS="$optldflags" \
./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-glibtest --disable-silent-rules --enable-gtk-doc-html=no \
  --enable-introspection=no

for i in po ; do
        printf 'all:\n\ttrue\ninstall:\n\ttrue\clean:\n\ttrue\n' > "$i"/Makefile
done

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/atk


code:
[mirrors]
http://ftp.barfooze.de/pub/sabotage/tarballs/atk-bridge-fake-0.0.1.tar.xz
http://foss.aueb.gr/mirrors/linux/sabotage/atk-bridge-fake-0.0.1.tar.xz
http://dl.2f30.org/mirrors/sabotage/tarballs/atk-bridge-fake-0.0.1.tar.xz

[vars]
filesize=692
sha512=db86739b3967aab195f6b1fa03121317632579778497f6914e85f292e20fef5f9466f2a5a3d88fe4c20e39dfdc8f5320ec206c82e02ca4688f68b39b269c035d
desc="dummy atk-bridge to be able to build gtk+3 without hard dbus deps"

[build]
make prefix="$butch_prefix" DESTDIR="$butch_install_dir" install

path: pkg/atk-bridge-fake


code:
[mirrors]
http://ftp.gnome.org/pub/GNOME/sources/atkmm/2.22/atkmm-2.22.6.tar.xz

[vars]
filesize=562892
sha512=69d5b3b2131658d7ffd5be86bcb0a5966fe9446a7cae1138cb2849d5ccf64f58fc9cc16cc7cb2c5b883bb441966980c8acaa7566d23771f9334919ca27c28942
desc='C++ bindings for the atk library'

[deps]
atk
glibmm

[deps.host]
pkgconf

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags
[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"
for i in doc ; do
        printf 'all:\n\ttrue\ninstall:\n\ttrue\clean:\n\ttrue\n' > "$i"/Makefile
done
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/atkmm


code:
[mirrors]
http://downloads.sourceforge.net/project/ats2-lang/ats2-lang/ats2-postiats-0.1.10/ATS2-Postiats-0.1.10.tgz

[vars]
filesize=3289626
sha512=624ff22a13c637ad1b681109a787a3c1dc922890a9a4e056caac0a6b2f89dd59e0eddfb92750588914b038279cc586d4effdba4823eab7cc155953c114fd9341
tardir=ATS2-Postiats-0.1.10
desc="the ATS programming language"

[deps]
gmp

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags

make
make DESTDIR="$butch_install_dir" install

path: pkg/ats


code:
[mirrors]
http://download.savannah.gnu.org/releases/attr/attr-2.4.47.src.tar.gz

[vars]
filesize=343692
sha512=2a333f63655758298650cf8f89c175efdc0112dcc4013e8d023e2a9a69f177e4bcb1f1d10b6666d6f2027dca4dec0833d54749952ab153d28367e1a72e6e2831
tardir=attr-2.4.47

[deps]

[build]
sed -i 's@-o $(PKG_USER) -g $(PKG_GROUP)@@' include/buildmacros
sed -i 's@CHOWN=_chown@CHOWN=true@' include/install-sh
patch -p1 < "$K"/attr-cdefs.patch
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CPPFLAGS="-D_GNU_SOURCE" \
CFLAGS="$optcflags" \
LDFLAGS="$optldflags" \
  ./configure -C --enable-gettext=no \
  --prefix="$butch_prefix" $xconfflags

for i in po ; do
	printf 'all:\n\ttrue\ninstall:\n\ttrue\ninstall-lib:\n\ttrue\ninstall-dev:\n\ttrue\nclean:\n\ttrue\n' > "$i"/Makefile
done

make -j$MAKE_THREADS

make DESTDIR="$butch_install_dir" install install-lib install-dev

path: pkg/attr


code:
[mirrors]
http://audacity.googlecode.com/files/audacity-minsrc-2.0.2.tar.bz2

[vars]
filesize=6794285
sha512=3099c01b099306ee77c3df569a7412c230006ba8e7f85d6e79f0bc0373cc4c95f231aab7e1bde0d297afa3c1db7fe6dc125715d803dc78a47df4b716d7423d2e
tardir=audacity-src-2.0.2
desc="audio editor and recording app written in C++"

[deps]
libsndfile
libsamplerate
wxgtk
expat

[build]
for i in . lib-src/sbsms lib-src/portaudio-v19 lib-src/libresample ; do
cp -f "$K"/config.sub "$i"/
done
patch -p1 < "$K"/audacity-timeb.patch
patch -p1 < "$K"/audacity-filedialog-segfault.patch
patch -p1 < "$K"/audacity-format.patch
sed -i 's@test "\$cross_compiling" = yes \&\&@false \&\&@g' configure

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir"
cat << EOF > wx-config
#!/bin/sh
#for i ; do
#printf "XXX %s\n" "\$i" >&2
#done
opts=
for i ; do
	case "\$i" in
	--version)  exec pkg-config --modversion wxgtk ;;
	--libs)     opts="\$opts --libs" ;;
	--cflags)   opts="\$opts --cflags" ;;
	--cxxflags) opts="\$opts --cflags" ;;
	esac
done
exec pkg-config \$opts wxgtk
EOF
chmod +x wx-config

PATH="$PWD:$PATH" \
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags -std=gnu89 -Wno-strict-prototypes" \
CXXFLAGS="$optcflags -Wno-unused-local-typedefs" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags \
  --disable-sse \
  --with-ffmpeg=no

[ -n "$CROSS_COMPILE" ] && {
"$K"/libtool.cross.gen --sysroot="$butch_root_dir"
for i in portaudio-v19 sbsms; do cp -f libtool lib-src/"$i"/ ; done
}

# audacity does weird things with msgfmt & xgettext
printf "install:\n\ttrue\n\nclean:\n\ttrue\n" > locale/Makefile
make V=1 -j$MAKE_THREADS AR="$CROSS_COMPILE"ar
make DESTDIR="$butch_install_dir" install

path: pkg/audacity


code:
[mirrors]
http://audiofile.68k.org/audiofile-0.3.6.tar.gz

[vars]
filesize=811733
sha512=
desc="A library for accessing various audio file formats"

[deps]
alsa-lib
flac

[build]
CFLAGS="$optcflags" \
  LDFLAGS="$optldflags" \
    ./configure --prefix="$butch_prefix" $xconfflags \
      --enable-shared --disable-static
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/audiofile


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/alphabetical/a/aufs-utils-4.0-20160510.tar.gz

[vars]
filesize=439290
sha512=1ba55ee78bd69b998a952cf10b04247e9eb39f7a26073a547b915651929e71d45375fc570551a17c4b60da17e74c5df55a1f6bca9df7806e0de2603acd74d2dd
desc="Utilities for the aufs layered filesystem. Note, requires kernel patch (pkg/kernel-aufs, qky-kernel)"

[deps]
kernel

[build]
#FAIL BROKEN BUILD
#note, qky-kernel (renamed to kernel at build-time) has dep kernel-aufs, builds with aufs support.
#note, got it from here: git clone git://aufs.git.sourceforge.net/gitroot/aufs/aufs-util.git aufs-utils
# cd aufs-utils
# git checkout origin/aufs4.0

sed -i -e 's% \-static % %' Makefile

make || exit 1

make DESTDIR="$butch_install_dir" install

path: pkg/aufs-utils


code:
[deps]
perl

[mirrors]
http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.xz

[vars]
filesize=1214744
sha512=995d3e5a8eb1eb37e2b7fae53c6ec7a9b4df997286b7d643344818f94636756b1bf5ff5ea9155e755cb9461149a853dfbf2886fc6bd7132e5afa9c168e306e9b
desc="tool for producing configure scripts"

[build]
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > tests/Makefile.in
./configure -C --prefix="$butch_prefix"
make
make DESTDIR="$butch_install_dir" install

path: pkg/autoconf


code:
[deps]
autoconf

[mirrors]
http://ftp.gnu.org/gnu/automake/automake-1.13.tar.xz

[vars]
filesize=1421396
sha512=e938422378e302dc32725a5bde98a7f2867c6fb6507361e3233ce22a17c7f04d11fd21f3c6e45548f2255817b871e347e312de3b263cad545b12befb6e7476ca
desc="automated makefile generator"

[build]
./configure -C --prefix="$butch_prefix"
make
make DESTDIR="$butch_install_dir" install

path: pkg/automake


code:
[mirrors]
http://www.harding.motd.ca/autossh/autossh-1.4e.tgz

[vars]
filesize=65852
sha512=2f71403ee005103c6a3e2e669f6b26153161c95c8dacd3e73d61673461b3512348636877760d911341771e744c0a682b107df4ac48621661ff36a9fc0191f2fb
desc="automatically restarts ssh connections"

[deps]

[build]
#patch -p1 < "$K"/some.patch

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags

#[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

make V=1 -j$MAKE_THREADS
dest="$butch_install_dir""$butch_prefix"
install -Dm 755 autossh "$dest"/bin/autossh
install -Dm 644 autossh.1 "$dest"/share/man/man1/autossh.1

path: pkg/autossh


code:
[mirrors]
http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3.tar.gz

[vars]
filesize=909744
sha512=b671008388d6a552e71066fec46429bc7f6639e8eac41113bcbba5a56212b78be31fcf04956b31e11c6b14888b0f6e825f7458395b9ff4fc28406074c7ded2b2

[deps]
libelf
libusbx

[deps.host]
bison
flex

[build]
cp -f "$K"/config.sub .
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure -C --prefix="$butch_prefix" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/avrdude


code:
[mirrors]
http://awesome.naquadah.org/download/awesome-3.5.6.tar.xz

[vars]
filesize=720112
sha512=8d89bf46956276a8bcf106bb255c051e8382b08617e17691134a8f3e5db3ec9f7773581c02ce62d23e72499f7b1e60fe4322c211e41219b5bffd1897a96f6cf6

[deps]
glib
libstartup-notification
libxdg-basedir
pango
lgi

[deps.host]
cmake
python

[build]
# lgi is a dependency already. Ignore non-working check script:
lgicheck="$butch_build_dir/build-utils/lgi-check.sh"
rm $lgicheck
ln -s /bin/true $lgicheck

# Usually a few images get converted to grayscale with 'convert'
# from imagemagick. We won't install imagemagick just for the
# build process (!), so hack around it with a fake binary:
fakebin="$butch_build_dir/sabotaged-bin/"
mkdir -p "$fakebin"
ln -s /bin/true "$fakebin/convert"

# NOTE: When setting the INSTALL_PREFIX to /, cmake assumes
# that the resulting path // is a network path and fails!
cmake	-DCMAKE_BUILD_TYPE=RELEASE \
	-DSYSCONFDIR=/etc \
	-DCMAKE_INSTALL_PREFIX:PATH=/. \

PATH=$PATH:$fakebin make V=1 -j$MAKE_THREADS

make DESTDIR="$butch_install_dir" install

path: pkg/awesome


code:
[mirrors]
https://github.com/BLAKE2/BLAKE2/archive/648089e0555cbed6bd64fbc1e5b97568cde665d9.tar.gz

[vars]
filesize=502996
sha512=c1990b15798ede4421731de66e46b38f8c8caffd46446a18b982a51baa6ee4097fba2ec9492e6e2915c26a5935120252523502941f2a8643f437a93c0b67fbf7
tarname=blake2-648089e0555cbed6bd64fbc1e5b97568cde665d9.tar.gz
tardir=BLAKE2-648089e0555cbed6bd64fbc1e5b97568cde665d9
desc='A tool similar to the md5sum or shasum utilities but for BLAKE2.'

[build]
cd b2sum
[ "$A" != "x86_64" ] && sed -i 's@-I../sse@@' makefile
sed -i 's@ -fopenmp@@' makefile

make
PREFIX=/ make DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://gd.tuwien.ac.at/graphics/gimp/babl/0.1/babl-0.1.10.tar.bz2
ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.10.tar.bz2

[vars]
filesize=449537
sha512=2950d94c255ee05d405e003a46138da0f4e0cad65e2d2a882089b788c2deac0524014f7c5758c3097253bdbebaded433caf0447c7d218c9cc96798df9e6f0c92
desc="support lib for gegl for color-space conversions"

[deps]
glib

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
CFLAGS="-D_GNU_SOURCE -I$PWD $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/babl


code:
[mirrors]
http://www.basic-converter.org/stable/bacon-3.2.2.tar.gz

[vars]
filesize=371739
sha512=a341fb8e00254ad2efae2f9e45015efd7d0dc6e5044e9e718963de712c2b4e8ee79f9acc4946fc1ec0966d6bcdc98c89127766c526513b8449f5095eae1b968c
desc="BaCon BASIC compiler, generates C and calls gnu C compiler"

[deps]
bash
gtk+2

[build]
#note, this builds a commandline compiler, 'bacon', and a GTK IDE, 'bacongui'
#note, bacon is written in shell script! needs bash 4.x.

CFLAGS="$optcflags" LDFLAGS="$optldflags -fPIC" \
  ./configure --prefix="$butch_prefix" $xconfflags

#Makefile does not recognise DESTDIR...
dest="$butch_install_dir""$butch_prefix"
PTN="s%^prefix .*%prefix          = ${dest}%"
sed -i -e "$PTN" Makefile

make V=1 -j$MAKE_THREADS

make install

#grab some more stuff. unfortunately, can't build off-line!
#HUG Highlevel Universal GUI library...
wget http://www.basic-converter.org/hug.bac || exit 1
mkdir temp1
./build/bacon -d temp1 -f hug.bac -o '-fPIC'
mkdir -p "$dest"/lib
cp -a -f temp1/hug.so "$dest"/lib/

#to link hug.so as a shared lib, need this:
wget http://www.basic-converter.org/hug_imports.bac
sed -i -e 's%"\./hug\.so"%"/lib/hug.so"%' hug_imports.bac
mkdir -p "$dest"/share/BaCon
cp -a -f hug_imports.bac "$dest"/share/BaCon/
#need to install this as well, as apps may include it, rather than use shared lib...
cp -a -f hug.bac "$dest"/share/BaCon/

#might as well grab these text-editor syntax highlighters...
#for gtksourceview:
wget http://www.basic-converter.org/bacon.lang
cp -a -f bacon.lang "$dest"/share/BaCon/
#for vim:
wget http://www.basic-converter.org/bacon.vim
cp -a -f bacon.vim "$dest"/share/BaCon/

path: pkg/bacon


code:
[mirrors]
http://ftp.gnu.org/gnu/bash/bash-4.3.30.tar.gz

[vars]
filesize=7977214
sha512=76e5d91f0d29f857d5ab39423075ee4a577b59bae22f86cefef82c814f25d37456655e083e3cb116406856b192ca8b5749852baf7d01dbac491a2fb2e5ab7686
desc="the bourne again shell. prerequisite to build lots of linux-centric sw."

[deps]

[build]
# FIXME: bash has a ton of configure tests with broken defaults
# for crosscompiling. breakage could for example be introduced by
# "checking for offset of exit status... 0" (due to crosscompile)
# on a native x86_64 run we get 8 (bash_cv_wexitstatus_offset)
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
CFLAGS="$optcflags" LDFLAGS="$optldflags -static" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --without-bash-malloc \
  --disable-rpath --enable-history bash_cv_getenv_redef=no \
  --enable-job-control bash_cv_sys_named_pipes=yes \
  --disable-nls
#  --with-installed-readline ac_cv_rl_version=5.0 \
make -j$MAKE_THREADS READLINE_LIB=lib/readline/libreadline.a
make DESTDIR="$butch_install_dir" install

path: pkg/bash


code:
[mirrors]
https://launchpad.net/bzr/2.6/2.6.0/+download/bzr-2.6.0.tar.gz

[vars]
filesize=11301124
sha512=f40d4380a837321c2ed168d15b0b5d31e9de6df93c0f8f2fd9b16c9351524b0afac5b8744740f587e9704efeb4cc004cae7f35aed47f73b5c796cbe2526af980
desc="a version control system written in python"

[deps.run]
python

[deps.host]
python
wget

[build]
python setup.py build
python setup.py install --prefix="$butch_prefix" \
       --root="$butch_install_dir"

path: pkg/bazaar


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/bbc_provided-2003.tar.bz2

[vars]
filesize=25321
sha512=68a44af92ad80cca27c8d46581682ffded4ac631990fe7cdf91272076662c1df426ffa369fffd5bf814a19f86555774dc6bde8206ff51cee4c55d3a2eed6c9f5
desc="Network utilities: ipcalc, or, and, dotquad"

[deps]

[build]
dest="$butch_install_dir""$butch_prefix"

[ -f and ] && rm -f and
[ -f or ] && rm -f or
[ -f dotquad ] && rm -f dotquad
[ -f ipcalc ] && rm -f ipcalc
gcc -Wall -O2 -s -o and andor.c -DAND
gcc -Wall -O2 -s -o or andor.c -DOR
gcc -Wall -O2 -s -o dotquad dotquad.c
gcc -Wall -O2 -s -o ipcalc ipcalc.c -lpopt

mkdir -p "$dest"/bin
install -m755 -s and "$dest"/bin
install -m755 -s or "$dest"/bin
install -m755 -s dotquad "$dest"/bin
install -m755 -s ipcalc "$dest"/bin

path: pkg/bbc-provided


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/bc-1.06.95.tar.bz2

[vars]
filesize=290069
sha512=16ec13f87ef76ad4de77d378ef8d65a582adca1bf661c9d7675e78d940680c77e81a00a01817fde7c1ad1524562d6f933caa5c42a0686f3f85aadbb39393afb1
desc="GNU's numeric processing language and a calculator"

[deps]

[build]
#from debian...
patch -p1 < "$K"/bc-1.06.95-debian28jul2011.patch

CFLAGS="$optcflags" \
  LDFLAGS="$optldflags" \
    ./configure --prefix="$butch_prefix" $xconfflags \
      --enable-shared --disable-static --with-readline
make -j$MAKE_THREADS || exit 1
make DESTDIR="$butch_install_dir" install

path: pkg/bc


code:
[mirrors]
http://he.fi/bchunk/bchunk-1.2.0.tar.gz

[vars]
filesize=15078
sha512=0e1f9daa2dfeff58e2c65ac2767bff804811fa22f70a220747aa873cb01b77b4c6a809736483aa22fb3f2d2a88885469d10fb45af4626069e992a0763a5fcc2d
desc='conversion of .cue/.bin cd image files into .iso format'

[build]
$CC $optcflags $optldflags bchunk.c -o bchunk
dest="$butch_install_dir""$butch_prefix"
install -Dm 755 bchunk "$dest"/bin/bchunk
install -Dm 644 bchunk.1 "$dest"/share/man/man1/bchunk.1

path: pkg/bchunk


code:
[mirrors]
http://prdownloads.sourceforge.net/bcl/bcl-1.2.0.tar.bz2

[vars]
filesize=91649
sha512=bf1dac4acfe7b26656f193aa518d32e15815bb6ff0cc6e69719d73d48e692bb81b8233ee9314a6e7188ca3c4cbb852408eace3e3f423f7f9a8cb54da032ad634
desc="basic compression library. readable, small and easy to use compression"

[deps]

[build]
cd src
make CC="$CC" CFLAGS="$optcflags -c" MKLIB="$CROSS_COMPILE"ar LFLAGS="$optldflags" \
  -j$MAKE_THREADS
dest="$butch_install_dir""$butch_prefix"
install -Dm 644 libbcl.a "$dest"/lib/libbcl.a
for i in bfc.exe bcltest.exe ; do
install -Dm 755 "$i" "$dest"/bin/"$i"
done

path: pkg/bcl


code:
[mirrors]
http://bcrypt.sourceforge.net/bcrypt-1.1.tar.gz

[vars]
filesize=36781
sha512=4cc939e997b125b48a66c20469d9743ec227dbee080d89b1ab2515a3c41749c6e8fb6d2d4276cd23eaf6bed0614989431f1f87c23220a94ad595024f8985d68b
desc="A utility to encrypt files"

[deps]

[build]

sed -i -e "s%^CFLAGS = %CFLAGS = ${optcflags} %" -e "s%^LDFLAGS = .*%LDFLAGS = ${optldflags} -lz %" Makefile

make || exit 1

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/bin
cp -a -f bcrypt "$dest"/bin/

path: pkg/bcrypt


code:
[mirrors]
http://xorg.freedesktop.org/releases/individual/app/bdftopcf-1.0.5.tar.gz

[vars]
filesize=152881
sha512=0ea80b1e90da292e82e97447526ea6c6b7299070145a09a1486974b92047c14d70439fe95d24f6fb13f8da07c66321840486d7ff910bb40abc7d2e9f216edfe7
desc="a font compiler for the X server and font server"

[deps]
libxfont

[build]

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CFLAGS="$optcflags" LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure --prefix="$butch_prefix" \
  --mandir="$butch_prefix"/share/man $xconfflags

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/bdftopcf


code:
[deps]
9base
busybox
e2fsprogs
extlinux
gcc4
gmp
m4
mpc
mpfr
musl
dynamic-toolchain
zlib
capchroot
bedrock-scripts

path: pkg/bedrock


code:
[mirrors]
http://bedrocklinux.org/1.0alpha2/bedrock-userland-1.0alpha2.tar.gz

[vars]
filesize=11594
sha512=962332a4e5fc0db883e2ea0e131ec0800824879050ec8046706ffe2886234041455d29a8aeddb3c979d9d29a4f2a94516d07bb28ca2df7ab736942d79db99c33

[deps]

[build]

mv opt share

mkdir -p "$butch_install_dir"/"$butch_prefix"
cp -r * "$butch_install_dir"/"$butch_prefix"/
# TODO merge etc/fstab etc/inittab etc/profile instead of overwriting

path: pkg/bedrock-scripts


code:
[mirrors]
http://downloads.sourceforge.net/project/beepmp/bmp/0.9.7.1/bmp-0.9.7.1.tar.gz

[vars]
filesize=2056564
sha512=a269f9487e67243a8bd24b70b0bafc7130de817ee5d925a1611a455135fe7fff3ed58860c7635a0265cc5b07b9d77483a55d84f40718cc3a3c164569496baecb

[deps]
gtk+2
mpg123

[build]
sed -i 's@sys/errno@errno@' beep/playlist.c
CFLAGS=-D_GNU_SOURCE ./configure -C --prefix="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://xorg.freedesktop.org/releases/individual/proto/bigreqsproto-1.1.2.tar.bz2

[vars]
filesize=113218
sha512=9c2f98191169f7bca69601fcea5ddcb45d50b3a6bae087a2d6ee2d83f9729155b23268ad4c46a3cc99162cdacf4c8e3d7f061e58d73237da96f23123444f67d8
desc="big requests extension for the X server"

[deps]
util-macros
musl

[build]
cp -f "$K"/config.sub .
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine)"
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure -C --prefix="$butch_prefix" $xconfflags
make DESTDIR="$butch_install_dir" -j$MAKE_THREADS install

path: pkg/bigreqsproto


code:
[mirrors]
ftp://ftp.isc.org/isc/bind9/9.10.2/bind-9.10.2.tar.gz

[vars]
filesize=8481111
sha512=e4c72fe52641a515620930d0e1c149e6f0d9cec2e1a64cbfd510829d908ccab7293197dbbe603c863168f9ea9ded57b27b32cbad02f8b60abc91acb035c2e79f
desc="utilities shipped with bind, the most widely used DNS server"

[deps]

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
BUILD_CC="$HOSTCC" \
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --without-readline \
  --without-libjson \
  --with-openssl="$butch_root_dir""$butch_prefix" \
  --with-ecdsa=yes --with-gost=no --with-randomdev=/dev/urandom

for i in dns isc bind9 isccfg lwres ; do
  make -j$MAKE_THREADS -C lib/$i
done

make -j$MAKE_THREADS -C bin/dig

make -C bin/dig DESTDIR="$butch_install_dir" install

path: pkg/bindutils


code:
[mirrors]
ftp://sourceware.org/pub/binutils/snapshots/binutils-2.24.90.tar.bz2
http://www.mirrorservice.org/sites/sourceware.org/pub/binutils/snapshots/binutils-2.24.90.tar.bz2

[vars]
filesize=23659627
sha512=dcd93cb314d5c275529c58d134956e48d64860bdd2e58bc94aa339aeba0ee66fbd7423ace1f71eba9905fa5b05db922c2242f585c8eef0247c4fa5fda56367af
desc="provides linker, assembler and other utils to handle object files"

[deps.stage0]
stage0-musl

[build]
patch -p1 < "$K"/binutils-arm.patch

"$K"/libibertyfix libiberty

[ "$STAGE" = "0" ] && CC="$butch_root_dir"/bin/musl-gcc
machine=
if [ -n "$CROSS_COMPILE" ] ; then
        machine=$($CC -dumpmachine)
        xconfflags="--host=$machine --target=$machine"
        export GCC_FOR_TARGET="$CC"
fi

config_arch_flags=
if [ "$A" = "powerpc" ] ; then
        config_arch_flags="--enable-secureplt"
fi
static_ldflags=-Wl,-static
static_ccflags=-static
config_lto_flags=
if [ "$BINUTILS_DYNAMIC" = 1 ] ; then
	static_ldflags=
	static_ccflags=
	config_lto_flags=--enable-lto
fi
LDFLAGS="$static_ldflags $optldflags" \
CC="$CC $static_ccflags" \
CFLAGS="-D_GNU_SOURCE -D_LARGEFILE64_SOURCE $optcflags" \
./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-nls --disable-werror \
  --enable-initfini-array \
  --disable-install-libbfd $config_arch_flags $config_lto_flags

make -j$MAKE_THREADS
# tooldir=/
make DESTDIR=$butch_install_dir install-gas install-ld install-binutils

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/lib/bfd-plugins
ln -sf "$butch_prefix"/lib/bfd-plugins/liblto_plugin.so \
       "$dest"/lib/bfd-plugins/liblto_plugin.so
rm -f "$dest"/bin/ld
if [ x$A = xpowerpc ] ; then
	cat << EOF > "$dest"/bin/ld
#!/bin/sh
ld.bfd --secure-plt \$@
EOF
	chmod +x "$dest"/bin/ld
else
	ln -sf ld.bfd "$dest"/bin/ld
fi

path: pkg/binutils


code:
[vars]
filesize=1652612
sha512=b789f55d9cb95c1b4fba004691ed9f79b76da55020c9b202e1704a02aab1ba43b9fc1015e29843ed552e6df6165cef9c6ebc8a29d15a21c6e194cad8a42ab055
desc="a yacc-compatible parser generator"

[mirrors]
ftp://ftp.gnu.org/gnu/bison/bison-2.4.3.tar.bz2
http://gnu.mirrorcatalogs.com/bison/bison-2.4.3.tar.bz2
http://spout.ussg.indiana.edu/gnu/bison/bison-2.4.3.tar.bz2

[deps.host]
m4

[build]
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > tests/Makefile.in
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags" LDFLAGS="-static $optldflags" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/bison


code:
[vars]
filesize=5172523
sha512=47003cd693af07ccd7a7cc186abec97954aaeb50ffa017ebea085e3d407fc66bcbcb94443fa6db3491340d942e3eb1fcc6ff7676de16c8267d1f35fd5277d438
desc="GTK+ code editor with syntax highlighting, tabs... focus on web dev"

[mirrors]
http://www.bennewitz.com/bluefish/stable/source/bluefish-2.2.7.tar.gz

[deps]
gtk+2
libxml2

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir"
cp -f "$K"/config.sub .
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags \
    --disable-python \
    --with-gtk2

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/bluefish


code:
[mirrors]
http://downloads.sourceforge.net/project/boost/boost/1.52.0/boost_1_52_0.tar.gz
http://heanet.dl.sourceforge.net/project/boost/boost/1.52.0/boost_1_52_0.tar.gz
http://surfnet.dl.sourceforge.net/project/boost/boost/1.52.0/boost_1_52_0.tar.gz

[vars]
filesize=64724106
sha512=8de651beb9a48f91f8a797f44966b8f25c3351d6893c1d79969aeb2ded3adeaf8fc14aa9b8a4410081dde9ef155330b41a4982a62b55adde40bb73f0066c74a2
desc="monstruous collection of C++ libraries"

[deps]
bzip2

[deps.host]
dynamic-toolchain

[build]
# https://svn.boost.org/trac/boost/ticket/7847
patch -p1 < "$K"/boost-execinfo.patch
patch -p1 < "$K"/boost-endian.patch

# FIXME there's no DESTDIR support, thus internal hardcoded paths will be all wrong
# https://svn.boost.org/trac/boost/ticket/7846
CC=gcc CFLAGS=-D_GNU_SOURCE ./bootstrap.sh --prefix="$butch_install_dir""$butch_prefix"

cat << EOF > tools/build/v2/user-config.jam
using gcc : foo : $CXX ;
EOF

sed -i 's@tm_gmtoff@__tm_gmtoff@g' libs/locale/src/std/../util/numeric.hpp
sed -i 's@tm_zone@__tm_zone@g' libs/locale/src/std/../util/numeric.hpp

# boost wants to build some asm stuff which fails on mips, but the rest is properly
# built/installed, so we must catch the error return code
./b2 toolset=gcc-foo -d+2 stage threading=multi link=shared -j$MAKE_THREADS || echo ERROR1
./b2 -d+2 install threading=multi link=shared || echo ERROR2

path: pkg/boost


code:
[mirrors]
http://downloads.sourceforge.net/project/bridge/bridge/bridge-utils-1.5.tar.gz

[vars]
filesize=33243
sha512=4e525fbd3defb509664ef3b728d9e5edfb92beaebdb5d7733d8203fb38cb3f4bb54d02dc1e28813889a2ee19c78b9b47da6d99c8032481a7fd7f104658dea7c3
desc="provides brctl utility, required to create and manage bridge devices"

[deps]

[build]

patch -p1 < "$K"/bridge-utils.patch

# since bridgeutils package comes without configure script, rather than
# relying on autoreconf -r etc, we just throw *.c at gcc.
# if in the future libbrigde is needed for something, we'll consider
# creating a plain makefile instead.

cat << EOF > config.h
#define PACKAGE_NAME "brigde-utils"
#define PACKAGE_VERSION 15
EOF

gcc -static -Os -s -fwhole-program -flto -I. -I libbridge/ -include sys/types.h `find . -name '*.c'` -o brctl.out

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/bin
cp brctl.out "$dest"/bin/brctl
mkdir -p "$dest"/share/man/man8
cp doc/brctl.8 "$dest"/share/man/man8/

path: pkg/bridge-utils


code:
[vars]
filesize=25521
sha512=07570a9a5797579273938ef728f222f483c733e78eb6acb00e2bce9ff9df29aa85ed715872032701c8f67fcbc7cf5501f12dc2b8234c30df7d25f50cc38359b0

[mirrors]
http://slackbuilds.org/mirror/slackware/slackware-14.0/source/n/bsd-finger/bsd-finger-0.17.tar.gz
http://ftp.linux.org.uk/pub/linux/Networking/netkit/bsd-finger-0.17.tar.gz

[deps]

[build]
patch -p1 < "$K"/bsd-finger-0.17.patch
patch -p1 < "$K"/bsd-finger-lprint.patch

./configure --prefix="$butch_prefix"
cat << EOF >MCONFIG
BINDIR=$butch_prefix/bin
SBINDIR=$butch_prefix/bin
MANDIR=$butch_prefix/share/man
BINMODE=755
DAEMONMODE=755
MANMODE=644
PREFIX=$butch_prefix
EXECPREFIX=$butch_prefix/bin
INSTALLROOT=$butch_install_dir
CC=gcc
CFLAGS= -D_GNU_SOURCE $optcflags
LDFLAGS= $optldflags -static
LIBS=
EOF

make -j$MAKE_THREADS
# the Makefile doesn't use mkdir -p as it should
dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/share/man/man1 "$dest"/share/man/man8 "$dest"/bin

make install

path: pkg/bsd-finger


code:
[deps]
libarchive

path: pkg/bsdtar


code:
[mirrors]
http://www.kernel.org/pub/linux/kernel/people/mason/btrfs-progs/btrfs-progs-v3.16.tar.xz
https://www.kernel.org/pub/linux/kernel/people/mason/btrfs-progs/btrfs-progs-v3.16.tar.xz
http://ftp.free.fr/pub/linux/kernel/people/mason/btrfs-progs/btrfs-progs-v3.16.tar.xz

[vars]
filesize=290544
sha512=dd1f4bc13e62623792121d0f2a2a388be85bae4eec4abc348e0d21949fefa58863e7bf56515dd57022c312ee02d2fa76cc7b1a1c2d78a36532961b22b410a4db

[deps]
lzo
zlib
acl
e2fsprogs
bash
sparse
libuuid
attr
libblkid

[build]
patch -p1 < "$K"/btrfs-progs.patch
make prefix="$butch_prefix" DESTDIR="$butch_install_dir"\
     CFLAGS="-DXATTR_NAME_MAX=255 -DXATTR_LIST_MAX=65536 \
     -DXATTR_SIZE_MAX=65536 -DPATH_MAX=4096 $optcflags" \
     LDFLAGS="$optldflags" -j$MAKE_THREADS install

make prefix="$butch_prefix" CFLAGS="-DXATTR_NAME_MAX=255 \
       -DXATTR_LIST_MAX=65536 -DXATTR_SIZE_MAX=65536 \
       -DPATH_MAX=4096 $optcflags" \
     LDFLAGS="$optldflags" -j$MAKE_THREADS static

make prefix="$butch_prefix" install
install -D -m 755 btrfs.static "$butch_install_dir"/"$butch_prefix"/bin/btrfs.static
install -D -m 755 mkfs.btrfs.static "$butch_install_dir"/"$butch_prefix"/bin/mkfs.btrfs.static

make prefix="$butch_prefix" CFLAGS="-DXATTR_NAME_MAX=255 \
       -DXATTR_LIST_MAX=65536 -DXATTR_SIZE_MAX=65536 \
       -DPATH_MAX=4096 $optcflags" \
     LDFLAGS="$optldflags" -j$MAKE_THREADS btrfs-zero-log.static

install -D -m 755 btrfs-zero-log.static "$butch_install_dir"/"$butch_prefix"/bin/btrfs-zero-log.static

path: pkg/btrfs-progs


code:
[mirrors]
http://www.busybox.net/downloads/busybox-1.20.2.tar.bz2

[vars]
filesize=2186738
sha512=089b67cd920f332daf910711739b1e55ba4c76cfa2122dfe5464432e0d76d3af8327837ebc3cc9954deef3e8f766d16a1928aecb2c169fe3de5a722eea7ea3dd

[deps]
kernel-headers

[deps.stage0]
patch
stage0-musl

[build]

if [ "$STAGE" = "0" ] ; then
	CC="$butch_root_dir"/bin/musl-gcc
	PATCH="$butch_root_dir"/bin/patch
else
	PATCH=patch
fi

dopatch() {
	echo "applying patch $1"
	"$PATCH" -p1 < "$1"
}

cp "$K"/busybox.stage1.config .config
dopatch "$K"/busybox.patch
dopatch "$K"/busybox-blowfish.patch
dopatch "$K"/busybox-unzip.patch
dopatch "$K"/busybox-xz-bugfix1.patch
dopatch "$K"/busybox-xz-bugfix2.patch
dopatch "$K"/busybox-xz-bugfix3.patch
dopatch "$K"/busybox-man.patch
dopatch "$K"/busybox-sed.patch
dopatch "$K"/busybox-awk-emptyfun.patch
dopatch "$K"/busybox-awk-int-overflow.patch
dopatch "$K"/busybox-tar-norecurse.patch
dopatch "$K"/busybox-tar-xz.patch
dopatch "$K"/busybox-tar-xz2.patch
dopatch "$K"/busybox-bzip2bug.patch
dopatch "$K"/busybox-fdisk-gpt-size.patch
dopatch "$K"/busybox-fdisk-sector-size.patch
dopatch "$K"/busybox-ping.patch
dopatch "$K"/busybox-ping2.patch
dopatch "$K"/busybox-grep-x.patch
dopatch "$K"/busybox-sort.patch
dopatch "$K"/busybox-libbb-make-unicode-printable.patch
dopatch "$K"/busybox-wget-https.patch
dopatch "$K"/busybox-cve-2013-1813.patch
dopatch "$K"/busybox-cve-2014-4607.patch
dopatch "$K"/busybox-cve-2016-2147.patch
dopatch "$K"/busybox-msghdr.patch

#__inline seems to get activated when -std=gnu99 is used, causing havoc
sed -i 's,__inline,,' ./scripts/kconfig/zconf.hash.c_shipped

if [ ! -z "$DEBUGBUILD" ] ; then
	debugcflags="-O0 -g"
	sed -i 's/# CONFIG_DEBUG is not set/CONFIG_DEBUG=y/' .config
	sed -i 's/# CONFIG_DEBUG_PESSIMIZE is not set/CONFIG_DEBUG_PESSIMIZE=y/' .config
	sed -i 's/CONFIG_NO_DEBUG_LIB=y/# CONFIG_NO_DEBUG_LIB is not set/' .config
fi

# alternative:
# make KBUILD_VERBOSE=1 CC="$CC" HOSTCC="$HOSTCC" \
# HOSTCFLAGS=-D_GNU_SOURCE -j$MAKE_THREADS

[ -z "$HOSTCC" ] && HOSTCC="$CC"

make V=1 LDFLAGS=-static HOSTLDFLAGS=-static \
CFLAGS_busybox="$debugcflags -Wl,-z,muldefs -Werror-implicit-function-declaration" \
HOSTCC="$HOSTCC -static" CC="$CC -static" HOSTCFLAGS=-D_GNU_SOURCE  -j$MAKE_THREADS
echo busybox build complete

# make true and false binaries so scripts using it are faster
# than when using several layers of indirection including a shell
# script
cat << EOF > true.c
int main() { return 0; }
EOF
cat << EOF > false.c
int main() { return 1; }
EOF

for p in true false ; do
$CC -static $optcflags "$p".c -o "$p" $optldflags
done
# done, continue with "make install" equivalent

dest=$butch_install_dir$butch_prefix
mkdir -p "$dest"/bin

busybox_bin=busybox
[ "$DEBUGBUILD" = "1" ] && busybox_bin=busybox_unstripped
# on armv4tl and mips, the stripped busybox binary is buggy - argv parsing is broken somehow:
# this manifests when trying to use enter-chroot script which fails.
#[ "$A" = "arm" ] || [ "$A" = "mips" ] && busybox_bin=busybox_unstripped

echo cp "$busybox_bin" "$dest"/bin/busybox
cp "$busybox_bin" "$dest"/bin/busybox

echo check if busybox works:
if [ -z $CROSS_COMPILE ] ; then
	"$dest"/bin/busybox --list >/dev/null
fi

trylink() {
	if [ ! -e bb-link ] ; then
		printf '#!%s/bin/busybox\n' "$butch_prefix" > bb-link
		chmod +x bb-link
	fi
	printf "trying to link busybox to %s ... " "$1"
	if ! cp -f bb-link "$1" ; then
		echo FAIL
		exit 1
	else
		echo OK
	fi
}

for f in $($HOSTCC -E -include include/autoconf.h -DMAKE_LINKS include/applets.h | sed -e 's/^LINK BB_DIR_BIN //' -e 's/^LINK BB_DIR_SBIN //' -e 's/LINK BB_DIR_ROOT //' -e '/^#/d' -e '/^}/d' -e '/^[ ]*$/d' | sort -u); do
	#echo ln -sf busybox "$dest"/bin/"$f"
	[ ! -f "$butch_root_dir/bin/$f" ] && \
	  trylink "$dest"/bin/"$f"
done

ln -sf busybox "$dest"/bin/sh

echo symlinks done.

for p in true false ; do
	# in case a symlink from one of the above program names to busybox
	#  already exists, we need to delete it
	# before copying. otherwise the *busybox binary* gets replaced
	# through the symlink...
	rm -f "$dest"/bin/"$p"
	cp -f "$p" "$dest"/bin/
done

path: pkg/busybox


code:
[deps]
musl
kernel-headers

[deps.host]
perl

[deps.run]
less

[vars]
filesize=2190170
sha512=9ad2af7216ae79c2c8cf246654a2c591983d347d22bfe4cd54ae41eaee0ea17f7bf8d6834add3f1f843494d6980707e0443aaf663075fda6e4e7e29728606c53

[mirrors]
http://www.busybox.net/downloads/busybox-1.20.1.tar.bz2

[build]

cp $K/busybox.stage1.config .config

make V=1 HOSTCFLAGS="-D_GNU_SOURCE -std=gnu89" docs/busybox.1

mkdir -p "$butch_install_dir/share/man/man1"
cp docs/busybox.1 "$butch_install_dir/share/man/man1"

path: pkg/busybox-man


code:
[mirrors]
ftp://invisible-island.net/byacc/byacc-20150711.tgz

[vars]
filesize=714438
sha512=348558046acca31a39e8df480ae4c46ad03a1b073a51877a8981914bce65e8922e83e14c45eecd0e122c9d3d018cd4b6ab8c7f29b8dbfa13d648f2f86104a4e9
desc="berkeley yacc is a tool to generate LALR(1) parsers"

[build]

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags

#[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/byacc


code:
[vars]
filesize=782025
sha512=00ace5438cfa0c577e5f578d8a808613187eff5217c35164ffe044fbafdfec9e98f4192c02a7d67e01e5a5ccced630583ad1003c37697219b0f147343a3fdd12

[mirrors]
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz

[build]
patch -p1 < "$K"/bzip2-flags.patch
sed -i 's@$(PREFIX)@$(DESTDIR)$(PREFIX)@g' Makefile
sed -i 's@$(PREFIX)/man@$(PREFIX)/share/man@g' Makefile
# test target is not cross-compile compatible
sed -i 's@all: libbz2.a bzip2 bzip2recover test@all: libbz2.a bzip2 bzip2recover@' Makefile
make -f Makefile-libbz2_so -j$MAKE_THREADS \
  CFLAGS="$optcflags -D_GNU_SOURCE -fPIC" \
  LDFLAGS="$optldflags" CC="$CC"
make -j$MAKE_THREADS PREFIX="$butch_prefix" \
  CFLAGS="$optcflags -D_GNU_SOURCE -fPIC" \
  LDFLAGS="$optldflags" CC="$CC"

make DESTDIR="$butch_install_dir" \
  PREFIX="$butch_prefix" install

dest="${butch_install_dir}${butch_prefix}/lib/"
install -m 0644 libbz2.so.1.0.6 "$dest/"
ln -sf libbz2.so.1.0.6 "$dest/libbz2.so.1.0"
ln -sf libbz2.so.1.0.6 "$dest/libbz2.so"


code:
[mirrors]
http://ftp.debian.org/debian/pool/main/c/ca-certificates/ca-certificates_20160104.tar.xz

[vars]
filesize=293632
sha512=4291ba58057b66d56853162b71862832135eab6f444a5e2cf3dd1089495d44624246dc0c540871851fe9aaceb42054516309402525c8f16a88911d3af9c3518a
tardir=ca-certificates

[deps]
libressl

[deps.host]
libressl

[build]
$HOSTCC "$K"/c_rehash.c -o c_rehash -lssl -lcrypto
export PATH=$PWD:"$PATH"
mkdir -p "$butch_install_dir""$butch_prefix"/share/ca-certificates/mozilla
cat << EOF > sbin/Makefile
install:
	install -Dm755 update-ca-certificates \$(DESTDIR)\$(sbindir)/update-ca-certificates
EOF
cp "$K"/certdata2pem.c mozilla/
cat << EOF > mozilla/Makefile
all: a.out
	./a.out
a.out:
	\$(HOSTCC) -Wall -Wextra -O0 -g certdata2pem.c
clean:
	-rm -f *.crt
install:
	for p in *.crt; do \
	 install -D -m 644 \$\$p \$(CERTSDIR)/\$\$p ; \
	done
EOF
sed -i 's@/usr@'"$butch_prefix"'@g' sbin/update-ca-certificates
make CERTSDIR="$butch_prefix"/share/ca-certificates
make CERTSDIR="$butch_prefix"/share/ca-certificates \
     DESTDIR="$butch_install_dir" sbindir="$butch_prefix"/bin install

mkdir -p "$butch_install_dir/etc/ssl/certs"

( cd "$butch_install_dir/share/ca-certificates/"
  find . -name '*.crt' | sort | cut -b3- > "$butch_install_dir/etc/ca-certificates.conf" )

cp sbin/update-ca-certificates .
sed -e 's#=/etc/#=${DESTDIR}/etc/#' -i update-ca-certificates
sed -e 's#=/share/#=${DESTDIR}/share/#' -i update-ca-certificates
sed -e 's#=/local/#=${DESTDIR}/local/#' -i update-ca-certificates

DESTDIR="$butch_install_dir" sh ./update-ca-certificates --fresh
# make sure everything in /etc gets overwritten
butch_do_overwrite_on_copy=true

path: pkg/ca-certificates


code:
[mirrors]
http://cairographics.org/releases/cairo-1.14.6.tar.xz
http://distfiles.lesslinux.org/cairo-1.14.6.tar.xz

[vars]
filesize=36040596
sha512=e2aa17a33b95b68d407b53ac321cca15b0c148eb49b8639c75b2af1e75e7b417a2168ea978dabb8581b341f0f45dc042d3b1a56b01ab525b1984015f0865316b

[deps]
fontconfig
libpng
glib
pixman
libx11
libxext

[build]
cat << EOF > test/Makefile.in
all:
	true
install:
	true

EOF
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) --with-sysroot=$butch_root_dir"
export ax_cv_c_float_words_bigendian=no
$CC -dM -E - < /dev/null  | grep __FLOAT_WORD_ORDER__ | \
  grep __ORDER_BIG_ENDIAN__ >/dev/null && \
  export ax_cv_c_float_words_bigendian=yes || true
CFLAGS="$optcflags -D_GNU_SOURCE" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  ac_cv_func_XRenderCreateLinearGradient=yes \
  ac_cv_func_XRenderCreateRadialGradient=yes \
  ac_cv_func_XRenderCreateConicalGradient=yes
make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/cairo


code:
[mirrors]
http://www.cairographics.org/releases/cairomm-1.10.0.tar.gz

[vars]
filesize=1089577
sha512=974b1c078c8d7b82f8d026e384811c016fa95cb62942fc12717edd993cb1660bc004bee5f8ce31c0540ef8d4105a2d86cd461ed3f5e996fd3faf65dfb37ac9e2

[deps]
cairo
libsigc++

[deps.host]
pkgconf

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS=-D_GNU_SOURCE \
CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags

[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"
for i in tests docs examples ; do
        printf 'all:\n\ttrue\ninstall:\n\ttrue\clean:\n\ttrue\n' > "$i"/Makefile
done

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/cairomm


code:
[mirrors]
https://dev.archlinux.org/~thomas/capchroot/capchroot-0.1.tar.gz
http://ftp.barfooze.de/pub/sabotage/tarballs/capchroot-0.1.tar.gz
http://foss.aueb.gr/mirrors/linux/sabotage/tarballs/capchroot-0.1.tar.gz
http://dl.2f30.org/mirrors/sabotage/tarballs/capchroot-0.1.tar.gz

[vars]
filesize=10122
sha512=897c10409ab3a7128e8b89ffef03a9b187aa1a62367be3b88cb443b3ee7b61a9ee8c1d0445f5973f663445febeca9b884ba1ef876df1a6c8fdd95d3c14c8701f

[deps]
libcap2

[build]
patch -p1 < "$K"/capchroot-0.1-static.patch
sed -i 's@/opt/bedrock@@' Makefile

#CFLAGS=-D_GNU_SOURCE ./configure -C --prefix="$butch_prefix"
make -j$MAKE_THREADS CFLAGS=-D_GNU_SOURCE
make DESTDIR="$butch_install_dir" install

path: pkg/capchroot


code:
[mirrors]
https://github.com/aquynh/capstone/archive/3722c74.tar.gz

[vars]
filesize=3186302
sha512=7854d6365c19d3ff9a65882bd34a247085746b4854940471dbdf62f23119a37569f123f3b6ced5a2f74782f2188bf8a3b5c7aff6beb063b44fdf9a1b44f90ad1
tarball=capstone-3722c74.tar.gz
tardir=capstone-3722c74f69ffa5b705d36cd49c19acdf958a9b7a

[deps]

[deps.host]
cmake

[build]
mkdir -p build && cd build
for i in ar ld nm objcopy objdump strip ; do
printf '#!/bin/sh\n%s%s "$@"\n' "$CROSS_COMPILE" "$i" > "$CROSS_COMPILE""$i"
chmod +x "$CROSS_COMPILE""$i"
done
[ -n "$CROSS_COMPILE" ] && xconfflags="
-DCMAKE_FIND_ROOT_PATH=$butch_root_dir$butch_prefix \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_AR="$CROSS_COMPILE"ar \
-DCMAKE_LD="$CROSS_COMPILE"ld \
-DCMAKE_NM="$CROSS_COMPILE"nm \
-DCMAKE_OBJCOPY="$CROSS_COMPILE"objcopy \
-DCMAKE_OBJDUMP="$CROSS_COMPILE"objdump \
-DCMAKE_STRIP="$CROSS_COMPILE"strip \
"

CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags  -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
CXXFLAGS="$optcflags" \
cmake $xconfflags \
  -DCMAKE_INSTALL_PREFIX="$butch_prefix" \
  -DCMAKE_VERBOSE_MAKEFILE=ON \
  ..
make -j$MAKE_THREADS VERBOSE=1
make DESTDIR="$butch_install_dir" install

path: pkg/capstone


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/cddetect-2.1-1.tar.bz2

[vars]
filesize=11290
sha512=8a64d3c743f3e5664f0cde39604a69c993aa4a4b1e8f8589469a85bec48caa06444f6c833a89a8f8c08eff50a48484617f8d572e6047ffdf0f13a51bb138cf47
desc="Detect CD inserted in drive"

[deps]

[build]
patch -p1 < "$K"/cddetect-2.1-1-limits.patch
make || exit 1

dest="$butch_install_dir""$butch_prefix"
mkdir -p $dest/sbin
install -m755 cddetect $dest/sbin

path: pkg/cddetect


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/cddetect_quick-2008-1.tar.bz2

[vars]
filesize=1323
sha512=53edcffdd968ad586bb830d7e880892e9f26664485d686e685a1f93ef1513c358a3ac0996e51421c844e0648fcb552754630ffd0411d026d4e19f915d872f283
desc="Detect CD inserted in drive, fast. Hack of cddetect."

[deps]

[build]

gcc cddetect.c -o cddetect_quick || exit 1

dest="$butch_install_dir""$butch_prefix"
mkdir -p $dest/sbin
install -m755 -s cddetect_quick $dest/sbin

path: pkg/cddetect-quick


code:
[mirrors]
http://downloads.sourceforge.net/project/cdrtools/alpha/cdrtools-3.02a06.tar.gz

[vars]
filesize=2694917
sha512=aeedde445417435456dff2cf0276df98434446ea4da431dd77aaf27715c1a3fe2b21f042cbe21853a553a31ee0345bcd6ba0d41898440b54d1ead84c44552127
desc="A command-line CD/DVD recording program"
tardir=cdrtools-3.02

[deps]

[build]

#hack:
echo 'bin:x:11:root' >> "$R"/etc/group

CFLAGS="$optcflags" LDFLAGS="$optldflags" make || exit 1

make INS_BASE="$butch_install_dir" install

path: pkg/cdrtools


code:
[deps]
go
git
[build]
repo="github.com/uriel/cgd"

dest="$butch_install_dir""$butch_prefix"
srcdest="$S"/build/"$butch_package_name"
GOROOT="$butch_root_dir"/opt/go GOPATH="$dest" go get "$repo"
[ -d "$srcdest" ] && rm -rf "$srcdest"
mv -f "$dest"/src "$srcdest"

path: pkg/cgd


code:
[mirrors]
http://code.call-cc.org/releases/4.9.0/chicken-4.9.0.1.tar.gz

[vars]
filesize=4023371
sha512=fff4b43833d98bcc76252f7f1d7e491f8f64cfdc7357c94c91df728eb556e2e9019bb4eb9fb944d7592c81ea1c8941114338b704ff690c0f24c5b518c4437f28

[build]
make PLATFORM=linux PREFIX="$butch_prefix"
make PLATFORM=linux PREFIX="$butch_prefix" DESTDIR="$butch_install_dir" install

path: pkg/chicken-scheme


code:
[mirrors]
http://download.tuxfamily.org/chrony/chrony-1.29.tar.gz
[vars]
filesize=392880
sha512=bea384e098a7ea3862e49b31ee85959ae1d23af3a095dd34dbfc6e52329dc9404ff2ca9d0e01eb12ea79d2f5ab484a67f025c152a374bc6bd0e3a803a3bec93e

[deps]
libcap2

[build]
[ -z "$butch_prefix" ] && butch_prefix=/
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure --prefix="/$butch_prefix" \
              --sbindir="/bin" \
              --without-readline \
              --without-nss
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
install -D -m 644 examples/chrony.conf.example "$butch_install_dir"/"$butch_prefix"/etc/chrony.conf

IS="$K"/bin/butch-install-service
"$IS" --down --log --force chrony "$K"/services/chrony

path: pkg/chrony


code:
[mirrors]
ftp://ftp.gnu.org/gnu/classpath/classpath-0.99.tar.gz

[vars]
filesize=11078232
sha512=d8f38677ecc6a0f4b26197ab16e9888c51043364141675ad69684828e2d0ecb93122249672e2e7997aea817cc4aac68c17ccf59bf8913afe81e9536bee6b73ac

[deps]
gcc474.java

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

[ -z "$GCJ" ] && GCJ=gcj
[ -z "$JAVAC" ] && export JAVAC="$GCJ -Wno-all -Wno-unchecked -Wno-raw \
  -Wno-allDeadCode -Wno-compareIdentical -Wno-serial -C"
extraflags=--disable-gtk-peer
test "$option_gtk" = 1 && extraflags=
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags \
  --disable-gconf-peer ac_cv_prog_java_works=yes --without-gjdoc \
  --disable-Werror --without-jar \
  --disable-gjdoc --disable-examples --disable-xmlj \
  --disable-dependency-tracking

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/classpath


code:
[mirrors]
http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz

[vars]
filesize=6068231
sha512=a0fe8f6305052ba7894a7d58aa30f97b4be1f52eb7de650273a704929a6fbe81c7cebfa6e68a18c9e7d62f7ed02c944f74c2974da9aacc70e2cb186e0a1be44d
desc='immensely bloated build tool mostly used by windows and C++ folks'

[deps]
bzip2
curl
expat
zlib
libarchive

[deps.host]
dynamic-toolchain

[build]
if [ -z "$CROSS_COMPILE" ] ; then
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure --prefix="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
else

mkdir -p build && cd build
for i in ar ld nm objcopy objdump strip ; do
printf '#!/bin/sh\n%s%s "$@"\n' "$CROSS_COMPILE" "$i" > "$CROSS_COMPILE""$i"
chmod +x "$CROSS_COMPILE""$i"
done
[ -n "$CROSS_COMPILE" ] && xconfflags="
-DCMAKE_FIND_ROOT_PATH=$butch_root_dir$butch_prefix \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_AR="$CROSS_COMPILE"ar \
-DCMAKE_LD="$CROSS_COMPILE"ld \
-DCMAKE_NM="$CROSS_COMPILE"nm \
-DCMAKE_OBJCOPY="$CROSS_COMPILE"objcopy \
-DCMAKE_OBJDUMP="$CROSS_COMPILE"objdump \
-DCMAKE_STRIP="$CROSS_COMPILE"strip \
"
sed -i 's@macro(ADD_DOCS target dependency)@macro(ADD_DOCS target dependency)\nendmacro()\nmacro(ADD_FUCKS target dependency)@' ../Utilities/CMakeLists.txt || { echo sed err ; exit 1 ; }
sed -i 's@^  COMMAND \${CMD}@  COMMAND true@' ../Utilities/CMakeLists.txt || { echo sed err ; exit 1 ; }
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags  -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
CXXFLAGS="$optcflags" \
cmake $xconfflags \
  -DCMAKE_INSTALL_PREFIX="$butch_prefix" \
  -DCMAKE_VERBOSE_MAKEFILE=ON \
  -DCMAKE_USE_SYSTEM_BZIP2=ON \
  -DCMAKE_USE_SYSTEM_LIBARCHIVE=ON \
  -DCMAKE_USE_SYSTEM_CURL=ON \
  -DCMAKE_USE_SYSTEM_ZLIB=ON \
  -DCMAKE_USE_SYSTEM_EXPAT=ON \
  -DCTEST_TEST_CPACK=OFF \
  ..
make -j$MAKE_THREADS VERBOSE=1

for i in 1 txt html docbook ; do
touch Docs/cmake.$i Docs/cmakecommands.$i Docs/cmakecompat.$i \
  Docs/cmakeprops.$i Docs/cmakepolicies.$i Docs/cmakevars.$i \
  Docs/cmakemodules.$i Docs/cmake-policies.$i Docs/cmake-properties.$i \
  Docs/cmake-variables.$i Docs/cmake-modules.$i Docs/cmake-commands.$i \
  Docs/cmake-compatcommands.$i
done

sed -i 's@^[\t ]*bin/cmake@\tcmake@g' Makefile
make DESTDIR="$butch_install_dir" install

fi

path: pkg/cmake


code:
[mirrors]
https://github.com/jgm/cmark/archive/0.18.tar.gz

[vars]
filesize=221416
sha512=2f7bb90ad4aadc15cc99a2d4a51c1fc612148f451a19ae8976f61550df899cde02894bf93d2ba48c1d341f9e7d0d3f76198be819fe7a24006736071ffbe7b3e0
tardir=cmark-0.18
tarball=cmark-0.18.tar.gz
desc="commonmark parsing and rendering library"

[deps.host]
cmake

[build]
mkdir build && cd build
for i in ar ld nm objcopy objdump strip ; do
printf '#!/bin/sh\n%s%s "$@"\n' "$CROSS_COMPILE" "$i" > "$CROSS_COMPILE""$i"
chmod +x "$CROSS_COMPILE""$i"
done
[ -n "$CROSS_COMPILE" ] && xconfflags="
-DCMAKE_FIND_ROOT_PATH=$butch_root_dir$butch_prefix \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
-DCMAKE_AR="$CROSS_COMPILE"ar \
-DCMAKE_LD="$CROSS_COMPILE"ld \
-DCMAKE_NM="$CROSS_COMPILE"nm \
-DCMAKE_OBJCOPY="$CROSS_COMPILE"objcopy \
-DCMAKE_OBJDUMP="$CROSS_COMPILE"objdump \
-DCMAKE_STRIP="$CROSS_COMPILE"strip \
"

CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
cmake $xconfflags \
  -DCMAKE_INSTALL_PREFIX="$butch_prefix" \
  -DCMAKE_VERBOSE_MAKEFILE=ON \
  ..
make -j$MAKE_THREADS VERBOSE=1
make DESTDIR="$butch_install_dir" install

path: pkg/cmark


code:
[vars]
filesize=480924
sha512=7f37a8dcfce047ada9968681e07f66f014f8090aa5ce99358944a60715c7ef2bc62abf4b5c146fe99a0c812f2286ff0c009683b702a4e20c66617d955cf80caa

[mirrors]
http://iweb.dl.sourceforge.net/project/cmph/cmph/cmph-2.0.tar.gz

[deps]

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
CPPFLAGS=-D_GNU_SOURCE \
  ./configure -C --prefix="$butch_prefix" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
#http://cmph.sourceforge.net/gperf.html
#+ gperf pulls in lots of GNU stuff

path: pkg/cmph


code:
[vars]
filesize=224675
sha512=a43e976dd7ca39d576ae51b0f66f9bc4fa21f30626cb814fa237389c9bbc1c0b5a3a28b1d3d0d86527c3a3ffb771cc68d29d5ca8b88f0390bda7926e668504e4

[mirrors]
http://downloads.sourceforge.net/project/cmus/cmus-v2.5.0.tar.bz2

[deps]
curses
alsa-lib
libogg
libvorbis
libmad

[build]
# fix call to check_program $CC which fails since it lacks quoting around "$CC"
sed -i 's@^\tcheck_program.*$@#@' scripts/checks.sh
LDFLAGS="$optldflags -lcurses -lterminfo" \
CFLAGS="$optcflags" \
LD="$CC" \
HOSTLD="$HOSTCC" \
./configure prefix="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/cmus


code:
[mirrors]
ftp://ftp.x.org/pub/individual/proto/compositeproto-0.4.2.tar.bz2

[vars]
filesize=101208
sha512=ad5e4d87b77a8447c228ca85ac8d010d93b5c64929dc866e99a25700b9905f7c3f22e48f8c7fdc54e87879ddcc90e5d4adc338aeea393d7057b19b5ccae31f11

[deps]
util-macros

[deps.host]
pkgconf

[build]
cp -f "$K"/config.sub .
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure -C --prefix="$butch_prefix" $xconfflags
make DESTDIR="$butch_install_dir" -j$MAKE_THREADS install

path: pkg/compositeproto


code:
[deps]
stage1
gdb
file
hexedit0r
htop
iptables
dropbear
lynx
nano
proxychains
posix-man
strace
git
screen
tcpdump
tree
wget
wireless-tools
wpa-supplicant
xz
su
extlinux
host

path: pkg/core


code:
[mirrors]
http://ftp.gnu.org/gnu/coreutils/coreutils-8.20.tar.xz
[vars]
filesize=5273788
sha512=adbeab5af780ae70d2a98a81e96ad2cdfbcbc20153372b0085f6ac75ae9fadff82bd09b460400820057692b4145d7f2d276630b76b0ed509303587972ed175cd

[deps.host]
dynamic-toolchain

[build]
patch -p1 < "$K"/coreutils-xcompile.patch
# by default gnulib builds 230 of 389 C-files.
GNULIB_CPPFLAGS=$("$K"/gnulibfix lib)
dir=$PWD
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
FORCE_UNSAFE_CONFIGURE=1 \
CFLAGS="-D_GNU_SOURCE -I $dir $GNULIB_CPPFLAGS" \
./configure -C --prefix="$butch_prefix" \
  gl_cv_func_working_mktime=yes gl_cv_func_linkat_follow=yes gl_cv_func_mknod_works=yes \
  gl_cv_func_getgroups_works=yes $xconfflags

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/coreutils


code:
[mirrors]
http://www.willhackforsushi.com/code/cowpatty/4.6/cowpatty-4.6.tgz

[vars]
filesize=104979
sha512=87c55f3f43c0342cbcc46227a1e4cfe3f23e215adc68e376991b85344b00b56e7b57e3cf0f1e3d18378cd830a247b2e36644b41b5c0f00a2a382b410f4ab35af
desc='wpa cracking and handshake verification tool'

[deps]
libpcap
libressl

[build]
make V=1 -j1 CFLAGS="-DOPENSSL $optcflags" \
  LDLIBS="$optldflags -lcrypto -lpcap"
make DESTDIR="$butch_install_dir" BINDIR="$butch_prefix"/bin install

path: pkg/cowpatty


code:
[deps]
perl

[vars]
filesize=739979
sha512=58971592e5a68f62955d7b2b1c5d638c526a01f9f7f2721d3081d8bc858873b53d3cbea7dce8236a10a6de70bdba69f9683f617c560e8487221f72957d30d30a

[mirrors]
http://search.cpan.org/CPAN/authors/id/A/AN/ANDK/CPAN-1.9800.tar.gz

[build]
perl Makefile.PL
make && make test && make DESTDIR="$butch_install_dir" install

path: pkg/cpan


code:
[vars]
filesize=1018483
sha512=b6ccb3e121ea29780219d21c9cd6267c2f7b7ae72fb899bb80e1c54cc33e9eac5363443d93dbfbe37e8e8d295dad2724ac607f0543cc62797919605f68c396aa

[mirrors]
http://ftp.gnu.org/gnu/cpio/cpio-2.11.tar.bz2

[deps]

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
gl_cflags=$("$K"/gnulibfix gnu)
CPPFLAGS="-D_GNU_SOURCE $gl_cflags" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  gl_cv_func_fdopendir_works=yes \
  gl_cv_func_rmdir_works=yes \
  gl_cv_func_sleep_works=yes \
  --disable-silent-rules
printf '#include_next <sys/stat.h>\n' > gnu/sys_stat.in.h
make -j$MAKE_THREADS AR="$CROSS_COMPILE"ar RANLIB="$CROSS_COMPILE"ranlib
make DESTDIR="$butch_install_dir" install

path: pkg/cpio


code:
[mirrors]
http://dev-www.libreoffice.org/src/cppunit-1.13.2.tar.gz

[vars]
filesize=953596
sha512=8f4be569f321d577cec31931f49f4df143bc94e283605509b6ea50c60690aa91a2aed940e7eebd4b2413a4218f9a6c3978d312d8e587eab040283c6563846ecd
desc="unit testing framework for C++"

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags

#[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/cppunit


code:
[mirrors]
http://cdn.kernel.org/pub/linux/utils/cryptsetup/v1.6/cryptsetup-1.6.7.tar.xz
https://www.kernel.org/pub/linux/utils/cryptsetup/v1.6/cryptsetup-1.6.7.tar.xz
http://ftp.free.fr/mirrors/ftp.kernel.org/linux/utils/cryptsetup/v1.6/cryptsetup-1.6.7.tar.xz
http://www.mirrorservice.org/sites/ftp.kernel.org/pub/linux/utils/cryptsetup/v1.6/cryptsetup-1.6.7.tar.xz

[vars]
filesize=1188876
sha512=d6cecd2f3f5d468d4337d4e8407c8c3315e8972c0fc72cd1f93fb67f02a632b56ad293f08f6682f24c9ad0b5ad5967be751e5679413109692ade5823aafd1d19
desc='required component to use encrypted filesystems'

[deps]
libuuid
libressl
popt
libdevmapper

[build]

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') --with-sysroot=$butch_root_dir"
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-nls \
  --with-crypto_backend=openssl
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/cryptsetup


code:
[vars]
filesize=479927
sha512=981912cd335978cde22864e977947fc75326572fb29518e559cc4a8ac1edc84b3604165218a666e36353f17da4f89f8e967acdb88696f816748eb946d79eaa15

[mirrors]
http://sourceforge.net/projects/ctags/files/ctags/5.8/ctags-5.8.tar.gz

[deps]

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
patch -p1 < "$K"/ctags-DESTDIR.patch
CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" --enable-etags $xconfflags

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/ctags


code:
[mirrors]
http://www.cups.org/software/1.6.3/cups-1.6.3-source.tar.bz2

[vars]
filesize=8265065
sha512=31cafa52bdf1f00d6cf78456bc1dbb2f0440e29a18d45d3088c0da6858b0e35c43be8a1fc10d0efff7572dac5cf16eb93e299a978c4c7ae8af1b2e1e1365ddba
tardir=cups-1.6.3

[deps]

[build]
patch -p1 < "$K"/cups-1.7.0-blfs-1.patch
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-static \
  --disable-avahi \
  --disable-webif \
  --disable-tcp-wrappers \
  --disable-gssapi \
  --disable-pam \
  --disable-dbus \
  --without-java \
  --without-perl \
  --without-python \
  --without-php \
  --disable-gnutls \
  --disable-openssl \
  --disable-cdsassl \
  --disable-dbus \
  --disable-ssl \
  --with-components=core \
  --with-icondir="$butch_prefix"/share/icons \
  --with-menudir="$butch_prefix"/share/applications \
  --with-rcdir="$butch_prefix"/share/cups-rc.d

sed -i 's/-fstack-protector//' Makedefs

make -j$MAKE_THREADS
make DSTROOT="$butch_install_dir" install

# TODO
# - write init scripts derived from /share/cups-rc.d/*
# install users, groups etc - see
# http://www.linuxfromscratch.org/blfs/view/7.4/pst/cups.html

path: pkg/cups


code:
[mirrors]
http://www.openprinting.org/download/cups-filters/cups-filters-1.0.38.tar.xz

[vars]
filesize=1034484
sha512=877f13e7255d4ad04c735ac18651571cffb21948ed4dd949cdba3c123e28d0d593fa5c648045d41da859b89a724a9ef9549571afb48d0143a794eb9ab718f0d0

[deps]
qpdf
cups
ijs
ghostscript
poppler

[build]
# in case this package doesnt work properly,
# install lcms2 may help (this is noted as a required dep in BLFS)

CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" \
  --without-rcdir \
  --with-gs-path="$butch_prefix"/bin/gs \
  --with-pdftops-path="$butch_prefix"/bin/gs \
  --disable-avahi \
  --disable-static \

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/cups-filters


code:
[mirrors]
https://curl.haxx.se/download/curl-7.48.0.tar.lzma

[vars]
filesize=5924818
sha512=1e4cc613aa56d3547beff46c3124a6cb3ba5df89da00055df0b27e2ad57beccec33fd80b2b0d0858cf0de45da5ab5cad8345b0f23f0c536a690a5eab7518a3af

[deps]
libressl
ca-certificates
zlib

[build]
patch -p1 < "$K"/curl-libressl.patch

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" \
CFLAGS="$optcflags" \
LDFLAGS="$optldflags" \
LIBS="-lssl -lcrypto -lz" \
./configure -C \
  --prefix="$butch_prefix" \
  --with-ssl \
  --enable-ipv6 \
  --with-ca-path="$butch_prefix"/etc/ssl/certs \
  --with-random=/dev/urandom $xconfflags

sed -i -e '/SUBDIRS/s:scripts::' Makefile
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/curl


code:
[mirrors]
https://github.com/a-nikolaev/curseofwar/archive/47f7989.tar.gz

[vars]
filesize=73477
sha512=c5d12b30b67de62860e4b29f1e728a24e3a48b7bcba9eb9dc2f868e8f2f62f863177f123861632c6db2d7dd41b6d16359dd78bf32e81843fd7f5caeac1764b57
tarball=curseofwar-1.2.0-47f7989.tar.gz
tardir=curseofwar-47f7989da6edf9a8f19348350f16ac7230b8352a
desc='simple but demanding RTS game, for terminal (curses) or sdl'

[deps]
sdl
curses

[build]
patch -p1 < "$K"/curseofwar-Makefile.patch
patch -p1 < "$K"/curseofwar-fullscreen.patch

cat << EOF > config.mak
CC=$CC
CFLAGS=$optcflags -I$butch_root_dir$butch_prefix/include/SDL
LDFLAGS=$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib
PREFIX=$butch_prefix
DESTDIR=$butch_install_dir
EOF

make SDL=1 -j$MAKE_THREADS all install
make -j$MAKE_THREADS all install

path: pkg/curseofwar


code:
[vars]
filesize=500724
sha512=d6ea0c6eb7fd19a668ce7f61bcc04bc64325352e7aad9a966cc405a7039390031ca38adc0ffa44c97940776d834a59d82d43eb2106643840ed25a0c51625c5b1
tarball=netbsd-curses-0.0.3.tar.xz
desc='netbsd libcurses, lightweight replacement for ncurses'

[mirrors]
http://ftp.barfooze.de/pub/sabotage/tarballs/${tarball}
http://foss.aueb.gr/mirrors/linux/sabotage/tarballs/${tarball}
http://dl.2f30.org/mirrors/sabotage/tarballs/${tarball}

[deps]
musl

[build]
cat << EOF > config.mak
CC=$CC
HOSTCC=$HOSTCC
AR=${CROSS_COMPILE}ar
RANLIB=${CROSS_COMPILE}ranlib
CFLAGS=-fPIC $optcflags
LDFLAGS=$optldflags
PREFIX=$butch_prefix
DESTDIR=$butch_install_dir
EOF

make V=1 -j$MAKE_THREADS
make install

path: pkg/curses


code:
[vars]
filesize=2942652
sha512=d84360b51b966f19ac3f1728265ff25e46d3a3ce6d9e7e30b154f0975bb10ce4f82f5ca3f308d2ff169c2b5dd97b0243e910d2e8ad59a5857aef7a70b9026b19

[mirrors]
ftp://ftp.gnu.org/non-gnu/cvs/source/stable/1.11.23/cvs-1.11.23.tar.bz2
http://ftp.gnu.org/non-gnu/cvs/source/stable/1.11.23/cvs-1.11.23.tar.bz2

[deps]

[build]
patch -p1 < "$K"/cvs1.patch
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --enable-case-sensitivity
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/cvs


code:
[mirrors]
http://cvs2svn.tigris.org/files/documents/1462/49237/cvs2svn-2.4.0.tar.gz

[vars]
filesize=514891
sha512=726fb8a3b3261eeb6d8097973f2741aa7a433f847bcef6701a6c0b7dc3d8fb5da1726e40f008d1dffac71791b953ddb9ade5db5809c98731d78e94da6465506a

[deps.run]
python

[deps.host]
python

[build]
python setup.py build
python setup.py install --prefix="$butch_prefix" \
       --root="$butch_install_dir"
dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/share/cvs2svn
cp cvs2git-example.options "$dest"/share/cvs2svn/


code:
[mirrors]
http://www.yassl.com/altpkg/wolfssl-3.4.6.tar.xz

[vars]
filesize=951728
sha512=18bda7d9e2c01347076e4e718cc41b7dcfb07a22d404d221508b028f1a2afee0f986b211cd385a792a9648a7dabbdf5ecad5ca3570ca2aaa9432645aa87801c3
desc='lightweight SSL/TLS library with partial openssl compatibility layer'

[deps]

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
debug_flags=
[ "$DEBUGBUILD" = 1 ] && debug_flags=--enable-debug

C_EXTRA_FLAGS="-D_GNU_SOURCE $optcflags" \
./configure --prefix="$butch_prefix" $xconfflags \
  --enable-dtls --enable-opensslExtra \
  --enable-static $debug_flags \
  --disable-silent-rules \
  --enable-ipv6 --enable-ripemd --enable-sha512 \
  --enable-sessioncerts --enable-certgen
# aesni is only for cpus with aes extension, amd bulldozer+ or corei7ish
# sniffer depends on pcap

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

if false ; then
	# this was an attempt to use cyassl's openssl compatibility layer
	# however it is not fit for this yet.
	ln -sf cyassl/openssl/ "$butch_install_dir/include/"

	ln -sf libcyassl.a "$butch_install_dir/lib/libssl.a"
	ln -sf libcyassl.a "$butch_install_dir/lib/libcrypto.a"

	ln -sf libcyassl.so "$butch_install_dir/lib/libssl.so"
	ln -sf libcyassl.so "$butch_install_dir/lib/libssl.so.1.0.0"

	ln -sf libcyassl.so "$butch_install_dir/lib/libcrypto.so"
	ln -sf libcyassl.so "$butch_install_dir/lib/libcrypto.so.1.0.0"
fi

path: pkg/cyassl


code:
[mirrors]
ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz
[vars]
filesize=5220231
sha512=78819cb9bb38bea4537d6770d309deeeef09ff44a67526177609d3e1257ff4334d2b5e5131d5a1e4dea7430d8db1918ea9d171f0dee38b5e8337f4b72ed068f0

[deps]

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CPPFLAGS="-D_GNU_SOURCE" \
CFLAGS="$optcflags" \
LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags

( cd include
make makemd5 CC="$HOSTCC"
)
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/cyrus-sasl


code:
[mirrors]
ftp://ftp.x.org/pub/individual/proto/damageproto-1.2.1.tar.bz2

[vars]
filesize=98392
sha512=f124e85fb3cc70ed3536cb9db57ac93461bbb5df1a713bc6b67a5ea49122556c321781ca150df681502f6ccfb7305f290e131ad25ce9ccbff5af268df11c86fc

[deps.host]
pkgconf

[build]
cp -f "$K"/config.sub .
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
./configure -C --prefix="$butch_prefix" $xconfflags
make DESTDIR="$butch_install_dir" -j$MAKE_THREADS install

path: pkg/damageproto


code:
[mirrors]
http://gondor.apana.org.au/~herbert/dash/files/dash-0.5.8.tar.gz

[vars]
filesize=223028
sha512=3dc42d3503b33c50b62c0f9104c0e41c4e8fa7490ba72bc09213fcc894d6fd92b9688c58389acf8b538b08f8e9cc179f0bf5572e22175d1960f04554594237b8
desc="debian almquist shell, a strictly POSIX conforming shell"

[deps]

[build]
cat << EOF > nl.c
#include <stdio.h>
int main() {
	/* the way nl is invoked (-v 0) means we should start with 0 */
        size_t i = 0; char b[4096];
        while(fgets(b, sizeof b, stdin)) { printf("%zu %s", i, b); i++; }
}

EOF
# dash mkbuiltins script depends on "nl"
$HOSTCC nl.c -o nl
export PATH="$PWD:$PATH"

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

LC_CTYPE=C CFLAGS="-D_GNU_SOURCE -D__KLIBC__ $optcflags -g" \
LDFLAGS="$optldflags -static" \
  ./configure -C --prefix="$butch_prefix" $xconfflags

LC_CTYPE=C make -j$MAKE_THREADS CC_FOR_BUILD="$HOSTCC"
make DESTDIR="$butch_install_dir" install

path: pkg/dash


code:
[mirrors]
http://download.oracle.com/berkeley-db/db-6.1.26.tar.gz

[vars]
filesize=37495772
sha512=2590ee3d9e30e6eaeb350edbc2fa7400582c0b520177fe0a3a57a966573268e18ad10b1dc6dee3fb1be9c93ac6f96f848c120793eaf873562464edd125cff4d4
desc='library to interface with berkeley (file-based) databases'

[deps]

[build]
patch -p1 < "$K"/bdb-configure.patch
cd build_unix
mv ../config.cache .

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

CFLAGS="-D_GNU_SOURCE" ../dist/configure -C \
    --prefix="$butch_prefix" --enable-compat185 $xconfflags \
    --enable-shared --enable-static --enable-dbm \
    db_cv_clock_monotonic=yes db_cv_build_sequence=yes db_cv_mmap_extend=yes

sed -i 's/^install_docs:/install_docs:\n\ttrue\ninstall_crap:/' Makefile
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/db


code:
[vars]
filesize=1929630
sha512=eb26f1dfb6c6e3757a408a98e0f4012eda926e2f8ee7a2356ebd567a2e4a7d96effca7cec6e6b4f9e7bc578cbdd7b703d00158343a260859aff0718c76f296b0

[mirrors]
http://dbus.freedesktop.org/releases/dbus/dbus-1.6.8.tar.gz

[deps]
libx11

[build]
mkdir -p dbus/sys
printf '#include <fcntl.h>\n\n' > dbus/sys/fcntl.h
CFLAGS=-D_GNU_SOURCE ./configure -C --prefix="$butch_prefix" --disable-tests --disable-verbose-mode
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/dbus


code:
[mirrors]
http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-0.100.2.tar.gz

[vars]
filesize=748836
sha512=f7bbbeac189a724b7f95dce42e8adaf533a1d1c038521990d0eb2cb41c3f088a93d432c257a75dcce31419a55020455084d983b9471ace385c497f659a39ef59

[deps]
dbus

[build]
CFLAGS=-D_GNU_SOURCE ./configure -C --prefix="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/dbus-glib


code:
[mirrors]
http://http.debian.net/debian/pool/main/d/debootstrap/debootstrap_1.0.67.tar.gz

[vars]
filesize=61863
sha512=751cfabdcefa6de099f12377f4e5ac611d97952197040c8d194abc0ac8f3abd59c21110828592bfa2c7a92299db57fe8c6ee0991e11894470f444a71cfd25151
tardir=debootstrap-1.0.67

[deps]
dpkg
makedev-debian

[build]
sed -i 's,usr/sbin,bin,g; s,usr/share,share,g;' Makefile
sed -i 's,--mtime="$(DATE)" ,,g' Makefile
make MAKEDEV="/bin/MAKEDEV" -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/debootstrap


code:
[mirrors]
http://delta.tigris.org/files/documents/3103/33566/delta-2006.08.03.tar.gz

[vars]
filesize=32804
sha512=3720f164f3721ad06bf5a73e654c70a67d6e7a56d0ce574fb0e8571b33269e56611a909f915bd0ea46434d94206a9548fd99fdef98181efe41e7fb03de75c585
desc='reduces testcases to the minimum to trigger a user-defined condition'

[deps]

[build]

$CC -D_GNU_SOURCE $optcflags $optldflags topformflat.c -o topformflat
dest="$butch_install_dir""$butch_prefix"
for i in topformflat delta multidelta ; do
install -D -m 755 $i "$dest"/bin/$i
done
install -D -m 644 www/using_delta.html  "$dest"/share/doc/delta/using_delta.html

path: pkg/delta


code:
[mirrors]
http://roy.marples.name/downloads/dhcpcd/dhcpcd-6.10.3.tar.xz

[vars]
filesize=185520
sha512=6ebcb720909f4d167d064d5e8ed961c331470762e89f4e5c145f048424ef170ffc218e9a9dcc94e3a8dce6ccc147710ec2ef17627a708918203858f3dcdca43d
desc="Dynamic Host Configuration Protocol (DHCP) Client Daemon"

[deps]

[build]
#include/sys/cdefs.h is in glibc, not in musl. a compat. header is available here:
# https://github.com/JuliaLang/openlibm/blob/master/src/cdefs-compat.h
#sticking it in here (so avail for later pkgs):
mkdir -p "$R"/include/sys
cat> "${R}"/include/sys/cdefs.h <<'EOFMKR'
#ifndef _CDEFS_COMPAT_H_
#define	_CDEFS_COMPAT_H_

#if defined(__cplusplus)
#define	__BEGIN_DECLS	extern "C" {
#define	__END_DECLS	}
#else
#define	__BEGIN_DECLS
#define	__END_DECLS
#endif

#ifdef __GNUC__
#ifndef __strong_reference
#ifdef __APPLE__
#define __strong_reference(sym,aliassym) __weak_reference(sym,aliassym)
#else
#define __strong_reference(sym,aliassym)	\
	OLM_DLLEXPORT extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)));
#endif /* __APPLE__ */
#endif /* __strong_reference */

#ifndef __weak_reference
#ifdef __ELF__
#ifdef __STDC__
#define	__weak_reference(sym,alias)	\
	__asm__(".weak " #alias);	\
	__asm__(".equ "  #alias ", " #sym)
#define	__warn_references(sym,msg)	\
	__asm__(".section .gnu.warning." #sym);	\
	__asm__(".asciz \"" msg "\"");	\
	__asm__(".previous")
#else
#define	__weak_reference(sym,alias)	\
	__asm__(".weak alias");		\
	__asm__(".equ alias, sym")
#define	__warn_references(sym,msg)	\
	__asm__(".section .gnu.warning.sym"); \
	__asm__(".asciz \"msg\"");	\
	__asm__(".previous")
#endif	/* __STDC__ */
#elif defined(__clang__) /* CLANG */
#ifdef __STDC__
#define __weak_reference(sym,alias)     \
    __asm__(".weak_reference " #alias); \
    __asm__(".set " #alias ", " #sym)
#else
#define __weak_reference(sym,alias)     \
    __asm__(".weak_reference alias");\
    __asm__(".set alias, sym")
#endif
#else	/* !__ELF__ */
#ifdef __STDC__
#define __weak_reference(sym,alias)	\
	__asm__(".stabs \"_" #alias "\",11,0,0,0");	\
	__asm__(".stabs \"_" #sym "\",1,0,0,0")
#define __warn_references(sym,msg)	\
	__asm__(".stabs \"" msg "\",30,0,0,0");		\
	__asm__(".stabs \"_" #sym "\",1,0,0,0")
#else
#define __weak_reference(sym,alias)	\
	__asm__(".stabs \"_/**/alias\",11,0,0,0");	\
	__asm__(".stabs \"_/**/sym\",1,0,0,0")
#define __warn_references(sym,msg)	\
	__asm__(".stabs msg,30,0,0,0");			\
	__asm__(".stabs \"_/**/sym\",1,0,0,0")
#endif	/* __STDC__ */
#endif	/* __ELF__ */
#endif  /* __weak_reference */
#endif	/* __GNUC__ */

#endif /* _CDEFS_COMPAT_H_ */
EOFMKR

CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --libexecdir="$butch_prefix"/lib/dhcpcd

make -j$MAKE_THREADS || exit 1

make V=1 DESTDIR="$butch_install_dir" install

mv -f "$R"/opt/dhcpcd/usr/share "$R"/opt/dhcpcd/share
rm -rf "$R"/opt/dhcpcd/usr
mkdir -p "$R"/var/lib/dhcpcd

path: pkg/dhcpcd


code:
[mirrors]
ftp://invisible-island.net/dialog/dialog-1.3-20160209.tgz

[vars]
filesize=499300
sha512=77ad7698c8acc9ec2c4a8e76d73972ed3ee8d323cdb8cb18fbe496ebe4a6c8be873e0e2ecf66bbeb7eb6c398d0ca125969cb068e89c33a17521e1e1b913b1e4a
desc="A utility for creating text-mode dialog boxes"

[deps]
curses

[build]
CFLAGS="$optcflags" LDFLAGS="$optldflags -lcurses -lterminfo" \
  ./configure --prefix="$butch_prefix" $xconfflags \
  --enable-nls --enable-widec

make -j$MAKE_THREADS || exit 1

make V=1 DESTDIR="$butch_install_dir" install
make V=1 DESTDIR="$butch_install_dir" install-lib

path: pkg/dialog


code:
[vars]
filesize=1824077
sha512=9c93735d1da1eb668b33b8763a1e504c1ffb5ffb2ebccce91f289e7eb51cd5342ab481c607bfeabafe3728cb25578ddbbe10c6722761247d8d3c2594ea744953

[mirrors]
ftp://ftp.gnu.org/gnu/diffutils/diffutils-3.0.tar.gz

[build]
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > tests/Makefile.in
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > gnulib-tests/Makefile.in
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags" LDFLAGS="$optldflags -static" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/diffutils


code:
[mirrors]
http://www.dillo.org/download/dillo-3.0.3.tar.bz2

[vars]
filesize=685824
sha512=6feabc19b31deb099bc974be28e009b688338b7cf726e2c7d917cfa07e2c28bfba3ef09be9427e5156bf195623516ce81f8b8ef3c5c426bfac7de505c70a5ef8

[deps]
fltk13
libpng
libressl

[build]
CFLAGS=-D_GNU_SOURCE ./configure -C --prefix="$butch_prefix" \
  --enable-ssl
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/share/applications/
cat << EOF > "$dest"/share/applications/dillo.desktop
[Desktop Entry]
Name=Dillo
Comment=Web Browser
Exec=dillo
Icon=dillo
MimeType=text/html;x-scheme-handler/http;x-scheme-handler/https;
Terminal=false
Type=Application
Categories=GTK;Network;WebBrowser;
EOF

path: pkg/dillo


code:
[mirrors]
http://www.directfb.org/downloads/Core/DirectFB-1.6/DirectFB-1.6.2.tar.gz

[vars]
filesize=4250510
sha512=47ab8803d6af28b167cd5eb1d231a503aad8cf4d9f3a811a7253af1dc5a49e432f917cf45b4877668cc10936830b76ce238c0102a68929bb604e97b97d3010c1

[deps]

[build]
patch -p1 < "$K"/directfb-sigval.patch
patch -p1 < "$K"/directfb-comparfn.patch
patch -p1 < "$K"/directfb-matrox.patch

CFLAGS="-D_GNU_SOURCE" ./configure -C --prefix="$butch_prefix" \
  --disable-silent-rules
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/directfb