code:
[vars]
tarball=util-linux-$(cat "$K"/util-linux.version).tar.xz

[deps]
util-linux-tarball

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

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

CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="-static $optldflags" \
  ./configure -C --prefix="$butch_prefix" --without-ncurses --disable-shared  \
                 --disable-nls --disable-rpath --disable-tls --disable-libuuid \
                 --disable-libmount --disable-mount --disable-losetup \
                 --disable-cytune --disable-fsck --disable-partx \
                 --disable-uuidd --disable-mountpoint --disable-fallocate \
                 --disable-unshare --disable-nsenter --disable-setpriv \
                 --disable-eject --disable-agetty --disable-cramfs --disable-bfs \
                 --disable-fdformat --disable-hwclock --disable-wdctl \
                 --disable-switch_root --disable-pivot_root --disable-kill \
                 --disable-utmpdump --disable-raw --disable-rename \
                 --disable-chfn-chsh-password --disable-chsh-only-listed \
                 --disable-login --disable-sulogin --disable-su --disable-runuser \
                 --disable-ul --disable-more --disable-pg --disable-setterm \
                 --disable-schedutils --disable-wall --disable-bash-completion \
                 --disable-pg-bell --disable-use-tty-group \
                 --disable-makeinstall-chown --disable-makeinstall-setuid \
                 --enable-libblkid --enable-partx $xconfflags
make -j$MAKE_THREADS partx
dest="$butch_install_dir""$butch_prefix"
install -D -m 755 partx "$dest"/bin/partx

path: pkg/partx


code:
[vars]
filesize=54576
sha512=e28503b63c6d18a2f45f4a732fdec0380c2ac15e1778136ec5e7ac568662b09183d3ad4fd36ca7e87cfe74540f916cb6365695bdf665a39da4cbe86c4bde7a78

[mirrors]
http://git.zx2c4.com/password-store/snapshot/password-store-1.6.5.tar.xz

[deps.run]
bash
gnupg
git
xclip
pwgen
tree

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

repo_name: aarf/bkauler

path: pkg/pass

license: unknown


code:
[mirrors]
http://ftp.gnu.org/gnu/patch/patch-2.6.1.tar.xz

[vars]
filesize=239408
sha512=3eaf474dfe5b09ddd8268311e8ac61d0b760cda391af1d79d5bf4e8e1a1b488be024a05dd6b89d44ae2ec18b3947f06a517ce66f453ff299f51a869a26ba1749

[deps.stage0]
stage0-musl

[build]
[ "$STAGE" = "0" ] && CC="$butch_root_dir/bin/musl-gcc"
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CC="$CC -static" \
CFLAGS="-D_GNU_SOURCE -Werror-implicit-function-declaration $optcflags" \
LDFLAGS="-static $optldflags" \
  ./configure -C --prefix=$butch_prefix $xconfflags

make -j$MAKE_THREADS
make DESTDIR=$butch_install_dir install

path: pkg/patch


code:
[mirrors]
http://hydra.nixos.org/build/1524660/download/3/patchelf-0.6.tar.gz
[vars]
filesize=139481
sha512=90f4fe3184efe56bc95a8a560b74172db184443edc2b6827a78e55549fe96d539aa93bda03b07828766ee4f475d18e93c3b0caf2ee87228e9bd4d60a8152e9c4

[deps.host]
dynamic-toolchain

[build]
# warning C++
LDFLAGS="-static" CXXFLAGS="-O0 -g0" ./configure -C --prefix="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/patchelf


code:
[vars]
filesize=160193
sha512=217354f69f1afbe5e5de64a7901eb0c82823696567226ebc2e077167ccfe6dfb85969f3961c631701fc38bc4635c4caf7fb0920eaa85e0ea2cc3a88d844bc1e3

[mirrors]
http://cyberelk.net/tim/data/patchutils/stable/patchutils-0.3.2.tar.bz2

[deps.run]
perl

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

path: pkg/patchutils


code:
[mirrors]
http://dev.gentoo.org/~vapier/dist/pax-utils-0.4.tar.xz
[vars]
filesize=80300
sha512=3b9242805a042dc6bf53bfa8355f5f157425a944c49a780ae131642484463aa63cf62959075215cb9dde02b15cdab2210e7ad4f4498dad8218ada9459dbd3be8

[deps]
libcap2

[build]
patch -p1 < "$K"/pax-utils-cvs.patch
#touch man/scanmacho.1
#CFLAGS=-D_GNU_SOURCE ./configure -C --prefix="$butch_prefix"
make depend
make -j$MAKE_THREADS
make PREFIX="$butch_install_dir$butch_prefix" install

path: pkg/pax-utils


code:
[mirrors]
http://pax.grsecurity.net/paxctl-0.7.tar.bz2
http://ftp.barfooze.de/pub/sabotage/tarballs/paxctl-0.7.tar.bz2
http://foss.aueb.gr/mirrors/linux/sabotage/tarballs/paxctl-0.7.tar.bz2
http://dl.2f30.org/mirrors/sabotage/tarballs/paxctl-0.7.tar.bz2

[vars]
filesize=7642
sha512=d715d7466c5d5b402a7b6c44257b959c81234b8b72dc3bad4ad1080f66da784b348e73fadd3b2072ddec6c6b08f042a35cbf9d63cb890ef9efceb1e2e8d56d0a

[deps]

[build]
sed -i 's@/sbin@$(bindir)/@g' Makefile
sed -i 's@ --owner 0 --group 0@@g' Makefile
make LDFLAGS=-static -j$MAKE_THREADS CC="$CC"
make DESTDIR="$butch_install_dir" bindir="$butch_prefix"/bin MANDIR="$butch_prefix"/share/man/man1 install

path: pkg/paxctl


code:
[vars]
filesize=781298
sha512=55b45e9456c4b790137671570ba83fb34df7dfb4429b97a0d1517dd35172b51e96ca349d5eb7ce543d79961ce8628700e5c92ffb147644c780f27b0dde8b06e2

[mirrors]
http://pcc.ludd.ltu.se/ftp/pub/pcc/pcc-20130319.tgz

[deps]
yasm
bison
flex

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

path: pkg/pcc


code:
[mirrors]
ftp://ftp.kernel.org/pub/software/utils/pciutils/pciutils-3.2.1.tar.xz
http://ftp.kernel.org/pub/software/utils/pciutils/pciutils-3.2.1.tar.xz

[vars]
filesize=282268
sha512=d49e5c3d2bc1ef22d25b4e38e8043f3cf0bb50ee6d7f7763e512ab8a740031eabb575e8f64fb5122dd97d27e2017b51dd356e112c59c76df3fc4b7fd0457ccf8

[deps]

[build]
patch -p1 < "$K"/pciutils-io.patch
patch -p1 < "$K"/pciutils-implicit.patch
patch -p1 < "$K"/pciutils-pread.patch

make CFLAGS="-D_GNU_SOURCE -DHAVE_PREAD $optcflags" LDFLAGS="$optldflags" \
  PREFIX="$butch_prefix" SBINDIR="$butch_prefix"/bin \
  DESTDIR="$butch_install_dir" \
  -j$MAKE_THREADS all install
make CFLAGS="-D_GNU_SOURCE -DHAVE_PREAD $optcflags" LDFLAGS="$optldflags" \
  PREFIX="$butch_prefix" SBINDIR="$butch_prefix"/bin \
  DESTDIR="$butch_install_dir" \
  -j$MAKE_THREADS install-lib

path: pkg/pciutils


code:
[mirrors]
http://downloads.sourceforge.net/project/pcmanfm/PCManFM%20%2B%20Libfm%20%28tarball%20release%29/PCManFM/pcmanfm-1.0rc1.tar.gz
http://ftp.barfooze.de/pub/sabotage/tarballs/pcmanfm-1.0rc1.tar.gz
http://foss.aueb.gr/mirrors/linux/sabotage/tarballs/pcmanfm-1.0rc1.tar.gz
http://dl.2f30.org/mirrors/sabotage/tarballs/pcmanfm-1.0rc1.tar.gz

[vars]
filesize=447192
sha512=78f76dbf8c6452df9017b42d5df11bae1fd0cfd270219030d7e44476c8d2ff7c5fe4a8639f36e2754094775427f90c74e8ab727588906dad03f595b2bee7c09c
desc='GTK+ filemanager, major component of the LXDE desktop'

[deps]
intltool
libfm
libx11
gtk+2

[build]
patch -p1 < "$K"/pcmanfm-xcompile.patch
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags -D_GNU_SOURCE" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" --disable-nls $xconfflags

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

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

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/share/lxde/pcmanfm
cp -f "$dest"/etc/xdg/pcmanfm/default/pcmanfm.conf "$dest"/share/lxde/pcmanfm/

path: pkg/pcmanfm


code:
[mirrors]
http://sourceforge.net/projects/pcre/files/pcre/8.38/pcre-8.38.tar.bz2
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.bz2

[vars]
filesize=1562265
sha512=ad3412ceee8f992787a3e7cbe0155ffba67affd4b2dfece6c4501dc8d2012f52dcc1ee1f56759362e04bbbd10ea9370b3e46f238e2f75005cb69f6c8439e52c0

[deps]
zlib

[build]
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
CFLAGS="-D_GNU_SOURCE $optcflags" \
CXXFLAGS=${CFLAGS} \
LDFLAGS="$optldflags" \
./configure -C --prefix="$butch_prefix" $xconfflags \
  --enable-utf8 --enable-unicode-properties \
  --enable-pcregrep-libz --disable-cpp
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/pcre


code:
[vars]
desc='profiling tool using instrumentation facilities provided by the kernel'
LINUX_VER=$(cat "$K"/kernel.version)
tarball=linux-"$LINUX_VER".tar.xz

[deps]
kernel-tarball
libelf

[build]
patch -p1 < "$K"/linux-4.10-perf-sysconf.patch
cd tools/perf
cat << EOF > hack.h
#ifndef __ASSEMBLER__
#include <string.h>
#include <errno.h>
#define sched_getcpu() (errno = ENOSYS, -1)
#define strerror_r(a,b,c) ((strerror_r)(a,b,c),b)
#endif
EOF

make WERROR=0 V=1 EXTRA_CFLAGS="-I$PWD -include hack.h $optcflags" \
LDFLAGS="$optldflags -static" NO_LIBPYTHON=1
install -Dm 755  perf "$butch_install_dir""$butch_prefix"/bin/perf

path: pkg/perf


code:
[mirrors]
http://www.cpan.org/src/5.0/perl-5.22.2.tar.xz

[vars]
filesize=11224216
sha512=8c4703d593700b933a8a8744360cccb0f11a6eae5a59820469da51306ca91ea0e4984530669749a4dccacb3d83ca685bc7ff2852b2b330bad314b2ca7fce3a59
desc='interpreter for the perl 5.x scripting language'

[deps.host]
dynamic-toolchain

[build]
VERSION=5.22.2

#workaround for issue #185
patch -p1 < "$K"/perl-arm-gcc473bug.patch

# with empty prefix, perl will disregard the prefix parameters entirely, failing to build
[ -z "$butch_prefix" ] && butch_prefix=/

debug_flags=
[ "$DEBUGBUILD" = "1" ] && debug_flags="-Doptimize=-O0 -DEBUGGING=-g"

sed -i 's,-fstack-protector,-fnostack-protector,g' ./Configure

CC="gcc" ./Configure -des \
  -Accflags="-D_GNU_SOURCE -D_BSD_SOURCE -fPIC $optcflags" \
  -Aldflags="$optldflags" \
  -Dprefix="$butch_prefix" -Dvendorprefix="$butch_prefix" \
  -Dinstallprefix="$butch_install_dir" \
  -Dprivlib="$butch_prefix"/lib/perl5/core_perl \
  -Darchlib="$butch_prefix"/lib/perl5/core_perl \
  -Dsitelib="$butch_prefix"/lib/perl5/site_perl \
  -Dsitearch="$butch_prefix"/lib/perl5/site_perl \
  -Dvendorlib="$butch_prefix"/lib/perl5/vendor_perl \
  -Dvendorarch="$butch_prefix"/lib/perl5/vendor_perl \
  -Dscriptdir="$butch_prefix"/bin \
  -Dsitescript="$butch_prefix"/bin \
  -Dvendorscript="$butch_prefix"/bin \
  -Dinc_version_list=none $debug_flags \
  -Dman1dir="$butch_prefix"/share/man/man1perl -Dman1ext=1perl \
  -Dman3dir="$butch_prefix"/share/man/man3perl -Dman3ext=3perl

make -j$MAKE_THREADS
make install

dest="$butch_install_dir""$butch_prefix"

if [ -n "$butch_install_dir" ] ; then

  # remove hardcoded DESTDIR from config, which gets used by ExtUtils::MakeMaker
  # and leads to perl stuff being installed into PACKAGEDESTDIR/PERLDESTDIR
  # - which of course causes breakage.

  sed -i s@"$butch_install_dir"@@g "$dest"/lib/perl5/core_perl/Config_heavy.pl

  # perl manpages take 20 MB, that's a third of its entire size.
  # as long as nobody needs them, we will remove them.
  rm -rf "$dest"/share/man

fi

# replace duplicated perl binary with symlink
ln -sf perl$VERSION "$dest"/bin/perl

path: pkg/perl


code:
[mirrors]
http://cpan.metacpan.org/authors/id/P/PH/PHRED/Archive-Zip-1.37.tar.gz

[vars]
sha512=416dc16286edef085a9fd11b3f98c3abf6345a70552cf4f0d4e0da364b39d400cb259a09f1b33b82ff4aa6494a88e85e59afd80a94ae8446c329eb8a3af63ef1
filesize=184345

