code:
[deps]
gmp
mpfr
mpc
zlib

[deps.host]
m4
zlib
libelf

[mirrors]
http://ftpmirror.gnu.org/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2

[vars]
filesize=90006707
sha512=9ac57377a6975fc7adac704ec81355262b9f537def6955576753b87715470a20ee6a2a3144a79cc8fcba3443f7b44c7337d79d704b522d053f54f79aa6b442df

[build]
VERSION=4.9.3
VERSION_REMOVE='s,4\.9\.3.*,,'
# check that libc.so is available, otherwise we'll get a libstdc++.so
# that is statically linked against musls libc.a.
# this will lead to random crashes in C++ apps since two concurrent
# malloc implementations will call brk and mess up each other.
if [ ! -f "$butch_prefix"/lib/libc.so ] ; then
	echo "libc.so non-existing or symlink broken"
	exit 1
fi

patch -p1 < "$K"/gcc485-unwind-dliterate.patch
patch -p1 < "$K"/gcc473-dliterate-configure-var.patch
patch -p1 < "$K"/gcc473-arm-hwcap.patch
patch -p1 < "$K"/gcc485-universal-initializer-no-warning.patch
patch -p1 < "$K"/gcc474-libssp_nonshared.patch

# fix specs file generation. this prevents libgcc_s from being used.
# not only is it slower, it'll cause assertion errors in ld.
sed -i 's,-lgcc_s,--start-group -lgcc_eh -lgcc -lc --end-group,' gcc/gcc.c

# we're doing a bit of hack to place the g++ contents in this folder
# the build system isnt really laid out for extracting multiple tarballs into
# the same dir...

"$K"/libibertyfix libiberty

#more g++ hackery
#sed -i 's,# include <syscall.h>,#include <sys/syscall.h>,' ./libstdc++-v3/libsupc++/guard.cc

#todo check if this isnt to intrusive
sed -i 's,gcc_no_link=yes,gcc_no_link=no,' ./libstdc++-v3/configure

#and even more g++ hackery
mv ./libstdc\+\+-v3/config/os/gnu-linux ./libstdc\+\+-v3/config/os/gnu-linux.org
cp -r ./libstdc\+\+-v3/config/os/generic ./libstdc\+\+-v3/config/os/gnu-linux
cp ./libstdc++-v3/config/os/gnu-linux.org/arm-eabi-extra.ver ./libstdc++-v3/config/os/gnu-linux/
#g++ hackery done

mv ./libitm/config/linux/x86 ./libitm/config/linux/x86_glibc
cp -r ./libitm/config/generic ./libitm/config/linux/x86

sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in

sed -i 's@/lib/ld-linux.so.2@/lib/ld-musl-i386.so.1@' gcc/config/i386/linux.h
sed -i 's@/lib/ld-linux.so.2@/lib/ld-musl-i386.so.1@' gcc/config/i386/linux64.h
if [ "$A" = arm ] ; then
dlarch=arm
$CC -dM -E - < /dev/null | grep __ARMEB__ > /dev/null && dlarch=${dlarch}eb
$CC -dM -E - < /dev/null | grep __ARM_PCS_VFP > /dev/null && dlarch=${dlarch}hf
sed -i 's@/lib/ld-linux.so.3@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/arm/linux-eabi.h
sed -i 's@/lib/ld-linux.so.2@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/arm/linux-elf.h
elif [ "$A" = mips ] ; then
dlarch=mips
$CC -dM -E - < /dev/null | grep _MIPSEL > /dev/null && dlarch=${dlarch}el
$CC -dM -E - < /dev/null | grep __mips_soft_float > /dev/null && dlarch=${dlarch}-sf
sed -i 's@/lib/ld.so.1@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/mips/linux.h
sed -i 's@/lib/ld.so.1@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/mips/linux64.h
sed -i 's@/lib64/ld.so.1@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/mips/linux64.h
sed -i 's@/lib32/ld.so.1@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/mips/linux64.h
fi
sed -i 's@/lib64/ld-linux-x86-64.so.2@/lib/ld-musl-x86_64.so.1@' gcc/config/i386/linux64.h
sed -i 's@/lib/ld.so.1@/lib/ld-musl-powerpc.so.1@g' gcc/config/rs6000/sysv4.h
sed -i 's@/lib/ld.so.1@/lib/ld-musl-powerpc.so.1@g' gcc/config/rs6000/linux64.h
sed -i 's@/lib64/ld64.so.1@/lib/ld-musl-powerpc64.so.1@g' gcc/config/rs6000/linux64.h

patch -p1 < "$K"/gcc-453-patch0.patch

config_arch_flags=
config_arch_target_cflags=
config_arch_target_ldflags=
if [ "$A" = "arm" ] ; then
	patch -p1 < "$K"/gcc-453-patch1.patch
elif [ "$A" = "powerpc" ] ; then
	patch -p1 < "$K"/gcc-454-stackend.patch
	config_arch_flags="--enable-secureplt --with-long-double-64"
	config_arch_target_cflags="-Wl,--secure-plt"
	config_arch_target_ldflags="-Wl,--secure-plt"
fi

machine=
if [ -n "$CROSS_COMPILE" ] ; then
	if [ -z "$GCC_ARCH_CONFIG_FLAGS" ] ; then
		#autodetect arch specifics if not passed via config
		gccv=$($CC -v 2>&1|grep "^Configured with: ")
		for flag in --with-arch --with-float --with-fpu ; do
			for arg in $gccv ; do
				printf "%s" "$arg" | grep "^$flag=" >/dev/null \
				&& { GCC_ARCH_CONFIG_FLAGS="$arg $GCC_ARCH_CONFIG_FLAGS" ; break ; }
			done
		done
	fi
	machine=$($CC -dumpmachine)
	xconfflags="--host=$machine --target=$machine $GCC_ARCH_CONFIG_FLAGS"
	export GCC_FOR_TARGET="$CC"
fi
export CC="$CC -static -D_GNU_SOURCE"

CFLAGS="-O0 -s" LDFLAGS="-Wl,--no-keep-memory" \
CFLAGS_FOR_TARGET="$config_arch_target_cflags" \
LDFLAGS_FOR_TARGET="$config_arch_target_ldflags" \
./configure -C --with-headers=no --prefix="$butch_prefix" \
  --disable-multilib \
  --with-multilib-list= \
  --disable-nls \
  --disable-mudflap \
  --disable-libmudflap \
  --enable-libssp \
  --disable-libgomp \
  --disable-debug \
  --disable-bootstrap \
  --disable-libsanitizer \
  --disable-gnu-indirect-function \
  --enable-lto \
  --with-system-zlib \
  --with-target-libiberty=no --with-target-zlib=no \
  --enable-languages=c,c++ --enable-clocale=generic \
  $config_arch_flags $xconfflags

gcc_cv_libc_provides_ssp=yes \
make -j$MAKE_THREADS BOOT_LDFLAGS="-static" LDFLAGS="-static"
make -j1 DESTDIR="$butch_install_dir" \
  install-gcc \
  install-lto-plugin \
  install-target-libgcc \
  install-target-libssp \
  install-target-libstdc++-v3

dest=$butch_install_dir$butch_prefix

#create a host_tuple dummy entry, so binutils stuff will get into /bin, etc
[ -z $machine ] && machine=$($dest/bin/gcc -dumpmachine)

[ ! -e ${dest}/${machine} ] && 	( cd $dest ; ln -sf . ${machine} )

#remove gcc's stddef.h which is not compatible
rm $dest/lib/gcc/$machine/$VERSION/include/stddef.h

#remove gcc's libssp.* (we only need libssp_nonshared.a)
rm "$dest"/lib/libssp.*

copy() {
	printf "cp %s %s\n" "$1" "$2"
	cp "$1" "$2"
}

