Aboriginal Pkgsrc - blinkkin/blinkkin.github.com GitHub Wiki

Use Binutils 2.16.1, version 2.17 has some issues (you can skip this): http://ftp.gnu.org/pub/gnu/binutils/binutils-2.16.1a.tar.bz2

C pre processor fix (cpp should be fixed in next Aboriginal Linux release):

cat > /tmp/cpp << 'EOF'
#!/bin/sh

gcc -E "$@"
EOF
mount --bind /tmp/cpp /bin/cpp

Missing entries in /etc/group (this is problem with my environment, used to silence "id -G -n" warnings)

bin:x:1:
daemon:x:2:
sys:x:3:
adm:x:4:
disk:x:6:
wheel:x:10:

Copy resolv.conf

cp /etc/resolv.conf .

Remove shared libraries and libtools files:

find root-filesystem-i686/ \( -iname "*.so*" ! -iname "ld-uClib*" \ ) | xargs rm
(Not sure why I didn't remove ld-uClibc, remove all shared libraries)
find root-filesystem-i686/ -name "*.so*" | xargs rm

find root-filesystem-i686/ -name "*.la" | xargs rm

Compile zlib:

Remove line from Makefile.in (this was problem with version 1.2.5, fixed in 1.2.6)
cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)

./configure --static --prefix=/usr
make && make install

Compile ncurses and Groff (no fixes here ;) ):

./configure --prefix=/usr
make && make install

Bootstrap script changes:

need_awk=yes

Bootstrapping ("-z muldefs" is used to force linker to choose one version of declaration, you will probably hit this with some bigger packages):

export LDFLAGS="-z muldefs"
./bootstrap --workdir=/tmp/pkgsrc --pkgdbdir=/usr/pkg/var/db --binary-kit=/tmp/bootstrap.tar

Additional options in mk.conf:

WRKOBJDIR=              /var/pkgsrc/work
DISTDIR=                /var/pkgsrc/distfiles
PACKAGES=               /var/pkgsrc/packages

SKIP_LICENSE_CHECK=     yes
X11_TYPE=               modular

DEPENDS_TARGET=         package-install
UPDATE_TARGET=          package-install

#PREFER.zlib=            pkgsrc               
#PREFER.ncurses=         pkgsrc

Set PATH and update pkg-vulnerabilities:

export PATH=$PATH:/usr/pkg/bin:/usr/pkg/sbin
pkg_admin -K /usr/pkg/var/db fetch-pkg-vulnerabilities

Changes to devel/libtool-base:

CONFIGURE_ARGS+=	--disable-shared
BUILD_SHLIBTOOL=	NO

Patch for converters/libiconv

--- preload/configure.orig      2012-01-23 21:38:00.000000000 +0100
+++ preload/configure   2012-01-23 21:39:05.000000000 +0100
@@ -11174,7 +11174,7 @@ _ACEOF

 case "$host_os" in
   linux* | solaris* | osf*)
-    PLUGLIB="preloadable_libiconv.so" ;;
+    PLUGLIB="" ;;
   *)
     PLUGLIB=""
 esac

Changes to lang/perl5

CFLAGS+=        -fno-stack-protector
remove CONFIGURE_ARGS+=       -Duseshrplib
CONFIGURE_ARGS+=        -Dusedl=n

security/openssl

don't use LDFLAGS+=       -z muldefs
CONFIGURE_ARGS+=        no-shared

lang/python26

CONFIGURE_ARGS+=        DYNLOADFILE="dynload_stub.o"
CONFIGURE_ARGS+=        --disable-shared
and big patch for Modules/Setup.dist

devel/libevent

CONFIGURE_ARGS+=        --enable-static --disable-shared

x11/libdrm (investigate why atomics are disabled in Aboriginal)

install devel/libatomic_ops

.include "../../devel/libatomic_ops/buildlink3.mk"
CONFIGURE_ENV+=         drm_cv_atomic_primitives=libatomic-ops

x11/xkbcomp (pkg-config workaround should work instead)

LDFLAGS+=               -static -lX11 -lxcb -lxkbfile -lpthread -lXau -lXdmcp

x11/modular-xorg-server (just for time being, workaround for missing perl module - we're using static build)

remove line
DEPENDS+=      xkeyboard-config-[0-9]*:../../x11/xkeyboard-config

graphics/MesaLib

enable DRI option?

x11/modular-xorg-server

requires
LDFLAGS="-z muldefs"

Stupid workaround for static linking with pkg-config (is there a better way?)

mv pkg-config pkg-config.old
cat > pkg-config << 'EOF'
#!/bin/sh

pkg-config.old --static "$@"
EOF

fix x11.pc by adding -ldl to private libs
fix fontconfig.pc by adding -liconv to Libs.private

security/PAM (pkgsrc uses old version 0.77, so --disable-nis isn't avaible. Create patches so rpcsvc/yp_prot.h isn't needed.)

x11/xterm

uclibc getpt() is missing 

--- main.c.orig
+++ main.c
@@ -2480,7 +2480,7 @@

 #endif
 #if defined(USE_USG_PTYS) || defined(__CYGWIN__)
-#ifdef __XGLIBC__              /* if __GLIBC__ and USE_USG_PTYS, we know glibc >= 2.1 */
+#ifdef __GLIBC__               /* if __GLIBC__ and USE_USG_PTYS, we know glibc >= 2.1 */
     /* GNU libc 2 allows us to abstract away from having to know the
        master pty device name. */
     if ((*pty = getpt()) >= 0) {

archivers/unzip

.if (${OPSYS} == "Linux")
CPPFLAGS+=      -DNO_LCHMOD
.endif

Some other stuff (pkgsrc uses static package list - file PLIST, this is failed attempt to force pkgsrc to skip *.so entries in PLIST without modifying file by hand)

PRINT_PLIST_AWK+=       /.so$/ { next; }