[deps.host]
perl

[deps.run]
perl

[deps]

[build]
perl Makefile.PL
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[mirrors]
http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Authen-SASL-2.16.tar.gz

[vars]
filesize=45129
sha512=d472b8b07b8915e65a219c0a40a7b6f25ca4fb767df301f426224b8f6ebf24d66fcb4422a1f421c39631e84585af06f6c64e41abe11e1e505d03e43a9f86bd6f

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl
perl5-Params-Classify

[mirrors]
http://search.cpan.org/CPAN/authors/id/Z/ZE/ZEFRAM/Class-Mix-0.005.tar.gz

[vars]
filesize=8676
sha512=9486a8ec4f6b1a5483610cdac110eed219bb849e8895a350309167206f8caef4209abbbc340a467f4c3b2ca3afc6e2b49b66601110517b66684689f4d88d20c9

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl
perl5-Class-Mix

[mirrors]
http://search.cpan.org/CPAN/authors/id/Z/ZE/ZEFRAM/Crypt-Eksblowfish-0.009.tar.gz

[vars]
filesize=36302
sha512=ca66a1ca4fd71388f25dc77c943e2416ed8534576309dd75f19a7219457418140c1bd21887d61918c34d3d6f9e11ea822b4661d30c6edf7f3673bbcd9a00a51b

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps.host]
perl

[deps.run]
perl

[deps]

[mirrors]
http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-1.631.tar.gz

[vars]
filesize=589096
sha512=7ed04167cfeb1f256613f06179d5280bbbf53e1d93d3306d5654f7278572f5cb131fb9ad16403cde05215c741cedd77e51b7cbdef15b5d4ea9dc79490775fa9e

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://www.cpan.org/authors/id/G/GA/GAAS/Data-Dump-1.23.tar.gz

[vars]
filesize=20771
sha512=6fd6c23bb6df7f7396219149dbfd23132fc2ea1dd344c32f62fc27a1afeeb28d7ebf2d429184bb6d1189f412e218f9e62a966b49fdd9ad5564e5152d67a02b96

[deps]
perl

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl
perl5-Crypt-Eksblowfish

[mirrors]
http://search.cpan.org/CPAN/authors/id/J/JA/JAITKEN/Digest-Bcrypt-1.0.1.tar.gz

[vars]
filesize=11831
sha512=b0bec588dd78ede5f9fb2331f2d9e3a89516ef065ad63fc960a252edc95634502be6c0957f44d8be5ed63c38c40ecdd25d5479c7ba9789fe86905d37ed9b7b01

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[mirrors]
http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/Digest-MD5-2.53.tar.gz

[vars]
filesize=47476
sha512=b35b297849271573434fde6cf507b1767b6c7f49793d0fd3dfeabc1aa2ec7b974c9bd7eb4201c7eec41ffa8bc4a6ee6abb7ea4262ce52f41d0cb279fd14fa1de

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[mirrors]
http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/Digest-SHA1-2.13.tar.gz

[vars]
filesize=39078
sha512=44d0c57ecc7d2126a0387552e76c9204e45fba174af6ff7abc1c9ae00d549eb7370ee20948caf12fafefedec0098b8231249d14b109c53470ee1d5bf3de3305d

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[vars]
filesize=39927
sha512=3fb8f452d625e321e77475cbc7d5672d53fe49945581561a0001be0a9464e67659303271648e102d52b6ebd04c87afc7432238fcade0c098f584f3b58c90ec82

[mirrors]
http://search.cpan.org/CPAN/authors/id/U/UR/URI/File-Slurp-9999.19.tar.gz

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl
perl5-HTML-Tagset

[mirrors]
http://www.cpan.org/authors/id/G/GA/GAAS/HTML-Parser-3.71.tar.gz

[vars]
filesize=90368
sha512=98165e22534477a4e06e6c61c10a16ad04f0e4ec79a52e458a322751d66fc3fe0182391ff60dce76076449f29dcfcb613a6e43a839d4fc15c4af5b4e8751036e

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[mirrors]
http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/HTML-Tagset-3.20.tar.gz

[vars]
filesize=8150
sha512=b53c099a96b493c3d03c51fcf3d58dd3b830069583f2d07477175ea234c43e91a0b380c82a71126f971faf2768e832af34967d08d899db7653d65613d6530072

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl
perl5-Net-SSLeay

[mirrors]
http://search.cpan.org/CPAN/authors/id/S/SU/SULLR/IO-Socket-SSL-1.955.tar.gz

[vars]
filesize=90057
sha512=dd54ee9aec107cdbcde5906581685344d72334cc6b621e70663f5488a8418d8e621e1ef23b92602f223984648491d5b9c8860277a1d45142d9a53e6b63bc3aa8

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl
perl5-IO-Socket-SSL

[mirrors]
http://search.cpan.org/CPAN/authors/id/C/CW/CWEST/Net-SMTP-SSL-1.01.tar.gz

[vars]
filesize=1806
sha512=7d078830d088b18a7493820800e01743da4d771e8fb5f68bd5d2a6b035f4e40729adb7e5878cdd9a1a192a0c4e523a1c170e8733e30516804b16bc79d50e31ad

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[mirrors]
http://search.cpan.org/CPAN/authors/id/M/MI/MIKEM/Net-SSLeay-1.55.tar.gz

[vars]
filesize=394657
sha512=204928a95937b31216008986692ef96370ab6623c9238b69a10452db40ce0b1d50d97813c53eca6debb5f605afa946fd4a468fd32fa63572c275ce0ad33ab855

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[mirrors]
http://search.cpan.org/CPAN/authors/id/Z/ZE/ZEFRAM/Params-Classify-0.013.tar.gz

[vars]
filesize=21014
sha512=8638d0d952854770049a8cf382ce02f6164025ad7224588d41be02f504947cb9d309d95c33d8fc1c2e3b5de6dfdbeac7fdaf9cd16dd6ba0a3d546c7a002e65e6

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[mirrors]
http://search.cpan.org/CPAN/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-1.11.tar.gz

[vars]
filesize=52077
sha512=cc1bd5f457dc80e46fb9904fb9dfe2bdf8bffdad8f436f0e8f5977dbc6924ef9eeceac61d8ab80df1bfcb5e14fe2476421831f47f9354726dd3b536beade0381

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz

[vars]
filesize=237377
sha512=4790d20d89478880b18255679727e5b2fb2860bb4de67d5032c805fd44c9f90697a240a612aba51255325192253aa578b346d658b29f631a4e92ad96e7d65b61

[deps]
perl
expat

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl
perl5-XML-SAX-Base
perl5-XML-Namespacesupport

[mirrors]
http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-0.99.tar.gz

[vars]
filesize=46703
sha512=f0c55efee4e3010deb474377394f9635bd8adc50108b562aeef54a2eef312cf87fb240d0495b5a5bd0c4cd5251db1bc74ba6cb549614708b1627f330959735e1

[build]
perl Makefile.PL
# https://rt.cpan.org/Public/Bug/Display.html?id=95915
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
PERL5LIB="$butch_install_dir""$butch_prefix"/lib/perl5/site_perl \
make DESTDIR="$butch_install_dir" install


code:
[deps]
perl

[mirrors]
http://www.cpan.org/authors/id/G/GR/GRANTM/XML-SAX-Base-1.08.tar.gz

[vars]
filesize=28197
sha512=2149a4772b10d31b6d0f4f0cf8d07145cdb103de518d3055f09ed921748a5b6c8269c9d7c017e865b8c251a3e930cf752eb33780d5291b4287c003af3b6ff47f

[build]
perl Makefile.PL
make -j$MAKE_THREADS
[ -z "$CROSS_COMPILE" ] && make test
make DESTDIR="$butch_install_dir" install


code:
[mirrors]
http://ftp.postgresql.org/pub/pgadmin3/release/v1.16.1/src/pgadmin3-1.16.1.tar.gz

[vars]
filesize=13783723
sha512=f5f110f99d15801dc2b2253c803cf038871461909cb63f114ee769ff0977183d6825f3bf13f378822f874fc15aa593f52cd999ccb97370b786b6e02f45ce4a81

[deps]
libxml2
libxslt
gtk+2
postgresql
wxgtk

[build]

printf '#!/bin/sh\ntrue\n' > pgadmin/ver_svn.sh

CXXFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install


code:
[vars]
tardir=phoronix-test-suite
filesize=471257
sha512=74c55145d9fd87c0463307c43f23dee5432193699cb665046b9ccc5c711cef89f9967ca1fa4c6ab236424621e14926e6b7b0e5692829d9efadb8fe3f722713dd

[mirrors]
http://www.phoronix.net/downloads/phoronix-test-suite/releases/phoronix-test-suite-3.8.0.tar.gz

[deps]
php

[build]
DESTDIR="$butch_install_dir" ./install-sh /

path: pkg/phoronix-testsuite


code:
[mirrors]
http://www.php.net/distributions/php-7.0.5.tar.xz

[vars]
filesize=11461716
sha512=9a91c1748bc2034016b4d25a116c96e7f60bc48a698864ed7f805870a2c5f6f75aa9a24ec4501403ba1fd45baccfefb2076db149da03c00dabc12e3190068c7c
desc='heavily broken scripting language for web development'

[deps]
gettext
freetype
libedit
re2c
curl
db
libressl
openssh
libjpeg
libpng
zlib
pcre
libxml2
json-c
bzip2

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

[ -z "$butch_prefix" ] && butch_prefix=/
pfx="$butch_prefix"
# all the below *_cv_ tests fail because the php configure tests
# use exit() but dont include stdlib.h. same for strcmp and string.h etc.
LDFLAGS="-Wl,--no-keep-memory  $optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
CFLAGS="-D_BSD_SOURCE -D_GNU_SOURCE $optcflags" ./configure -C $xconfflags \
  --prefix="$butch_prefix" --enable-re2c-cgoto \
  --mandir="$butch_prefix"/share/man \
  _cv_have_broken_glibc_fopen_append=no \
  ac_cv_what_readdir_r=POSIX ac_cv_broken_sprintf=no \
  ac_cv_crypt_blowfish=yes ac_cv_crypt_md5=yes ac_cv_crypt_SHA256=yes \
  ac_cv_crypt_SHA512=yes ac_cv_crypt_des=yes ac_cv_crypt_ext_des=yes \
  ac_cv_pwrite=yes ac_cv_pread=yes \
  --with-curlwrappers --with-libxml-dir="$pfx" --with-jpeg-dir="$pfx" \
  --with-png-dir="$pfx" --with-openssl-dir="$pfx" --with-sqlite3 \
  --with-pcre-regex="$pfx" --with-pcre-dir="$pfx" --with-zlib="$pfx" \
  --with-zlib-dir="$pfx" --with-curl="$pfx" --with-bz2="$pfx" \
  --with-db4="$pfx" --with-gmp="$pfx" \
  --with-libedit="$pfx" --with-freetype-dir="$pfx" \
  --enable-maintainer-zts \

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

path: pkg/php


code:
[mirrors]
https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-0.9.7.tar.bz2
http://www.ring.gr.jp/pub/net/gnupg/pinentry/pinentry-0.9.7.tar.bz2

[vars]
filesize=432978
sha512=9c5bc8f7246e8b0affd83fea6e64c47cecf6a12515a82dd2a6712b230306a9c3c97da4dbf6519ea98c85c88bf180a5a2b8c46cedcd594f224e5a08f2f0e35bf0
desc='dialogs for secure password input into gnupg'

[deps]
curses
libassuan

[build]
sed -i 's@_MEMORY_H@MY_MEMORY_H@g' secmem/memory.h
ln -sf memory.h secmem/mymemory.h

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

CPPFLAGS="-D_GNU_SOURCE -I$PWD/secmem -include mymemory.h" \
CFLAGS="$optcflags" \
CXXFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --enable-pinentry-curses \
  --with-libassuan-prefix="$butch_root_dir$butch_prefix" \
  --disable-pinentry-gtk2

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


code:
[mirrors]
https://github.com/wiire/pixiewps/archive/d5a7111.tar.gz

[vars]
filesize=38745
sha512=821910db45d33bbd72b220b64b0f96cb8e9f7d18dc279c704c02c3f3cbc709b5dc974ead3348d3110f04d179fc9a4e38daff24a5a781dd59423b56e94f256c73
tarball=pixiewps-1.2.2-d5a7111.tar.gz
tardir=pixiewps-d5a7111097c32cb34f54ed64e3d6884b31a53761
desc='pixiedust offline wps attack tool'

[deps]

[build]
cd src
make V=1 -j$MAKE_THREADS CCFLAGS="-std=c99 $optcflags $optldflags"
install -Dm 755 pixiewps "$butch_install_dir""$butch_prefix"/bin/pixiewps

path: pkg/pixiewps


code:
[deps.host]
perl

[mirrors]
http://cairographics.org/releases/pixman-0.30.2.tar.gz
http://distfiles.lesslinux.org/pixman-0.30.2.tar.gz
http://cairographics.org/releases/pixman-0.30.2.tar.gz
http://www.x.org/releases/individual/lib/pixman-0.30.2.tar.gz

[vars]
filesize=799461
sha512=a86f4b7cbd8440d28a47773edf1a2055898b2d65501cba42b22f70af377ffa5beff1a2f695009e708640e6c98cf54f069560dcaa98ce308157baa6d139e57d56

[build]
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > test/Makefile.in
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --disable-sse2 --disable-mmx --disable-arm-neon --disable-arm-simd --disable-arm-iwmmxt"