echo link gcc intrinsic headers into /include/gcc
# this allows usage of -I/include/gcc for stuff that uses them
mkdir -p  $dest/include/gcc
for i in $dest/lib/gcc/$machine/$VERSION/include/* ; do
  header=`basename "$i"`
  # do not copy headers that exist in musl
  [ -e "$dest/include/$header" ] || copy "$i" "$dest/include/gcc/" || true
done

ln -sf gcc "$dest"/bin/cc

# assert that libstdc++.so is not statically linked against musl
if ! readelf -a "$dest"/lib/libstdc++.so | grep NEEDED | grep libc.so > /dev/null ; then
	echo "error: libstdc++.so has no NEEDED entry for libc.so!"
	exit 1
fi

ln -sf gcc "$dest"/bin/gcc-$VERSION
ln -sf g++ "$dest"/bin/g++-$VERSION

rm "$butch_install_dir""$butch_prefix"/lib/*.la


code:
[mirrors]
http://ftpmirror.gnu.org/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2

[vars]
filesize=95441837
sha512=d619847383405fd389f5a2d7225f97fedb01f81478dbb8339047ccba7561a5c20045ab500a8744bffd19ea51892ce09fc37f862f2cfcb42de0f0f8cd8f8da37a
desc="the GNU compiler collection, v5.3.0"

[deps]
gmp
mpfr
mpc
zlib

[deps.host]
m4
zlib
libelf

[build]
VERSION=5.3.0
VERSION_REMOVE='s,5\.3\.0.*,,'
# check that libc.so is available, otherwise we'll get a libstdc++.so
# that is statically linked against musls libc.a.
# this will lead to random crashes in C++ apps since two concurrent
# malloc implementations will call brk and mess up each other.
if [ ! -f "$butch_root_dir""$butch_prefix"/lib/libc.so ] ; then
	echo "libc.so non-existing or symlink broken"
	exit 1
fi

patch -p1 < "$K"/gcc520-unwind-dliterate.patch
patch -p1 < "$K"/gcc473-dliterate-configure-var.patch
patch -p1 < "$K"/gcc473-arm-hwcap.patch
patch -p1 < "$K"/gcc520-libssp_nonshared.patch

# fix specs file generation. this prevents libgcc_s from being used.
# not only is it slower, it'll cause assertion errors in ld.
sed -i 's,-lgcc_s,--start-group -lgcc_eh -lgcc -lc --end-group,' gcc/gcc.c

# we're doing a bit of hack to place the g++ contents in this folder
# the build system isnt really laid out for extracting multiple tarballs into
# the same dir...

"$K"/libibertyfix libiberty

#more g++ hackery
#sed -i 's,# include <syscall.h>,#include <sys/syscall.h>,' ./libstdc++-v3/libsupc++/guard.cc

#todo check if this isnt to intrusive
sed -i 's,gcc_no_link=yes,gcc_no_link=no,' ./libstdc++-v3/configure

#and even more g++ hackery
mv ./libstdc\+\+-v3/config/os/gnu-linux ./libstdc\+\+-v3/config/os/gnu-linux.org
cp -r ./libstdc\+\+-v3/config/os/generic ./libstdc\+\+-v3/config/os/gnu-linux
cp ./libstdc++-v3/config/os/gnu-linux.org/arm-eabi-extra.ver ./libstdc++-v3/config/os/gnu-linux/
#g++ hackery done

mv ./libitm/config/linux/x86 ./libitm/config/linux/x86_glibc
cp -r ./libitm/config/generic ./libitm/config/linux/x86

sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in

sed -i 's@/lib/ld-linux.so.2@/lib/ld-musl-i386.so.1@' gcc/config/i386/linux.h
sed -i 's@/lib/ld-linux.so.2@/lib/ld-musl-i386.so.1@' gcc/config/i386/linux64.h
if [ "$A" = arm ] ; then
dlarch=arm
$CC -dM -E - < /dev/null | grep __ARMEB__ > /dev/null && dlarch=${dlarch}eb
$CC -dM -E - < /dev/null | grep __ARM_PCS_VFP > /dev/null && dlarch=${dlarch}hf
sed -i 's@/lib/ld-linux.so.3@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/arm/linux-eabi.h
sed -i 's@/lib/ld-linux.so.2@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/arm/linux-elf.h
elif [ "$A" = mips ] ; then
dlarch=mips
$CC -dM -E - < /dev/null | grep _MIPSEL > /dev/null && dlarch=${dlarch}el
$CC -dM -E - < /dev/null | grep __mips_soft_float > /dev/null && dlarch=${dlarch}-sf
sed -i 's@/lib/ld.so.1@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/mips/linux.h
sed -i 's@/lib/ld.so.1@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/mips/linux64.h
sed -i 's@/lib64/ld.so.1@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/mips/linux64.h
sed -i 's@/lib32/ld.so.1@/lib/ld-musl-'$dlarch'.so.1@' gcc/config/mips/linux64.h
fi
sed -i 's@/lib64/ld-linux-x86-64.so.2@/lib/ld-musl-x86_64.so.1@' gcc/config/i386/linux64.h
sed -i 's@/lib/ld.so.1@/lib/ld-musl-powerpc.so.1@g' gcc/config/rs6000/sysv4.h
sed -i 's@/lib/ld.so.1@/lib/ld-musl-powerpc.so.1@g' gcc/config/rs6000/linux64.h
sed -i 's@/lib64/ld64.so.1@/lib/ld-musl-powerpc64.so.1@g' gcc/config/rs6000/linux64.h

patch -p1 < "$K"/gcc-453-patch0.patch

config_arch_flags=
config_arch_target_cflags=
config_arch_target_ldflags=
if [ "$A" = "arm" ] ; then
	patch -p1 < "$K"/gcc-453-patch1.patch
elif [ "$A" = "powerpc" ] ; then
	patch -p1 < "$K"/gcc-454-stackend.patch
	config_arch_flags="--enable-secureplt --with-long-double-64"
	config_arch_target_cflags="-Wl,--secure-plt"
	config_arch_target_ldflags="-Wl,--secure-plt"
fi

machine=
if [ -n "$CROSS_COMPILE" ] ; then
	if [ -z "$GCC_ARCH_CONFIG_FLAGS" ] ; then
		#autodetect arch specifics if not passed via config
		gccv=$($CC -v 2>&1|grep "^Configured with: ")
		for flag in --with-arch --with-float --with-fpu ; do
			for arg in $gccv ; do
				printf "%s" "$arg" | grep "^$flag=" >/dev/null \
				&& { GCC_ARCH_CONFIG_FLAGS="$arg $GCC_ARCH_CONFIG_FLAGS" ; break ; }
			done
		done
	fi
	machine=$($CC -dumpmachine)
	xconfflags="--host=$machine --target=$machine $GCC_ARCH_CONFIG_FLAGS"
	export GCC_FOR_TARGET="$CC"
fi
static_ccflags=-static
if [ "$GCC_DYNAMIC" = 1 ] ; then
	static_ccflags=
fi
export CC="$CC $static_ccflags -D_GNU_SOURCE"

CFLAGS="-O0 -s" LDFLAGS="-Wl,--no-keep-memory" \
CFLAGS_FOR_TARGET="$config_arch_target_cflags" \
LDFLAGS_FOR_TARGET="$config_arch_target_ldflags" \
./configure -C --with-headers=no --prefix="$butch_prefix" \
  --disable-multilib \
  --with-multilib-list= \
  --disable-nls \
  --disable-mudflap \
  --disable-libmudflap \
  --enable-libssp \
  --disable-libgomp \
  --disable-debug \
  --disable-bootstrap \
  --disable-libsanitizer \
  --disable-gnu-indirect-function \
  --enable-lto \
  --with-system-zlib \
  --with-target-libiberty=no --with-target-zlib=no \
  --enable-languages=c,c++,lto --enable-clocale=generic \
  $config_arch_flags $xconfflags

gcc_cv_libc_provides_ssp=yes \
make -j$MAKE_THREADS BOOT_LDFLAGS="$static_ccflags" LDFLAGS="$static_ccflags"
make -j1 DESTDIR="$butch_install_dir" \
  install-gcc \
  install-lto-plugin \
  install-target-libgcc \
  install-target-libssp \
  install-target-libstdc++-v3

dest=$butch_install_dir$butch_prefix

#create a host_tuple dummy entry, so binutils stuff will get into /bin, etc
[ -z $machine ] && machine=$($dest/bin/gcc -dumpmachine)

[ ! -e ${dest}/${machine} ] && 	( cd $dest ; ln -sf . ${machine} )

#remove gcc's stddef.h which is not compatible
rm $dest/lib/gcc/$machine/$VERSION/include/stddef.h

#link liblto_plugin.so in place
[ -e "$dest"/libexec/gcc/$machine/$VERSION/liblto_plugin.so ] && {
mkdir -p "$dest"/lib/bfd-plugins
ln -sf ../../libexec/gcc/$machine/$VERSION/liblto_plugin.so \
   "$dest"/lib/bfd-plugins/liblto_plugin.so
}

#remove gcc's libssp.* (we only need libssp_nonshared.a)
rm "$dest"/lib/libssp.*

copy() {
	printf "cp %s %s\n" "$1" "$2"
	cp "$1" "$2"
}

echo link gcc intrinsic headers into /include/gcc
# this allows usage of -I/include/gcc for stuff that uses them
mkdir -p  $dest/include/gcc
for i in $dest/lib/gcc/$machine/$VERSION/include/* ; do
  header=`basename "$i"`
  # do not copy headers that exist in musl
  [ -e "$dest/include/$header" ] || copy "$i" "$dest/include/gcc/" || true
done

ln -sf gcc "$dest"/bin/cc

# assert that libstdc++.so is not statically linked against musl
if ! readelf -a "$dest"/lib/libstdc++.so | grep NEEDED | grep libc.so > /dev/null ; then
	echo "error: libstdc++.so has no NEEDED entry for libc.so!"
	exit 1
fi

ln -sf gcc "$dest"/bin/gcc-$VERSION
ln -sf g++ "$dest"/bin/g++-$VERSION

rm "$butch_install_dir""$butch_prefix"/lib/*.la

repo_name: aarf/bkauler

license: unknown


code:
[mirrors]
ftp://ftp.gnu.org/gnu/gdb/gdb-7.5.1.tar.bz2
http://ftp.gnu.org/gnu/gdb/gdb-7.5.1.tar.bz2

[vars]
filesize=21349391
sha512=23b240f0ca9376dfc2fdeb79e725a3784841d1f787db9f7ca62a5e2f824ddd8b2d5fb3450e19dd8fee79589e3b0a5fe638eaa35966363c78c82711731c26dc47

[deps]
kernel-headers
curses
gettext
readline

[deps.host]
patch

[build]
#fix missing "makeinfo" requirement...
find . -name 'configure' -exec sed -i 's,MAKEINFO="$MISSING makeinfo",MAKEINFO=true,' '{}' \;

# remove hardcoded -O2 -g CFLAGS which are *not* overridable (i.e. always appended, taking precedence)
find . -name configure -exec sed -e 's/CFLAGS="-g -O2"/:/g' -e 's/CFLAGS="-O2"/:/g' -i "{}" \;

patch -p1 < "$K"/gdb-threaddb.patch
patch -p1 < "$K"/gdb-linux_nat.patch
patch -p1 < "$K"/gdb-amd64-debugreg.patch
patch -p1 < "$K"/gdb-arm-gentmap.patch
patch -p1 < "$K"/gdb-76-linux-low-threaddb.patch
patch -p1 < "$K"/gdb-76-pid_t.patch

# fix mips build ...
cp "$K"/gdb-sgidefs.h gdb/sgidefs.h

"$K"/libibertyfix libiberty

cp -f "$K"/config.sub .

mkdir build
cd build
mv ../config.cache .
# fixing implicit declaration in recursively called (by make) configure tests...
cat << EOF >> config.cache
bash_cv_must_reinstall_sighandlers=yes
bash_cv_func_sigsetjmp=yes
bash_cv_func_strcoll_broken=no
bash_cv_func_ctype_nonascii=no
ac_cv_func_strncmp_works=yes
ac_cv_c_stack_direction=-1
gt_cv_func_gnugettext1_libintl=yes
EOF
# readline and and libiberty have broken checks; but we have to copy config.cache
# everywhere to get cache.
for culprit in readline libiberty libdecnumber opcodes readline bfd ; do
	mkdir -p $culprit
	cp config.cache $culprit/
done
sed -i 's/noconfigdirs=""/noconfigdirs="intl readline"/' ../configure
# let's use libedit in lieu of readline and save us from the in-tree compile of the latter...
ln -sf "$butch_root_dir""$butch_prefix"/lib/libreadline.a readline/libreadline.a
archflags=
if [ "$A" = "powerpc" ] ; then
	cp "$K"/ppc-regs.h .
	archflags="-include $PWD/ppc-regs.h"
fi

gdbserverflags="--enable-gdbserver=no"
[ "$WANT_GDBSERVER" = 1 ] && gdbserverflags="--enable-gdbserver=yes --disable-inprocess-agent"
# gdbserver tries to build some .so for inprocess-agent, but it doesnt strip away -static
# from LDFLAGS, so it tries to link the .so with -shared -static, which can't work

xconfflags=
targets="--enable-64-bit-bfd --enable-targets=x86_64-linux,i386-linux,powerpc-linux,arm-linux,mips-linux,mipsel-linux,microblaze-linux"
if [ -n "$CROSS_COMPILE" ] ; then
        xconfflags="--host=$($CC -dumpmachine)"
        targets=
fi

LDFLAGS="-static $optldflags" \
CFLAGS="-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -O0 $optcflags $archflags" \
../configure -C \
  --prefix="$butch_prefix" --disable-werror --disable-tls \
  --with-system-zlib=yes $gdbserverflags $targets $xconfflags \
  --disable-sim \
  --disable-tui \

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


code:
[mirrors]
ftp://ftp.gnu.org/gnu/gdb/gdb-7.6.2.tar.bz2
http://ftp.gnu.org/gnu/gdb/gdb-7.6.2.tar.bz2

[vars]
filesize=24269334
sha512=e72e9c2abb58cc08c38841380270fe783f26baf62798171d21cf0843e6c9a81d285f424dc6229ea7b1c6c957d999c8aa75c2bd15076817abb9caab28c4eb7666
desc='the GNU debugger. debug applications created in asm, C, C++'

[deps]
kernel-headers
curses
gettext
readline
zlib

[build]
#bash dependency: see https://sourceware.org/bugzilla/show_bug.cgi?id=16370
#fix missing "makeinfo" requirement...
find . -name 'configure' -exec sed -i 's,MAKEINFO="$MISSING makeinfo",MAKEINFO=true,' '{}' \;

# remove hardcoded -O2 -g CFLAGS which are *not* overridable (i.e. always appended, taking precedence)
find . -name configure -exec sed -e 's/CFLAGS="-g -O2"/:/g' -e 's/CFLAGS="-O2"/:/g' -i "{}" \;

patch -p1 < "$K"/gdb-threaddb.patch
patch -p1 < "$K"/gdb-linux_nat.patch
patch -p1 < "$K"/gdb-amd64-debugreg.patch
patch -p1 < "$K"/gdb-arm-gentmap.patch
patch -p1 < "$K"/gdb-76-linux-low-threaddb.patch
patch -p1 < "$K"/gdb-76-readline.patch
patch -p1 < "$K"/gdb-76-pid_t.patch
patch -p1 < "$K"/gdb-76-configure-ash.patch
patch -p1 < "$K"/gdb-76-debuglink-dir.patch

# fix mips build ...
cp "$K"/gdb-sgidefs.h gdb/sgidefs.h

"$K"/libibertyfix libiberty
# total madness: gdb uses libiberty *AND* gnulib
"$K"/gnulibfix gdb/gnulib/import

mkdir build
cd build
mv ../config.cache .
# fixing implicit declaration in recursively called (by make) configure tests...
cat << EOF >> config.cache
bash_cv_must_reinstall_sighandlers=yes
bash_cv_func_sigsetjmp=yes
bash_cv_func_strcoll_broken=no
bash_cv_func_ctype_nonascii=no
ac_cv_func_strncmp_works=yes
ac_cv_c_stack_direction=-1
gt_cv_func_gnugettext1_libintl=yes
EOF
# readline and and libiberty have broken checks; but we have to copy config.cache
# everywhere to get cache.
for culprit in readline libiberty libdecnumber opcodes readline bfd ; do
	mkdir -p $culprit
	cp config.cache $culprit/
done
sed -i 's/noconfigdirs=""/noconfigdirs="intl readline"/' ../configure
# let's use libedit in lieu of readline and save us from the in-tree compile of the latter...
ln -sf "$butch_root_dir""$butch_prefix"/lib/libreadline.a readline/libreadline.a
archflags=
if [ "$A" = "powerpc" ] ; then
	cp "$K"/ppc-regs.h .
	archflags="-include $PWD/ppc-regs.h"
fi

gdbserverflags="--enable-gdbserver=no"
[ "$WANT_GDBSERVER" = 1 ] && gdbserverflags="--enable-gdbserver=yes --disable-inprocess-agent"
# gdbserver tries to build some .so for inprocess-agent, but it doesnt strip away -static
# from LDFLAGS, so it tries to link the .so with -shared -static, which can't work

static_ldflags=-static
pythonflags=
[ "$WANT_PYTHON" = 1 ] && { pythonflags="--with-python" ; static_ldflags= ; }
[ "$GDB_DYNAMIC" = 1 ] && static_ldflags=
tuiflags=
[ "$WANT_TUI" = 1 ] || tuiflags=--disable-tui

xconfflags=
targets="--enable-64-bit-bfd --enable-targets=x86_64-linux,i386-linux,powerpc-linux,arm-linux,mips-linux,mipsel-linux,microblaze-linux"
if [ -n "$CROSS_COMPILE" ] ; then
	xconfflags="--host=$($CC -dumpmachine)"
	targets=
fi

LDFLAGS="$static_ldflags $optldflags" \
CFLAGS="-Dgnu_fnmatch=fnmatch \
 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_rl_echoing_p=readline_echoing_p \
  -O0 $optcflags $archflags" \
../configure -C \
  --prefix="$butch_prefix" --disable-werror --disable-tls \
  --with-system-zlib=yes $gdbserverflags $xconfflags $targets \
  $pythonflags \
  --disable-sim \
  $tuiflags

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


code:
[mirrors]
http://mirror.switch.ch/ftp/mirror/gnu/gdbm/gdbm-1.11.tar.gz

[vars]
filesize=811662
sha512=272fb65ab9ca0a21e9f0dcfb2c638457e87cbb938c65ee850123474d11f2858496f84d3fa9edca27cd91c7220160cfdb59f90bd46ddc45395514addc9fd4151c
desc='gnu dbm key/value database library'

[deps]

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
CPPFLAGS=-D_GNU_SOURCE \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-nls
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/gdbm


code:
[mirrors]
http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.33/gdk-pixbuf-2.33.1.tar.xz

[vars]
filesize=2709492
sha512=acc8c31c2436b6cce7eb1b93061d00aa231ffc8a19c247aa90d270d0cf67cfbd4a3c503d44451f16ba9a4424a97ffe5748271ef8985f7dd8c6996273df8769c1

[deps]
libtiff
libjpeg
libpng
glib
xz

[deps.host]
perl

[build]
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\nclean:\n\ttrue\n\ndistclean:\n\ttrue" > tests/Makefile.in
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) --with-sysroot=$butch_root_dir"
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib -lz" \
  ./configure -C \
  --prefix="$butch_prefix" \
  --disable-introspection \
  --disable-nls $xconfflags gio_can_sniff=yes
make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

dest="$butch_install_dir""$butch_prefix"
dest2="$dest"/include/gdk-pixbuf-2.0/gdk-pixbuf-xlib/
mkdir -p "$dest2"
cp -r contrib/gdk-pixbuf-xlib/*.h "$dest2"

# make fails to generate the file loaders.cache which is crucial to have,
# otherwise gdk-pixbuf will not function at all and only print misleading
# "Couldn't recognize the image file format ..." error messages
# the makefile uses gdk-pixbuf-query-loaders on libpixbufloader-*.la,
#  and since these point to prefix, the referenced .so files are not found.

if [ -z "$CROSS_COMPILE" ] ; then
LD_LIBRARY_PATH="$butch_prefix/lib:$dest/lib" \
"$dest"/bin/gdk-pixbuf-query-loaders "$dest"/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-*.so \
  > "$dest"/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache

sed -i 's,^"'"$dest"',",g' "$dest"/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
else
	echo "XXXXXXXXXX WARNING: need to run gdk-pixbuf-query-loaders on target fs XXXXXXXXXX"
fi

path: pkg/gdk-pixbuf


code:
[vars]
filesize=4149876
sha512=18c98190e387870fd85e8dba7c8033be90594bad038701cc285bfa6a7c3e8bf2817b91330be8d832c18afa3aba17bb3c9c67d86921c5c55be21483b0eb727942

[mirrors]
http://download.geany.org/geany-1.25.tar.bz2

[deps]
gtk+2

[deps.host]
perl

[build]
#https://github.com/geany/geany/issues/829
sed -i 's@which \$CXX@true@' configure
[ -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 --disable-nls

printf 'all:\n\ttrue\ninstall:\n\ttrue\clean:\n\ttrue\n' > po/Makefile

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

path: pkg/geany


code:
[mirrors]
http://download.gimp.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2

[vars]
filesize=7502040
sha512=16ef3f6852fd8efef2b6468a754342a2d003f2c2bef468d9465a448e6c89dedb8e791570f073a9faed05218a7c94c6c418eaa0f3abeadfb3e6b88d766ab792c8

[deps]
pango
cairo
glib
gtk+2
libpng
babl
intltool

[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 \
  --without-sdl \
  --disable-silent-rules

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

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

path: pkg/gegl


code:
[mirrors]
http://ftp.barfooze.de/pub/sabotage/tarballs/gettext-tiny-0.0.4.tar.bz2
http://foss.aueb.gr/mirrors/linux/sabotage/tarballs/gettext-tiny-0.0.4.tar.bz2
http://dl.2f30.org/mirrors/sabotage/tarballs/gettext-tiny-0.0.4.tar.bz2

[vars]
filesize=8874
sha512=719a0fe328bc24ecd6af1b23fd4436f07258a4d598e434b98057735d2ad8e3fc5567374a2f4c8e9e1d0bd76b93ad6555a9d0c448f1429d56776ae9cbcff8235b

[deps]

[build]
patch -p1 < "$K"/gettext-tiny-noop.patch
patch -p1 < "$K"/gettext-tiny-msgmerge-configure.patch
echo prefix="$butch_prefix" > config.mak
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/gettext


code:
[deps]
curses

[deps.host]
dynamic-toolchain

[vars]
filesize=15139737
sha512=1735599307a2d12be609ecfe1141815a11af144c6b94301f6c7101242e0b628251a3613d1d70df099ec07423befeaf10dfb53b8176f710c7e158c4fc63ea8747

[mirrors]
http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz

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

path: pkg/gettext-gnu


code:
[mirrors]
http://downloads.ghostscript.com/public/ghostscript-9.16.tar.bz2

[vars]
filesize=29163348
sha512=6886b6d4f542563c8a87f9ea243736b5b97d2e4c277e6fc8cba0b7b07b7f394c2cff940ada1cfbb8f8e3916df53044837cbfcb1d5c22df865641496766630599

[deps]
expat
freetype
libpng
libtiff
libjpeg
zlib
lcms2
jbig2dec

[build]
# may need some additional fonts
# TODO: add packages for them
# http://www.linuxfromscratch.org/blfs/view/7.4/pst/gs.html
# http://downloads.sourceforge.net/gs-fonts/ghostscript-fonts-std-8.11.tar.gz
# http://downloads.sourceforge.net/gs-fonts/gnu-gs-fonts-other-6.0.tar.gz

# get rid of in-tree lib copies, so the system ones are picked up
rm -rf expat freetype lcms lcms2 jpeg libpng tiff lcms lcms2 cups/libs jbig2dec

printf "#!/bin/sh\necho -lfreetype -I$butch_root_dir$butch_prefix/include/freetype2\n" > freetype-config
chmod +x freetype-config
export PATH="$PWD:$PATH"

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
endian=$("$K"/endiancheck.sh)
CPPFLAGS="-D_GNU_SOURCE" \
CFLAGS="$optcflags $optldflags  -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --enable-"$endian"-endian \
  --enable-dynamic \
  --disable-static \
  --disable-cups \
  --with-system-libtiff \
  --disable-compile-inits \
  --with-jbig2dec \
  --enable-fontconfig \
  --enable-freetype \
  --with-x \
  --disable-gtk \
  --without-luratech
# due to a missing GSLCMS2SRCDIR variable, the build for 2 files ends up
# including -I/include, which pulls in the hosts headers
sed -i 's/GLLCMS2CC=.*$/GLLCMS2CC=$(CC) $(LCMS2_CFLAGS) $(CFLAGS) $(I_)$(GLI_) $(II)FOO$(LCMS2SRCDIR)BAR$(D)include$(_I) $(GLF_)/' base/lib.mak

make CC="$HOSTCC" base/genarch base/genconf base/echogs
mkdir -p obj/aux soobj/aux
for i in echogs genarch genconf ; do
	cp base/"$i" obj/aux
	cp base/"$i" soobj/aux
done

make -j$MAKE_THREADS so
make DESTDIR="$butch_install_dir" soinstall

dest="$butch_install_dir""$butch_prefix"
# in the dynamic build, gsx and gsc are equivalent to gs,
# but they apparently use some different screen output mode.
# so it may be better to symlink gsc to gs.
ln -s gsx "$dest"/bin/gs

path: pkg/ghostscript


code:
[vars]
filesize=287653
sha512=4866df223e6d219a5c9a327874bcd67260c83fba8f99862222df41ef86fb31efa0172a777bf46c853ca380dc2a64bbd41bf4fd658fcb84a924cab4e0f525dcfd

[mirrors]
http://linuxbrit.co.uk/downloads/giblib-1.2.4.tar.gz

[deps]
freetype
libxext
imlib2

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"
cat << EOF >> imlib2-config
#!/bin/sh
printf "%s" "-lImlib2"
EOF
chmod +x imlib2-config
export PATH="$PWD:$PATH"
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"

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

path: pkg/giblib


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

[vars]
filesize=43452
sha512=2f6e604d9201e27c0744f50acf465e5789e474347182f5a21378776b58e9e7102265e3e7a5ca29dad5501b8e9ecfe8b653381e8e9383a8215ef22752604b09cc
desc="A utility for converting 16 color gif images to LSS encoding (Syslinux)"

[deps]

[build]
sed -i -e "s%^CFLAGS =%CFLAGS = -fPIC ${optcflags} %" gif_lib/Makefile
sed -i -e "s%^CFLAGS =%CFLAGS = -fPIC ${optcflags} %" Makefile
sed -i -e "s%^LDFLAGS =.*%LDFLAGS = ${optldflags}%" Makefile

make

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


code:
[mirrors]
http://downloads.sourceforge.net/sourceforge/giflib/giflib-5.1.4.tar.bz2

[vars]
filesize=639703
sha512=32b5e342056c210e6478e9cb3b6ceec9594dcfaf34feea1eb4dad633a081ed4465bceee578c19165907cb47cb83912ac359ceea666a8e07dbbb5420f9928f96d
uchkurl=http://sourceforge.net/projects/giflib/files/

[deps]
libx11

[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 have_xmlto=no
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/giflib


code:
[mirrors]
http://www.lcdf.org/gifsicle/gifsicle-1.88.tar.gz

[vars]
filesize=564670
sha512=4a54557d2a9acb4601151f7a266156ebd317bddb1255d84df042a62be0f57bd75ad8585794bd82081701977c84781696bb06565a3aa1709e0ef04ab89fb2df91
desc="A command-line tool for creating, editing, and getting information about GIF images and animations"

[deps]
libx11
giflib

[build]
#note, mtpaint will use this, if it exists, for creating gif animations.

CFLAGS="$optcflags" LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --enable-gifview --enable-gifdiff --disable-ungif --with-x
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/gifsicle


code:
[mirrors]
http://download.gimp.org/pub/gimp/v2.8/gimp-2.8.14.tar.bz2

[vars]
sha512=533f6b931624d36525cb2f3fbc27fe27565d761bbe26873bb5445c06c01523c044d1814363a8cd76b6e381440db4c6e302b0d3f7a9e5aac7f60072770552f1ba
filesize=20440077
desc='GNOME image manipulation program'

[deps]
babl
gegl
gtk+2
glib
atk
gdk-pixbuf
shared-mime-info

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

# with empty prefix, gimp references share/... instead of /share/...
[ -z "$butch_prefix" ] && butch_prefix=/

# disable the gimp head in the toolbox by default
patch -p1 < "$K"/gimp-toolbox-wilber.patch
sed -i 's@^[[:space:]]*-I$(includedir)@@' $(find . -name Makefile.in)
sed -i 's@^libgimpui = .*$@libgimpui = $(top_builddir)/libgimp/libgimpui-$(GIMP_API_VERSION).la $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la@' $(find plug-ins/ -name Makefile.in)
printf "#!/bin/sh\necho -lfreetype -I$butch_root_dir$butch_prefix/include/freetype2\n" > freetype-config
chmod +x freetype-config
export PATH="$PWD:$PATH"

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\
  --mandir="$butch_prefix"/share/man \
  --disable-python \
  --disable-alsatest \
  --disable-nls \
  --disable-silent-rules \
  --disable-glibtest \
  --without-lcms
#  --with-lcms=lcms2

for i in po po-plug-ins po-python po-libgimp po-script-fu po-tips ; 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/gimp


code:
[mirrors]
http://cdn.kernel.org/pub/software/scm/git/git-2.8.2.tar.xz

[vars]
filesize=3972444
sha512=61c77138c9f29068fc639292f1d4a0119c065aa1267b9e615f90466a15ab5a23e8c1e04fb1032df0a3a5862ec1335d526927a54c02a19efe77267595f7d1cd85
desc='tools to work with the git distributed version control system'

[deps]
musl
curl

[deps.run]
perl

[build]

make CURL_LIBCURL="$butch_root_dir/lib/libcurl.a $butch_root_dir/lib/libssl.a $butch_root_dir/lib/libcrypto.a" \
  CC="$CC" HOSTCC="$HOSTCC" \
  prefix="$butch_prefix" gitexecdir="$butch_prefix"/lib/git-core \
  NO_TCLTK=1 NO_PYTHON=1 NO_EXPAT=1 NO_GETTEXT=1 \
  CFLAGS="$optcflags" LDFLAGS="$optldflags -static" \
  DESTDIR="$butch_install_dir" -j$MAKE_THREADS V=1 all install

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/bin
cp gitk-git/gitk "$dest"/bin/
ln -sf git "$dest"/bin/git-receive-pack
ln -sf git "$dest"/bin/git-upload-archive

path: pkg/git


code:
[mirrors]
http://cdn.kernel.org/pub/software/scm/git/git-manpages-2.8.0.tar.xz

[vars]
filesize=386684
sha512=67a0ddc1a8cec0d835f0889467315523020bb75460cffba39883528833b4e714496950738898c79d156a821db78d16bd76dff0bc7aa5eab8a0217862aa2672e8
desc='manpages for git'

[deps]
man

[build]
dest="$butch_install_dir""$butch_prefix"/share/man
mkdir -p "$dest"
for i in 1 5 7 ; do
cp -a ./man$i "$dest"/
done

path: pkg/git-man


code:
[deps]
git

[deps.run]
tcl
tk

[vars]
desc='graphical frontend to browse git repositories'

path: pkg/gitk


code:
[mirrors]
http://downloads.sourceforge.net/project/glew/glew/1.10.0/glew-1.10.0.tgz

[vars]
filesize=567605
sha512=0c998fda9fe01c9296a3453966c0449c9968f4f5f989065ca65f0da3830ae8d805699d0ee0362c3b18765420222ba18842b9db20986212afceb36c971ae1bdca

[deps]
libx11
libxmu
libxi
libxext
mesalib

[build]
sed -i 's:lib64:lib:g' ./config/Makefile.linux
make -j$MAKE_THREADS CC="$CC" LD="$CC" STRIP=true \
  LDFLAGS.EXTRA="-Wl,-rpath-link=$butch_root_dir$butch_prefix/lib"
GLEW_DEST="$butch_install_dir""$butch_prefix" make install

path: pkg/glew


code:
[mirrors]
http://ftp.gnome.org/pub/gnome/sources/glib/2.45/glib-2.45.2.tar.xz

[vars]
filesize=7151720
sha512=ee25cd8865851a9e7dad0ce90f49883695e802c08f339f9dea83334ed3cd991f6940c83e3f701c24afa9644c939078092fe14a4997d9c70cec3883f4139f9e01

[deps]
musl
libffi
gettext
zlib

[deps.host]
perl
pkgconf

[build]
for p in glib-gtimer-varargs glib-no_python ; do
	echo $p
	patch -p1 < "$K"/$p.patch
done

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

CFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE -Dloff_t=off_t $optcflags" \
LDFLAGS="$optldflags" ./configure -C $xconfflags \
  --prefix="$butch_prefix" --disable-modular-tests --disable-selinux --disable-fam \
  --disable-silent-rules glib_cv_stack_grows=no glib_cv_uscore=no \
  ac_cv_func_posix_getpwuid_r=yes ac_cv_func_posix_getgrgid_r=yes

echo '#include <string.h>' >> config.h

# skip over bogus "missing" checks that only waste time or cause build errors
echo true > missing

make V=1 -j$MAKE_THREADS DESTDIR="$butch_install_dir" \
  LDFLAGS="-Wl,-rpath-link=$this_dir/gthread/.libs/ -Wl,-rpath-link=$this_dir/gmodule/.libs/" \

make DESTDIR="$butch_install_dir" install

path: pkg/glib


code:
[mirrors]
http://ftp.gnome.org/pub/gnome/sources/glib-networking/2.36/glib-networking-2.36.2.tar.xz

[vars]
filesize=352284
sha512=077c8d821ff3942b7ddad51b4045a6a9aa05b50da58f5446ee2e536dbdffa81018141feea9e793da7b031a2991c6e4ccc66e524d288ab9e85603daa895283536

[deps]
gnutls
ca-certificates

[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
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/glib-networking


code:
[mirrors]
http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.28/glibmm-2.28.2.tar.xz

[vars]
filesize=4584624
sha512=c2f3352b67337a28e5d3f662063153addf66fb3fd1024363cc5654c5e75bc8dfc2e6c33159885c030b97da568aa1b5e2477d5972bbd3d46625fd19831427865b

[deps]
glib
libsigc++

[build]
patch -p1 < "$K"/glibmm-varianttype.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" \
  ./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/glibmm


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/glipper-lite-2013-technosaurus.tar.bz2

[vars]
filesize=24082
sha512=67afbc552ce9d815a74d939f133d824a6a465334746ceeacdcbcd3dc941095e4e24511816724ce0be924b17413c8170f593f60ebf2a7cd777fca77ccc7439c92
desc="Glipper-Lite is a clipboard manager in the desktop tray, written in C"

[deps]
gtk+2

[build]
./build

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/bin
install -m 755 -s glipper "$dest"/bin

path: pkg/glipper-lite


code:
[mirrors]
http://tamacom.com/global/global-6.5.2.tar.gz

[vars]
filesize=2924850
sha512=b2eb71f60622bd74adb3e2d5a5a18e91f30ebb5cdeb9cd7408c3a8ea62a9902f8bb9d7de251e76226d61f61fd719ac60443655a2819ae27cb943bb76f237b58e
desc='source code tagging system, similar to ctags'

[deps]

[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/global


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

[vars]
filesize=126969
sha512=3e5bb1949ab9993e07d2ed7e829b9e0a8803eab476e9f4082fc01087c3dce01f3bcb9d55261eaf60e55977a689b326ed1dcf40f74d5e1fc660c83bea094b6754

[deps]

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

path: pkg/glproto


code:
[mirrors]
ftp://ftp.freedesktop.org/pub/mesa/glu/glu-9.0.0.tar.bz2
http://ftp.cc.uoc.gr/mirrors/linux/lfs/LFS/svn/Xorg/glu-9.0.0.tar.bz2

[vars]
filesize=493206
sha512=ff920e3fbca739794e1432a92fdd8517aa732110fea71ed724185425042f83ce18e9866c16f95c6e10f6993f0814a90fac9636e2b3d8ca2084d1ac0a860f61c8

[deps]
mesalib

[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"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/glu


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

[vars]
filesize=17152
sha512=22f0ac738c165177c2fee98c5cf4e3dea42e65fe6e43b7adbb68bbbe3cdf51f732ec4e06185b2510fcdbe3546159cf8bbd7f321c5ed00273c683c9fc902bca23

[deps]
mesalib

[build]
make -j$MAKE_THREADS DEMOS_PREFIX="$butch_prefix" DESTDIR="$butch_install_dir" glxgears glxinfo install

path: pkg/glxdemos


code:
[deps.host]
m4

[vars]
filesize=2024576
sha512=b53cc482e73aa91ae4f83301d9ef83a98cd85cfe53347e102a059fa477edceebded466223b436bc250314eb6ec2e53ecc4fa1528341435f09e232f0c4e305bad

[mirrors]
http://ftpmirror.gnu.org/gmp/gmp-5.0.2.tar.bz2
ftp://ftp.gmplib.org/pub/gmp-5.0.2/gmp-5.0.2.tar.bz2

[build]
# force correct ABI detection on x86 (could fail if a 64bit kernel is used)
abihack=
case "$A" in i[3-6]86) abihack="ABI=32" ;; esac

printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > tests/Makefile.in
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CPPFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE" \
CFLAGS="-Wno-implicit $optcflags" \
LDFLAGS="$optldflags" \
./configure -C $xconfflags \
  --prefix="$butch_prefix" --with-pic --disable-shared $abihack

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
dest="$butch_install_dir""$butch_prefix"
rm -f "$dest"/lib/libgmp.la

path: pkg/gmp


code:
[build]
dest="$butch_install_dir""$butch_prefix"
dest2="$dest"/lib/pkgconfig
mkdir -p "$dest2"

cat << EOF > "$dest2"/gnome-icon-theme.pc
prefix=
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include

Name: Gnome Icon Theme
Description:
Requires: glib-2.0
Version: 2.32.2
Libs:
Cflags:
EOF

path: pkg/gnome-icon-theme-fake


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/gnome-menus-2.14.3.tar.bz2

[vars]
filesize=406000
sha512=17cb019184e7d1fe6ea7974c6217aed2a4661f0ea85a3779da8e5d51ab22880286d1b3b69fdc9d5cd704738c920c427355d9f052a8449e8bbd14ad1b2ef7c8e0
desc="An implementation of the freedesktop menu specification for GNOME"

[deps]

[build]
#need this for pkg xdg-puppy.
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-python --enable-debug=no

make DESTDIR="$butch_install_dir" install

path: pkg/gnome-menus


code:
[deps]
gnu-grep
gettext-gnu

path: pkg/gnu


code:
[mirrors]
http://download.sourceforge.net/gnu-efi/gnu-efi_3.0u.orig.tar.gz

[vars]
filesize=159662
sha512=77224d555befb96b14c20a3a39aacb50ed2db9dfff0c112113c3fb211152106f76cf278b4d37b4251e9f83327c7fd59319e6dee802c97d3bfa7308f7c43b34e3
tardir=gnu-efi-3.0

[deps]
pciutils
libelf

[build]
case "$A" in
  i[3-6]86) sed -ri 's, --no-undefined,,g' Make.defaults ;;
  x86_64) ;;
  *) echo "ERROR: gnu-efi-libs only supports the intel architecture" ; exit 0 ;;
esac
make CC="$CC" PREFIX="$butch_prefix" INSTALLROOT="$butch_install_dir" \
  -j1 all install

path: pkg/gnu-efi-libs


code:
[mirrors]
http://codu.org/~rofl/gnu-getopt-0.0.1.tar.bz2
http://ftp.barfooze.de/pub/sabotage/tarballs/gnu-getopt-0.0.1.tar.bz2
http://foss.aueb.gr/mirrors/linux/sabotage/tarballs/gnu-getopt-0.0.1.tar.bz2
http://dl.2f30.org/mirrors/sabotage/tarballs/gnu-getopt-0.0.1.tar.bz2

[vars]
filesize=6664
sha512=86d9dad674b82655986b32c8611e4025bea3d1bb5ab521f7f1a20e38a20c6eab563652fcc11080f59419b2edf2c794cc88a6394148352b0a8eab0af1c11518c2

[deps]

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

path: pkg/gnu-getopt


code:
[mirrors]
http://ftp.gnome.org/pub/gnome/sources/gnumeric/1.10/gnumeric-1.10.15.tar.bz2

[vars]
filesize=18577516
sha512=4978e633d364de14b615532ff202825298f032a29b27b721fcb99da041a8c15c3fa0eb416a8d4c68dd08a304aa2306c980f3e45ed509d0394e41ecb2558bf69f

[deps]
gtk+2
goffice
gettext

[deps.host]
perl5-XML-Parser

[build]

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

CPPFLAGS=-D_GNU_SOURCE CFLAGS="$optcflags -std=gnu89" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure -C --prefix="$butch_prefix" $xconfflags \
  --without-python \
  --without-perl
[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"
for i in po po-functions ; do
	printf 'all:\n\ttrue\ninstall:\n\ttrue\clean:\n\ttrue\n' > "$i"/Makefile
done

make V=1 -j$MAKE_THREADS
sed -i 's@install-data-hook-omf:@install-data-hook-omf:\n\ttrue\n\nfoobar:@' doc/C/Makefile
make DESTDIR="$butch_install_dir" install

path: pkg/gnumeric


code:
[mirrors]
http://mirrors.dotsrc.org/gcrypt/gnupg/gnupg-1.4.19.tar.bz2
http://mirror.tje.me.uk/pub/mirrors/ftp.gnupg.org/gnupg/gnupg-1.4.19.tar.bz2

[vars]
filesize=3713811
sha512=cce2a83efb05f963ad0f8afd04999cc852889d46b4cad4cf399a37fd6e69f0911a5ccaa0192cb891a941cfa93125349b481efa789a127e3c0aa2c5ba53672741

[deps]
libgcrypt

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine)"
CFLAGS="$optcflags -D_GNU_SOURCE" \
LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags --disable-nls
make -j$MAKE_THREADS AR="$CROSS_COMPILE"ar
make DESTDIR="$butch_install_dir" install

path: pkg/gnupg


code:
[mirrors]
ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4/gnutls-3.4.11.tar.xz
http://ftp.heanet.ie/mirrors/ftp.gnupg.org/gcrypt/gnutls/v3.4/gnutls-3.4.11.tar.xz

[vars]
filesize=6652224
sha512=cf58309a45f751d07dc05858c163209cefd09831717220df7e072a303c7af5f71da872e975a776557e42982bc21efbe2e4d6f2ec46aec020e7d465274d1d4b42

[deps]
libnettle
libtasn1

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir"
sed -i 's@LIBGNUTLS_LIBS=.*$@LIBGNUTLS_LIBS="-lgnutls $LIBS"@' configure
sed -i 's@LIBGNUTLS_CFLAGS=.*$@LIBGNUTLS_CFLAGS=@' configure
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 \
  --disable-nls \
  --without-p11-kit
make V=1 -j$MAKE_THREADS CPPFLAGS=-D_GNU_SOURCE
make DESTDIR="$butch_install_dir" install

path: pkg/gnutls


code:
[mirrors]
https://storage.googleapis.com/golang/go1.6.src.tar.gz

[vars]
filesize=12613308
sha512=59e9d72a80558fd5e3f176e068897a45333b36e35f6c00393647941a70e741168e65941b6059397378020c3b78ec3471a48809682f7efd97cf33eec6325fc3e8
tardir=go

[deps.host]
go14

[build]
cd ./src && GOROOT_BOOTSTRAP="$butch_root_dir$butch_prefix"/opt/go14 ./make.bash
cd ../../ && cp -ar go/* "$butch_install_dir""$butch_prefix"
[ -h "$butch_root_dir""$butch_prefix"/bin/go ] && rm "$butch_root_dir""$butch_prefix"/bin/go
[ -h "$butch_root_dir""$butch_prefix"/bin/gofmt ] && rm "$butch_root_dir""$butch_prefix"/bin/gofmt
ln -s "$butch_install_dir""$butch_prefix"/bin/go "$butch_root_dir""$butch_prefix"/bin/go
ln -s "$butch_install_dir""$butch_prefix"/bin/gofmt "$butch_root_dir""$butch_prefix"/bin/gofmt
butch_do_relocate=false

path: pkg/go


code:
[mirrors]
https://storage.googleapis.com/golang/go1.4.2.src.tar.gz

[vars]
filesize=10921896
sha512=cda1a29d4418875dffaf3324004ddae8e1bbb573f7668e6e0c03d8b61284f4db7fca244c181f2859f8ccdd3db6391fb21e0d98a1a9fc15096c15883249d48a9c
tardir=go

[deps.host]
bash

[build]
[ -n "$CROSS_COMPILE" ] && {
echo "go is not compatible with crosscompilation"
echo "it tries to build and execute stuff built with \$CC"
exit 1
}
patch -p1 < "$K"/go.patch
cd ./src && ./make.bash
cd ../../ && cp -ar go/* "$butch_install_dir""$butch_prefix"
[ -h "$butch_root_dir""$butch_prefix"/bin/go ] && rm "$butch_root_dir""$butch_prefix"/bin/go
[ -h "$butch_root_dir""$butch_prefix"/bin/gofmt ] && rm "$butch_root_dir""$butch_prefix"/bin/gofmt
ln -s "$butch_install_dir""$butch_prefix"/bin/go "$butch_root_dir""$butch_prefix"/bin/go
ln -s "$butch_install_dir""$butch_prefix"/bin/gofmt "$butch_root_dir""$butch_prefix"/bin/gofmt
butch_do_relocate=false


code:
[mirrors]
http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.38/gobject-introspection-1.38.0.tar.xz

[vars]
filesize=1226324
sha512=2eeafbb09484988c8489757232233aa9bf5cefecf7f80ed940867cf721e271644f7e94d8ae3b18717340ba3af1c208701c4766b1113af03972311517fda10e8f

[deps]
python
glib

[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
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/gobject-introspection


code:
[mirrors]
http://ftp.gnome.org/pub/GNOME/sources/goffice/0.8/goffice-0.8.17.tar.xz

[vars]
filesize=1814488
sha512=61a3063d37e2ded4d4065d261f728c862daea04090ac38abe2524089ed1ee253e0d77e501f5b3451b1e011491a8225f90fd4914f28ce2a347ecf561098e6400c

[deps]
gtk+2
libgsf
pcre

[build]
sed -i 's#info (r, NULL#full&, 0#' goffice/utils/regutf8.c
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
cp -f "$K"/config.sub .
CFLAGS="$optcflags" LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
CPPFLAGS=-D_GNU_SOURCE \
  ./configure -C --prefix="$butch_prefix" $xconfflags

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

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

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

path: pkg/goffice


code:
[vars]
filesize=983500
sha512=24a65ac93c9d640670b015a76378eb7e0f167bec685d03f7dc68005d5a6d693d98b2189f7a0ab5bb9e5dc700de7d417c215230f9dbe062ba119240a8da535dad
desc='source code generator for fast string comparisons via hashes'

[mirrors]
http://ftp.gnu.org/pub/gnu/gperf/gperf-3.0.4.tar.gz

[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" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/gperf


code:
[mirrors]
http://kent.dl.sourceforge.net/project/lxde/GPicView%20%28image%20Viewer%29/GpicView%200.2.3/gpicview-0.2.3.tar.gz
http://switch.dl.sourceforge.net/project/lxde/GPicView%20%28image%20Viewer%29/GpicView%200.2.3/gpicview-0.2.3.tar.gz

[vars]
filesize=478447
sha512=22eaf70937c6b72ca41f056bc22abb6084181b7fc67a0089672b80bca2a959a002292fd20648338a6429bce37723fd2d278ed7517c2318c0a757a940f87f5cd4

[deps]
gtk+2
libjpeg
perl5-XML-Parser
intltool
shared-mime-info

[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" --disable-nls $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/gpicview


code:
[mirrors]
http://downloads.sourceforge.net/project/gptfdisk/gptfdisk/1.0.1/gptfdisk-1.0.1.tar.gz

[vars]
filesize=195378
sha512=6aa2ed6213183ea38ce7dd6e7f4f23b88cc56bed5a4d078f563b9e0a3c276eacf869e28a27ccb4e473753f7bced7ecb5de4535626f9ed22b7a59a39906d0419c
desc="GPT fdisk is a disk partitioning tool for GUID Partition Table disks"

[deps]

[build]

make || exit 1

dest="$butch_install_dir""$butch_prefix"
mkdir -p $dest/sbin
install -m755 -s gdisk $dest/sbin
install -m755 -s cgdisk $dest/sbin
install -m755 -s fixparts $dest/sbin
install -m755 -s sgdisk $dest/sbin

path: pkg/gptfdisk


code:
[deps]
kernel-headers
flex
bison

[mirrors]
http://grsecurity.net/stable/gradm-3.0-201311242038.tar.gz
http://codu.org/~rofl/tarballs/gradm-3.0-201311242038.tar.gz
http://ftp.barfooze.de/pub/sabotage/tarballs/gradm-3.0-201311242038.tar.gz
http://foss.aueb.gr/mirrors/linux/sabotage/tarballs/gradm-3.0-201311242038.tar.gz
http://dl.2f30.org/mirrors/sabotage/tarballs/gradm-3.0-201311242038.tar.gz

[vars]
filesize=81944
sha512=1b8bc6af402e3feecf5da2ac17bbf1d2753e588332b2360d2de06e8f54c4464895a4f085a52224ca23b2b2207939e666c25c77afee876bc3f137c86f02166f40
tardir=gradm

[build]
make -j$MAKE_THREADS CFLAGS="-include sys/socket.h -D_GNU_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -D_LARGEFILE64_SOURCE"
make MANDIR="$butch_prefix"/share/man DESTDIR="$butch_install_dir" install

path: pkg/gradm


code:
[mirrors]
http://grafx2.googlecode.com/files/grafx2-2.4.2035-src.tgz

[vars]
filesize=721482
sha512=f23a6b150b6b040226a34859b271fec5b4e0d8eb123b895d242ad5bcb11db2dcb5918040af62340fda30772e3d05a1e140c962e5566451993029f0111e757c57
tardir=grafx2

[deps]
sdl
sdl-image
sdl-ttf
lua

[build]
patch -p1 < "$K"/grafx2-sighandler.patch
cd src
make -j$MAKE_THREADS
make prefix=$butch_prefix DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://downloads.sourceforge.net/silgraphite/graphite2-1.2.4.tgz
http://kent.dl.sourceforge.net/project/silgraphite/graphite2/graphite2-1.2.4.tgz

[vars]
sha512=fb4a7bfd5656233975ce339e4e155ccb4fd401b87e30440edab98739355596e41abf5dccf6487d53f6353840a7c87b8270ee33e79c6630cf13a25ac2cb2114de
filesize=6938866

[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 \
  -Wno-dev \
  ..
make -j$MAKE_THREADS VERBOSE=1
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
ftp://mirrors.kernel.org/gnu/grep/grep-2.25.tar.xz
http://mirrors.kernel.org/gnu/grep/grep-2.25.tar.xz

[vars]
filesize=1327856
sha512=7a738f938dde350ae71eb87083586e25768ba392113cba973a4e567b476c788ca66e0736d63f5e0e12a7847fa70379dc0b6568ec92431ea4604acd2cbedd66c1
desc='GNU grep with more features than busybox grep'

[deps]
xz
gettext

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

path: pkg/grep


code:
[mirrors]
ftp://ftp.gnu.org/gnu/groff/groff-1.22.2.tar.gz
http://ftpmirror.gnu.org/groff/groff-1.22.2.tar.gz

[vars]
filesize=4019913
sha512=ea34db53f075b6816827b07ac3d6a19ed50529c939044337eb3124575ac3b41363e1d81bbd5bf552a7a10f6b1dd233d6e7acaf646e18cfe94464c59dc20ffe80
desc="bloated gnu replacement for nroff and troff text formatters. C++."

[deps.host]
libstdc++

[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
for i in doc contrib/hdtbl ; do
        printf 'all:\n\ttrue\ninstall:\n\ttrue\clean:\n\ttrue\n' > "$i"/Makefile.sub
done

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

path: pkg/groff


code:
[mirrors]
http://mirror.switch.ch/ftp/mirror/gnu/gsl/gsl-1.15.tar.gz
[vars]
filesize=3281134
sha512=dcea557bcd34d4ee6d2c52741c2f95702e5e6110a99f033b412489b1930d21a40ead29392f754656375801d706df01199878263e856ca3081f9a514dc3299185

[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" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/gsl


code:
[mirrors]
http://ftp.gnome.org/pub/gnome/sources/gst-plugins-base/0.10/gst-plugins-base-0.10.36.tar.xz

[vars]
filesize=2364108
sha512=ea77778e073515df58229a641b4363df31f0b80204a5a43a8feb31f0b03a5a4b9b79d6e07e1615c773a59927a9b649f1b1d782def1120d581d09a090be8363b8

[deps]
libogg
libvorbis
gstreamer01
pango

[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 \
--disable-nls \
--disable-oggtest --disable-vorbistest --disable-freetypetest \
--disable-examples--disable-nls --disable-silent-rules
[ -n "$CROSS_COMPILE" ] && "$K"/libtool.cross.gen --sysroot="$butch_root_dir"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://gstreamer.freedesktop.org/src/gst-ffmpeg/gst-ffmpeg-0.10.13.tar.bz2

[vars]
filesize=4784059
sha512=f1141fc73b4bf1d774053ce53c4a67d5e600d6f0118ee7824cd2ff4fc8af8ba1dfbd5cf82d9e15872f3e6f8730112ddfc520a7d8df3cf605a9725e959f37e6ed

[deps]
gstreamer01

[build]
patch -p1 < "$K"/gst-ffmpeg-0.10.13-gcc-4.7-1.patch

CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" \
  --with-ffmpeg-extra-configure="--disable-yasm" \

# FIXME: it's currently not possible to build against the system
# ffmpeg. the code is using some enum CodecID which was apparently
# removed in recent ffmpegs. having 2 different versions of ffmpeg
# in use is less than optimal.
#
#  --with-system-ffmpeg

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


code:
[mirrors]
http://ftp.gnome.org/pub/gnome/sources/gst-plugins-good/0.10/gst-plugins-good-0.10.31.tar.xz

[vars]
filesize=2738016
sha512=d153dcd5bb846450e9d76fe247f2b2e627e760feaad1bfd4c503a39af2128fad3630788463ea0d50539209236c864df0b2172ab9dac52f49cadff69ac7346809

[deps]
gstreamer01

[build]

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

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


code:
[vars]
filesize=3025876
sha512=7468abb578398681d2adb0e9bbc9ee8ae25aaef72369d45a66ada6c67d1759afdce606cb32e68d9e30ae813196bdfef3d4d33202bc77839cc1fbf5fc436c1bd8

[mirrors]
http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-0.10.36.tar.xz

[deps]
libxml2
glib

[deps.host]
flex

[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 \
  --disable-nls \
  --disable-examples \
  --disable-introspection \
  --enable-gst-debug=yes \

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

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


code:
[mirrors]
http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.28.tar.xz

[vars]
filesize=13354884
sha512=86d563645ca70c1e14afd4b38d925f496e596cbf6181f2e95310f58c2f4152aaecc559e3c513e6d405fcf48d8d413d59a9d72782216529c1280bd8e1947d7760

[deps]
pango
cairo
atk
gdk-pixbuf
libx11
libxext
libxrender
libxdamage
libxcomposite
libxcursor
libxrandr
libxinerama

[deps.host]
pkgconf

[build]
patch -p1 < "$K"/gtk-icontheme-fallback.patch

# fixes from LFS: fix messed up makefile when docbook is installed
sed -i 's#l \(gtk-.*\).sgml#& -o \1#' docs/tutorial/Makefile.in
sed -i 's#l \(gtk-.*\).sgml#& -o \1#' docs/faq/Makefile.in
sed -i 's#.*@man_#man_#' docs/reference/gtk/Makefile.in

printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\nclean:\n\ttrue\n\ndistclean:\n\ttrue" > gdk/tests/Makefile.in
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\nclean:\n\ttrue\n\ndistclean:\n\ttrue" > gtk/tests/Makefile.in
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\nclean:\n\ttrue\n\ndistclean:\n\ttrue" > tests/Makefile.in
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\nclean:\n\ttrue\n\ndistclean:\n\ttrue" > modules/other/gail/tests/Makefile.in
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\nclean:\n\ttrue\n\ndistclean:\n\ttrue" > docs/reference/gtk/Makefile.in

# remove obfuscated symbols
printf '#!/bin/sh\ntrue\n' > gtk/makegtkalias.pl
for i in gtk/gtkaliasdef.c gtk/gtkalias.h ; do
        rm -f "$i" && touch "$i"
done

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) --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"\
 --disable-rebuilds  --disable-glibtest \
 --disable-cups --disable-introspection $xconfflags

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

echo '#include <string.h>' >> config.h

for i in demos tests po po-properties ; do
  printf 'all:\n\ttrue\n\ninstall:\n\ttrue\n\nclean:\n\ttrue\n\ndistclean:\n\ttrue' \
    > "$i"/Makefile
done

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

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/share/doc/gtk+-2.24.10 &&
cp -R docs/faq/html "$dest"/share/doc/gtk+-2.24.10/faq &&
cp -R docs/tutorial/html "$dest"/share/doc/gtk+-2.24.10/tutorial &&
install -m644 docs/*.txt "$dest"/share/doc/gtk+-2.24.10

if [ -z "$CROSS_COMPILE" ] ; then
LD_LIBRARY_PATH="$dest"/lib \
  "$dest"/bin/gtk-query-immodules-2.0 > "$dest"/etc/gtk-2.0/gtk.immodules
else
	echo "XXXXXXX WARNING gtk-query-immodules-2.0 needs to be run on the target rootfs XXXXXXX"
fi

cat > "$dest"/etc/gtk-2.0/gtkrc << "EOF"
include "/share/themes/Clearlooks/gtk-2.0/gtkrc"
gtk-icon-theme-name = "elementary"
EOF

# add missing pkgconfig dependency
sed -i 's@gio-2.0@gio-2.0 gmodule-2.0@' "$dest"/lib/pkgconfig/gtk+-x11-2.0.pc


code:
[mirrors]
http://ftp.gnome.org/pub/gnome/sources/gtk+/3.16/gtk+-3.16.3.tar.xz

[vars]
filesize=18228560
sha512=5ab6ff3f4e4c47dd8532027bfade1420524d48b53f7c7bcef4ee581095ecc53f33ac072076837ed34306d5d84103958b27a3099b10e5cf95c38fb34342fc8aa8

[deps]
libepoxy
glib
pango
cairo
atk-bridge-fake
libxi

[build]
# gdbus-codegen is a program usually delivered by glib, but we patch it out
# because it requires python to build, and we don't do dbus
mkdir bin
cat << EOF > bin/gdbus-codegen
#!/bin/sh
touch gtkdbusgenerated.h
touch gtkdbusgenerated.c
#cp gtkdbusinterfaces.xml foo.xml
#exit 1
EOF
chmod +x bin/gdbus-codegen
# patch out crap relying on dbus
cat << EOF > gtk/gtkmountoperation.c
#define GMountOperation void
#define GtkMountOperation void
#define GtkWindow void
#define GdkScreen void
#define gboolean int
#define GType unsigned long /* size_t */
#define P __attribute__ ((visibility ("default")))
extern GType g_mount_operation_get_type();
P GType gtk_mount_operation_get_type() { return g_mount_operation_get_type(); }
P GMountOperation *gtk_mount_operation_new (GtkWindow *parent) { return 0; }
P gboolean gtk_mount_operation_is_showing (GtkMountOperation *op) { return 0; }
P void gtk_mount_operation_set_parent (GtkMountOperation *op, GtkWindow *parent) {}
P GtkWindow *gtk_mount_operation_get_parent (GtkMountOperation *op) { return 0; }
P void gtk_mount_operation_set_screen (GtkMountOperation *op, GdkScreen *screen){}
P GdkScreen *gtk_mount_operation_get_screen (GtkMountOperation *op){ return 0; }
EOF
for i in tests testsuite docs examples docs/reference docs/tools docs/reference/gtk docs/reference/libgail-util ; do
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > $i/Makefile.in
done
[ -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"

PATH="$PWD/bin:$PATH" make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/gtkdialog-0.8.4pre-svn514.tar.bz2

[vars]
filesize=907069
sha512=92ed467653982b6016f27ee07f888df2070e6938bd4f59a2390bbf4b91e00e1d51d1ee714d890f54fddec9df2ae5ebe8e79ac02d04b2cd78d9e1f1cd7fdd8c26
desc="A utility for creating X11 dialog boxes from shell scripts"

[deps]
gtk+2

[build]
#hmmm, have to do this...
if [ ! -f doc/version.texi ];then
  echo '@set UPDATED 24 September 2015
@set UPDATED-MONTH September 2015
@set EDITION 0.8.4
@set VERSION 0.8.4' > doc/version.texi
fi

./autogen.sh

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

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

path: pkg/gtkdialog


code:
[mirrors]
http://ftp.gnome.org/pub/GNOME/sources/gtkmm/2.24/gtkmm-2.24.2.tar.xz

[vars]
filesize=10776640
sha512=9f48138641815a40f9c22f6b8785cbcd9e92473c405577dcc6ae29559835d51a17d87fd75518d8043eeec8ce0f643aeb8cfcd68a6df382d0b392da33f6c6f8b7

[deps]
gtk+2
glibmm
pangomm
atkmm

[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 docs tests demos ; 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/gtkmm


code:
[deps]
sweep
abiword
audacity
evince
epdfview
grafx2
gnumeric
gpicview
gimp
gitk
leafpad
milkytracker
transmission
ixchat
dillo
netsurf
pgadmin3
sylpheed

path: pkg/gui


code:
[mirrors]
http://downloads.sourceforge.net/project/gimp-print/gutenprint-5.2/5.2.11/gutenprint-5.2.11.tar.bz2

[vars]
filesize=6570118
sha512=f4010e489dd6763b19113abf1d55e84cea8d36b920d03dbe204dba30ab0d3fb3e3391e739cd1a56e2f63581c8ce4a856a7f747deb6e7b18d7e1f7a3d87901c60
desc="Printer drivers for Canon, Epson, Lexmark, Sony, Olympus, and PCL"

[deps]
cups
cups-filters
ijs

[build]
#patch from here: https://sourceforge.net/p/gimp-print/mailman/message/34446411/
patch -p1 < "$K"/gutenprint-endianness-olympus.patch

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

path: pkg/gutenprint


code:
[mirrors]
http://downloads.sourceforge.net/project/guvcview/source/guvcview-src-2.0.1.tar.gz

[vars]
filesize=960661
sha512=b3877f00f4caf224eac2010f62e1c3d575b94f84cd0a8da7a5f1df6c851384c7a9e356de905ce27e143dc9761137ae1cce146bb4f6c0aa6d270dd53551bce67a

[deps]
gtk+3
libv4l2
libusbx
portaudio
perl5-XML-Parser

[build]
patch -p1 < "$K"/guvcview-decls.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 \
  --disable-sdl2 \
  --disable-pulse \
  --disable-debian-menu \
  --disable-nls \
  --disable-gsl

#[ -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/guvcview


code:
[mirrors]
http://sourceforge.net/projects/guvcview/files/source/guvcview-src-1.5.0.tar.gz

[vars]
filesize=498336
sha512=c5d266eb0165eab0973b78ad527bf7806dc1e77d8a4e8d318c613acfaf764677c7a560156b25eb0a6fae5651d1a3e38ed83bb675885be4d1dcc63e57746d886a

[deps]
gtk+2
libv4l2
libusbx
portaudio

[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 -DCODEC_FLAG2_FASTPSKIP=0x100 -DCODEC_FLAG2_BPYRAMID=0x10 -DCODEC_FLAG2_WPRED=0x20" \
CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags \
  --disable-sdl2 \
  --disable-pulse \
  --disable-debian-menu \
  --disable-nls \
  --disable-gsl

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

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


code:
[mirrors]
http://ftp.gnu.org/gnu/gzip/gzip-1.8.tar.xz

[vars]
filesize=728116
sha512=efd3e2439476054badeb127d9156e24e9252129111219f13fd939596c057b2a96291630b2717181984b391abf249ac8699488bbd01ceeb8a70b121c500b10c55

[deps]
zlib

[build]
"$K"/gnulibfix lib
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
CPPFLAGS="-Drpl_fdopendir=fdopendir -DS_IRWXUGO=0777 -DO_BINARY=0" \
./configure -C $xconfflags \
  --prefix="$butch_prefix"
make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/gzip


code:
[mirrors]
https://github.com/h2o/h2o/archive/v1.7.0.tar.gz

[vars]
filesize=6543732
sha512=b905cd4c99f150495d7252cc911cfd05285dc8aa1874ffc078e57185b7b3f613d5d0ab7950198d1431e1ed610371f3bee282f7dfef65f1575cf333267ebafa06
tardir=h2o-1.7.0
tarball=h2o-1.7.0.tar.gz

[deps]
libressl

[deps.host]
cmake
perl

[build]
xconfflags=
[ -n "$CROSS_COMPILE" ] && xconfflags="-DCMAKE_FIND_ROOT_PATH=$butch_root_dir$butch_prefix"
CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
cmake $xconfflags -DCMAKE_INSTALL_PREFIX="$butch_prefix" .
make VERBOSE=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

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


code:
[mirrors]
http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.2.6.tar.bz2

[vars]
filesize=1336078
sha512=00963674f41d12fb231c59813693f7b665924a1b57d9410a7a00de533aa6c5693b3852fbf03b8ed07183fb2e648b9250d949df59830e38c6adc0360ae8580edc

[deps]
freetype

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

[ -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 \
  --with-icu=no

#[ -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/harfbuzz


code:
[mirrors]
http://www.issihosts.com/haveged/haveged-1.9.1.tar.gz

[vars]
filesize=474845
sha512=267d62cfeb886ea00fa412de1a91a34821460d0f4ad789dcfb3547018300e1cbf480917571b19652f2d449369293031d9534f9533bbf6a59560f4f10608c9cd2

[deps]
zlib

[build]
cp -f "$K"/config.sub config/
[ -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

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

path: pkg/haveged


code:
[vars]
filesize=130277
sha512=5b8908a762d892c403406da4798202bed95f035396e3c49f04da910fa53a6b442a7d7c9cb1e5d786d7c8c5a1b681c8d1db10f1bd8dad09600a6f3811fbf8afb7

[mirrors]
http://downloads.sourceforge.net/hdparm/hdparm-9.48.tar.gz

[deps]

[build]
make CC="$CC" V=1 STRIP=true \
 CFLAGS="$optcflags" \
 LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  -j$MAKE_THREADS
make binprefix="$butch_prefix" manprefix="$butch_prefix" \
     sbindir="$butch_prefix"/bin \
     DESTDIR="$butch_install_dir" install

path: pkg/hdparm


code:
[vars]
filesize=82725
sha512=3a0dbec19eb093b6a818910a1b24f2d7328dc785dc12cd0097c37f98e7ac558d31cda8717381d814259bd54f5de12e50cc8d9d617bd4e09c4a903ef63838807f

[mirrors]
http://sourceforge.net/projects/heirloom/files/heirloom-sh/050706/heirloom-sh-050706.tar.bz2

[deps]

[build]
patch -p0 defs.h < "$K"/heirloom-sh-defs.patch #disable dependency on sys/acct.h
sed -i 's@getopt(@mygetopt(@g' jobs.c getopt.c bltin.c ulimit.c
make -j$MAKE_THREADS CFLAGS="$optcflags" LDFLAGS="$optldflags -static"
dest="$butch_install_dir""$butch_prefix"
install -D -m 644 sh.1.out "$dest"/share/man/man1/jsh.1
install -D -m 755 sh "$dest"/bin/jsh

path: pkg/heirloom-sh


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

[vars]
filesize=20592
sha512=53593ace3da9043a3767ce2f8b92533400f453be6702c4712b9d952b130e2072b86f8b5a85e21d78dc90b2b1041fd85e65761f6175d00c920c1bd55c84b2f499
desc='terminal hex editor, fork of hexedit'

[deps]
curses

[build]
make -j$MAKE_THREADS \
  CFLAGS="$optcflags" \
  LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib"
make DESTDIR="$butch_install_dir" prefix="$butch_prefix" install


code:
[mirrors]
https://www.hiawatha-webserver.org/files/hiawatha-10.0.tar.gz

[vars]
filesize=883112
sha512=ec73fb92fc6c22a7e6db2e10b75720fc97d3e5bb070222d21f532734c324d6b9de4bfc4ac348072ef1f7590d8082d90108b0cbe562481af1fd4f47bdc62450c1

[deps.host]
cmake

[deps]
mbedtls

[build]
# NOTE: the mirror requires tls, download with curl:
#       USE_CURL=1 butch install hiawatha
# NOTE: XSLT support requires libxlst
# NOTE about mbedtls:
# Hiawatha usually compiles its own mbedtls to make sure it has the
# right config options. In sabotage, we already have these options set,
# so we use the system library of course.

CFLAGS="-static" cmake \
	-DENABLE_CACHE=OFF \
	-DENABLE_RPROXY=ON \
	-DENABLE_TOOLKIT=OFF \
	-DENABLE_XSLT=OFF \
	-DUSE_SYSTEM_MBEDTLS=ON \
	-DCMAKE_INSTALL_PREFIX="$butch_prefix" \
	-DCMAKE_INSTALL_BINDIR="$butch_prefix/bin" \
	-DCMAKE_INSTALL_SBINDIR="$butch_prefix/bin" \
	-DCMAKE_INSTALL_SYSCONFDIR="$butch_prefix/etc/hiawatha" \
	-DCMAKE_INSTALL_LIBDIR="$butch_prefix/lib" \
	-DCMAKE_INSTALL_MANDIR="$butch_prefix/share/man" \
	-DCONFIG_DIR="$butch_prefix/etc/hiawatha" \
	-DLOG_DIR="$butch_prefix/var/log/hiawatha" \
	-DPID_DIR="$butch_prefix/var/run/hiawatha" \
	-DWEBROOT_DIR="$butch_prefix/var/www" \

make V=1 -j$MAKE_THREADS

# set the user-id to www-data (as in the service)
sed -i 's/#ServerId = www-data/ServerId = www-data/' config/hiawatha.conf

make DESTDIR="$butch_install_dir" install

# install the service
IS="$K"/bin/butch-install-service
"$IS" --down --log --force hiawatha "$K"/services/hiawatha

path: pkg/hiawatha


code:
[mirrors]
http://freedesktop.org/software/icon-theme/releases/hicolor-icon-theme-0.5.tar.gz

[vars]
filesize=31611
sha512=3495aae12d22ab3a276fa9e5cc44e06de401bc3979c84cdaf20552d3ddd53dd45b5c34ada0010df210abf22553d6ae9f28a805d750c3cd7c30bbb4abbb45c6b2

[deps]
gtk+2

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

path: pkg/hicolor-icon-theme


code:
[deps]
lxde-icon-theme
gtk+2

[build]
dest="$butch_install_dir""$butch_prefix"
dest_direct="$butch_root_dir""$butch_prefix"
# create a valid index.theme for the gnome hicolor theme
# without this file, most gtk apps will fail to display their icons
# correctly, including gnumeric.
themedir="$dest"/share/icons/hicolor
mkdir -p "$themedir"

prefixtheme="$dest_direct"/share/icons/hicolor/index.theme
if [ ! -e "$prefixtheme" ] || \
   { [ -L "$prefixtheme" ] \
     && [ $(readlink -f "$prefixtheme") = "$themedir"/index.theme ]; } ; then
	cp "$dest_direct"/share/icons/nuoveXT2/index.theme "$themedir"/
	sed -i 's@nuoveXT.2.2@hicolor@g' "$themedir"/index.theme
	sed -i 's@nuoveXT 2.2@hicolor@g' "$themedir"/index.theme
	sed -i 's@nuoveXT-1.6,@@g' "$themedir"/index.theme
	# you must theoretically call this whenever you installed new gtk apps
	gtk-update-icon-cache "$themedir"
else
	gtk-update-icon-cache -f "$dest_direct"/share/icons/hicolor
fi

# do not forget to set your icon theme to nuoveXT using
# lxde start menu -> preferences -> customize look and feel
# (that's the lxappearance app)

path: pkg/hicolor-icon-theme-fake


code:
[build]
$CC -std=gnu99 -fstack-protector-all -Wa,--noexecstack -s -Os -o host \
  $optcflags $optldflags "$K"/host.c

mv host "$butch_root_dir""$butch_prefix"/bin

path: pkg/host


code:
[mirrors]
http://w1.fi/releases/hostapd-2.5.tar.gz

[vars]
filesize=1720783
sha512=bbb0547c29f4925aff8639cae3291ed020c2a9d989dd267be831b2418880916d2ec69003e36ecc796c348476086397cca8f63c52633f91c11a9c2ab72e1c83c0

[deps]
zlib
libressl
libnl-tiny

[build]
patch -p0 < "$K"/wpa_supplicant25-libressl.patch
patch -p0 < "$K"/wpa_supplicant25-eloop.patch
cd hostapd
cp defconfig .config

CFLAGS="-D_GNU_SOURCE -I$butch_prefix/include/libnl-tiny \
  -DLIBNL1_COMPAT \
  -DCONFIG_LIBNL20 \
  -D__int32_t=int32_t -D__int16_t=int16_t -D__uint8_t=uint8_t \
  -D__uint32_t=uint32_t -D__uint16_t=uint16_t \
  -include stdint.h $optcflags" \
  LDFLAGS="-lz $optldflags" make -j$MAKE_THREADS CONFIG_LIBNL_TINY=y
make BINDIR=/bin DESTDIR="$butch_install_dir" install

path: pkg/hostapd


code:
[mirrors]
http://www.hping.org/hping2.0.0-rc3.tar.gz

[vars]
filesize=124573
sha512=a5273ddf98d39f8bd602d7653bb7e024c1d0a48e6619d0e15eac9ce877d4869fd7e5500f86cc2a35b29b95a27012f2e8c6f69d9bb11e6f9bd30edafd459a1a9c
tardir=hping2-rc3
[deps]

[build]
patch -p1 < "$K"/hping2-endian.patch
sed -i 's@./hping2 -v@true@g' Makefile.in

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

export CC="$CC -D_GNU_SOURCE $optcflags $optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib"
./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags
endian=__LITTLE_ENDIAN_BITFIELD
[ $("$K"/endiancheck.sh) = "big" ] &&  endian=__BIG_ENDIAN_BITFIELD
printf "#define %s\n" "$endian" > byteorder.h

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

make V=1 -j$MAKE_THREADS CC="$CC"
install -D -m 755 hping2 "$butch_install_dir""$butch_prefix"/sbin/hping2
install -D -m 644 docs/hping2.8 "$butch_install_dir""$butch_prefix"/share/man/man8/hping2.8


code:
[mirrors]
http://www.hping.org/hping3-20051105.tar.gz

[vars]
filesize=584001
sha512=3b3faa836e70054c8f9f004d876b7eb5f668b64826a6aaf8ca3685619111d9df4eb494a7d38b83cea6cb5f0bd164956461039bf4f73f7c7e90d80cede639b2b3

[deps]
tcl
libpcap

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

sed -i 's@net/bpf.h@pcap/bpf.h@g' libpcap_stuff.c script.c
sed -i 's@-L/usr/local/lib@@g' Makefile.in
sed -i 's@./hping3 -v@true@g' Makefile.in

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

export CC="$CC -D_GNU_SOURCE $optcflags $optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib"
./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags
endian=__LITTLE_ENDIAN_BITFIELD
[ $("$K"/endiancheck.sh) = "big" ] &&  endian=__BIG_ENDIAN_BITFIELD
printf "#define %s\n" "$endian" > byteorder.h

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

make V=1 -j$MAKE_THREADS CC="$CC"
install -D -m 755 hping3 "$butch_install_dir""$butch_prefix"/sbin/hping3
install -D -m 644 docs/hping3.8 "$butch_install_dir""$butch_prefix"/share/man/man8/hping3.8


code:
[mirrors]
http://hisham.hm/htop/releases/2.0.1/htop-2.0.1.tar.gz

[vars]
filesize=477196
sha512=57991a55b69028c01549b067ec749099466df5b08a0ed9a65dd779e6d2c8ee0a5d9c330bb6c727b04a349146ad441b7115718e433d1f8232f74b28903fb351ff

[deps]
curses

[build]
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
LIBS="-lcurses -lterminfo" \
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-unicode \

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

path: pkg/htop


code:
[mirrors]
http://downloads.sourceforge.net/hunspell/hunspell-1.3.3.tar.gz

[vars]
filesize=986081
sha512=7599981d002a4a032c41c83f6287243a4942b0e25c408049a3ba86c16f63ce964800a3ac325ace0402b0d7256690c4a4151a66f19a8f58cc455af0498bb1af04

[deps]

[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 --disable-nls
sed -i 's/#include <error.h>//g' ./src/tools/munch.c
sed -i 's/#include <errno.h>//g' ./src/tools/munch.c
sed -i 's/#include <error.h>//g' ./src/tools/unmunch.c
sed -i 's/#include <errno.h>//g' ./src/tools/unmunch.c
make -j$MAKE_THREADS V=1
make DESTDIR="$butch_install_dir" install

path: pkg/hunspell


code:
[vars]
filesize=897398
sha512=eae646b97c46e464824f62cb95ce2e80298d5432abb9c8f94dba87dcaf1f05e00e9d4bd23d62ba332e0a408203d8b31709de04073f954578a0ee3d353ed74402

[mirrors]
http://i3wm.org/downloads/i3-4.7.2.tar.bz2

[deps]
libev
libyajl
libxcb
xcb-util-keysyms
xcb-util-cursor
xcb-util-wm
pcre
libstartup-notification

[build]
CPPFLAGS="-DGLOB_TILDE=0" make -j $MAKE_THREADS && make DESTDIR="$butch_install_dir" install


code:
[build]
$CC $optcflags -std=gnu99 -o iconv "$K"/iconv.c -static $optldflags

mv iconv "$butch_root_dir""$butch_prefix"/bin/

path: pkg/iconv


code:
[mirrors]
http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-src.tgz

[vars]
filesize=25600847
sha512=21a3eb2c3678cd27b659eed073f8f1bd99c9751291d077820e9a370fd90b7d9b3bf414cc03dec4acb7fa61087e02d04f9f40e91a32c5180c718e2102fbd0cd35
tardir=icu

[deps]

[build]
cp -f "$K"/config.sub source/
if [ -n "$CROSS_COMPILE" ] ; then
  echo '**** building for host ****'
  mkdir host
  cd host
  CPPFLAGS=-D_GNU_SOURCE CFLAGS="-O0 -g0" CXXFLAGS="-O0 -g0" \
  CC=gcc CXX=g++ ../source/configure \
    --enable-strict=no --enable-static --enable-shared=no --enable-tests=no \
    --enable-samples=no --enable-dyload=no
  make VERBOSE=1 -j$MAKE_THREADS
  echo '**** host build finished ****'

  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir --with-cross-build=$PWD"
  cd ..
fi

cd source
[ -z "$CXX" ] && export CXX=g++
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure --prefix="$butch_prefix" $xconfflags \
  --disable-tests --disable-samples
make VERBOSE=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/icu


code:
[mirrors]
http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.28.tar.gz

[vars]
filesize=142677
sha512=c606e456f81f224eba9f8912e11fb76b759c160313d1db3c9035775b8c1ca57ca10c88dfb33318ba02f5c025218a377ca78ee160fc3d9a31ac6e95b92f340d4f
desc="A daemon to automatically configure a ethernet device on state change"

[deps]
libdaemon

[build]
#from T2...
patch -p1 < "$K"/ifplugd-0.28-fix-header.patch
patch -p1 < "$K"/ifplugd-0.28-no-init.patch
patch -p1 < "$K"/ifplugd-0.28-unsigned-types.patch

CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure --prefix="$butch_prefix" $xconfflags \
  --disable-lynx --disable-xmltoman --with-initdir=/etc/ifplugd  --disable-subversion

make -j$MAKE_THREADS || exit 1

make V=1 DESTDIR="$butch_install_dir" install

path: pkg/ifplugd


code:
[mirrors]
http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.18.tar.gz

[vars]
filesize=127456
sha512=70eefaf9a3f34e4cb3b8ad60962436b3cd27062427882c24d0d9beb46b2310dcb9239412cdaae3e4f3f47d2f491fa028c9290a98489db71ac5b9b8d9a7c9c5df
desc="Detect active ethernet. install 'ifstatus' only. old version."

[deps]

[build]
#note, does not need libdaemon.

patch -p1 < "$K"/ifplugd-0.28-unsigned-types.patch

CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure --prefix="$butch_prefix" $xconfflags \
  --disable-lynx --disable-xmltoman --disable-subversion

make -j$MAKE_THREADS || exit 1

#make V=1 DESTDIR="$butch_install_dir" install
mkdir -p "$R"/opt/ifplugd-old/sbin
cp -a -f src/ifstatus "$R"/opt/ifplugd-old/sbin/ifplugstatus-0.18

path: pkg/ifplugd-old


code:
[vars]
filesize=160381
sha512=41e3bc5feac5927f67356f491fcab7a28f7a32102cc33c67d81c1dc755273c42e32b540b14b6254a540f1b6c1b1ad6c50e3095c3b5282db2ea12dd0049ce2ebd

[mirrors]
http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz

[deps]
libpcap
curses

[build]
cp -f "$K"/config.sub config/
[ -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 \
  --sbindir="$butch_prefix"/bin

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

path: pkg/iftop


code:
[mirrors]
http://www.openprinting.org/download/ijs/download/ijs-0.35.tar.bz2

[vars]
filesize=257476
sha512=b5f8df6fe394efea4ee7059c1ca8d7eb91588f060642da12f6591f0f40d169883aa9f7a6976a00042c89dd370b30f36afc407c4e7515cbd68537505a63c9a293

[deps]

[build]
[ -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-shared --disable-static

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

path: pkg/ijs


code:
[mirrors]
http://downloads.sourceforge.net/enlightenment/imlib2-1.4.8.tar.bz2

[vars]
filesize=891876
sha512=ddfd9a27edb8a27d992e2e6d911fd9330062b4c402283ecf1914d3da4f7aa39c59728ae4cbbbf73c6f875ad4aabbe43db9ec46fb54754f217eeabf66f6ef3bdf
uchkurl=https://sourceforge.net/projects/enlightenment/files/imlib2-src/

[deps]
bzip2
libxext
freetype
libpng
libjpeg
giflib

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

printf "#!/bin/sh\necho -lfreetype -I$butch_root_dir$butch_prefix/include/freetype2\n" > freetype-config
chmod +x freetype-config
export PATH="$PWD:$PATH"

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"
make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
ftp://mirrors.kernel.org/gnu/indent/indent-2.2.10.tar.gz
http://mirrors.kernel.org/gnu/indent/indent-2.2.10.tar.gz

[vars]
filesize=702667
sha512=a90faf1bf855ecc1e0b0f47f4133e4a46be8b2c42bd0aa7f6cf6d764b7883b34b558e3ca443b193b1a747f64cd2653640f1aecbc8a17265c66260f6d6d621e19

[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

#[ -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/indent


code:
[mirrors]
http://downloads.sourceforge.net/project/inkscape/inkscape/0.48.4/inkscape-0.48.4.tar.bz2
http://surfnet.dl.sourceforge.net/project/inkscape/inkscape/0.48.4/inkscape-0.48.4.tar.bz2
http://heanet.dl.sourceforge.net/project/inkscape/inkscape/0.48.4/inkscape-0.48.4.tar.bz2

[vars]
filesize=19712522
sha512=55954925e74e2c222e7ddb86bf75e9ad17c854d991258fd3a1bf1b2aafe7014418138246a51f9ab9c4444795b03419781517910debd3448ae461f1dd1b5848be
desc='vector graphic manipulation program'

[deps]
poppler
poppler-data
cairo
libgc
gtkmm
libxml2
libxslt
libpng
gsl
boost
popt
liblcms
freetype

[build]
patch -p1 < "$K"/inkscape-gcc48.patch
# https://bugs.launchpad.net/altlinux/+source/inkscape/+bug/910335
sed -i 's@sys/fcntl.h@fcntl.h@' src/color-profile.cpp
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir"

printf "#!/bin/sh\necho -lfreetype -I$butch_root_dir$butch_prefix/include/freetype2\n" > freetype-config
chmod +x freetype-config
export PATH="$PWD:$PATH"

CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" CXXFLAGS="$optcflags -O0 -g0" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-nls \
  --disable-silent-rules \
  --enable-poppler-cairo \
  --without-inkjar

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

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

path: pkg/inkscape


code:
[mirrors]
http://constexpr.org/innoextract/files/innoextract-1.4.tar.gz

[vars]
filesize=151230
sha512=60700ef05ff50e3409b92571ebfc7342c0eadc8add5d1262f7e7740e1a14cfd186a8a9ac0ecab85f01ae50f21edb48f49ba9428369131f7cd46c4b07214838ea
desc='extraction of windows installers in .exe format created with innosetup'

[deps]
boost
iconv
xz

[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/innoextract


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/alphabetical/i/inotify-tools-3.14.tar.gz

[vars]
filesize=358772
sha512=6074d510e89bba5da0d7c4d86f2562c662868666ba0a7ea5d73e53c010a0050dd1fc01959b22cffdb9b8a35bd1b0b43c04d02d6f19927520f05889e8a9297dfb
desc="Command line utilities for the Linux inotify system"

[deps]

[build]
CFLAGS="$optcflags" \
LDFLAGS="$optldflags" \
  ./configure --prefix="$butch_prefix" $xconfflags

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

path: pkg/inotify-tools


code:
[deps]
util-macros

[vars]
filesize=195642
sha512=4bc3986a49273777850342cfa086641eeba0fd95ad428a2f025bd44e9ea04516cb6e190b3fd2a99fe21c63d9fe4010bebe57aefe3807050d00f8b301289ec43a

[mirrors]
ftp://ftp.x.org/pub/individual/proto/inputproto-2.3.tar.bz2

[build]
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags
make DESTDIR="$butch_install_dir" install

path: pkg/inputproto


code:
[deps.host]
perl
perl5-XML-Parser

[deps.run]
perl
perl5-XML-Parser

[vars]
filesize=140340
sha512=87769800d88fe16965e59b919d1c219e928fcc4e6708f07ecba7f97c33aa5e4955635d487ef1632c94632730a9755de4776c1b2d553ae0860a038ad250153955

[mirrors]
http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/intltool-0.40.6.tar.bz2

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

path: pkg/intltool


code:
[mirrors]
http://guichaz.free.fr/iotop/files/iotop-0.6.tar.bz2

[vars]
filesize=29779
sha512=b1047da3bc46604447cc8ab22442a3a5381e1a79a6b176fe9ee8402ee5cebb959205407a6aeaffccccde9d2f67624ff8ee6717b051838f13ab88bf3a16db3ab9
desc='monitoring of system i/o'

[deps]
python

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

path: pkg/iotop


code:
[deps]
musl
kernel-headers

[deps.host]
pkgconf

[vars]
filesize=507123
sha512=3bf6db564359acafa738068980793129982318317bea69f21282d80f40dcb1e16938f8e2928e6cdcc4e77d89b2bc3f6c45aad7eb11ff84063b78e5f8e1907f9e
desc='packet filter, firewall, routing'

[mirrors]
http://ftp.netfilter.org/pub/iptables/iptables-1.4.14.tar.bz2

[build]
patch -p1 < "$K"/iptables-1.4.14-musl-fixes.patch
patch -p1 < "$K"/iptables-1.4.14-nf-header.patch
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="-D_GNU_SOURCE -DSTDC_HEADERS $optcflags" \
LDFLAGS="$optldflags -static" \
 ./configure -C --prefix="$butch_prefix" $xconfflags --disable-shared
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/iptables


code:
[mirrors]
http://www.irssi.org/files/irssi-0.8.15.tar.bz2

[vars]
filesize=948847
sha512=cecda925ae7c422fd95e8e94a123be8732a59a3a3c5d149b2fe16e1cac78cc516acb7a89ad79cf4ac0c412c9d4d3ea83fe5c0535ab6428e98479dc8909d0615a
desc='console IRC client'

[deps.host]
perl

[deps.run]
perl

[deps]
glib
libressl
zlib
curses

[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" \
LIBS="-lcurses -lterminfo -lz" \
 ./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/irssi


code:
[mirrors]
ftp://www.kernel.org/pub/software/network/iw/iw-3.17.tar.xz
http://www.kernel.org/pub/software/network/iw/iw-3.17.tar.xz
http://ftp.free.fr/mirrors/ftp.kernel.org/software/network/iw/iw-3.17.tar.xz

[vars]
filesize=91796
sha512=ac4779a88aacb9e2f4859cdb3e953bfba0a83b2e8140777092d61ced6799f09d8ec5628a359109cc23e6389e0ec0ab5a98b9da93c400b7cffedd930013c44f39

[deps]
libnl-tiny

[deps.host]
pkgconf

[build]
patch -p1 < "$K"/iw-libnl-tiny.patch
CFLAGS="-D_GNU_SOURCE -I$butch_prefix/include/libnl-tiny \
  -DCONFIG_LIBNL20 -DLIBNL1_COMPAT \
  -D__int32_t=int32_t -D__int16_t=int16_t -D__uint8_t=uint8_t \
  -D__uint32_t=uint32_t -D__uint16_t=uint16_t \
  -include stdint.h $optcflags" \
  LDFLAGS="$optldflags" make -j$MAKE_THREADS
make PREFIX="$butch_prefix" SBINDIR="$butch_prefix"/bin DESTDIR="$butch_install_dir" install

path: pkg/iw


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

[vars]
filesize=410676
sha512=d8c355a81301069aae7c08e6c128e86d9ad5cb33a094ab15f579fd19c1f858020b9ed33664cb664c37746a8c7d36152b6f96fb3e94ba62ad606770d8f4ea832f
desc='GTK+ IRC client based on latest xchat2 release + some hexchat backports'

[deps]
gtk+2
libressl

[deps.host]
gdk-pixbuf

[deps.none]
perl
python

[build]
#PERL_CFLAGS="-D_BSD_SOURCE -I$butch_root_dir$butch_prefix/lib/perl5/core_perl/CORE" \
#PERL_LDFLAGS="-lperl -L$butch_root_dir$butch_prefix/lib/perl5/core_perl/CORE" \
#PY_CFLAGS="-I$butch_root_dir$butch_prefix/include/python2.7" \
#PY_LDFLAGS="-lpython2.7" \
CPPFLAGS="-D_GNU_SOURCE" CFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure --prefix="$butch_prefix" \
  --disable-perl \
  --disable-python \
  --disable-tcl
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/ixchat


code:
[mirrors]
http://downloads.sourceforge.net/project/jamvm/jamvm/JamVM%202.0.0/jamvm-2.0.0.tar.gz

[vars]
filesize=741459
sha512=8ac27787ee94fa8fde962635d3c08d1dc1e5244c9d56bb693e73f3fd9b58e944ad3f7a0127afeed727d7c00d904a775d2c483157f5ac87e7eab6ecade1aad21d
desc='lightweight java vm (needed to run java programs)'

[deps.run]
classpath

[build]
#patch -p1 < "$K"/some.patch
cp -f src/os/darwin/i386/init.c src/os/linux/i386/init.c
cp -f src/os/darwin/i386/init.c src/os/linux/x86_64/init.c

[ -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 \
  --with-classpath-install-dir="$butch_prefix"

#[ -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/jamvm


code:
[mirrors]
http://www.digip.org/jansson/releases/jansson-2.6.tar.bz2

[vars]
filesize=319429
sha512=42e66a2fcbbb3483564c20a089ad2712c9cd32f4b36a3c2cee4ae376336e33759eb715026f3e2db0746a45fda24c6c0980b6a2332b45560b571bbb715ecda73e

[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

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

path: pkg/jansson


code:
[mirrors]
http://downloads.ghostscript.com/public/jbig2dec/jbig2dec-0.13.tar.gz

[vars]
filesize=442571
sha512=ef64a65c54bec65f61602de7130dc9594aae58aaea7958f7cc987f25d0794511e15a423e86501ace4f40c0364796fb97ceab72edb0b69232926767ba16c1b05d

[deps]

[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" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://ftp.barfooze.de/pub/sabotage/tarballs/jobflow-1.0.0.tar.bz2
http://foss.aueb.gr/mirrors/linux/sabotage/tarballs/jobflow-1.0.0.tar.bz2

[vars]
filesize=27202
sha512=3f0a1b5f1c47506e69418ceb22ba58b95a6cd20d2d95f5b1ae0c20caca4d3300492976a8e81deb8b329c29e9e3117f22a05f131af3450f1c01a50b5eeac71962
desc='parallel execution of command line tasks'

[deps.stage0]
stage0-musl

[build]
# prepare build config...
printf "LDFLAGS += -static %s\n" "$optldflags" > config.mak
printf "CFLAGS += %s\n" "$optcflags" >> config.mak

# and build
[ "$STAGE" = "0" ] && CC="$butch_root_dir"/bin/musl-gcc
make -j$MAKETHREADS

# "make install"
dest=$butch_install_dir$butch_prefix
install -Dm 755 jobflow "$dest"/bin/jobflow

path: pkg/jobflow


code:
[mirrors]
https://github.com/magnumripper/JohnTheRipper/archive/1.8.0.6-jumbo-1.tar.gz

[vars]
filesize=32760152
sha512=146d3f8ec9304357938ec3a447221828fb52fb4d5045082f0559e7220f689ea87c6ef9c0ae4ccd386f7bc2db6290fbf708f4c04e4437b37921410c1eb4c47ac4
tarball=JohnTheRipper-1.8.0.6-jumbo-1.tar.gz
tardir=JohnTheRipper-1.8.0.6-jumbo-1
desc='password hash cracker'

[deps]
libressl

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

cd src

[ -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 LIBS="-lssl -lcrypto"
cd ..

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/share/john "$dest"/bin
for i in run doc README* ; do
	cp -ra "$i" "$dest"/share/john/
done
cat << EOF > "$dest"/bin/john
#!/bin/sh
echo "to run john the ripper, cd into /share/john/run and run the tools from there!"
exit 1
EOF
chmod +x "$dest"/bin/john

path: pkg/john