CFLAGS="-DPIXMAN_NO_TLS $optcflags" ./configure -C --prefix="$butch_prefix" \
  --disable-loongson-mmi $xconfflags
sed -i -e '/TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR/d' -e '/TOOLCHAIN_SUPPORTS__THREAD/d' config.h
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/pixman


code:
[deps]
alsa-utils
autoconf
automake
bison
bridge-utils
busybox-man
capchroot
perl5-Data-Dump
perl5-File-Slurp
curl
cryptsetup
diffutils
dropbear
expat
file
flex
gdb
git
gnupg
gradm
iptables
kbd
less
libao
libjpeg
libpng
lighttpd
luajit
lvm
lynx
nano
curses
ndhcp
openal
openssh
patch
patchutils
pax-utils
paxctl
posix-man
proxychains
psmisc
python
perl
rsync
sdl
sdl-image
sdl-mixer
sdl-net
sdl-ttf
sdl-gfx
strace
stunnel
svn
tcpdump
tomoyo
tmux
wget
wireless-tools
wpa-supplicant
xz

path: pkg/pkg


code:
[deps]
pkgconf

path: pkg/pkg-config


code:
[deps]
musl

[mirrors]
http://files.etoilebsd.net/pkgconf/pkgconf-0.8.9.tar.bz2
http://mirror.r0x0r.me/sabotage/pkgconf-0.8.9.tar.bz2
http://ftp.barfooze.de/pub/sabotage/tarballs/pkgconf-0.8.9.tar.bz2

[vars]
filesize=80211
sha512=3acb571412dedc2587203ed05537ce3adbaa64f2fab4f561da9824917c15e2ea771db7525f9a026261086f4ae196c3a5183e1bb3d33e14fdd779fbe74e6215c3
desc='lightweight drop-in replacement for pkg-config'

[build]
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
patch -p1 < "$K"/pkgconf-fix-empty-prefix.patch
patch -p1 < "$K"/pkgconf-sysroot-twice.patch
CFLAGS="$CFLAGS -D_GNU_SOURCE -D_BSD_SOURCE $optcflags" \
LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
ln -sf pkgconf "$butch_install_dir/bin/pkg-config"

path: pkg/pkgconf


code:
[vars]
filesize=208687
sha512=5bc9479fe75f120aee136befeb24c8d7d85f61410b551177ed61fd1b4ea9cce7989796b067e357ea93b44b4ae9f66311687066f188236c5efdfd3750695a8017

[mirrors]
http://pm-utils.freedesktop.org/releases/pm-utils-1.4.1.tar.gz

[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 \
     --sysconfdir="$butch_prefix"/etc \
     --docdir="$butch_prefix"/share/doc/pm-utils-1.4.1

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

make V=1 -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
install -v -m644 man/*.1 "$butch_install_dir"/share/man/man1
install -v -m644 man/*.8 "$butch_install_dir"/share/man/man8

path: pkg/pm-utils


code:
[mirrors]
http://sourceforge.net/projects/polyml/files/polyml/5.5.2/polyml.5.5.2.tar.gz

[vars]
filesize=5599140
sha512=248c2a38c4691898bc1243a041f4683bf227d9c8a98c6c3545af2a8a3249ed5ed96f33f90cb2dede8809b42f33c0557650147302cfe046a5fba965ccd93cbc5b

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

path: pkg/polyml


code:
[mirrors]
http://poppler.freedesktop.org/poppler-0.24.4.tar.xz

[vars]
filesize=1511248
sha512=5567a51c2d2311ceaae087a7f7d5c0b71ba90afa91184a41997b3ea76aeff6d5b182d7c4018a1c2e93eb15b1f6cfec783b326940797ad4d5b7ee0276008b06db

[deps.host]
pkgconf

[deps]
libx11
libtiff
libjpeg
libpng
freetype
fontconfig
cairo
glib

[build]
patch -p1 < "$K"/poppler-segfault.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=12925

[ -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 \
  --enable-introspection=no \
  --enable-cms=none \
  --disable-gtk-test \
  --disable-poppler-qt4 \
  --disable-poppler-qt5 \
  --disable-splash-output \
  --disable-libopenjpeg \
  --enable-xpdf-headers \
  --enable-zlib
[ -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/poppler


code:
[mirrors]
http://poppler.freedesktop.org/poppler-data-0.4.6.tar.gz

[vars]
filesize=4182141
sha512=5e5f5302c475d3630961b7a89a2e8c8b77884ee99289d97b626d9f1daee54314f4b1d070397c8f3dce0c420a71960d4663c56637eb9ba54de2eec3e481636035

[deps]
poppler

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

path: pkg/poppler-data


code:
[mirrors]
http://rpm5.org/files/popt/popt-1.16.tar.gz

[vars]
filesize=702769
sha512=bae2dd4e5d682ef023fdc77ae60c4aad01a3a576d45af9d78d22490c11e410e60edda37ede171920746d4ae0d5de3c060d15cecfd41ba75b727a811be828d694

[deps.host]
dynamic-toolchain

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags -D_GNU_SOURCE" \
LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags
for i in po ; do
        printf 'all:\n\ttrue\ninstall:\n\ttrue\clean:\n\ttrue\n' > "$i"/Makefile
done

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

path: pkg/popt


code:
[mirrors]
http://people.redhat.com/~rjones/portablexdr/files/portablexdr-4.9.1.tar.gz

[vars]
filesize=354321
sha512=47f2402e7ed9f2f518e2a45e76e8ad6c4b1e7ae1bd9408ca4dca3d0883697e755460ee64eef405e23b1840ad3b89ad54555bdf59dc8bae3cd8b67086d6ab3b1f

[deps]

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

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

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

make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
dest="$butch_install_dir""$butch_prefix"
printf '#include <rpc/types.h>\n#include <rpc/xdr.h>\n' \
  > "$dest"/include/rpc/rpc.h
ln -s portable-rpcgen "$dest"/bin/rpcgen

path: pkg/portablexdr


code:
[mirrors]
http://www.portaudio.com/archives/pa_stable_v19_20140130.tgz

[vars]
filesize=1504620
sha512=078adfdc2cec7fbd4019837eee65f8411b873b51064dfd7334e1c55118c26ea1fb68cb22e46ee69adb69c78d026b00a7ed973c40632e7d79703e12669a62ee3e
tardir=portaudio

[deps]

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

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

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

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

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

path: pkg/portaudio


code:
[deps]
less

[mirrors]
ftp://www.kernel.org/pub/linux/docs/man-pages/man-pages-posix/man-pages-posix-2013-a.tar.xz
http://www.kernel.org/pub/linux/docs/man-pages/man-pages-posix/man-pages-posix-2013-a.tar.xz
http://mirror.anl.gov/pub/linux/docs/man-pages/man-pages-posix/man-pages-posix-2013-a.tar.xz

[vars]
filesize=930736
sha512=e6ec8eb57269fadf368aeaac31b5a98b9c71723d4d5cc189f9c4642d6e865c88e44f77481dccbdb72e31526488eb531f624d455016361687a834ccfcac19fa14
desc='POSIX manpages - _the_ guide for system (libc) APIs and std utilities'

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

path: pkg/posix-man


code:
[mirrors]
http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-3.1.0.tar.gz
http://archive.mgm51.com/mirrors/postfix-source/official/postfix-3.1.0.tar.gz
ftp://ftp.porcupine.org/mirrors/postfix-release/official/postfix-3.1.0.tar.gz

[vars]
filesize=4336709
sha512=06cf4c827de8d613cab6a57a8e76198d293660a263f60d17dd189f511da4b1e12eb98bbcf75695697a62959e26ca204bf2a53eb6657e8bd756a816977e717783

[deps]
db
libressl
dovecot

[build]
sed -i -e 's@#if OPENSSL_VERSION_NUMBER < 0x10100000L@#ifndef OPENSSL_VERSION@' src/tls/tls.h
CCARGS="-DNO_NIS -DUSE_TLS -DUSE_SASL_AUTH -DDEF_SASL_SERVER_TYPE=\"dovecot\"" \
AUXLIBS="-lssl -lcrypto" make -f Makefile.init makefiles
make -j$MAKE_THREADS
sh postfix-install -non-interactive \
   install_root="$butch_install_dir" \
   daemon_directory="$butch_prefix"/lib/postfix \
   manpage_directory="$butch_prefix"/share/man

dest="$butch_install_dir""$butch_prefix"
mv "$dest"/usr/* "$dest"/
rm "$dest"/bin/*
mv "$dest"/sbin/* "$dest"/bin/
rm -rf "$dest"/usr "$dest"/sbin

mv "$dest"/etc/postfix "$dest"/share/doc
if [ ! -f  "$dest"/etc/postfix/main.cf ] ; then
	install -D -m 644 "$K"/postfix-main.cf "$dest"/etc/postfix/main.cf
	install -D -m 644 "$K"/postfix-master.cf "$dest"/etc/postfix/master.cf
	install -D -m 644 "$K"/postfix-virtual "$dest"/etc/postfix/virtual
	cat <<- EOF > "$dest"/etc/postfix/README
	Edit 'virtual' to route mail to users, then reload with 'postmap /etc/postfix/virtual'.
	See /share/doc/postfix for further information.
	EOF
fi

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

path: pkg/postfix


code:
[mirrors]
http://ftp.postgresql.org/pub/source/v9.4.8/postgresql-9.4.8.tar.bz2

[vars]
filesize=17740626
sha512=d1cc8a02ed7eb0af365479cee43b3cd33fade69e07eb82343cd562efda5a460e405836e1fb2492a8cb22a71d14038216868cb48694400b3c31a56c4aee0bcac4
desc="professional SQL database server and interface libraries"
uchkurl=http://ftp.postgresql.org/pub/source/

[deps.host]
python

[deps]
libressl
libxml2
libxslt
readline
timezones

[build]
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) \
  --with-sysroot=$butch_root_dir --with-system-tzdata="$butch_prefix"/etc/zoneinfo"

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 \
  --enable-thread-safety \
  --docdir="$butch_prefix"/share/doc/postgresql \
  --mandir="$butch_prefix"/share/man
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

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

path: pkg/postgresql


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

[vars]
filesize=5243
sha512=31c1a7a831e84aa48c1faebe77b1106e991d8ebc43093e1d992b0b3e6a521b3fe7d15b0679ef2b79a918334f408f78bf7c7592f42d0066c43a1fcafd2290487d
desc="Displays battery state-of-charge, gtk2 applet for desktop tray"

[deps]
gtk+2
gettext-gnu

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

sed -i -e 's%/usr/%/%' powerapplet_tray.c

[ -f powerapplet_tray ] && rm -f powerapplet_tray
[ -f powerapplet_tray.pot ] && rm -f powerapplet_tray.pot
gcc powerapplet_tray.c -o powerapplet_tray `pkg-config --cflags --libs gtk+-2.0`
xgettext --keyword="_" -o powerapplet_tray.pot powerapplet_tray.c

#these destinations are Puppy-heritage: /root/Startup
#need to rethink these. set to /lib/Startup
strip --strip-unneeded powerapplet_tray
mkdir -p "$dest"/lib/Startup
cp -a -f powerapplet_tray "$dest"/lib/Startup/
mkdir -p "$dest"/share/doc/nls/powerapplet_tray
cp -a -f powerapplet_tray.pot "$dest"/share/doc/nls/powerapplet_tray/

path: pkg/powerapplet-tray


code:
[mirrors]
http://samba.org/ftp/ppp/ppp-2.4.6.tar.gz

[vars]
filesize=687744
sha512=65d6967ba43cd8b4d3f63f52ff69f6fed964f748fc780dff982629668213c2cd1891671f6f4a0c1c22118a382e282fabdd2328e60a120d9b984d3c17f9355cc6

[deps]
libnl-tiny

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

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

sed -i 's/HAVE_SYS_CDEFS_H/FOOBAR/' pppd/plugins/rp-pppoe/config.h
sed -i 's,#include <sys/cdefs.h>,#define __P(foo) foo,' pppd/magic.h

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

for i in pppstats pppd/plugins/rp-pppoe pppd/plugins/radius pppd chat pppdump ; do
	sed -i 's/-s -c/-D/g' $i/Makefile
done

make V=1 COPTS="$CPPFLAGS $CFLAGS $LDFLAGS" -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/ppp


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

[vars]
filesize=107998
sha512=6d6b3cb78ff7c6ad8103d0003479f94702aea412640feec5d82cb630c9560fd0e1f7b6124e9eaba138adc9bf61ee08ef193537c2754c9b79737ef871c5114c59

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


code:
[mirrors]
http://ftp.de.debian.org/debian/pool/main/p/procps/procps_3.3.9.orig.tar.xz
[vars]
filesize=560812
sha512=62c7270aa48b4346a3198f306d1cb8474f64650bfb67e8cc6c4d41923e50c31c95b3a0367a464823fb50a6137ec0c6352006292ac85b50caf730ec8ec35eb553
tardir=procps-ng-3.3.9

[deps]

[build]
cat << EOF > include/error.h
#include <stdio.h>
#include <string.h>
#define HAVE_PROGRAM_INVOCATION_SHORT_NAME
#define PROGRAM_NAME "procps"

#define error(status, errnum, ...) \
  do { fflush(stdout); \
       dprintf(2, PROGRAM_NAME ": "); \
       dprintf(2, __VA_ARGS__); \
       if(errnum) dprintf(2, ": %s", strerror(errnum)); \
       dprintf(2, "\n"); \
       if(status) exit(status); \
  } while(0)

#define error_at_line(status, errnum, fn, line, ...) \
  do { fflush(stdout); \
       dprintf(2, PROGRAM_NAME ": %s:%d", fn, (int) line); \
       dprintf(2, __VA_ARGS__); \
       if(errnum) dprintf(2, ": %s", strerror(errnum)); \
       dprintf(2, "\n"); \
       if(status) exit(status); \
  } while(0)

EOF
mkdir -p include/sys
cat << EOF > include/sys/dir.h
#include <dirent.h>
#define direct dirent
EOF

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

STRIP=true \
CPPFLAGS="-D_GNU_SOURCE -DGLOB_TILDE=0 -DAF_INET6=10 -DAF_INET=2" \
CFLAGS="$optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure -C --prefix="$butch_prefix" $xconfflags \
  --without-ncurses \

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

dest="$butch_install_dir""$butch_prefix"
mv $dest/usr/bin/* $dest/bin/

path: pkg/procps


code:
[mirrors]
https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2

[vars]
filesize=2021416
sha512=8b092b87fcd79223db199cd3d330f3d43689b47f345aa4e34028dcf1680d609a5d5a89ab08588e817b566d3b265834c38f1db580bc1c144b512ce74d35f2a174

[deps]
libstdc++

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

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/protobuf


code:
[deps]
protobuf

[mirrors]
https://github.com/protobuf-c/protobuf-c/releases/download/v1.1.0/protobuf-c-1.1.0.tar.gz

[vars]
filesize=453852
sha512=50e0a9df1152e468c1bda88f67836fbe88e1ad711b3e6517265cdf715d89c2e15e7fb48c46ad4e163c978e54c899712e7a6e5e9b8bf7145cfdbc04947e0dcb34

[build]
if [ -n "$CROSS_COMPILE" ] ; then
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/') \
  --with-sysroot=$butch_root_dir --with-protoc=protoc"
  type protoc >/dev/null || {
    echo "error: need protoc installed on the host" ; exit 1 ;
  }
fi
CXXFLAGS="-D_GNU_SOURCE $optcflags" \
CFLAGS="-D_GNU_SOURCE -DSTDC_HEADERS $optcflags" \
LDFLAGS="$optldflags" \
 ./configure -C --prefix="$butch_prefix" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/protobuf-c


code:
[mirrors]
http://downloads.sourceforge.net/proxychains-ng/proxychains-ng-4.11.tar.bz2

[vars]
filesize=31856
sha512=241365e8a8bbcead22c7844a2970f59bfc1ee9ef9a42a3f800823e70008bd976835d705a8b9894980c46307dce3a886514051023bafef113845531cb5d928e1c
desc='redirect connections of dynamic linked programs to one or more proxies'

[deps]

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

path: pkg/proxychains


code:
[deps]
gettext
curses

[vars]
filesize=492733
sha512=8f4526e53c80a3bc19430b5721610b733f59a330ee0230a3a285d104f99969c092421cb59b4e535aff3337c4de2118c148e2ea2e7019b704a28b22eff40b19d3

[mirrors]
http://downloads.sourceforge.net/psmisc/psmisc-22.19.tar.gz

[build]
patch -p1 < "$K"/psmisc-termcap.patch
[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine|sed 's/musl/gnu/')"
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-harden-flags
echo "#include <limits.h>" >>config.h
sed -i 's/!strcmp(__progname, "pstree.x11")/0/' src/pstree.c
sed -i '/__progname/d' src/pstree.c
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
rm "$butch_install_dir""$butch_prefix"/bin/pstree.x11

path: pkg/psmisc


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/pup-tools-20150407.tar.bz2

[vars]
filesize=27044
sha512=3d2e688189c7191b84ba6bf993452e32a159d163c81650fcd147240865aff4c647eb21afd5856ac7eabc922314a9c3d8ede4f66b0581ed4a516b1564415f1d9e
desc="Core utilities used in Puppy Linux and derivatives"

[deps]
gtk+2
bacon

[build]
cd bacon
./build-pup-tools
cd ..
cd gcc
./build-pup-tools
cd ..
cd diet
#used to use dietlibc, but now building with musl...
gcc printcols.c -o printcols
gcc vercmp.c -o vercmp
gcc truncate.c -o truncate
cd ..

dest="$butch_install_dir""$butch_prefix"
mkdir "$dest"/sbin
for AEXE in debdb2pupdb find_cat pngoverlay popup proxy-setup pup_event_frontend_d pup_event_ipc welcome1stboot
do
 install -m755 -s bacon/$AEXE "$dest"/sbin
done
for AEXE in getcurpos
do
 install -m755 -s gcc/$AEXE "$dest"/sbin
done
for AEXE in printcols truncate vercmp
do
 install -m755 -s diet/$AEXE "$dest"/sbin
done

path: pkg/pup-tools


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/puppyinputdetect-1.1i.tar.bz2

[vars]
filesize=8699
sha512=4735bea8a0a646cf32aa1438ac09eb10aba71f2cb8d08a3a8dc5b7b5990a0a8ab6624c6f09778bdcf08f6d36795d15a6db32bbb848cf233729144e4e86ce8726
desc="Detect usb/ps2 mouse and keyboard. Does not detect serial mouse"

[deps]

[build]
#note, run with --help to see how to use.
make || exit 1

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

path: pkg/puppyinputdetect


code:
[mirrors]
http://distro.ibiblio.org/quirky/quirky6/sources/t2/april/puppyserialdetect-1.1h.tar.bz2

[vars]
filesize=8897
sha512=6c7359603d604a7d466eb4165ab030ffe0ff5156d3a9f0feac6d6da7cddcb595ecc2939e51d6fc3631a701c71d00d1aa8acc1e7aeda17ec5db4ef6993735ad6a
desc="Detects usb/ps2 mouse and keyboard, and serial mouse and serial modem"

[deps]

[build]
#note, run with --help to see how to use.
./compile.sh || exit 1

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

path: pkg/puppyserialdetect


code:
[vars]
filesize=105001
sha512=913a5c84e24e0bfb23930a790d9e030f2c88014bb61266c96e3d11890c4667fe42662f01c103c4dcbbc2e69515598a8546a4edb185b81422b90524432f7cc2e5
desc='pipe viewer. add to piped command chains to see speed information'

[mirrors]
http://www.ivarch.com/programs/sources/pv-1.5.2.tar.bz2

[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 LD="$CROSS_COMPILE"ld
make DESTDIR="$butch_install_dir" install

path: pkg/pv


code:
[vars]
filesize=53513
sha512=9c56ff04ca2f6f60126608a25f395ddbc4a3ac59585a6f233c87d993b6388e30b1867d43a6bc5b0f9f1f4064b12ea450eac4f7c9ac2844707a99fad1bbd2664d

[mirrors]
http://downloads.sourceforge.net/project/pwgen/pwgen/2.07/pwgen-2.07.tar.gz

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


code:
[mirrors]
https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
http://sources.buildroot.net/Python-2.7.10.tar.xz

[vars]
filesize=12250696
sha512=67615a6defbcda062f15a09f9dd3b9441afd01a8cc3255e5bc45b925378a0ddc38d468b7701176f6cc153ec52a4f21671b433780d9bde343aa9b9c1b2ae29feb
desc='interpreter for the python 2.x scripting language'

[deps]
musl
curses
libressl
bzip2
expat
libffi

[build]
# work around buggy installer which puts stuff into prefix directly (omitting destdir) when
# the prefix equals "/"
[ "$butch_prefix" = "/" ] && butch_prefix=

# python can't deal with prefix= or prefix=/ correctly.
# it will emit empty PREFIX and EXEC_PREFIX macros into pyconfig.h
# additionally it searches for stuff only relative to its own binary.
# this doesn't work well with our symlink relocation strategy.
patch -p1 < "$K"/python273-pathsearch.patch
patch -p1 < "$K"/python-xcompile.patch
patch -p1 < "$K"/python-includedirs.patch
patch -p1 < "$K"/python2710-curses.patch

sed -i 's@return readline@return feedline@' configure

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) --build=$($HOSTCC -dumpmachine)"

CFLAGS="-D_GNU_SOURCE -D_BSD_SOURCE -fPIC $optcflags" \
LDFLAGS="$optldflags" ./configure -C --prefix="$butch_prefix" \
  --with-system-expat --with-system-ffi $xconfflags \
  ac_cv_lib_readline_rl_callback_handler_install=no \
  ac_cv_lib_readline_rl_pre_input_hook=no \
  ac_cv_lib_readline_rl_completion_display_matches_hook=no \
  ac_cv_lib_readline_rl_completion_matches=no \
  ac_cv_file__dev_ptmx=yes

if [ -n "$CROSS_COMPILE" ] ; then
	cp pyconfig.h pyconfig.h.target
	for i in SIZEOF_LONG SIZEOF_PTHREAD_T SIZEOF_SIZE_T SIZEOF_TIME_T SIZEOF_VOID_P SIZEOF_UINTPTR_T ; do
		sed -i 's,#define '$i',//,' pyconfig.h
	done
	printf "%s\n" 'int main() { printf("%zu\n", sizeof(time_t)); return 0;}' > foo.c
	$HOSTCC -include time.h -include stdio.h foo.c
	l=$(./a.out)
cat << EOF >> pyconfig.h
#define SIZEOF_LONG __SIZEOF_LONG__
#define SIZEOF_PTHREAD_T SIZEOF_LONG
#define SIZEOF_SIZE_T SIZEOF_LONG
#define SIZEOF_VOID_P SIZEOF_LONG
#define SIZEOF_UINTPTR_T SIZEOF_LONG
#define SIZEOF_TIME_T $l
EOF
	make Parser/pgen CC="$HOSTCC" -j$MAKE_THREADS
	cp pyconfig.h.target pyconfig.h
else
	make Parser/pgen -j$MAKE_THREADS
fi

# python does not use the user CFLAGS as last element, so they override our
# optimization and debug level with their hardcoded one.
# thus the usage of EXTRA_CFLAGS to get into the last position.
EXTRA_CFLAGS="$optcflags" make -j$MAKE_THREADS

make DESTDIR="$butch_install_dir" install

# shrinking python's install size from 90+ MB to 40+...
dest="$butch_install_dir""$butch_prefix"
# removing duplicate libpython2.7.a which takes 10-17MB depending on CFLAGS
ln -sf ../../libpython2.7.a "$dest"/lib/python2.7/config/libpython2.7.a
# removing tests
for test in sqlite3/test email/test ctypes/test test unittest/test lib-tk/test \
            bsddb/test json/tests lib2to3/tests distutils/tests tests ; do
	rm -rf "$dest"/lib/python2.7/"$test"
done
# removing precompiled python code
# this can cause a minimal startup time increase
find "$dest"/lib/python2.7/ -name '*.pyo' -or -name '*.pyc' -exec rm {} \;

path: pkg/python


code:
[mirrors]
https://pypi.python.org/packages/source/d/dbus-python/dbus-python-0.84.0.tar.gz

[vars]
filesize=563906
sha512=65cc9d0fb1f9f58f8ee01fca566d7b15de7d7097ccb3bd6c575a1130f166c1aead3368a0dc15275472699e762ca2864c67598a2e87703bc0b9eb7ced5fd68f18

[deps]
python
wget
dbus

[build]

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

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

path: pkg/python-dbus


code:
[mirrors]
https://pypi.python.org/packages/source/e/ecdsa/ecdsa-0.10.tar.gz

[vars]
filesize=45153
sha512=c1a51e95af938aca01001a4aa7e3a830157d5ffd0370d880340e513edbe176b30750fb86270d605b729dcc5741346d552b2bf16d7b3b4910fd1d06f96eaffc0f

[deps.run]
python

[deps.host]
python
wget

[build]
# FIXME: there appears to be no mirror without https
python setup.py build
python setup.py install --prefix="$butch_prefix" --root="$butch_install_dir"

path: pkg/python-ecdsa


code:
[mirrors]
https://pypi.python.org/packages/source/n/numpy/numpy-1.10.4.tar.gz

[vars]
filesize=4069996
sha512=57ace46e357d49be0efd904e5ceb9862c626c916987c8798a12de7ae1e06816ad8483439ac4619792a04889631b5998f2397dc601c78dea33a784b4831c19c79

[deps.run]
python

[deps.host]
python

[build]
patch -p0 < "$K"/numpy-musl.patch
python setup.py build
python setup.py install --prefix="$butch_prefix" \
       --root="$butch_install_dir"

path: pkg/python-numpy


code:
[mirrors]
http://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz
[vars]
filesize=247594
sha512=b969797d4c93aabefa4b66e0ad3d2c3ccedd3324e68bb1fa81d383f1e867d24ce2fb91851b0470607312041e3c3c0224c920be2e77d6f9af01084146c65f308a

[deps.run]
python

[deps.host]
python
setuptools
wget

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

path: pkg/python-pip


code:
[mirrors]
http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2

[vars]
filesize=402070
sha512=cb3d54de9af4134460ce731da8166a3127a642c8a2e6184109437ddec115cd55b8dd2413a5c81700277bfe2f22fcfe268db4f3ba0f7649751e85bb34295f79fc

[deps]
python
cairo

[build]
[ -z "$butch_prefix" ] && butch_prefix=/

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

./waf build -j$MAKE_THREADS
DESTDIR="$butch_install_dir" ./waf install


code:
[mirrors]
https://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.6.tar.gz
https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.tar.gz
http://sources.openelec.tv/devel/pycrypto-2.6.tar.gz

[vars]
filesize=443445
sha512=7dc82f258e87aad458e88626c5167c17ef9f967aadfc62c41592e14476acf247dd41468bc7351ebb15a6e26f106e5f62bb3a00686b18522b1607e3c7e36b53a8

[deps]
python

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

path: pkg/python-pycrypto


code:
[mirrors]
http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz

[vars]
filesize=2134254
sha512=485f02c4f3113a9de5e731c089de8a9bdcc639152de162f20eb8b50659a42e24f53d0685346dc46f390439be5a5c001dcce7cb866b180948c0f1441d01a7d6c2

[deps]
sdl
sdl-mixer
smpeg

[deps.run]
python

[deps.host]
python

[build]
patch -p1 < "$K"/pygame-drop_v4l_support.patch
sed -i 's@int pos = 0@Py_ssize_t pos = 0@' src/scrap_x11.c
printf "#!/bin/sh\necho 1.2.15\necho -lSDL -I$butch_root_dir$butch_prefix/include/SDL\n" > sdl-config
printf "#!/bin/sh\necho 0.4.5\necho -lsmpeg -I$butch_root_dir$butch_prefix/include/smpeg\n" > smpeg-config
chmod +x sdl-config
chmod +x smpeg-config
export PATH="$PWD:$PATH"
python setup.py build
python setup.py install --prefix="$butch_prefix" \
       --root="$butch_install_dir"

path: pkg/python-pygame


code:
[mirrors]
http://ftp.acc.umu.se/pub/GNOME/sources/pygobject/2.28/pygobject-2.28.6.tar.xz
[vars]
filesize=747248
sha512=37544ea2377258758169b25a2969d5ee1c9ffb9b6e63e05bc7a0471a49ac9169c51ec587d4489172c7d256f53df878a81c1992a08059aa7e43dbbb69f799545c

[deps]
python
glib
gobject-introspection
python-py2cairo

[build]
patch -p1 < "$K"/pygobject-2.28.6-introspection-1.patch

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

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

path: pkg/python-pygobject


code:
[mirrors]
http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2

[vars]
filesize=2361097
sha512=64f4344fcf7636e0b2016ffd5310250b5c02a1bf87e44aef39b5d4cf4a5fc50d27cb4f030d4c6802cff61fffb88dee7752821e3d8a4cd1c34dc3745d9ff2f0da

[deps]
python
gtk+2
python-pygobject

[build]
# https://github.com/sabotage-linux/sabotage/issues/135
[ -z "$butch_prefix" ] && butch_prefix=/

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

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

path: pkg/python-pygtk


code:
[mirrors]
http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10.2/PyQt-x11-gpl-4.10.2.tar.gz

[vars]
filesize=11280941
sha512=6600b87e55f5a8fa0e41549f08d7639baec3ac9ffe14d6b141d808b14f672676abf872a48a300491a9b24eb5a14299f636a71bda246bb63cdb38d5afcd64b6d1

[deps]
python
python-sip
qt4

[build]
QMAKESPEC=/opt/qt4/mkspecs/linux-g\+\+/ python ./configure.py \
  --confirm-license \
  --bindir="$butch_prefix"/bin \
  --sipdir="$butch_prefix"/share/python-sip \
  --destdir="$butch_prefix"/lib/python2.7/site-packages \

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


code:
[vars]
filesize=794335
sha512=20f4b0f49a5cf029abb3efa8d2c95dcc5f77670fa4391cb714e835ab1d80348d2ed95759c8ed6bf9c6405ed02331288c5a6fee1303c83c2ddc9f95ae12f29e12

[deps]
python

[mirrors]
http://pypi.python.org/packages/source/s/setuptools/setuptools-3.4.4.tar.gz

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

path: pkg/python-setuptools


code:
[mirrors]
https://pypi.python.org/packages/source/s/simplejson/simplejson-3.3.0.tar.gz

[vars]
filesize=67250
sha512=83e0157c57d24ce1b0ed01a206faf61c832bf8c427cd0db546c2a352cbc5e8f197a93dc09a1bbf9337431adbabccce36da62352f26799fd50dac0678c22a62b3

[deps.run]
python

[deps.host]
python
wget

[build]
# FIXME: there appears to be no mirror without https
python setup.py build
python setup.py install --prefix="$butch_prefix" --root="$butch_install_dir"

path: pkg/python-simplejson


code:
[mirrors]
http://sourceforge.net/projects/pyqt/files/sip/sip-4.14.7/sip-4.14.7.tar.gz

[vars]
filesize=754916
sha512=8a2ff12553c4c0b31f5884ef292b9c233d0a1148c66c9bdea2b7f74ce151465a16f8e511069e6e47a0527f960c1f13a9ec6c5766d7324670c236a92536bbb6b3

[deps]
python

[build]
python ./configure.py \
  --bindir="$butch_prefix"/bin \
  --incdir="$butch_prefix"/include/python2.7 \
  --sipdir="$butch_prefix"/share/python-sip \
  --destdir="$butch_prefix"/lib/python2.7/site-packages \

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

path: pkg/python-sip


code:
[mirrors]
https://pypi.python.org/packages/source/s/slowaes/slowaes-0.1a1.tar.gz

[vars]
filesize=7017
sha512=09126a6cf2a0da27c45b12d25c3a9147f47448311f9e36b6db2aa62d8b85f3fdf66f10f8f5d84edf48cde7f6c766d9ed384832f9ca0e28f95104149a7f424d95

[deps]
setuptools
python

[deps.host]
python
setuptools
wget

[deps.run]
python

[build]
# FIXME: there appears to be no mirror without https
python setup.py build
python setup.py install --prefix="$butch_prefix" --root="$butch_install_dir"

path: pkg/python-slowaes


code:
[mirrors]
https://pypi.python.org/packages/source/u/urlgrabber/urlgrabber-3.1.0.tar.gz

[vars]
filesize=79158
sha512=8e2c1ef08a83c64e28984fe006be1294cef2cbb00bf592706ebffdc53295b3fa2ffc26e88c26d6a25a66b05e85043543e674f4e19627ebdfe2df0a36c9733435

[deps.run]
python

[deps.host]
python
wget

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

path: pkg/python-urlgrabber


code:
[mirrors]
https://fedorahosted.org/released/python-virtinst/virtinst-0.600.4.tar.gz

[vars]
filesize=8180759
sha512=59a0ab1cc9080ce55b857853602311e8573b7339ceb540bffecd19ae1e41a30248058897fbc257fd264c8592bac23e09730927a68d351181e68e919270018536

[deps]
libvirt
python-urlgrabber

[build]

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

path: pkg/python-virtinst


code:
[mirrors]
https://pypi.python.org/packages/source/w/websocket-client/websocket-client-0.12.0.tar.gz

[vars]
filesize=22376
sha512=274b9db34799f99c2480bc5951d782e1bbde548b5820446d4bdea3ba1b325ec0200361c340bcc0a96ccc33a475a30cc748b6f852089e8157b7e5762aab84282c

[deps.run]
python

[deps.host]
python
wget

[build]
# FIXME: there appears to be no mirror without https
python setup.py build
python setup.py install --prefix="$butch_prefix" --root="$butch_install_dir"

path: pkg/python-websocket


code:
[mirrors]
http://wiki.qemu-project.org/download/qemu-1.7.0.tar.bz2

[vars]
filesize=12248954
sha512=6ee52444b93fc2953e8080383cc0cdc618a826ddd5252bf5f6faf27d91699a414924d6015d27ea12ce1cc21e135acbc8dde595c84a4ce1e0c7173f0446f867eb

[deps]
glib
sdl
libx11
pixman
libcap2

[build]

# WARNING this package needs more than 512 MB ram to build

patch -p1 < "$K"/qemu-170-openpty.patch
patch -p1 < "$K"/qemu-170-sigset_t.patch

CFLAGS="-D_GNU_SOURCE -Dflock64=flock -D__SIGRTMIN=32 -D__SIGRTMAX=\(NSIG-1\)"
# F_EXLCK is 4; F_SHLCK 8 on all archs except alpha
CFLAGS="$CFLAGS -DF_EXLCK=4 -DF_SHLCK=8"
CFLAGS="$CFLAGS $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
./configure --prefix="$butch_prefix" \
  --host-cc="$HOSTCC" \
  --disable-strip \
  --enable-kvm \
  --enable-virtfs \
  --disable-werror \
  --disable-vnc \
  --disable-bluez \
  --enable-sdl

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

path: pkg/qemu


code:
[mirrors]
http://wiki.qemu-project.org/download/qemu-1.3.0.tar.bz2

[vars]
filesize=10286423
sha512=2b314590363697140c3f7b3c445a40782f34c3d8911ded66e15ddd4470c7f38d0035fa09b6e6d99122f209495b62111809ce2eb4fc308fc120b9c598d18c2bc7

[deps]
glib
sdl
libx11

[build]

# WARNING this package needs more than 512 MB ram to build

patch -p1 < "$K"/qemu-syscall.patch
patch -p1 < "$K"/qemu-mmap.patch
patch -p1 < "$K"/qemu-arm-user-exec.patch

CFLAGS="-D_GNU_SOURCE -Dflock64=flock -D__SIGRTMIN=32 -D__SIGRTMAX=\(NSIG-1\)"
CFLAGS="$CFLAGS -DF_SETLKW64=F_SETLKW -DF_GETLK64=F_GETLK -DF_SETLK64=F_SETLK"
CFLAGS="$CFLAGS -O2 -g0" \
./configure --prefix="$butch_prefix" \
  --enable-kvm \
  --disable-werror \
  --disable-vnc \
  --disable-bluez \
  --enable-sdl

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


code:
[mirrors]
http://ftp.gnu.org/gnu/coreutils/coreutils-8.25.tar.xz

[vars]
filesize=5725008
sha512=571f95d44987d373081ed4c6ac82155ad3dcd95621d7b1a7163597e80ecbbafef2cd74b2ef594587a443a1a4355083879f898a286bb0230c48112d43d076ccd6
desc="GNU core utilities"

[deps]
busybox

[deps.host]
dynamic-toolchain

[build]
#note, 8.24 onwards supports progress-bar for dd.
#disables symlinking after install, as it is done below...
butch_do_relocate=false

#much of this comes from the full coreutiles recipe...
# by default gnulib builds 230 of 389 C-files.
GNULIB_CPPFLAGS=$("$K"/gnulibfix lib)
dir=$PWD
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"

#static pkgs are so big! have removed "-static" from LDFLAGS...
FORCE_UNSAFE_CONFIGURE=1 LDFLAGS="$optldflags" \
  CFLAGS="-D_GNU_SOURCE -I $dir $GNULIB_CPPFLAGS" \
    ./configure -C --prefix="$butch_prefix" \
      gl_cv_func_working_mktime=yes gl_cv_func_linkat_follow=yes gl_cv_func_mknod_works=yes \
      gl_cv_func_getgroups_works=yes $xconfflags

make V=1 -j$MAKE_THREADS || exit 1

#this is a cutdown installation, for quirky linux (need to replace some busybox applets)...
#make DESTDIR="$butch_install_dir" install
[ -d "$R"/opt/coreutils ] && rm -rf "$R"/opt/coreutils
mkdir -p "$R"/opt/coreutils/bin
for APROG in cat chmod cksum comm cp cut date dd dirname du expand fold ginstall head install join ln ls md5sum mv od paste pr readlink rm rmdir seq sleep sort split stat tac test touch uname uniq wc
do
 [ ! -e src/$APROG ] && continue
 busybox cp -a src/$APROG "$R"/opt/coreutils/bin/
 #replace busybox applets...
 busybox ln -snf ../opt/coreutils/bin/$APROG "$R"/bin/$APROG
done
[ -f "$R"/opt/coreutils/bin/ginstall ] && [ ! -e "$R"/opt/coreutils/bin/install ] && busybox ln -snf ../opt/coreutils/bin/ginstall "$R"/bin/install
#leave the busybox df in place...
if [ -f src/df ];then
 busybox cp -a src/df "$R"/opt/coreutils/bin/
 busybox ln -snf ../opt/coreutils/bin/df "$R"/bin/df-FULL
fi

path: pkg/qky-coreutils


code:
[mirrors]
https://github.com/apple/cups/releases/download/release-2.1.3/cups-2.1.3-source.tar.bz2

[vars]
filesize=8832400
sha512=5cc715b8521b4d6af29a97a8abf7a1b0973840c00727ee8e7926e89a4a9da8e67565d14cc4b57ab7cfb40b238d4faaed7608b9ab95947cc3671ed87b710f8f36
tardir=cups-2.1.3

[deps]
libjpeg
libtiff
libpng
gzip
libressl
attr

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

CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib -liconv" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-static \
  --disable-avahi \
  --disable-tcp-wrappers \
  --disable-gssapi \
  --disable-pam \
  --disable-dbus \
  --without-java \
  --without-python \
  --without-php \
  --disable-gnutls \
  --disable-openssl \
  --disable-cdsassl \
  --disable-dbus \
  --disable-ssl \
  --with-components=all \
  --with-icondir="$butch_prefix"/share/icons \
  --with-menudir="$butch_prefix"/share/applications \
  --with-rcdir="$butch_prefix"/share/cups-rc.d \
  --disable-libusb --with-logdir=/var/cups/log --disable-systemd \
  --enable-shared --enable-webif --with-printcap=/etc/printcap --with-perl

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

make -j$MAKE_THREADS || exit 1

make DSTROOT="$butch_install_dir" install

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

path: pkg/qky-cups


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

[vars]
filesize=1373028
sha512=5c3648670ae141038a373c4e800e81a7584759e3caf8c4e4468cb0da11c0ff521ac80678e603856c7209da6638673400305c38903cb27e3b4d792d17947e2af4

[deps]
qpdf
cups
ijs
ghostscript
poppler

[build]
#note, was unable to compile, missing 'gdbus-codegen.py'. traced it to a patch in glib recipe, 'glib-no_python.py' (removed patch, that fixed it).
#note, have changed recipe for poppler, much better for cups-filters.

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

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

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

path: pkg/qky-cups-filters


code:
[mirrors]
http://daniel-baumann.ch/files/software/dosfstools/dosfstools-3.0.24.tar.xz

[vars]
filesize=78148
sha512=9e75e3868f42d4cb404998e8a0cd7d3bc7fe4fc0cf68559644c960fe73e7f0eb67c26ff169085c9e1858e5402efed813b883a5f3682aea29e4d0fc9c9142a006

[build]
patch -p0 < "$K"/dosfstools-loff_and_BLOCK_SIZE.patch
make CFLAGS="-D_GNU_SOURCE $optcflags" LDFLAGS="$optldflags -liconv" \
  PREFIX="$butch_prefix" DESTDIR="$butch_install_dir" \
  SBINDIR="$butch_prefix/bin" -j$MAKE_THREADS all install

path: pkg/qky-dosfstools


code:
[mirrors]
http://prdownloads.sourceforge.net/e2fsprogs/e2fsprogs-1.42.9.tar.gz
[vars]
filesize=6069173
sha512=31041c45bc4e4a37fc4a1026424e15d4fc8fbf990c968fc9fba92861d9bec15f192dee8d5341cc2215af30a86b0bdb12d8a01f3c113b79a66c65f4a737136bb7

[deps.host]
pkgconf

[deps]
kernel-headers

[build]

[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"

CFLAGS="-D_GNU_SOURCE $optcflags -D__uint64_t=u_int64_t -fPIC" \
LDFLAGS="$optldflags -static" \
  ./configure -C --prefix="$butch_prefix" --with-root-prefix="$butch_prefix" \
  --sbindir="$butch_prefix"/bin $xconfflags --disable-nls \
  --disable-fsck --disable-uuidd

make V=1 -j$MAKE_THREADS || exit 1

make DESTDIR="$butch_install_dir" install

#some of these should be replaced by symlinks...
ln -snf tune2fs $butch_install_dir/bin/e2label
ln -snf tune2fs $butch_install_dir/bin/findfs
ln -snf e2fsck $butch_install_dir/bin/fsck.ext2
ln -snf e2fsck $butch_install_dir/bin/fsck.ext3
ln -snf e2fsck $butch_install_dir/bin/fsck.ext4
rm -f $butch_install_dir/bin/fsck.ext4dev
ln -snf mke2fs $butch_install_dir/bin/mkfs.ext2
ln -snf mke2fs $butch_install_dir/bin/mkfs.ext3
ln -snf mke2fs $butch_install_dir/bin/mkfs.ext4
rm -f $butch_install_dir/bin/mkfs.ext4dev


code:
[mirrors]
http://dev.gentoo.org/~blueness/eudev/eudev-3.1.2.tar.gz

[vars]
filesize=1858004
sha512=d9aeb37a163ce4a0c116f75a927b4b99f8445d06624fbb3c28ade18f3effd8c54af5a4a52477c31a0452822a3dc0901468263195256e9dbf79d2ef08cf46f2b6

[deps]
kernel-headers
libblkid
glib
kmod
gperf

[build]
#eudev 3.1.5 is broken (doesn't compile libgudev), use 3.1.2.

CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -lblkid" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --with-rootlibdir=/lib --with-firmware-path=/lib/firmware/updates:/lib/firmware \
  --enable-introspection=no --disable-selinux --with-rootprefix= --disable-gtk-doc \
  --disable-manpages --disable-keymap --with-modprobe=/sbin/modprobe \
  --enable-modules \
  --enable-split-usr --exec-prefix= --enable-hwdb --enable-kmod --enable-rule-generator

make -j$MAKE_THREADS V=1

make DESTDIR="$butch_install_dir" install

#install fixes...
dest="$butch_install_dir""$butch_prefix"
if [ -d "$dest"/share/pkgconfig ];then
 mkdir -p "$dest"/lib/pkgconfig
 cp -a -f "$dest"/share/pkgconfig/* "$dest"/lib/pkgconfig/
 rm -rf "$dest"/share/pkgconfig
fi
[ -h "$dest"/sbin/udevadm ] && rm -f "$dest"/sbin/udevadm

#remove all the rules, they are supplied by quirky rootfs-skeleton...
#gotta get rid of these anyway, as they totally stuff up module loading...
rm -f "$dest"/lib/udev/rules.d/*.rules

path: pkg/qky-eudev


code:
[mirrors]
http://releases.mozilla.org/pub/mozilla.org/firefox/releases/38.8.0esr//source/firefox-38.8.0esr.source.tar.bz2
ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/38.8.0esr/source/firefox-38.8.0esr.source.tar.bz2

[vars]
filesize=181198635
sha512=fcd2497a60176b8403a1793d1ad0a1c96a0a60217c2d4d7acd0506abf6810892bd51fd113d8f952f92b20032efc539a6b1233d8d124c2eb72d726b0935c04d65
tardir=mozilla-esr38
uchkurl=http://releases.mozilla.org/pub/mozilla.org/firefox/releases/

[deps]
libevent
gtk+2
alsa-lib
zip
zlib
libpng
bzip2
libxt
mesalib
libogg
libvorbis
icu
libvpx

[deps.host]
perl
python

[build]
FF_VERSION=38.8.0esr
export SHELL=/bin/sh

PATCH() {
	echo "***** $1 *****"
	patch -p1 < "$K"/"$1"
}

PATCH firefox-virtualenv.patch
PATCH firefox-getprotobyname_r.patch
PATCH firefox-finite.patch
PATCH firefox-gregor.patch
PATCH firefox-profiler.patch
PATCH firefox-hunspell.patch

# https://bugzilla.mozilla.org/show_bug.cgi?id=1041962
PATCH firefox-31-basename.patch

PATCH firefox38-BLOCK_SIZE.patch
PATCH firefox38-xul-order.patch
PATCH firefox38-arm-temp-failure.patch

cat << EOF > mozconfig
mk_add_options MOZ_MAKE_FLAGS="-j$MAKE_THREADS"
mk_add_options MOZ_GL_DEFAULT_PROVIDER=NONE
ac_add_options --disable-dbus
ac_add_options --disable-necko-wifi
ac_add_options --disable-libnotify
ac_add_options --disable-jemalloc
ac_add_options --disable-replace-malloc
ac_add_options --disable-wrap-malloc

ac_add_options --disable-profiling
ac_add_options --disable-shark
ac_add_options --disable-callgrind
ac_add_options --disable-vtune

ac_add_options --disable-elf-hack

# this option breaks the build
#ac_add_options --disable-webspeech
# disabling ogg as the makefile forgets to add -logg -lvorbis
#ac_add_options --disable-ogg
#ac_add_options --disable-opus
ac_add_options --disable-webgl

# GStreamer is necessary for H.264 video playback in HTML5 Video Player;
# to be enabled, also remember to set "media.gstreamer.enabled" to "true"
# in about:config. If you have installed GStreamer comment out this line:
ac_add_options --disable-gstreamer

# Uncomment these lines if you have installed optional dependencies:
ac_add_options --enable-system-hunspell
#ac_add_options --enable-startup-notification

# Uncomment this line if you compiled Cairo with --enable-tee switch and want
# to use it instead of the bundled one:
#ac_add_options --enable-system-cairo

# If you have not installed Yasm then uncomment these 3 lines:
#ac_add_options --disable-webm
ac_add_options --disable-webrtc
ac_add_options --disable-libjpeg-turbo

ac_add_options --disable-pulseaudio

# If you have installed xulrunner uncomment the next two ac_add_options lines
# and check that the sdk will be set by running pkg-config in a subshell
# and has not become hardcoded or empty when you created this file
#ac_add_options --with-system-libxul
#ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)

# note, have modified sqlite recipe to be compatible with firefox.
# Comment out following options if you have not installed
# recommended dependencies:
ac_add_options --enable-system-sqlite
ac_add_options --with-system-libevent
ac_add_options --with-system-libvpx
#ac_add_options --with-system-nspr
#ac_add_options --with-system-nss
ac_add_options --with-system-icu

# It is recommended not to touch anything below this line
ac_add_options --prefix=/$butch_prefix
ac_add_options --enable-application=browser

ac_add_options --disable-crashreporter
ac_add_options --disable-installer
ac_add_options --disable-updater
ac_add_options --disable-debug
ac_add_options --disable-tests

ac_add_options --enable-optimize
ac_add_options --enable-strip
ac_add_options --enable-install-strip
ac_add_options --enable-gio
ac_add_options --enable-official-branding
ac_add_options --enable-safe-browsing
ac_add_options --enable-url-classifier

ac_add_options --enable-system-ffi
ac_add_options --enable-system-pixman

ac_add_options --with-pthreads

ac_add_options --with-system-bz2
#ac_add_options --with-system-jpeg
#ac_add_options --with-system-png
ac_add_options --with-system-zlib

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-build-dir
EOF
[ -n "$CROSS_COMPILE" ] && \
  printf "ac_add_options %s\n" "--target=$($CC -dumpmachine)" >> mozconfig

mkdir -p include/sys
cat << EOF > include/sys/cdefs.h
#ifndef __P
#define __P(foo) foo
#endif
EOF

find . -name '*.[ch]' | xargs sed -i s'@#include <sys/cdefs.h>@#define __P(x) x@g'

# prevent overriding our own CFLAGS with built-in -O3 -g by appending
sed -i 's@MOZ_OPTIMIZE_FLAGS=@MOZ_OPTIMIZE_FLAGS= #@g' configure
sed -i 's@MOZ_PGO_OPTIMIZE_FLAGS=@MOZ_PGO_OPTIMIZE_FLAGS= #@g' configure
sed -i 's@MOZ_DEBUG_FLAGS=@MOZ_DEBUG_FLAGS= #@g' configure
sed -i 's@HOST_OPTIMIZE_FLAGS=@HOST_OPTIMIZE_FLAGS= #@g' configure

reqldf="-Wl,--no-keep-memory -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib"
allflags="-D_GNU_SOURCE $optcflags -I$PWD/include $optldflags $reqldf"
# on arm binutils 2.24 assertion failure is triggered due to some of the cflags
# in the default butch config. see issue #186
[ "$A" = arm ] && \
allflags="-D_GNU_SOURCE -I$PWD/include -Os -g0 -fno-unwind-tables \
-fno-asynchronous-unwind-tables -Wa,--noexecstack $reqldf"
CFLAGS="$allflags" \
CXXFLAGS="$allflags" \
make -f client.mk

# TODO: check whether this step is actually necessary
CFLAGS="$allflags" \
CXXFLAGS="$allflags" \
make -C firefox-build-dir/browser/installer

dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/lib/firefox-"$FF_VERSION" "$dest"/bin \
  "$dest"/share/applications "$dest"/share/pixmaps
cp -r firefox-build-dir/dist/firefox/* "$dest"/lib/firefox-"$FF_VERSION"/ \

ln -sf ../lib/firefox-"$FF_VERSION"/firefox-bin "$dest"/bin/

cat << EOF > "$dest"/bin/firefox
#!/bin/sh
LD_LIBRARY_PATH="$dest"/lib/firefox-"$FF_VERSION" \
firefox-bin
EOF
chmod +x "$dest"/bin/firefox

cat << EOF > "$dest"/share/applications/firefox.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Firefox Web Browser
Comment=Browse the World Wide Web
GenericName=Web Browser
Exec=firefox %u
Terminal=false
Type=Application
Icon=firefox
Categories=GNOME;GTK;Network;WebBrowser;
MimeType=application/xhtml+xml;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
StartupNotify=true
EOF
ln -sf ../../lib/firefox-"$FF_VERSION"/browser/icons/mozicon128.png \
"$dest"/share/pixmaps/firefox.png

path: pkg/qky-firefox


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

[vars]
filesize=6458256
sha512=178c33ae34b37fb1ded233b94cac7549bcb6319818b10f416c6edbbd5385052273faddd02cfee9f93992f7ffed59b016a4aa2e5bdcd807f8b0304843ba6a6121

[deps]
curses

[deps.host]
dynamic-toolchain

[build]
#compiling a very old version of gnu gettext. deliberately.
#first, I tried 0.10.40, oldest available, but it is missing gettext.sh and envsubst.
#0.13.1 was released in 2003. Compiles in less than a minute.

#want libintl.a only...
LDFLAGS="$optldflags" CFLAGS="$optcflags" \
  ./configure --prefix="$butch_prefix" \
  --disable-shared --enable-static

make -j$MAKE_THREADS

#have to run this, then delete everything else afterward...
make install DESTDIR="$butch_install_dir"

dest="$butch_install_dir""$butch_prefix"
rm -rf "$dest"/doc
rm -rf "$dest"/include
rm -rf "$dest"/info
rm -rf "$dest"/lib
rm -rf "$dest"/man
rm -rf "$dest"/share
#if already installed 'gettext' (gettext-tiny), do not overwrite...
[ -e "$R"/bin/msgfmt ] && rm -f "$dest"/bin/msgfmt
[ -e "$R"/bin/msgmerge ] && rm -f "$dest"/bin/msgmerge

#does it matter?, this isn't executable...
chmod 755 "$dest"/bin/gettext.sh

path: pkg/qky-gettext-gnu


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"

#xmlto is there, but configure gets confused...
have_xmlto=no CPPFLAGS=-D_GNU_SOURCE CFLAGS="$optcflags" LDFLAGS="$optldflags" \
./configure -C --prefix="$butch_prefix" $xconfflags
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install

path: pkg/qky-giflib


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

[vars]
filesize=7441032
sha512=5bbea7d07ba6d75c35c6be8f1ebc685aa2549bd20030741b2d6e2c30e9b2d476c2afa50a974bbdad98c305666c8b04357b51619c97fe50d3e9965700088aad9b

[deps]
musl
libffi
gettext
zlib
libiconv
libelf
pcre

[deps.host]
perl
pkgconf

[build]
#20160511: chasing why cup-filters wouldn't compile, 'gdbus-codegen.py' missing from glib.
# glib-no_python.patch is the cause, take it out. I also found it breaks build of glib if dbus is installed.
for p in glib-gtimer-varargs ; 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 \
  --with-libiconv=gnu --with-pcre=system --enable-libelf \
  --enable-debug=no --disable-installed-tests --disable-always-build-tests \
  --disable-static --disable-selinux

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/qky-glib


code:
[deps.host]
gcc4

[deps]
kernel-aufs
kernel-tarball
kernel-patches

[vars]
LINUX_VER=$(cat "$K"/kernel.version)
tarball=linux-"$LINUX_VER".tar.xz

[build]
# get into menuconfig using
# make HOSTCFLAGS="-D_GNU_SOURCE" HOSTLDFLAGS=-lncurses menuconfig

# install regulatory domain database into kernel tree
# we build it fixed into the kernel so we don't need the bloated "crda" tool
# to change regulatory domains with iw set reg.
cp -f "$K"/linux-regdb.txt net/wireless/db.txt

dopatch() {
	echo "applying patch $1"
	if ! patch -p1 < "$1" ; then
		echo "patch failed!"
		exit 1
	fi
}

for p in $(cat "$K"/kernel.patches) ; do
	kpatch="$C"/kernel-patch-"$p".xz
	[ -e "$kpatch" ] || {
		echo "error: kernel patch $kpatch not found"
		exit 1
	}
	xzcat "$C"/kernel-patch-"$p".xz | patch -p 1
done

# work around mismatch between devicename and channel name in 9p virtfs code
# p9_virtio_create gets something like "/dev/chan" and the channel name is "chan"
dopatch "$K"/linux-virtio9p.patch

# patches to support busybox trap and sed with strict musl BRE engine
dopatch "$K"/linux-3.18-posix_sed.patch
# linux 4.3 broke monitor mode on ralink wireless chips
# https://bugs.kali.org/view.php?id=3028
dopatch "$K"/linux-4.3-ralink-monitor.patch

#patches for quirky...
dopatch "$R"/opt/kernel-aufs/aufs4-kbuild.patch
dopatch "$R"/opt/kernel-aufs/aufs4-base.patch
dopatch "$R"/opt/kernel-aufs/aufs4-standalone.patch
dopatch "$R"/opt/kernel-aufs/aufs4-mmap.patch
cp -a -f "$R"/opt/kernel-aufs/fs/aufs ./fs/
cp -a -f "$R"/opt/kernel-aufs/Documentation/* ./Documentation/
cp -f "$R"/opt/kernel-aufs/aufs_type.h ./include/uapi/linux/
dopatch "$R"/opt/kernel-aufs/aufs-allow-sfs.patch
dopatch "$K"/linux-usb-storage.patch
dopatch "$K"/linux-printk.h.patch

#after ages, failed with: net/ceph/snapshot.c:21:20: fatal error: stddef.h: No such file or directory
sed -i -e 's%^#include <stddef.h>%#include <linux/stddef.h>%' net/ceph/snapshot.c

#installation tries to access non-existent lib/modules/4.4.2 (and run depmod in it)
#hack, manually create it...
mkdir -p "$R"/lib/modules/${LINUX_VER}/kernel

export ARCH=$A
linux_config="$K"/quirky-linux.config-4.4-${ARCH}

if [ -z "$HOSTCC" ] ; then
	HOSTCC="$CC"
fi

if [ "$A" = arm ] ; then
	[ -z "$ARM_ARCH" ] && (echo "error: need to set ARM_ARCH to 4-7" ; exit 1)
	linux_config="$linux_config $K/linux.config.armv${ARM_ARCH}l"
fi

cat "$linux_config" > my.config

make V=1 ARCH=$A allnoconfig HOSTCFLAGS="-D_GNU_SOURCE" \
  KCONFIG_ALLCONFIG=my.config DISABLE_PAX_PLUGINS=y

make V=1 -j$MAKE_THREADS CC="$CC" ARCH=$A HOSTCC="$HOSTCC" \
  HOSTCFLAGS=-D_GNU_SOURCE DISABLE_PAX_PLUGINS=y

mkdir -p $butch_root_dir/boot $butch_root_dir/lib/modules $butch_root_dir/lib/firmware

egrep -q '\=m$' my.config && got_modules=true || got_modules=false

$got_modules && \
make INSTALL_MOD_PATH=$butch_root_dir DISABLE_PAX_PLUGINS=y modules_install

cp -f System.map $butch_root_dir/boot/

if [ "$A" = arm ] ; then
	kpath="arch/arm/boot/zImage"
else
	kpath="arch/x86/boot/bzImage"
fi
cp -f $kpath $butch_root_dir/boot/vmlinuz

# "build" headers into dest/
# we need to build them after the kernel because grsec assumes this order
# otherwise some generated headers won't be found
make V=1 ARCH=$A HOSTCFLAGS=-D_GNU_SOURCE INSTALL_HDR_PATH=dest \
  DISABLE_PAX_PLUGINS=y headers_install

# remove junk from kernel headers
find dest/include \( -name .install -o -name ..install.cmd \) -delete

$got_modules && depmod "$LINUX_VER"

exit 0

path: pkg/qky-kernel


code:
[mirrors]
ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/kmod-15.tar.xz

[vars]
filesize=1453996
sha512=67a03cabe9d81c14eb0bef20f3c8ff4614418cb2b2c3e1428d8a57399372ecdce6e403399a578d2f62a1ae4b61c83713edd1ad1e31533ea35503c5b11b92c223

[deps]
zlib
xz

[build]
#note, --enable-manpages requires libxslt

for i in kmod kmod-test-stdout kmod-test-glibc-assumption kmod-static-assert ; do
	patch -p1 < "$K"/"$i".patch
done

[ -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 \
  --with-zlib --disable-manpages --with-xz --enable-tools

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

#need symlinks...
dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/bin
ln -s kmod "$dest"/bin/lsmod
ln -s kmod "$dest"/bin/depmod
ln -s kmod "$dest"/bin/insmod
ln -s kmod "$dest"/bin/modinfo
ln -s kmod "$dest"/bin/modprobe
ln -s kmod "$dest"/bin/rmmod

path: pkg/qky-kmod


code:
[mirrors]
http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz

[vars]
filesize=3131891
sha512=9ec194f4783dae6de8c529cac31b5cfbfcfea212c5d47b1f87cd49df013e38f8580a9e7aa1384918df0921b4ba999d5e73eb6d6362cce2d7287e64308b673963
desc="The ncurses (new curses) library"

[deps]

[build]
#see how this goes. have compiled 'curses' in 'quirky-core', compiling 'qky-ncurses'
# later in 'quirky-cli'. reason, want proper wide-char libs.

CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure --prefix="$butch_prefix" $xconfflags \
  --without-ada --without-cxx --without-manpages --without-tests \
  --enable-pc-files --with-shared --without-debug --without-libtool \
  --enable-symlinks --enable-widec --enable-ext-colors \
  --enable-sigwinch --enable-hard-tabs --enable-colorfgbg \
  --with-termlib --with-normal

make -j$MAKE_THREADS || exit 1

make V=1 DESTDIR="$butch_install_dir" install

path: pkg/qky-ncurses


code:
[vars]
filesize=1655244
sha512=4e37dbdd6f5032c9ebfec43704f6882379597d038167b9c4d04053efa083c68a705196713864451fa9e11d32777e16c68982877945c5efd9ea5f8252cb20e1c4

[mirrors]
http://ftp.gnu.org/gnu/parted/parted-3.2.tar.xz

[deps]
libdevmapper
libuuid

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

CFLAGS="-D_GNU_SOURCE -Dloff_t=off_t $optcflags" LDFLAGS="$optldflags -liconv" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --enable-threads=posix       \
  --disable-shared --disable-nls --without-readline

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

path: pkg/qky-parted


code:
[mirrors]
http://poppler.freedesktop.org/poppler-0.43.0.tar.xz

[vars]
filesize=1671368
sha512=e00422a875be2e9b8b16a268d31d1080f609ce070f553b2db8001fc71efebe44183d5e63f45b1111a99b106548809b1fe8474aca7710c20bc4c654968d42508b

[deps.host]
pkgconf

[deps]
libx11
libtiff
libjpeg
libpng
freetype
fontconfig
cairo
glib

[build]
patch -p1 < "$K"/poppler-segfault.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=12925

[ -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 \
  --enable-introspection=no --enable-cms=lcms2 --disable-gtk-test \
  --disable-poppler-qt4 --disable-poppler-qt5 --enable-xpdf-headers \
  --enable-zlib --disable-dependency-tracking --enable-opi --enable-a4-paper \
  --enable-libcurl --enable-utils \
  --enable-poppler-glib --enable-libpng --enable-libjpeg --enable-libtiff

[ -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/qky-poppler


code:
[mirrors]
https://people.freedesktop.org/~hadess/shared-mime-info-0.90.tar.bz2

[vars]
filesize=580163
sha512=7bc05939f6df99f082e8325593e23a3981bc9c613f1cd73cd5e098ea1bb6f219a345b81e5655a0dc61f1c14bf63085cd86b6e96ec859ead0a09ea894c53fb876
desc="The freedesktop.org shared MIME database"

[deps]
glib
libxml2

[build]
#BK: deliberately using an old version, as later versions are broken (don't support inline hierarchy).

mkdir .deps
touch .deps/update_mime_database-update-mime-database.Tpo

[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
CFLAGS="$optcflags -D_GNU_SOURCE" \
LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
  ./configure -C --prefix="$butch_prefix" $xconfflags

sed -i 's@$(AM_V_at)$(am__mv) $(DEPDIR)/update_mime_database-update-mime-database.Tpo@#@' Makefile

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

# FIXME makefile is buggy and breaks randomly with multiple processes
make -j1
make DESTDIR="$butch_install_dir" install
dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/lib/pkgconfig
mv "$dest"/share/pkgconfig/* "$dest"/lib/pkgconfig/
rm -rf "$dest"/share/pkgconfig

#BK:
mkdir -p "$dest"/etc/profile.d
cat > "$dest"/etc/profile.d/0-xdg-base <<-EOT
export XDG_CONFIG_DIRS=/etc/xdg
export XDG_DATA_DIRS=/share
EOT

path: pkg/qky-shared-mime-info


code:
[mirrors]
http://sqlite.org/2016/sqlite-autoconf-3110100.tar.gz

[vars]
filesize=2359545
sha512=c3efd2693e6a9526a2901d9879982a421e81e7e979aef65a160e71b255339344079a1943395480d5c37a1acc6243a8d45f45fa688f7e996774da38a3a99e71a1

[deps]
musl
readline

[deps.host]
pkgconf

[build]
#note, for firefox, need: -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY

if false ; then
./configure -C --prefix="$butch_prefix"
make -j$MAKE_THREADS
make DESTDIR="$butch_install_dir" install
else

read CPPFLAGS << EOF
  -DPACKAGE_NAME=\"sqlite\" -DPACKAGE_TARNAME=\"sqlite\"
  -DPACKAGE_VERSION=\"3.11.1\" -DPACKAGE_STRING=\"sqlite\ 3.11.1\"
  -DPACKAGE_BUGREPORT=\"http://www.sqlite.org\"
  -DPACKAGE_URL=\"\" -DPACKAGE=\"sqlite\" -DVERSION=\"3.11.1\"
  -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1
  -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1
  -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
  -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_FDATASYNC=1
  -DHAVE_USLEEP=1 -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1
  -DHAVE_DECL_STRERROR_R=1 -DHAVE_STRERROR_R=1 -DHAVE_READLINE=1
  -DHAVE_POSIX_FALLOCATE=1 -D_REENTRANT=1 -DSQLITE_THREADSAFE=1
  -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE
  -DSQLITE_SECURE_DELETE -DSQLITE_ENABLE_UNLOCK_NOTIFY
EOF

cat << EOF > Makefile
sqlite3: libsqlite3.so shell.o
	\$(CC) -L. -lsqlite3 -o \$@ shell.o
libsqlite3.so: sqlite3.o
	\$(CC) \$(LDFLAGS) -shared -Wl,-soname=\$@ -o \$@ \$<
libsqlite3.a: sqlite3.o
	ar rc \$@ \$<

all: libsqlite3.so libsqlite3.a sqlite3
install:
	install -D -m 755 sqlite3 \$(DESTDIR)\$(prefix)/bin/sqlite3
	install -D -m 644 sqlite3.1 \$(DESTDIR)\$(prefix)/share/man/man1/sqlite3.1
	install -D -m 644 libsqlite3.so \$(DESTDIR)\$(prefix)/lib/libsqlite3.so
	ln -sf libsqlite3.so \$(DESTDIR)\$(prefix)/lib/libsqlite3.so.0
	ln -sf libsqlite3.so \$(DESTDIR)\$(prefix)/lib/libsqlite3.so.0.8.6
	install -D -m 644 libsqlite3.a \$(DESTDIR)\$(prefix)/lib/libsqlite3.a
	install -D -m 644 sqlite3.pc \$(DESTDIR)\$(prefix)/lib/pkgconfig/sqlite3.pc
	install -D -m 644 sqlite3.h \$(DESTDIR)\$(prefix)/include/sqlite3.h
	install -D -m 644 sqlite3ext.h \$(DESTDIR)\$(prefix)/include/sqlite3ext.h

.PHONY: all install
EOF

cat << EOF > sqlite3.pc
prefix=$butch_prefix
exec_prefix=\${prefix}
libdir=\${prefix}/lib
includedir=\${prefix}/include
Name: SQLite
Description: SQL database engine
Version: 3.11.1
Libs: -lsqlite3 -lreadline
Libs.private:
Cflags:
EOF
make all CC="$CC" CFLAGS="$optcflags -fPIC -O0" CPPFLAGS="$CPPFLAGS" -j2
make DESTDIR="$butch_install_dir" prefix="$butch_prefix" install

fi

path: pkg/qky-sqlite


code:
[deps]
kernel-headers
gnu-efi-libs

[deps.host]
perl
nasm

[vars]
filesize=9772883
sha512=ca3da9d7f5f1c4ccc2eaa1cc33f5d2bb4afe2518dadeb863169ba2cce023c62112e5312181b047ce868a217e36f9b103622cf2e0e8559c3b7de35ad191388450

[mirrors]
ftp://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.bz2
http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.bz2
http://www.kernel.org/pub/linux/utils/boot/syslinux/6.xx/syslinux-6.02.tar.bz2
http://ftp.wh2.tu-dresden.de/pub/mirrors/kernel.org/linux/utils/boot/syslinux/syslinux-6.02.tar.bz2
http://ftp.hosteurope.de/mirror/ftp.kernel.org/pub/linux/utils/boot/syslinux/syslinux-6.02.tar.bz2
http://ftp.uni-ulm.de/pub/mirrors/kernel.org/utils/boot/syslinux/6.xx/syslinux-6.02.tar.bz2

[build]
#note, we do not need mtools!
isx86=0
case "$A" in
  i[3-6]86) isx86=1 ;;
  x86_64) isx86=1 ;;
  x32) isx86=1 ;;
esac

[ "$isx86" = 1 ] || {
    echo "ERROR: syslinux6 only supports the intel architecture"
    exit 0
}
sed -i 's,codepage com32 lzo core memdisk mbr memdump gpxe sample,codepage com32 core mbr,g' Makefile
sed -i 's,diag libinstaller dos win32 win64 dosutil txt,libinstaller txt,g' Makefile
sed -i 's,win32/syslinux.exe win64/syslinux64.exe,,g' Makefile
sed -i 's,dosutil/*.com dosutil/*.sys,,g' Makefile
sed -i 's,gpxe/gpxelinux.0 dos/syslinux.com,,g' Makefile
sed -i 's,core/isolinux.bin core/isolinux-debug.bin,,g' Makefile
sed -i 's,core/pxelinux.0 core/lpxelinux.0,,g' Makefile
sed -i 's,codepage com32 lzo core mbr sample efi txt,codepage com32 core mbr efi txt,g' Makefile
sed -i 's,com32 utils dosutil,com32 utils,g' Makefile
sed -i 's,libupload tools lib elflink/ldlinux gpllib libutil modules mboot,lib libutil,' com32/Makefile
sed -i 's,menu samples elflink rosh cmenu hdt gfxboot sysdump lua/src chain,menu,' com32/Makefile
sed -i 's,#include <getkey.h>,#include "include/getkey.h",' com32/libutil/keyname.c
sed -i 's,#include <libutil.h>,#include "include/libutil.h",' com32/libutil/keyname.c
sed -i 's,#include "sha1.h",#include "include/sha1.h",' com32/libutil/sha1hash.c
sed -i 's,#include <base64.h>,#include "include/base64.h",' com32/libutil/unbase64.c
sed -i 's,#include <md5.h>,#include "include/md5.h",' com32/libutil/md5.c
sed -i 's,#include <md5.h>,#include "include/md5.h",' com32/libutil/crypt-md5.c
sed -i 's,#include <minmax.h>,#include "include/minmax.h",' com32/libutil/sha256crypt.c
sed -i 's,#include "xcrypt.h",#include "include/xcrypt.h",' com32/libutil/sha256crypt.c
sed -i 's,#include <minmax.h>,#include "include/minmax.h",' com32/libutil/sha512crypt.c
sed -i 's,#include "xcrypt.h",#include "include/xcrypt.h",' com32/libutil/sha512crypt.c
sed -i 's,#include <base64.h>,#include "include/base64.h",' com32/libutil/base64.c
sed -i '/herror.*/d' utils/gethostip.c
sed -ri 's,__uint([0-9]+)_t,uint\1_t,g' efi/wrapper.c
sed -ri 's,__uint([0-9]+)_t,uint\1_t,g' efi/wrapper.h

PREFIXED_PATHS="BINDIR='/bin' LIBDIR='/lib' DATADIR='/share' MANDIR='/man' INCDIR='/include'"

make $PREFIXED_PATHS AUXDIR="$butch_prefix/lib/syslinux/bios" INSTALLROOT="$butch_install_dir" bios installer
make $PREFIXED_PATHS AUXDIR="$butch_prefix/lib/syslinux/bios" INSTALLROOT="$butch_install_dir" -j1 bios install

target=efi64
case "$A" in i[3-6]86) target=efi32 ;; esac
make $PREFIXED_PATHS AUXDIR="$butch_prefix/lib/syslinux" INSTALLROOT="$butch_install_dir" $target installer
make $PREFIXED_PATHS AUXDIR="$butch_prefix/lib/syslinux" INSTALLROOT="$butch_install_dir" -j1 $target install

#we don't have mtools, need to do this...
dest="$butch_install_dir""$butch_prefix"
cp -a -f bios/linux/syslinux-nomtools "$dest"/bin/syslinux


code:
[vars]
filesize=287052
sha512=ab1ad36467ff79ff5ab0b924620001612cae44def58c05ade01a4e58d8a4d48df61c09faba49a20497b7d6314045bbaf137b51a9f4e6b65ed0ea3bb339bf1c45

[mirrors]
http://ftp.kernel.org/pub/linux/utils/usb/usbutils/usbutils-008.tar.xz

[deps.host]
dynamic-toolchain

[deps]
libusb
libiconv

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

CFLAGS="$optcflags -liconv" \
LDFLAGS="$optldflags -liconv" \
  ./configure --prefix="$butch_prefix" $xconfflags \
  --sbindir="$butch_prefix"/bin
make -j$MAKE_THREADS

make DESTDIR="$butch_install_dir" install
dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/lib/pkgconfig
mv "$dest"/share/pkgconfig/* "$dest"/lib/pkgconfig/
rm -rf "$dest"/share/pkgconfig

mkdir -p "$dest"/share
wget http://www.linux-usb.org/usb.ids -O "$dest"/share/usb.ids
[ -f "$dest"/share/usb.ids.gz ] && rm -f "$dest"/share/usb.ids.gz

path: pkg/qky-usbutils


code:
[mirrors]
https://www.kernel.org/pub/linux/utils/util-linux/v2.28/util-linux-2.28.tar.xz

[vars]
filesize=4119560
sha512=a1f911bdfda5985de87105d39501e501a5f9ec0fe6a433e3f2fed9a80e104342bb4a7e0e6dc9b7d677d5429249f05b343cb5370b0ea0e068dc889699d4ec1f8a
desc="System utilities for Linux, cut-down for Quirky Linux"

[deps]
curses
zlib

[build]
#this installs a cutdown set of utilities, in some cases replacing busybox applets.
#this is done from years of experience with puppy linux, where the busybox applets
#were found to be inadequate.
#this also installs libblkid and libuuid. those in e2fsprogs are disabled.
#20160516: --disable-all-programs, followed by --enable-<name> is supposed to work, but doesn't,
# so have to compile everything, then install, then delete what i don't want.

patch -p1 < "$K"/util-linux-fix-nls-disabled.patch

#20160516 'more', 'pg' do not compile...
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -lcurses -lterminfo" \
./configure -C \
  --prefix="$butch_prefix" --with-ncurses --enable-shared --disable-static  \
  --disable-silent-rules --disable-nls --disable-colors-default --without-udev \
  --disable-use-tty-group --without-python --without-readline \
  --enable-libmount --enable-libuuid --enable-libblkid --enable-libsmartcols \
  --enable-libfdisk --disable-more --disable-pg

make -j$MAKE_THREADS

make DESTDIR="$butch_install_dir" install

#20160516 now keep want i want...
WHATIWANT=' addpart cfdisk col delpart eject fdformat fdisk flock fsck getopt hwclock ldattach losetup mkfs mkswap mount partx readprofile rename resizepart rev rtcwake setarch setsid swapoff swapon umount uuidd whereis '
dest="$butch_install_dir""$butch_prefix"
ALLINSTALLED="$(find "$dest"/bin "$dest"/sbin -maxdepth 1 -type f | tr '\n' ' ')"
for AINSTALLED in $ALLINSTALLED
do
 [ ! -f $AINSTALLED ] && continue
 ANAME="$(basename $AINSTALLED)"
 [ "$(echo -n "$WHATIWANT" | grep " ${ANAME} ")" != "" ] && continue
 rm -f $AINSTALLED
done

#puppy-heritage thing...
mv -f ${dest}/bin/mount ${dest}/bin/mount-FULL
mv -f ${dest}/bin/umount ${dest}/bin/umount-FULL
mv -f ${dest}/sbin/losetup ${dest}/sbin/losetup-FULL

path: pkg/qky-util-linux


code:
[deps]
xproto
libx11
xorg-server

[mirrors]
http://xorg.freedesktop.org/releases/individual/driver/xf86-video-nv-2.1.20.tar.bz2

[vars]
filesize=396982
sha512=f7c3f00aa949bdffdcb180fa727204b1cdbbad560919e111c589f8614fd897186cdefe014714505aa4646419b4d8bb879eaca96fea032b56cc8c71ba7faa6373

[build]
#from T2, fix missing mibstore.h...
patch -p1 < "$K"/xf86-video-nv-build_fix.patch

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


code:
[mirrors]
ftp://ftp.x.org/pub/individual/xserver/xorg-server-1.16.3.tar.bz2

[vars]
filesize=5806406
sha512=c0459ed95a6682b2094340b6b8fc7b59fcda5227ee2f13e87f68eb5c29b91cd3f05c5fc2126e33d6303beb3ad04d19466951ef4eb53f2e9918684cdaf3692c5a

[deps]
util-macros
pixman
xorg-proto-headers
xorg-libraries
libxkbfile
freetype
libfontenc
libxau
libxdmcp
libxfont
mesalib
libressl

[build]
printf "all:\n\ttrue\n\ninstall:\n\ttrue\n\n" > test/Makefile.in
sed -i 's/termio.h/termios.h/' hw/xfree86/os-support/xf86_OSlib.h

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

LDFLAGS="$optldflags -Wl,-rpath-link=$butch_root_dir$butch_prefix/lib" \
CPPFLAGS="-D__gid_t=gid_t -D__uid_t=uid_t -DNOFILES_MAX=256 -D_GNU_SOURCE \
          -I$butch_root_dir$butch_prefix/include/pixman-1" \
CFLAGS=" $optcflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
    --disable-dmx --disable-xnest --disable-xephyr --disable-config-hal \
    --disable-kdrive --disable-xfbdev --disable-xwin --disable-xvfb \
    --disable-config-dbus  --disable-config-udev --enable-glx \
    --without-systemd-daemon --with-fontrootdir=/share/fonts \
    --disable-systemd-logind --enable-xorg

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

# make /etc/X11 a symlink to /share/X11, so the config can be found easily
dest="${butch_prefix}${butch_install_dir}"
mkdir -p "$dest"/etc
ln -s ../share/X11 "$dest"/etc/

xmoddest="${butch_prefix}${butch_install_dir}"/share/X11/xorg.conf.d
mkdir -p "$xmoddest"
cp "$K"/20-modules.conf "$xmoddest"/

# FIXME starting X as non-root needs suid bit on the "server"
for i in Xfbdev Xorg ; do
	[ -e "$dest"/"$i" ] && chmod +s "$dest"/"$i"
done

path: pkg/qky-xorg-server


code:
[mirrors]
https://www.x.org/releases/individual/lib/xtrans-1.3.5.tar.bz2

[vars]
filesize=186833
sha512=049fb996313e8a1625b66e1645a5f56d8a26c5dd91afe5869269716fce05f6c97c84f8ce4a6df2057106b47982c8291cecc223bef241f694174434c981a7029b

[build]
[ -n "$CROSS_COMPILE" ] && xconfflags="--host=$($CC -dumpmachine)"
CFLAGS="$optcflags" LDFLAGS="$optldflags" \
  ./configure -C --prefix="$butch_prefix" $xconfflags
make DESTDIR="$butch_install_dir" install
dest="$butch_install_dir""$butch_prefix"
mkdir -p "$dest"/lib/pkgconfig
mv "$dest"/share/pkgconfig/* "$dest"/lib/pkgconfig/
rm -rf "$dest"/share/pkgconfig

path: pkg/qky-xtrans


code:
[mirrors]
http://downloads.sourceforge.net/qpdf/qpdf-5.0.0.tar.gz

[vars]
filesize=7556793
sha512=207d5539b434cca9a7f582882786b4d5f473cd374a1a249a0d4f335c7d9ef22cdb857a32ef3e23b98b0c329191eb6c980fa576930553211ddc00dfa11416baa8

[deps]
pcre

[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

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

path: pkg/qpdf