Radix cross Linux

Radix Linux distribution for embedded systems.

637 Commits   4 Branches   3 Tags
author: Andrey V.Kosteltsev <kx@radix.pro> 2016-10-16 22:28:14 +0000 committer: Andrey V.Kosteltsev <kx@radix.pro> 2016-10-16 22:28:14 +0000 commit: c0448fad70ae6b11643e096a0db5dd6810e7017b parent: 97caf2550daab6f0cba57170a10f5f2d4fd8b89e
Commit Summary:
SDL: image, mixer, net, ttf; libmikmod, smpeg
Diffstat:
48 files changed, 3239 insertions, 0 deletions
diff --git a/X11/libs/sdl/sdl-image/1.2.12-x86_32/Makefile b/X11/libs/sdl/sdl-image/1.2.12-x86_32/Makefile
new file mode 100644
index 000000000..497e52b18
--- /dev/null
+++ b/X11/libs/sdl/sdl-image/1.2.12-x86_32/Makefile
@@ -0,0 +1,178 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC64)
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+CREATE_X86_32_PACKAGE = true
+
+
+include ../../../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/l/sdl/sdl-image
+
+REQUIRES           = X11/libs/sdl/sdl-image/1.2.12
+REQUIRES          += X11/libs/sdl/sdl/1.2.15-x86_32
+REQUIRES          += libs/libpng/libpng14/1.4.19-x86_32
+REQUIRES          += libs/libtiff/4.0.6-x86_32
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 1.2.12
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/l/sdl/sdl-image/SDL_image-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/SDL_image-$(version)
+src_dir_name       = SDL_image-$(version)
+doc_dir_name       = sdl-image-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = xlibs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SDL_IMAGE_32_PKG_NAME                = sdl-image-x32
+SDL_IMAGE_32_PKG_VERSION             = 1.2.12
+SDL_IMAGE_32_PKG_ARCH                = $(TOOLCHAIN)
+SDL_IMAGE_32_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SDL_IMAGE_32_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SDL_IMAGE_32_PKG_GROUP               = $(PKG_GROUP)
+###                                   |---handy-ruler-------------------------------|
+SDL_IMAGE_32_PKG_SHORT_DESCRIPTION   = SDL loading images library
+SDL_IMAGE_32_PKG_URL                 = $(BUG_URL)
+SDL_IMAGE_32_PKG_LICENSE             = custom
+SDL_IMAGE_32_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SDL_IMAGE_32_PKG_NAME)-pkg-description
+SDL_IMAGE_32_PKG_DESCRIPTION_FILE_IN = $(SDL_IMAGE_32_PKG_NAME)-pkg-description.in
+SDL_IMAGE_32_PKG_INSTALL_SCRIPT      = $(SDL_IMAGE_32_PKG_NAME)-pkg-install.sh
+
+SDL_IMAGE_32_PKG = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SDL_IMAGE_32_PKG_NAME)-package
+
+pkg_basename     = $(SDL_IMAGE_32_PKG_NAME)-$(SDL_IMAGE_32_PKG_VERSION)-$(SDL_IMAGE_32_PKG_ARCH)-$(SDL_IMAGE_32_PKG_DISTRO_NAME)-$(SDL_IMAGE_32_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../../../build-system/core.mk
+
+
+env_sysroot  = DESTDIR=$(SDL_IMAGE_32_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(MULTILIB_X86_32_SUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(src_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+
+extra_configure_switches += --bindir=/usr/bin/32
+
+extra_configure_switches += --disable-rpath
+extra_configure_switches += --enable-jpg-shared=no
+extra_configure_switches += --enable-png-shared=no
+extra_configure_switches += --enable-tif-shared=no
+
+extra_configure_switches += --enable-static=yes
+extra_configure_switches += --enable-shared=yes
+
+
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET32)          \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SDL_IMAGE_32_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -rf $(SDL_IMAGE_32_PKG)/usr/include
+	@rm -rf $(SDL_IMAGE_32_PKG)/usr/share
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SDL_IMAGE_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libSDL_image.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SDL_IMAGE_32_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libSDL_image.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libSDL_image.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" SDL_image.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SDL_IMAGE_32_PKG); \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SDL_IMAGE_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SDL_IMAGE_32_PKG_DESCRIPTION_FILE): $(SDL_IMAGE_32_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SDL_IMAGE_32_PKG_DESCRIPTION_FILE) $(SDL_IMAGE_32_PKG_INSTALL_SCRIPT)
+	@cp $(SDL_IMAGE_32_PKG_DESCRIPTION_FILE) $(SDL_IMAGE_32_PKG)/.DESCRIPTION
+	@cp $(SDL_IMAGE_32_PKG_INSTALL_SCRIPT) $(SDL_IMAGE_32_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SDL_IMAGE_32_PKG)/.REQUIRES
+	@echo "pkgname=$(SDL_IMAGE_32_PKG_NAME)"                            >  $(SDL_IMAGE_32_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SDL_IMAGE_32_PKG_VERSION)"                          >> $(SDL_IMAGE_32_PKG)/.PKGINFO ; \
+	 echo "arch=$(SDL_IMAGE_32_PKG_ARCH)"                               >> $(SDL_IMAGE_32_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SDL_IMAGE_32_PKG_DISTRO_NAME)"                  >> $(SDL_IMAGE_32_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SDL_IMAGE_32_PKG_DISTRO_VERSION)"                >> $(SDL_IMAGE_32_PKG)/.PKGINFO ; \
+	 echo "group=$(SDL_IMAGE_32_PKG_GROUP)"                             >> $(SDL_IMAGE_32_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SDL_IMAGE_32_PKG_SHORT_DESCRIPTION)\"" >> $(SDL_IMAGE_32_PKG)/.PKGINFO ; \
+	 echo "url=$(SDL_IMAGE_32_PKG_URL)"                                 >> $(SDL_IMAGE_32_PKG)/.PKGINFO ; \
+	 echo "license=$(SDL_IMAGE_32_PKG_LICENSE)"                         >> $(SDL_IMAGE_32_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SDL_IMAGE_32_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/X11/libs/sdl/sdl-image/1.2.12-x86_32/PATCHES b/X11/libs/sdl/sdl-image/1.2.12-x86_32/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/X11/libs/sdl/sdl-image/1.2.12-x86_32/sdl-image-x32-pkg-description.in b/X11/libs/sdl/sdl-image/1.2.12-x86_32/sdl-image-x32-pkg-description.in
new file mode 100644
index 000000000..3f7ade9c6
--- /dev/null
+++ b/X11/libs/sdl/sdl-image/1.2.12-x86_32/sdl-image-x32-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+             |-----handy-ruler------------------------------------------------------|
+sdl-image-x32: sdl-image-x32 @VERSION@ (x86_32 SDL loading images library)
+sdl-image-x32:
+sdl-image-x32: This is a simple library to load images of various formats as SDL
+sdl-image-x32: surfaces. This library supports BMP, PNM (PPM/PGM/PBM), XPM, LBM,
+sdl-image-x32: PCX, GIF, JPEG, PNG, TGA, and TIFF formats.
+sdl-image-x32:
+sdl-image-x32:
+sdl-image-x32: Homepage: http://www.libsdl.org
+sdl-image-x32:
+sdl-image-x32:
+sdl-image-x32:
diff --git a/X11/libs/sdl/sdl-image/1.2.12-x86_32/sdl-image-x32-pkg-install.sh b/X11/libs/sdl/sdl-image/1.2.12-x86_32/sdl-image-x32-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/X11/libs/sdl/sdl-image/1.2.12-x86_32/sdl-image-x32-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/X11/libs/sdl/sdl-image/1.2.12/Makefile b/X11/libs/sdl/sdl-image/1.2.12/Makefile
new file mode 100644
index 000000000..1990761c1
--- /dev/null
+++ b/X11/libs/sdl/sdl-image/1.2.12/Makefile
@@ -0,0 +1,215 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC32)
+COMPONENT_TARGETS += $(HARDWARE_PC64)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXQ)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BT1)
+
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+
+include ../../../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/l/sdl/sdl-image
+
+REQUIRES           = X11/libs/sdl/sdl/1.2.15
+REQUIRES          += libs/libpng/libpng14/1.4.19
+REQUIRES          += libs/libtiff/4.0.6
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 1.2.12
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/l/sdl/sdl-image/SDL_image-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/SDL_image-$(version)
+src_dir_name       = SDL_image-$(version)
+doc_dir_name       = sdl-image-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = xlibs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SDL_IMAGE_PKG_NAME                = sdl-image
+SDL_IMAGE_PKG_VERSION             = 1.2.12
+SDL_IMAGE_PKG_ARCH                = $(TOOLCHAIN)
+SDL_IMAGE_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SDL_IMAGE_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SDL_IMAGE_PKG_GROUP               = $(PKG_GROUP)
+###                                |---handy-ruler-------------------------------|
+SDL_IMAGE_PKG_SHORT_DESCRIPTION   = SDL loading images library
+SDL_IMAGE_PKG_URL                 = $(BUG_URL)
+SDL_IMAGE_PKG_LICENSE             = custom
+SDL_IMAGE_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SDL_IMAGE_PKG_NAME)-pkg-description
+SDL_IMAGE_PKG_DESCRIPTION_FILE_IN = $(SDL_IMAGE_PKG_NAME)-pkg-description.in
+SDL_IMAGE_PKG_INSTALL_SCRIPT      = $(SDL_IMAGE_PKG_NAME)-pkg-install.sh
+
+SDL_IMAGE_PKG    = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SDL_IMAGE_PKG_NAME)-package
+
+pkg_basename     = $(SDL_IMAGE_PKG_NAME)-$(SDL_IMAGE_PKG_VERSION)-$(SDL_IMAGE_PKG_ARCH)-$(SDL_IMAGE_PKG_DISTRO_NAME)-$(SDL_IMAGE_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(SDL_IMAGE_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(LIBSUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(doc_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+
+extra_configure_switches += --disable-rpath
+extra_configure_switches += --enable-jpg-shared=no
+extra_configure_switches += --enable-png-shared=no
+extra_configure_switches += --enable-tif-shared=no
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET)            \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SDL_IMAGE_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	# ======= Install Documentation =======
+	@if [ -d $(SDL_IMAGE_PKG)/usr/share/man ]; then \
+	  ( cd $(SDL_IMAGE_PKG)/usr/share/man ; \
+	    for manpagedir in `find . -type d -name "man*"` ; do \
+	      ( cd $$manpagedir ; \
+	        for eachpage in `find . -type l -maxdepth 1` ; do \
+	          ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+	          rm $$eachpage ; \
+	        done ; \
+	        gzip -9 *.?  ; \
+	      ) \
+	    done \
+	  ) \
+	 fi
+	@mkdir -p $(SDL_IMAGE_PKG)/usr/doc/$(doc_dir_name)
+	@cp -a $(SRC_DIR)/COPYING \
+	       $(SDL_IMAGE_PKG)/usr/doc/$(doc_dir_name)
+	@mkdir -p $(SDL_IMAGE_PKG)/usr/share/doc/$(doc_dir_name)
+	@( cd $(SRC_DIR) ; \
+	   cp -a COPYING README \
+	         $(SDL_IMAGE_PKG)/usr/share/doc/$(doc_dir_name) ; \
+	 )
+	@( cd $(SRC_DIR) ; \
+	   if [ -r CHANGES ]; then \
+	     DOCSDIR=`echo $(SDL_IMAGE_PKG)/usr/share/doc/$(doc_dir_name)` ; \
+	     cat CHANGES | head -n 1000 > $$DOCSDIR/CHANGES ; \
+	     touch -r CHANGES $$DOCSDIR/CHANGES ; \
+	   fi \
+	 )
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SDL_IMAGE_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libSDL_image.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SDL_IMAGE_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libSDL_image.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libSDL_image.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" SDL_image.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SDL_IMAGE_PKG); \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SDL_IMAGE_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SDL_IMAGE_PKG_DESCRIPTION_FILE): $(SDL_IMAGE_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SDL_IMAGE_PKG_DESCRIPTION_FILE) $(SDL_IMAGE_PKG_INSTALL_SCRIPT)
+	@cp $(SDL_IMAGE_PKG_DESCRIPTION_FILE) $(SDL_IMAGE_PKG)/.DESCRIPTION
+	@cp $(SDL_IMAGE_PKG_INSTALL_SCRIPT) $(SDL_IMAGE_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SDL_IMAGE_PKG)/.REQUIRES
+	@echo "pkgname=$(SDL_IMAGE_PKG_NAME)"                            >  $(SDL_IMAGE_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SDL_IMAGE_PKG_VERSION)"                          >> $(SDL_IMAGE_PKG)/.PKGINFO ; \
+	 echo "arch=$(SDL_IMAGE_PKG_ARCH)"                               >> $(SDL_IMAGE_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SDL_IMAGE_PKG_DISTRO_NAME)"                  >> $(SDL_IMAGE_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SDL_IMAGE_PKG_DISTRO_VERSION)"                >> $(SDL_IMAGE_PKG)/.PKGINFO ; \
+	 echo "group=$(SDL_IMAGE_PKG_GROUP)"                             >> $(SDL_IMAGE_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SDL_IMAGE_PKG_SHORT_DESCRIPTION)\"" >> $(SDL_IMAGE_PKG)/.PKGINFO ; \
+	 echo "url=$(SDL_IMAGE_PKG_URL)"                                 >> $(SDL_IMAGE_PKG)/.PKGINFO ; \
+	 echo "license=$(SDL_IMAGE_PKG_LICENSE)"                         >> $(SDL_IMAGE_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SDL_IMAGE_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/X11/libs/sdl/sdl-image/1.2.12/PATCHES b/X11/libs/sdl/sdl-image/1.2.12/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/X11/libs/sdl/sdl-image/1.2.12/sdl-image-pkg-description.in b/X11/libs/sdl/sdl-image/1.2.12/sdl-image-pkg-description.in
new file mode 100644
index 000000000..e82baee67
--- /dev/null
+++ b/X11/libs/sdl/sdl-image/1.2.12/sdl-image-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+         |-----handy-ruler------------------------------------------------------|
+sdl-image: sdl-image @VERSION@ (SDL loading images library)
+sdl-image:
+sdl-image: This is a simple library to load images of various formats as SDL
+sdl-image: surfaces. This library supports BMP, PNM (PPM/PGM/PBM), XPM, LBM,
+sdl-image: PCX, GIF, JPEG, PNG, TGA, and TIFF formats.
+sdl-image:
+sdl-image:
+sdl-image: Homepage: http://www.libsdl.org
+sdl-image:
+sdl-image:
+sdl-image:
diff --git a/X11/libs/sdl/sdl-image/1.2.12/sdl-image-pkg-install.sh b/X11/libs/sdl/sdl-image/1.2.12/sdl-image-pkg-install.sh
new file mode 100755
index 000000000..b44c4e648
--- /dev/null
+++ b/X11/libs/sdl/sdl-image/1.2.12/sdl-image-pkg-install.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Preserve new files
+install_file() {
+  NEW="$1"
+  OLD="`dirname $NEW`/`basename $NEW .new`"
+  # If there's no file by that name, mv it over:
+  if [ ! -r $OLD ]; then
+    mv $NEW $OLD
+  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+    rm $NEW
+  fi
+  # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/Makefile b/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/Makefile
new file mode 100644
index 000000000..ddf8e2640
--- /dev/null
+++ b/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/Makefile
@@ -0,0 +1,191 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC64)
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+CREATE_X86_32_PACKAGE = true
+
+
+include ../../../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/l/sdl/sdl-mixer
+
+REQUIRES           = X11/libs/sdl/sdl-mixer/1.2.12
+REQUIRES          += X11/libs/sdl/sdl/1.2.15-x86_32
+REQUIRES          += libs/libmodplug/0.8.8.5-x86_32
+REQUIRES          += libs/libmikmod/3.1.20-x86_32
+REQUIRES          += libs/libvorbis/1.3.5-x86_32
+REQUIRES          += libs/smpeg/0.4.5-x86_32
+REQUIRES          += libs/libmad/0.15.1b-x86_32
+REQUIRES          += app/flac/1.3.1-x86_32
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 1.2.12
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/l/sdl/sdl-mixer/SDL_mixer-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/SDL_mixer-$(version)
+src_dir_name       = SDL_mixer-$(version)
+doc_dir_name       = sdl-mixer-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = xlibs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SDL_MIXER_32_PKG_NAME                = sdl-mixer-x32
+SDL_MIXER_32_PKG_VERSION             = 1.2.12
+SDL_MIXER_32_PKG_ARCH                = $(TOOLCHAIN)
+SDL_MIXER_32_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SDL_MIXER_32_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SDL_MIXER_32_PKG_GROUP               = $(PKG_GROUP)
+###                                   |---handy-ruler-------------------------------|
+SDL_MIXER_32_PKG_SHORT_DESCRIPTION   = Simple multi-channel audio mixer
+SDL_MIXER_32_PKG_URL                 = $(BUG_URL)
+SDL_MIXER_32_PKG_LICENSE             = custom
+SDL_MIXER_32_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SDL_MIXER_32_PKG_NAME)-pkg-description
+SDL_MIXER_32_PKG_DESCRIPTION_FILE_IN = $(SDL_MIXER_32_PKG_NAME)-pkg-description.in
+SDL_MIXER_32_PKG_INSTALL_SCRIPT      = $(SDL_MIXER_32_PKG_NAME)-pkg-install.sh
+
+SDL_MIXER_32_PKG = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SDL_MIXER_32_PKG_NAME)-package
+
+pkg_basename     = $(SDL_MIXER_32_PKG_NAME)-$(SDL_MIXER_32_PKG_VERSION)-$(SDL_MIXER_32_PKG_ARCH)-$(SDL_MIXER_32_PKG_DISTRO_NAME)-$(SDL_MIXER_32_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../../../build-system/core.mk
+
+
+env_sysroot  = DESTDIR=$(SDL_MIXER_32_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(MULTILIB_X86_32_SUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(src_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+
+extra_configure_switches += --bindir=/usr/bin/32
+
+extra_configure_switches += --enable-music-mod
+extra_configure_switches += --enable-music-ogg
+extra_configure_switches += --enable-music-flac
+extra_configure_switches += --enable-music-mp3
+extra_configure_switches += --enable-music-mp3-mad-gpl
+
+extra_configure_switches += --enable-static=yes
+extra_configure_switches += --enable-shared=yes
+
+
+extra_environment  = LIBMIKMOD_CONFIG=$(TARGET_DEST_DIR)/usr/bin/32/libmikmod-config
+extra_environment += SMPEG_CONFIG=$(TARGET_DEST_DIR)/usr/bin/32/smpeg-config
+
+
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@( cd $(SRC_DIR) ; \
+	   sed -i "s,usr/local/lib,usr/lib$(MULTILIB_X86_32_SUFFIX),g" timidity/config.h ; \
+	 )
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) $(extra_environment) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET32)          \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SDL_MIXER_32_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -rf $(SDL_MIXER_32_PKG)/usr/include
+	@rm -rf $(SDL_MIXER_32_PKG)/usr/share
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SDL_MIXER_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libSDL_mixer.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SDL_MIXER_32_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libSDL_mixer.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libSDL_mixer.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" SDL_mixer.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SDL_MIXER_32_PKG); \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SDL_MIXER_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SDL_MIXER_32_PKG_DESCRIPTION_FILE): $(SDL_MIXER_32_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SDL_MIXER_32_PKG_DESCRIPTION_FILE) $(SDL_MIXER_32_PKG_INSTALL_SCRIPT)
+	@cp $(SDL_MIXER_32_PKG_DESCRIPTION_FILE) $(SDL_MIXER_32_PKG)/.DESCRIPTION
+	@cp $(SDL_MIXER_32_PKG_INSTALL_SCRIPT) $(SDL_MIXER_32_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SDL_MIXER_32_PKG)/.REQUIRES
+	@echo "pkgname=$(SDL_MIXER_32_PKG_NAME)"                            >  $(SDL_MIXER_32_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SDL_MIXER_32_PKG_VERSION)"                          >> $(SDL_MIXER_32_PKG)/.PKGINFO ; \
+	 echo "arch=$(SDL_MIXER_32_PKG_ARCH)"                               >> $(SDL_MIXER_32_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SDL_MIXER_32_PKG_DISTRO_NAME)"                  >> $(SDL_MIXER_32_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SDL_MIXER_32_PKG_DISTRO_VERSION)"                >> $(SDL_MIXER_32_PKG)/.PKGINFO ; \
+	 echo "group=$(SDL_MIXER_32_PKG_GROUP)"                             >> $(SDL_MIXER_32_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SDL_MIXER_32_PKG_SHORT_DESCRIPTION)\"" >> $(SDL_MIXER_32_PKG)/.PKGINFO ; \
+	 echo "url=$(SDL_MIXER_32_PKG_URL)"                                 >> $(SDL_MIXER_32_PKG)/.PKGINFO ; \
+	 echo "license=$(SDL_MIXER_32_PKG_LICENSE)"                         >> $(SDL_MIXER_32_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SDL_MIXER_32_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/PATCHES b/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/sdl-mixer-x32-pkg-description.in b/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/sdl-mixer-x32-pkg-description.in
new file mode 100644
index 000000000..63826c5fb
--- /dev/null
+++ b/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/sdl-mixer-x32-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+             |-----handy-ruler------------------------------------------------------|
+sdl-mixer-x32: sdl-mixer-x32 @VERSION@ (x86_32 Simple multi-channel audio mixer)
+sdl-mixer-x32:
+sdl-mixer-x32: SDL_mixer is a simple multi-channel audio mixer. It supports
+sdl-mixer-x32: 8 channels of 16 bit stereo audio, plus a single channel of music,
+sdl-mixer-x32: mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3
+sdl-mixer-x32: libraries.
+sdl-mixer-x32:
+sdl-mixer-x32:
+sdl-mixer-x32: Homepage: http://www.libsdl.org
+sdl-mixer-x32:
+sdl-mixer-x32:
diff --git a/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/sdl-mixer-x32-pkg-install.sh b/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/sdl-mixer-x32-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/X11/libs/sdl/sdl-mixer/1.2.12-x86_32/sdl-mixer-x32-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/X11/libs/sdl/sdl-mixer/1.2.12/Makefile b/X11/libs/sdl/sdl-mixer/1.2.12/Makefile
new file mode 100644
index 000000000..025563dc8
--- /dev/null
+++ b/X11/libs/sdl/sdl-mixer/1.2.12/Makefile
@@ -0,0 +1,227 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC32)
+COMPONENT_TARGETS += $(HARDWARE_PC64)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXQ)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BT1)
+
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+
+include ../../../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/l/sdl/sdl-mixer
+
+REQUIRES           = X11/libs/sdl/sdl/1.2.15
+REQUIRES          += libs/libmodplug/0.8.8.5
+REQUIRES          += libs/libmikmod/3.1.20
+REQUIRES          += libs/libvorbis/1.3.5
+REQUIRES          += libs/smpeg/0.4.5
+REQUIRES          += libs/libmad/0.15.1b
+REQUIRES          += app/flac/1.3.1
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 1.2.12
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/l/sdl/sdl-mixer/SDL_mixer-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/SDL_mixer-$(version)
+src_dir_name       = SDL_mixer-$(version)
+doc_dir_name       = sdl-mixer-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = xlibs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SDL_MIXER_PKG_NAME                = sdl-mixer
+SDL_MIXER_PKG_VERSION             = 1.2.12
+SDL_MIXER_PKG_ARCH                = $(TOOLCHAIN)
+SDL_MIXER_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SDL_MIXER_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SDL_MIXER_PKG_GROUP               = $(PKG_GROUP)
+###                                |---handy-ruler-------------------------------|
+SDL_MIXER_PKG_SHORT_DESCRIPTION   = Simple multi-channel audio mixer
+SDL_MIXER_PKG_URL                 = $(BUG_URL)
+SDL_MIXER_PKG_LICENSE             = custom
+SDL_MIXER_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SDL_MIXER_PKG_NAME)-pkg-description
+SDL_MIXER_PKG_DESCRIPTION_FILE_IN = $(SDL_MIXER_PKG_NAME)-pkg-description.in
+SDL_MIXER_PKG_INSTALL_SCRIPT      = $(SDL_MIXER_PKG_NAME)-pkg-install.sh
+
+SDL_MIXER_PKG    = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SDL_MIXER_PKG_NAME)-package
+
+pkg_basename     = $(SDL_MIXER_PKG_NAME)-$(SDL_MIXER_PKG_VERSION)-$(SDL_MIXER_PKG_ARCH)-$(SDL_MIXER_PKG_DISTRO_NAME)-$(SDL_MIXER_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(SDL_MIXER_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(LIBSUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(doc_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+
+extra_configure_switches += --enable-music-mod
+extra_configure_switches += --enable-music-ogg
+extra_configure_switches += --enable-music-flac
+extra_configure_switches += --enable-music-mp3
+extra_configure_switches += --enable-music-mp3-mad-gpl
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+extra_environment  = LIBMIKMOD_CONFIG=$(TARGET_DEST_DIR)/usr/bin/libmikmod-config
+extra_environment += SMPEG_CONFIG=$(TARGET_DEST_DIR)/usr/bin/smpeg-config
+
+
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@( cd $(SRC_DIR) ; \
+	   sed -i "s,usr/local/lib,usr/lib$(LIBSUFFIX),g" timidity/config.h ; \
+	 )
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) $(extra_environment) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET)            \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SDL_MIXER_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	# ======= Install Documentation =======
+	@if [ -d $(SDL_MIXER_PKG)/usr/share/man ]; then \
+	  ( cd $(SDL_MIXER_PKG)/usr/share/man ; \
+	    for manpagedir in `find . -type d -name "man*"` ; do \
+	      ( cd $$manpagedir ; \
+	        for eachpage in `find . -type l -maxdepth 1` ; do \
+	          ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+	          rm $$eachpage ; \
+	        done ; \
+	        gzip -9 *.?  ; \
+	      ) \
+	    done \
+	  ) \
+	 fi
+	@mkdir -p $(SDL_MIXER_PKG)/usr/doc/$(doc_dir_name)
+	@cp -a $(SRC_DIR)/COPYING \
+	       $(SDL_MIXER_PKG)/usr/doc/$(doc_dir_name)
+	@mkdir -p $(SDL_MIXER_PKG)/usr/share/doc/$(doc_dir_name)
+	@( cd $(SRC_DIR) ; \
+	   cp -a COPYING README \
+	         $(SDL_MIXER_PKG)/usr/share/doc/$(doc_dir_name) ; \
+	 )
+	@( cd $(SRC_DIR) ; \
+	   if [ -r CHANGES ]; then \
+	     DOCSDIR=`echo $(SDL_MIXER_PKG)/usr/share/doc/$(doc_dir_name)` ; \
+	     cat CHANGES | head -n 1000 > $$DOCSDIR/CHANGES ; \
+	     touch -r CHANGES $$DOCSDIR/CHANGES ; \
+	   fi \
+	 )
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SDL_MIXER_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libSDL_mixer.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SDL_MIXER_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libSDL_mixer.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libSDL_mixer.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" SDL_mixer.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SDL_MIXER_PKG); \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SDL_MIXER_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SDL_MIXER_PKG_DESCRIPTION_FILE): $(SDL_MIXER_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SDL_MIXER_PKG_DESCRIPTION_FILE) $(SDL_MIXER_PKG_INSTALL_SCRIPT)
+	@cp $(SDL_MIXER_PKG_DESCRIPTION_FILE) $(SDL_MIXER_PKG)/.DESCRIPTION
+	@cp $(SDL_MIXER_PKG_INSTALL_SCRIPT) $(SDL_MIXER_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SDL_MIXER_PKG)/.REQUIRES
+	@echo "pkgname=$(SDL_MIXER_PKG_NAME)"                            >  $(SDL_MIXER_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SDL_MIXER_PKG_VERSION)"                          >> $(SDL_MIXER_PKG)/.PKGINFO ; \
+	 echo "arch=$(SDL_MIXER_PKG_ARCH)"                               >> $(SDL_MIXER_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SDL_MIXER_PKG_DISTRO_NAME)"                  >> $(SDL_MIXER_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SDL_MIXER_PKG_DISTRO_VERSION)"                >> $(SDL_MIXER_PKG)/.PKGINFO ; \
+	 echo "group=$(SDL_MIXER_PKG_GROUP)"                             >> $(SDL_MIXER_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SDL_MIXER_PKG_SHORT_DESCRIPTION)\"" >> $(SDL_MIXER_PKG)/.PKGINFO ; \
+	 echo "url=$(SDL_MIXER_PKG_URL)"                                 >> $(SDL_MIXER_PKG)/.PKGINFO ; \
+	 echo "license=$(SDL_MIXER_PKG_LICENSE)"                         >> $(SDL_MIXER_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SDL_MIXER_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/X11/libs/sdl/sdl-mixer/1.2.12/PATCHES b/X11/libs/sdl/sdl-mixer/1.2.12/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/X11/libs/sdl/sdl-mixer/1.2.12/sdl-mixer-pkg-description.in b/X11/libs/sdl/sdl-mixer/1.2.12/sdl-mixer-pkg-description.in
new file mode 100644
index 000000000..d058e72db
--- /dev/null
+++ b/X11/libs/sdl/sdl-mixer/1.2.12/sdl-mixer-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+         |-----handy-ruler------------------------------------------------------|
+sdl-mixer: sdl-mixer @VERSION@ (Simple multi-channel audio mixer)
+sdl-mixer:
+sdl-mixer: SDL_mixer is a simple multi-channel audio mixer. It supports
+sdl-mixer: 8 channels of 16 bit stereo audio, plus a single channel of music,
+sdl-mixer: mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3
+sdl-mixer: libraries.
+sdl-mixer:
+sdl-mixer:
+sdl-mixer: Homepage: http://www.libsdl.org
+sdl-mixer:
+sdl-mixer:
diff --git a/X11/libs/sdl/sdl-mixer/1.2.12/sdl-mixer-pkg-install.sh b/X11/libs/sdl/sdl-mixer/1.2.12/sdl-mixer-pkg-install.sh
new file mode 100755
index 000000000..b44c4e648
--- /dev/null
+++ b/X11/libs/sdl/sdl-mixer/1.2.12/sdl-mixer-pkg-install.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Preserve new files
+install_file() {
+  NEW="$1"
+  OLD="`dirname $NEW`/`basename $NEW .new`"
+  # If there's no file by that name, mv it over:
+  if [ ! -r $OLD ]; then
+    mv $NEW $OLD
+  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+    rm $NEW
+  fi
+  # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/X11/libs/sdl/sdl-net/1.2.8-x86_32/Makefile b/X11/libs/sdl/sdl-net/1.2.8-x86_32/Makefile
new file mode 100644
index 000000000..6f5c27290
--- /dev/null
+++ b/X11/libs/sdl/sdl-net/1.2.8-x86_32/Makefile
@@ -0,0 +1,175 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC64)
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+CREATE_X86_32_PACKAGE = true
+
+
+include ../../../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/l/sdl/sdl-net
+
+REQUIRES           = X11/libs/sdl/sdl-net/1.2.8
+REQUIRES          += X11/libs/sdl/sdl/1.2.15-x86_32
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 1.2.8
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/l/sdl/sdl-net/SDL_net-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/SDL_net-$(version)
+src_dir_name       = SDL_net-$(version)
+doc_dir_name       = sdl-net-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = xlibs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SDL_NET_32_PKG_NAME                = sdl-net-x32
+SDL_NET_32_PKG_VERSION             = 1.2.8
+SDL_NET_32_PKG_ARCH                = $(TOOLCHAIN)
+SDL_NET_32_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SDL_NET_32_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SDL_NET_32_PKG_GROUP               = $(PKG_GROUP)
+###                                 |---handy-ruler-------------------------------|
+SDL_NET_32_PKG_SHORT_DESCRIPTION   = SDL portable network library
+SDL_NET_32_PKG_URL                 = $(BUG_URL)
+SDL_NET_32_PKG_LICENSE             = custom
+SDL_NET_32_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SDL_NET_32_PKG_NAME)-pkg-description
+SDL_NET_32_PKG_DESCRIPTION_FILE_IN = $(SDL_NET_32_PKG_NAME)-pkg-description.in
+SDL_NET_32_PKG_INSTALL_SCRIPT      = $(SDL_NET_32_PKG_NAME)-pkg-install.sh
+
+SDL_NET_32_PKG   = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SDL_NET_32_PKG_NAME)-package
+
+pkg_basename     = $(SDL_NET_32_PKG_NAME)-$(SDL_NET_32_PKG_VERSION)-$(SDL_NET_32_PKG_ARCH)-$(SDL_NET_32_PKG_DISTRO_NAME)-$(SDL_NET_32_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../../../build-system/core.mk
+
+
+env_sysroot  = DESTDIR=$(SDL_NET_32_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(MULTILIB_X86_32_SUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(src_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --bindir=/usr/bin/32
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --enable-static=yes
+extra_configure_switches += --enable-shared=yes
+
+
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET32)          \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SDL_NET_32_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -rf $(SDL_NET_32_PKG)/usr/include
+	@rm -rf $(SDL_NET_32_PKG)/usr/share
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SDL_NET_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libSDL_net.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SDL_NET_32_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libSDL_net.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libSDL_net.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" SDL_net.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SDL_NET_32_PKG); \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SDL_NET_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SDL_NET_32_PKG_DESCRIPTION_FILE): $(SDL_NET_32_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SDL_NET_32_PKG_DESCRIPTION_FILE) $(SDL_NET_32_PKG_INSTALL_SCRIPT)
+	@cp $(SDL_NET_32_PKG_DESCRIPTION_FILE) $(SDL_NET_32_PKG)/.DESCRIPTION
+	@cp $(SDL_NET_32_PKG_INSTALL_SCRIPT) $(SDL_NET_32_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SDL_NET_32_PKG)/.REQUIRES
+	@echo "pkgname=$(SDL_NET_32_PKG_NAME)"                            >  $(SDL_NET_32_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SDL_NET_32_PKG_VERSION)"                          >> $(SDL_NET_32_PKG)/.PKGINFO ; \
+	 echo "arch=$(SDL_NET_32_PKG_ARCH)"                               >> $(SDL_NET_32_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SDL_NET_32_PKG_DISTRO_NAME)"                  >> $(SDL_NET_32_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SDL_NET_32_PKG_DISTRO_VERSION)"                >> $(SDL_NET_32_PKG)/.PKGINFO ; \
+	 echo "group=$(SDL_NET_32_PKG_GROUP)"                             >> $(SDL_NET_32_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SDL_NET_32_PKG_SHORT_DESCRIPTION)\"" >> $(SDL_NET_32_PKG)/.PKGINFO ; \
+	 echo "url=$(SDL_NET_32_PKG_URL)"                                 >> $(SDL_NET_32_PKG)/.PKGINFO ; \
+	 echo "license=$(SDL_NET_32_PKG_LICENSE)"                         >> $(SDL_NET_32_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SDL_NET_32_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/X11/libs/sdl/sdl-net/1.2.8-x86_32/PATCHES b/X11/libs/sdl/sdl-net/1.2.8-x86_32/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/X11/libs/sdl/sdl-net/1.2.8-x86_32/sdl-net-x32-pkg-description.in b/X11/libs/sdl/sdl-net/1.2.8-x86_32/sdl-net-x32-pkg-description.in
new file mode 100644
index 000000000..a8162ff10
--- /dev/null
+++ b/X11/libs/sdl/sdl-net/1.2.8-x86_32/sdl-net-x32-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+           |-----handy-ruler------------------------------------------------------|
+sdl-net-x32: sdl-net-x32 @VERSION@ (x86_32 SDL portable network library)
+sdl-net-x32:
+sdl-net-x32: This is an example portable network library for use with SDL.
+sdl-net-x32: It is available under the zlib license, found in the file COPYING.
+sdl-net-x32:
+sdl-net-x32:
+sdl-net-x32:
+sdl-net-x32: Homepage: http://www.libsdl.org
+sdl-net-x32:
+sdl-net-x32:
+sdl-net-x32:
diff --git a/X11/libs/sdl/sdl-net/1.2.8-x86_32/sdl-net-x32-pkg-install.sh b/X11/libs/sdl/sdl-net/1.2.8-x86_32/sdl-net-x32-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/X11/libs/sdl/sdl-net/1.2.8-x86_32/sdl-net-x32-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/X11/libs/sdl/sdl-net/1.2.8/Makefile b/X11/libs/sdl/sdl-net/1.2.8/Makefile
new file mode 100644
index 000000000..b74a88b9b
--- /dev/null
+++ b/X11/libs/sdl/sdl-net/1.2.8/Makefile
@@ -0,0 +1,211 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC32)
+COMPONENT_TARGETS += $(HARDWARE_PC64)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXQ)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BT1)
+
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+
+include ../../../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/l/sdl/sdl-net
+
+REQUIRES           = X11/libs/sdl/sdl/1.2.15
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 1.2.8
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/l/sdl/sdl-net/SDL_net-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/SDL_net-$(version)
+src_dir_name       = SDL_net-$(version)
+doc_dir_name       = sdl-net-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = xlibs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SDL_NET_PKG_NAME                = sdl-net
+SDL_NET_PKG_VERSION             = 1.2.8
+SDL_NET_PKG_ARCH                = $(TOOLCHAIN)
+SDL_NET_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SDL_NET_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SDL_NET_PKG_GROUP               = $(PKG_GROUP)
+###                              |---handy-ruler-------------------------------|
+SDL_NET_PKG_SHORT_DESCRIPTION   = SDL portable network library
+SDL_NET_PKG_URL                 = $(BUG_URL)
+SDL_NET_PKG_LICENSE             = custom
+SDL_NET_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SDL_NET_PKG_NAME)-pkg-description
+SDL_NET_PKG_DESCRIPTION_FILE_IN = $(SDL_NET_PKG_NAME)-pkg-description.in
+SDL_NET_PKG_INSTALL_SCRIPT      = $(SDL_NET_PKG_NAME)-pkg-install.sh
+
+SDL_NET_PKG      = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SDL_NET_PKG_NAME)-package
+
+pkg_basename     = $(SDL_NET_PKG_NAME)-$(SDL_NET_PKG_VERSION)-$(SDL_NET_PKG_ARCH)-$(SDL_NET_PKG_DISTRO_NAME)-$(SDL_NET_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(SDL_NET_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(LIBSUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(doc_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET)            \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SDL_NET_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	# ======= Install Documentation =======
+	@if [ -d $(SDL_NET_PKG)/usr/share/man ]; then \
+	  ( cd $(SDL_NET_PKG)/usr/share/man ; \
+	    for manpagedir in `find . -type d -name "man*"` ; do \
+	      ( cd $$manpagedir ; \
+	        for eachpage in `find . -type l -maxdepth 1` ; do \
+	          ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+	          rm $$eachpage ; \
+	        done ; \
+	        gzip -9 *.?  ; \
+	      ) \
+	    done \
+	  ) \
+	 fi
+	@mkdir -p $(SDL_NET_PKG)/usr/doc/$(doc_dir_name)
+	@cp -a $(SRC_DIR)/COPYING \
+	       $(SDL_NET_PKG)/usr/doc/$(doc_dir_name)
+	@mkdir -p $(SDL_NET_PKG)/usr/share/doc/$(doc_dir_name)
+	@( cd $(SRC_DIR) ; \
+	   cp -a COPYING README \
+	         $(SDL_NET_PKG)/usr/share/doc/$(doc_dir_name) ; \
+	 )
+	@( cd $(SRC_DIR) ; \
+	   if [ -r CHANGES ]; then \
+	     DOCSDIR=`echo $(SDL_NET_PKG)/usr/share/doc/$(doc_dir_name)` ; \
+	     cat CHANGES | head -n 1000 > $$DOCSDIR/CHANGES ; \
+	     touch -r CHANGES $$DOCSDIR/CHANGES ; \
+	   fi \
+	 )
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SDL_NET_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libSDL_net.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SDL_NET_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libSDL_net.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libSDL_net.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" SDL_net.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SDL_NET_PKG); \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SDL_NET_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SDL_NET_PKG_DESCRIPTION_FILE): $(SDL_NET_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SDL_NET_PKG_DESCRIPTION_FILE) $(SDL_NET_PKG_INSTALL_SCRIPT)
+	@cp $(SDL_NET_PKG_DESCRIPTION_FILE) $(SDL_NET_PKG)/.DESCRIPTION
+	@cp $(SDL_NET_PKG_INSTALL_SCRIPT) $(SDL_NET_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SDL_NET_PKG)/.REQUIRES
+	@echo "pkgname=$(SDL_NET_PKG_NAME)"                            >  $(SDL_NET_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SDL_NET_PKG_VERSION)"                          >> $(SDL_NET_PKG)/.PKGINFO ; \
+	 echo "arch=$(SDL_NET_PKG_ARCH)"                               >> $(SDL_NET_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SDL_NET_PKG_DISTRO_NAME)"                  >> $(SDL_NET_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SDL_NET_PKG_DISTRO_VERSION)"                >> $(SDL_NET_PKG)/.PKGINFO ; \
+	 echo "group=$(SDL_NET_PKG_GROUP)"                             >> $(SDL_NET_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SDL_NET_PKG_SHORT_DESCRIPTION)\"" >> $(SDL_NET_PKG)/.PKGINFO ; \
+	 echo "url=$(SDL_NET_PKG_URL)"                                 >> $(SDL_NET_PKG)/.PKGINFO ; \
+	 echo "license=$(SDL_NET_PKG_LICENSE)"                         >> $(SDL_NET_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SDL_NET_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/X11/libs/sdl/sdl-net/1.2.8/PATCHES b/X11/libs/sdl/sdl-net/1.2.8/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/X11/libs/sdl/sdl-net/1.2.8/sdl-net-pkg-description.in b/X11/libs/sdl/sdl-net/1.2.8/sdl-net-pkg-description.in
new file mode 100644
index 000000000..d3c1bd22f
--- /dev/null
+++ b/X11/libs/sdl/sdl-net/1.2.8/sdl-net-pkg-description.in
@@ -0,0 +1,20 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+       |-----handy-ruler------------------------------------------------------|
+sdl-net: sdl-net @VERSION@ (SDL portable network library)
+sdl-net:
+sdl-net: This is an example portable network library for use with SDL.
+sdl-net: It is available under the zlib license, found in the file COPYING.
+sdl-net:
+sdl-net:
+sdl-net:
+sdl-net: Homepage: http://www.libsdl.org
+sdl-net:
+sdl-net:
+sdl-net:
+
diff --git a/X11/libs/sdl/sdl-net/1.2.8/sdl-net-pkg-install.sh b/X11/libs/sdl/sdl-net/1.2.8/sdl-net-pkg-install.sh
new file mode 100755
index 000000000..b44c4e648
--- /dev/null
+++ b/X11/libs/sdl/sdl-net/1.2.8/sdl-net-pkg-install.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Preserve new files
+install_file() {
+  NEW="$1"
+  OLD="`dirname $NEW`/`basename $NEW .new`"
+  # If there's no file by that name, mv it over:
+  if [ ! -r $OLD ]; then
+    mv $NEW $OLD
+  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+    rm $NEW
+  fi
+  # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/Makefile b/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/Makefile
new file mode 100644
index 000000000..b6e27cbc0
--- /dev/null
+++ b/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/Makefile
@@ -0,0 +1,179 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC64)
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+CREATE_X86_32_PACKAGE = true
+
+
+include ../../../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/l/sdl/sdl-ttf
+
+REQUIRES           = X11/libs/sdl/sdl-ttf/2.0.11
+REQUIRES          += X11/libs/sdl/sdl/1.2.15-x86_32
+REQUIRES          += libs/freetype/2.6.3-x86_32
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 2.0.11
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/l/sdl/sdl-ttf/SDL_ttf-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/SDL_ttf-$(version)
+src_dir_name       = SDL_ttf-$(version)
+doc_dir_name       = sdl-ttf-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = xlibs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SDL_TTF_32_PKG_NAME                = sdl-ttf-x32
+SDL_TTF_32_PKG_VERSION             = 2.0.11
+SDL_TTF_32_PKG_ARCH                = $(TOOLCHAIN)
+SDL_TTF_32_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SDL_TTF_32_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SDL_TTF_32_PKG_GROUP               = $(PKG_GROUP)
+###                                 |---handy-ruler-------------------------------|
+SDL_TTF_32_PKG_SHORT_DESCRIPTION   = SDL TrueType fonts library
+SDL_TTF_32_PKG_URL                 = $(BUG_URL)
+SDL_TTF_32_PKG_LICENSE             = custom
+SDL_TTF_32_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SDL_TTF_32_PKG_NAME)-pkg-description
+SDL_TTF_32_PKG_DESCRIPTION_FILE_IN = $(SDL_TTF_32_PKG_NAME)-pkg-description.in
+SDL_TTF_32_PKG_INSTALL_SCRIPT      = $(SDL_TTF_32_PKG_NAME)-pkg-install.sh
+
+SDL_TTF_32_PKG   = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SDL_TTF_32_PKG_NAME)-package
+
+pkg_basename     = $(SDL_TTF_32_PKG_NAME)-$(SDL_TTF_32_PKG_VERSION)-$(SDL_TTF_32_PKG_ARCH)-$(SDL_TTF_32_PKG_DISTRO_NAME)-$(SDL_TTF_32_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../../../build-system/core.mk
+
+
+env_sysroot  = DESTDIR=$(SDL_TTF_32_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(MULTILIB_X86_32_SUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(src_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --bindir=/usr/bin/32
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --enable-static=yes
+extra_configure_switches += --enable-shared=yes
+
+
+extra_environment  = FREETYPE_CONFIG=$(TARGET_DEST_DIR)/usr/bin/32/freetype-config
+
+
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) $(extra_environment) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET32)          \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SDL_TTF_32_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -rf $(SDL_TTF_32_PKG)/usr/include
+	@rm -rf $(SDL_TTF_32_PKG)/usr/share
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SDL_TTF_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libSDL_ttf.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SDL_TTF_32_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libSDL_ttf.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libSDL_ttf.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" SDL_ttf.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SDL_TTF_32_PKG); \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SDL_TTF_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SDL_TTF_32_PKG_DESCRIPTION_FILE): $(SDL_TTF_32_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SDL_TTF_32_PKG_DESCRIPTION_FILE) $(SDL_TTF_32_PKG_INSTALL_SCRIPT)
+	@cp $(SDL_TTF_32_PKG_DESCRIPTION_FILE) $(SDL_TTF_32_PKG)/.DESCRIPTION
+	@cp $(SDL_TTF_32_PKG_INSTALL_SCRIPT) $(SDL_TTF_32_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SDL_TTF_32_PKG)/.REQUIRES
+	@echo "pkgname=$(SDL_TTF_32_PKG_NAME)"                            >  $(SDL_TTF_32_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SDL_TTF_32_PKG_VERSION)"                          >> $(SDL_TTF_32_PKG)/.PKGINFO ; \
+	 echo "arch=$(SDL_TTF_32_PKG_ARCH)"                               >> $(SDL_TTF_32_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SDL_TTF_32_PKG_DISTRO_NAME)"                  >> $(SDL_TTF_32_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SDL_TTF_32_PKG_DISTRO_VERSION)"                >> $(SDL_TTF_32_PKG)/.PKGINFO ; \
+	 echo "group=$(SDL_TTF_32_PKG_GROUP)"                             >> $(SDL_TTF_32_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SDL_TTF_32_PKG_SHORT_DESCRIPTION)\"" >> $(SDL_TTF_32_PKG)/.PKGINFO ; \
+	 echo "url=$(SDL_TTF_32_PKG_URL)"                                 >> $(SDL_TTF_32_PKG)/.PKGINFO ; \
+	 echo "license=$(SDL_TTF_32_PKG_LICENSE)"                         >> $(SDL_TTF_32_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SDL_TTF_32_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/PATCHES b/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/PATCHES
new file mode 100644
index 000000000..d461cf0f1
--- /dev/null
+++ b/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/PATCHES
@@ -0,0 +1,2 @@
+
+../../../../../sources/packages/l/sdl/sdl-ttf/patches/SDL_ttf-2.0.11-shaded-text.patch -p0
diff --git a/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/sdl-ttf-x32-pkg-description.in b/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/sdl-ttf-x32-pkg-description.in
new file mode 100644
index 000000000..eca390ff8
--- /dev/null
+++ b/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/sdl-ttf-x32-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+           |-----handy-ruler------------------------------------------------------|
+sdl-ttf-x32: sdl-ttf-x32 @VERSION@ (x86_32 SDL TrueType fonts library)
+sdl-ttf-x32:
+sdl-ttf-x32: This library is a wrapper around the FreeType 2.0 library which
+sdl-ttf-x32: allows you to use TrueType fonts to render text in SDL applications.
+sdl-ttf-x32:
+sdl-ttf-x32:
+sdl-ttf-x32:
+sdl-ttf-x32: Homepage: http://www.libsdl.org
+sdl-ttf-x32:
+sdl-ttf-x32:
+sdl-ttf-x32:
diff --git a/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/sdl-ttf-x32-pkg-install.sh b/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/sdl-ttf-x32-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/X11/libs/sdl/sdl-ttf/2.0.11-x86_32/sdl-ttf-x32-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/X11/libs/sdl/sdl-ttf/2.0.11/Makefile b/X11/libs/sdl/sdl-ttf/2.0.11/Makefile
new file mode 100644
index 000000000..e17eb0a25
--- /dev/null
+++ b/X11/libs/sdl/sdl-ttf/2.0.11/Makefile
@@ -0,0 +1,215 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC32)
+COMPONENT_TARGETS += $(HARDWARE_PC64)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXQ)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BT1)
+
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+
+include ../../../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/l/sdl/sdl-ttf
+
+REQUIRES           = X11/libs/sdl/sdl/1.2.15
+REQUIRES          += libs/freetype/2.6.3
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 2.0.11
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/l/sdl/sdl-ttf/SDL_ttf-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/SDL_ttf-$(version)
+src_dir_name       = SDL_ttf-$(version)
+doc_dir_name       = sdl-ttf-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = xlibs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SDL_TTF_PKG_NAME                = sdl-ttf
+SDL_TTF_PKG_VERSION             = 2.0.11
+SDL_TTF_PKG_ARCH                = $(TOOLCHAIN)
+SDL_TTF_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SDL_TTF_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SDL_TTF_PKG_GROUP               = $(PKG_GROUP)
+###                              |---handy-ruler-------------------------------|
+SDL_TTF_PKG_SHORT_DESCRIPTION   = SDL TrueType fonts library
+SDL_TTF_PKG_URL                 = $(BUG_URL)
+SDL_TTF_PKG_LICENSE             = custom
+SDL_TTF_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SDL_TTF_PKG_NAME)-pkg-description
+SDL_TTF_PKG_DESCRIPTION_FILE_IN = $(SDL_TTF_PKG_NAME)-pkg-description.in
+SDL_TTF_PKG_INSTALL_SCRIPT      = $(SDL_TTF_PKG_NAME)-pkg-install.sh
+
+SDL_TTF_PKG      = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SDL_TTF_PKG_NAME)-package
+
+pkg_basename     = $(SDL_TTF_PKG_NAME)-$(SDL_TTF_PKG_VERSION)-$(SDL_TTF_PKG_ARCH)-$(SDL_TTF_PKG_DISTRO_NAME)-$(SDL_TTF_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(SDL_TTF_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(LIBSUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(doc_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+extra_environment  = FREETYPE_CONFIG=$(TARGET_DEST_DIR)/usr/bin/freetype-config
+
+
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) $(extra_environment) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET)            \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SDL_TTF_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	# ======= Install Documentation =======
+	@if [ -d $(SDL_TTF_PKG)/usr/share/man ]; then \
+	  ( cd $(SDL_TTF_PKG)/usr/share/man ; \
+	    for manpagedir in `find . -type d -name "man*"` ; do \
+	      ( cd $$manpagedir ; \
+	        for eachpage in `find . -type l -maxdepth 1` ; do \
+	          ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+	          rm $$eachpage ; \
+	        done ; \
+	        gzip -9 *.?  ; \
+	      ) \
+	    done \
+	  ) \
+	 fi
+	@mkdir -p $(SDL_TTF_PKG)/usr/doc/$(doc_dir_name)
+	@cp -a $(SRC_DIR)/COPYING \
+	       $(SDL_TTF_PKG)/usr/doc/$(doc_dir_name)
+	@mkdir -p $(SDL_TTF_PKG)/usr/share/doc/$(doc_dir_name)
+	@( cd $(SRC_DIR) ; \
+	   cp -a COPYING README \
+	         $(SDL_TTF_PKG)/usr/share/doc/$(doc_dir_name) ; \
+	 )
+	@( cd $(SRC_DIR) ; \
+	   if [ -r CHANGES ]; then \
+	     DOCSDIR=`echo $(SDL_TTF_PKG)/usr/share/doc/$(doc_dir_name)` ; \
+	     cat CHANGES | head -n 1000 > $$DOCSDIR/CHANGES ; \
+	     touch -r CHANGES $$DOCSDIR/CHANGES ; \
+	   fi \
+	 )
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SDL_TTF_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libSDL_ttf.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SDL_TTF_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libSDL_ttf.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libSDL_ttf.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" SDL_ttf.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SDL_TTF_PKG); \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SDL_TTF_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SDL_TTF_PKG_DESCRIPTION_FILE): $(SDL_TTF_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SDL_TTF_PKG_DESCRIPTION_FILE) $(SDL_TTF_PKG_INSTALL_SCRIPT)
+	@cp $(SDL_TTF_PKG_DESCRIPTION_FILE) $(SDL_TTF_PKG)/.DESCRIPTION
+	@cp $(SDL_TTF_PKG_INSTALL_SCRIPT) $(SDL_TTF_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SDL_TTF_PKG)/.REQUIRES
+	@echo "pkgname=$(SDL_TTF_PKG_NAME)"                            >  $(SDL_TTF_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SDL_TTF_PKG_VERSION)"                          >> $(SDL_TTF_PKG)/.PKGINFO ; \
+	 echo "arch=$(SDL_TTF_PKG_ARCH)"                               >> $(SDL_TTF_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SDL_TTF_PKG_DISTRO_NAME)"                  >> $(SDL_TTF_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SDL_TTF_PKG_DISTRO_VERSION)"                >> $(SDL_TTF_PKG)/.PKGINFO ; \
+	 echo "group=$(SDL_TTF_PKG_GROUP)"                             >> $(SDL_TTF_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SDL_TTF_PKG_SHORT_DESCRIPTION)\"" >> $(SDL_TTF_PKG)/.PKGINFO ; \
+	 echo "url=$(SDL_TTF_PKG_URL)"                                 >> $(SDL_TTF_PKG)/.PKGINFO ; \
+	 echo "license=$(SDL_TTF_PKG_LICENSE)"                         >> $(SDL_TTF_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SDL_TTF_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/X11/libs/sdl/sdl-ttf/2.0.11/PATCHES b/X11/libs/sdl/sdl-ttf/2.0.11/PATCHES
new file mode 100644
index 000000000..d461cf0f1
--- /dev/null
+++ b/X11/libs/sdl/sdl-ttf/2.0.11/PATCHES
@@ -0,0 +1,2 @@
+
+../../../../../sources/packages/l/sdl/sdl-ttf/patches/SDL_ttf-2.0.11-shaded-text.patch -p0
diff --git a/X11/libs/sdl/sdl-ttf/2.0.11/sdl-ttf-pkg-description.in b/X11/libs/sdl/sdl-ttf/2.0.11/sdl-ttf-pkg-description.in
new file mode 100644
index 000000000..100d92060
--- /dev/null
+++ b/X11/libs/sdl/sdl-ttf/2.0.11/sdl-ttf-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+       |-----handy-ruler------------------------------------------------------|
+sdl-ttf: sdl-ttf @VERSION@ (SDL TrueType fonts library)
+sdl-ttf:
+sdl-ttf: This library is a wrapper around the FreeType 2.0 library which
+sdl-ttf: allows you to use TrueType fonts to render text in SDL applications.
+sdl-ttf:
+sdl-ttf:
+sdl-ttf:
+sdl-ttf: Homepage: http://www.libsdl.org
+sdl-ttf:
+sdl-ttf:
+sdl-ttf:
diff --git a/X11/libs/sdl/sdl-ttf/2.0.11/sdl-ttf-pkg-install.sh b/X11/libs/sdl/sdl-ttf/2.0.11/sdl-ttf-pkg-install.sh
new file mode 100755
index 000000000..b44c4e648
--- /dev/null
+++ b/X11/libs/sdl/sdl-ttf/2.0.11/sdl-ttf-pkg-install.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Preserve new files
+install_file() {
+  NEW="$1"
+  OLD="`dirname $NEW`/`basename $NEW .new`"
+  # If there's no file by that name, mv it over:
+  if [ ! -r $OLD ]; then
+    mv $NEW $OLD
+  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+    rm $NEW
+  fi
+  # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/libs/libmikmod/3.1.20-x86_32/Makefile b/libs/libmikmod/3.1.20-x86_32/Makefile
new file mode 100644
index 000000000..33375e7b1
--- /dev/null
+++ b/libs/libmikmod/3.1.20-x86_32/Makefile
@@ -0,0 +1,176 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC64)
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+CREATE_X86_32_PACKAGE = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/m/mikmod/lib
+
+REQUIRES           = libs/libmikmod/3.1.20
+REQUIRES          += libs/alsa-lib/1.1.1-x86_32
+REQUIRES          += app/esound/0.2.41-x86_32
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 3.1.20
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/m/mikmod/lib/libmikmod-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/libmikmod-$(version)
+src_dir_name       = libmikmod-$(version)
+doc_dir_name       = libmikmod-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = libs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+LIBMIKMOD_32_PKG_NAME                = libmikmod-x32
+LIBMIKMOD_32_PKG_VERSION             = 3.1.20
+LIBMIKMOD_32_PKG_ARCH                = $(TOOLCHAIN)
+LIBMIKMOD_32_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+LIBMIKMOD_32_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+LIBMIKMOD_32_PKG_GROUP               = $(PKG_GROUP)
+###                                   |---handy-ruler-------------------------------|
+LIBMIKMOD_32_PKG_SHORT_DESCRIPTION   = A portable sound library
+LIBMIKMOD_32_PKG_URL                 = $(BUG_URL)
+LIBMIKMOD_32_PKG_LICENSE             = LGPLv2.1
+LIBMIKMOD_32_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(LIBMIKMOD_32_PKG_NAME)-pkg-description
+LIBMIKMOD_32_PKG_DESCRIPTION_FILE_IN = $(LIBMIKMOD_32_PKG_NAME)-pkg-description.in
+LIBMIKMOD_32_PKG_INSTALL_SCRIPT      = $(LIBMIKMOD_32_PKG_NAME)-pkg-install.sh
+
+LIBMIKMOD_32_PKG = $(CURDIR)/$(TARGET_BUILD_DIR)/$(LIBMIKMOD_32_PKG_NAME)-package
+
+pkg_basename     = $(LIBMIKMOD_32_PKG_NAME)-$(LIBMIKMOD_32_PKG_VERSION)-$(LIBMIKMOD_32_PKG_ARCH)-$(LIBMIKMOD_32_PKG_DISTRO_NAME)-$(LIBMIKMOD_32_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot  = DESTDIR=$(LIBMIKMOD_32_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(MULTILIB_X86_32_SUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(doc_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --bindir=/usr/bin/32
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --enable-alsa
+extra_configure_switches += --enable-esd
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET32)          \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(LIBMIKMOD_32_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -rf $(LIBMIKMOD_32_PKG)/usr/include
+	@rm -rf $(LIBMIKMOD_32_PKG)/usr/share
+	# ======= remove toolchain path from target libmikmod-config script =======
+	@( cd $(LIBMIKMOD_32_PKG)/usr/bin/32 ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libmikmod-config ; \
+	 )
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(LIBMIKMOD_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libmikmod.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(LIBMIKMOD_32_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libmikmod.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libmikmod.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libmikmod.pc ; \
+	 )
+	# ======= tune libmicmod-config script for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/bin/32 ; \
+	   sed -i "s,=/usr,=$(TARGET_DEST_DIR)/usr,g" libmikmod-config ; \
+	   sed -i "s,L/usr,L$(TARGET_DEST_DIR)/usr,g" libmikmod-config ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(LIBMIKMOD_32_PKG) ; \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+	@touch $@
+
+$(LIBMIKMOD_32_PKG_DESCRIPTION_FILE): $(LIBMIKMOD_32_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(LIBMIKMOD_32_PKG_DESCRIPTION_FILE) $(LIBMIKMOD_32_PKG_INSTALL_SCRIPT)
+	@cp $(LIBMIKMOD_32_PKG_DESCRIPTION_FILE) $(LIBMIKMOD_32_PKG)/.DESCRIPTION
+	@cp $(LIBMIKMOD_32_PKG_INSTALL_SCRIPT) $(LIBMIKMOD_32_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(LIBMIKMOD_32_PKG)/.REQUIRES
+	@echo "pkgname=$(LIBMIKMOD_32_PKG_NAME)"                            >  $(LIBMIKMOD_32_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(LIBMIKMOD_32_PKG_VERSION)"                          >> $(LIBMIKMOD_32_PKG)/.PKGINFO ; \
+	 echo "arch=$(LIBMIKMOD_32_PKG_ARCH)"                               >> $(LIBMIKMOD_32_PKG)/.PKGINFO ; \
+	 echo "distroname=$(LIBMIKMOD_32_PKG_DISTRO_NAME)"                  >> $(LIBMIKMOD_32_PKG)/.PKGINFO ; \
+	 echo "distrover=$(LIBMIKMOD_32_PKG_DISTRO_VERSION)"                >> $(LIBMIKMOD_32_PKG)/.PKGINFO ; \
+	 echo "group=$(LIBMIKMOD_32_PKG_GROUP)"                             >> $(LIBMIKMOD_32_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(LIBMIKMOD_32_PKG_SHORT_DESCRIPTION)\"" >> $(LIBMIKMOD_32_PKG)/.PKGINFO ; \
+	 echo "url=$(LIBMIKMOD_32_PKG_URL)"                                 >> $(LIBMIKMOD_32_PKG)/.PKGINFO ; \
+	 echo "license=$(LIBMIKMOD_32_PKG_LICENSE)"                         >> $(LIBMIKMOD_32_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(LIBMIKMOD_32_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/libs/libmikmod/3.1.20-x86_32/PATCHES b/libs/libmikmod/3.1.20-x86_32/PATCHES
new file mode 100644
index 000000000..4add49a4b
--- /dev/null
+++ b/libs/libmikmod/3.1.20-x86_32/PATCHES
@@ -0,0 +1,2 @@
+
+../../../sources/packages/m/mikmod/lib/patches/libmikmod-3.1.20-64bit.patch -p0
diff --git a/libs/libmikmod/3.1.20-x86_32/libmikmod-x32-pkg-description.in b/libs/libmikmod/3.1.20-x86_32/libmikmod-x32-pkg-description.in
new file mode 100644
index 000000000..898156296
--- /dev/null
+++ b/libs/libmikmod/3.1.20-x86_32/libmikmod-x32-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+             |-----handy-ruler------------------------------------------------------|
+libmikmod-x32: libmikmod-x32 @VERSION@ (x86_32 A portable sound library)
+libmikmod-x32:
+libmikmod-x32: The MikMod sound library is an excellent way for a programmer
+libmikmod-x32: to add music and sound effects to an application. It is a powerful
+libmikmod-x32: and flexible library, with a simple and easy-to-learn API.
+libmikmod-x32:
+libmikmod-x32:
+libmikmod-x32: Homepage: http://mikmod.sourceforge.net
+libmikmod-x32:
+libmikmod-x32:
+libmikmod-x32:
diff --git a/libs/libmikmod/3.1.20-x86_32/libmikmod-x32-pkg-install.sh b/libs/libmikmod/3.1.20-x86_32/libmikmod-x32-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/libs/libmikmod/3.1.20-x86_32/libmikmod-x32-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/libs/libmikmod/3.1.20/Makefile b/libs/libmikmod/3.1.20/Makefile
new file mode 100644
index 000000000..fbe5d6fad
--- /dev/null
+++ b/libs/libmikmod/3.1.20/Makefile
@@ -0,0 +1,214 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC32)
+COMPONENT_TARGETS += $(HARDWARE_PC64)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXQ)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BT1)
+
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/m/mikmod/lib
+
+REQUIRES           = libs/alsa-lib/1.1.1
+REQUIRES          += app/esound/0.2.41
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 3.1.20
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/m/mikmod/lib/libmikmod-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/libmikmod-$(version)
+src_dir_name       = libmikmod-$(version)
+doc_dir_name       = libmikmod-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = libs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+LIBMIKMOD_PKG_NAME                = libmikmod
+LIBMIKMOD_PKG_VERSION             = 3.1.20
+LIBMIKMOD_PKG_ARCH                = $(TOOLCHAIN)
+LIBMIKMOD_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+LIBMIKMOD_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+LIBMIKMOD_PKG_GROUP               = $(PKG_GROUP)
+###                                |---handy-ruler-------------------------------|
+LIBMIKMOD_PKG_SHORT_DESCRIPTION   = A portable sound library
+LIBMIKMOD_PKG_URL                 = $(BUG_URL)
+LIBMIKMOD_PKG_LICENSE             = LGPLv2.1
+LIBMIKMOD_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(LIBMIKMOD_PKG_NAME)-pkg-description
+LIBMIKMOD_PKG_DESCRIPTION_FILE_IN = $(LIBMIKMOD_PKG_NAME)-pkg-description.in
+LIBMIKMOD_PKG_INSTALL_SCRIPT      = $(LIBMIKMOD_PKG_NAME)-pkg-install.sh
+
+LIBMIKMOD_PKG    = $(CURDIR)/$(TARGET_BUILD_DIR)/$(LIBMIKMOD_PKG_NAME)-package
+
+pkg_basename     = $(LIBMIKMOD_PKG_NAME)-$(LIBMIKMOD_PKG_VERSION)-$(LIBMIKMOD_PKG_ARCH)-$(LIBMIKMOD_PKG_DISTRO_NAME)-$(LIBMIKMOD_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(LIBMIKMOD_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(LIBSUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(doc_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --enable-alsa
+extra_configure_switches += --enable-esd
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET)            \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(LIBMIKMOD_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -f $(LIBMIKMOD_PKG)/usr/share/info/dir
+	@gzip -9 $(LIBMIKMOD_PKG)/usr/share/info/*
+	# ======= Install Documentation =======
+	@if [ -d $(LIBMIKMOD_PKG)/usr/share/man ]; then \
+	  ( cd $(LIBMIKMOD_PKG)/usr/share/man ; \
+	    for manpagedir in `find . -type d -name "man*"` ; do \
+	      ( cd $$manpagedir ; \
+	        for eachpage in `find . -type l -maxdepth 1` ; do \
+	          ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+	          rm $$eachpage ; \
+	        done ; \
+	        gzip -9 *.? ; \
+	      ) \
+	    done \
+	  ) \
+	 fi
+	@mkdir -p $(LIBMIKMOD_PKG)/usr/doc/$(doc_dir_name)
+	@cp -a $(SRC_DIR)/AUTHORS $(SRC_DIR)/COPYING* \
+	       $(LIBMIKMOD_PKG)/usr/doc/$(doc_dir_name)
+	@mkdir -p $(LIBMIKMOD_PKG)/usr/share/doc/$(doc_dir_name)
+	@( cd $(SRC_DIR) ; \
+	   cp -a AUTHORS COPYING* INSTALL NEWS README TODO \
+	         $(LIBMIKMOD_PKG)/usr/share/doc/$(doc_dir_name) ; \
+	 )
+	@( cd $(SRC_DIR) ; \
+	   if [ -r ChangeLog ]; then \
+	     DOCSDIR=`echo $(LIBMIKMOD_PKG)/usr/share/doc/$(doc_dir_name)` ; \
+	     cat ChangeLog | head -n 1000 > $$DOCSDIR/ChangeLog ; \
+	     touch -r ChangeLog $$DOCSDIR/ChangeLog ; \
+	   fi \
+	 )
+	# ======= remove toolchain path from target libmikmod-config script =======
+	@( cd $(LIBMIKMOD_PKG)/usr/bin ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libmikmod-config ; \
+	 )
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(LIBMIKMOD_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libmikmod.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(LIBMIKMOD_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libmikmod.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libmikmod.la ; \
+	 )
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libmikmod.pc ; \
+	 )
+	# ======= tune libmicmod-config script for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/bin ; \
+	   sed -i "s,=/usr,=$(TARGET_DEST_DIR)/usr,g" libmikmod-config ; \
+	   sed -i "s,L/usr,L$(TARGET_DEST_DIR)/usr,g" libmikmod-config ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(LIBMIKMOD_PKG) ; \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+	@touch $@
+
+$(LIBMIKMOD_PKG_DESCRIPTION_FILE): $(LIBMIKMOD_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(LIBMIKMOD_PKG_DESCRIPTION_FILE) $(LIBMIKMOD_PKG_INSTALL_SCRIPT)
+	@cp $(LIBMIKMOD_PKG_DESCRIPTION_FILE) $(LIBMIKMOD_PKG)/.DESCRIPTION
+	@cp $(LIBMIKMOD_PKG_INSTALL_SCRIPT) $(LIBMIKMOD_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(LIBMIKMOD_PKG)/.REQUIRES
+	@echo "pkgname=$(LIBMIKMOD_PKG_NAME)"                            >  $(LIBMIKMOD_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(LIBMIKMOD_PKG_VERSION)"                          >> $(LIBMIKMOD_PKG)/.PKGINFO ; \
+	 echo "arch=$(LIBMIKMOD_PKG_ARCH)"                               >> $(LIBMIKMOD_PKG)/.PKGINFO ; \
+	 echo "distroname=$(LIBMIKMOD_PKG_DISTRO_NAME)"                  >> $(LIBMIKMOD_PKG)/.PKGINFO ; \
+	 echo "distrover=$(LIBMIKMOD_PKG_DISTRO_VERSION)"                >> $(LIBMIKMOD_PKG)/.PKGINFO ; \
+	 echo "group=$(LIBMIKMOD_PKG_GROUP)"                             >> $(LIBMIKMOD_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(LIBMIKMOD_PKG_SHORT_DESCRIPTION)\"" >> $(LIBMIKMOD_PKG)/.PKGINFO ; \
+	 echo "url=$(LIBMIKMOD_PKG_URL)"                                 >> $(LIBMIKMOD_PKG)/.PKGINFO ; \
+	 echo "license=$(LIBMIKMOD_PKG_LICENSE)"                         >> $(LIBMIKMOD_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(LIBMIKMOD_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/libs/libmikmod/3.1.20/PATCHES b/libs/libmikmod/3.1.20/PATCHES
new file mode 100644
index 000000000..4add49a4b
--- /dev/null
+++ b/libs/libmikmod/3.1.20/PATCHES
@@ -0,0 +1,2 @@
+
+../../../sources/packages/m/mikmod/lib/patches/libmikmod-3.1.20-64bit.patch -p0
diff --git a/libs/libmikmod/3.1.20/libmikmod-pkg-description.in b/libs/libmikmod/3.1.20/libmikmod-pkg-description.in
new file mode 100644
index 000000000..c360159bf
--- /dev/null
+++ b/libs/libmikmod/3.1.20/libmikmod-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+         |-----handy-ruler------------------------------------------------------|
+libmikmod: libmikmod @VERSION@ (A portable sound library)
+libmikmod:
+libmikmod: The MikMod sound library is an excellent way for a programmer
+libmikmod: to add music and sound effects to an application. It is a powerful
+libmikmod: and flexible library, with a simple and easy-to-learn API.
+libmikmod:
+libmikmod:
+libmikmod: Homepage: http://mikmod.sourceforge.net
+libmikmod:
+libmikmod:
+libmikmod:
diff --git a/libs/libmikmod/3.1.20/libmikmod-pkg-install.sh b/libs/libmikmod/3.1.20/libmikmod-pkg-install.sh
new file mode 100755
index 000000000..af10e550c
--- /dev/null
+++ b/libs/libmikmod/3.1.20/libmikmod-pkg-install.sh
@@ -0,0 +1,69 @@
+#!/bin/sh
+
+# Preserve new files
+install_file() {
+  NEW="$1"
+  OLD="`dirname $NEW`/`basename $NEW .new`"
+  # If there's no file by that name, mv it over:
+  if [ ! -r $OLD ]; then
+    mv $NEW $OLD
+  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+    rm $NEW
+  fi
+  # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  #
+  # NOTE:
+  #   'install-info' can work using relative paths and we can make use build machine
+  #   utility during installation to the some partition and use target 'install-info'
+  #   during installation directly on the running target machine.
+  #
+  if [ -x /usr/bin/install-info ] ; then
+    install-info --info-dir=usr/share/info usr/share/info/mikmod.info.gz 2>/dev/null
+  elif ! grep "(mikmod)" usr/share/info/dir 1> /dev/null 2> /dev/null ; then
+  cat << EOF >> usr/share/info/dir
+
+Programming
+* MikMod: (mikmod).             MikMod Sound Library.
+EOF
+  fi
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  if [ -x /usr/bin/install-info ] ; then
+    install-info --delete --info-file=usr/share/info/mikmod.info.gz --dir-file=usr/share/info/dir 2> /dev/null || /bin/true
+  fi
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/libs/smpeg/0.4.5-x86_32/Makefile b/libs/smpeg/0.4.5-x86_32/Makefile
new file mode 100644
index 000000000..073387088
--- /dev/null
+++ b/libs/smpeg/0.4.5-x86_32/Makefile
@@ -0,0 +1,196 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC64)
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+CREATE_X86_32_PACKAGE = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/m/smpeg
+
+REQUIRES           = libs/smpeg/0.4.5
+REQUIRES          += X11/libs/sdl/sdl/1.2.15-x86_32
+REQUIRES          += X11/libs/glu/9.0.0-x86_32
+REQUIRES          += X11/libs/gtk+2/2.24.25-x86_32
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 0.4.5
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/m/smpeg/smpeg-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/smpeg-$(version)
+src_dir_name       = smpeg-$(version)
+doc_dir_name       = smpeg-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = libs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SMPEG_32_PKG_NAME                = smpeg-x32
+SMPEG_32_PKG_VERSION             = 0.4.5
+SMPEG_32_PKG_ARCH                = $(TOOLCHAIN)
+SMPEG_32_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SMPEG_32_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SMPEG_32_PKG_GROUP               = $(PKG_GROUP)
+###                               |---handy-ruler-------------------------------|
+SMPEG_32_PKG_SHORT_DESCRIPTION   = SDL MPEG Player Library
+SMPEG_32_PKG_URL                 = $(BUG_URL)
+SMPEG_32_PKG_LICENSE             = LGPLv2.1
+SMPEG_32_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SMPEG_32_PKG_NAME)-pkg-description
+SMPEG_32_PKG_DESCRIPTION_FILE_IN = $(SMPEG_32_PKG_NAME)-pkg-description.in
+SMPEG_32_PKG_INSTALL_SCRIPT      = $(SMPEG_32_PKG_NAME)-pkg-install.sh
+
+SMPEG_32_PKG     = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SMPEG_32_PKG_NAME)-package
+
+pkg_basename     = $(SMPEG_32_PKG_NAME)-$(SMPEG_32_PKG_VERSION)-$(SMPEG_32_PKG_ARCH)-$(SMPEG_32_PKG_DISTRO_NAME)-$(SMPEG_32_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot  = DESTDIR=$(SMPEG_32_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(MULTILIB_X86_32_SUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(doc_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --bindir=/usr/bin/32
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --disable-sdltest
+extra_configure_switches += --enable-gtk-player
+extra_configure_switches += --disable-gtktest
+extra_configure_switches += --enable-opengl-player
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+extra_environment  = SDL_CONFIG=$(TARGET_DEST_DIR)/usr/bin/32/sdl-config
+
+
+TARGET_BIN_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX)
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) $(extra_environment) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET32)          \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SMPEG_32_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -rf $(SMPEG_32_PKG)/usr/include
+	@rm -rf $(SMPEG_32_PKG)/usr/share
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SMPEG_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libsmpeg.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SMPEG_32_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libsmpeg.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libsmpeg.la ; \
+	 )
+	# ======= tune libmicmod-config script for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/bin/32 ; \
+	   sed -i "s,=/usr,=$(TARGET_DEST_DIR)/usr,g" smpeg-config ; \
+	   sed -i "s,L/usr,L$(TARGET_DEST_DIR)/usr,g" smpeg-config ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SMPEG_32_PKG) ; \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target binaries =======
+	@( cd $(SMPEG_32_PKG)/usr/bin/32 ; \
+	   for file in `find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_BIN_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SMPEG_32_PKG)/usr/lib$(MULTILIB_X86_32_SUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SMPEG_32_PKG_DESCRIPTION_FILE): $(SMPEG_32_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SMPEG_32_PKG_DESCRIPTION_FILE) $(SMPEG_32_PKG_INSTALL_SCRIPT)
+	@cp $(SMPEG_32_PKG_DESCRIPTION_FILE) $(SMPEG_32_PKG)/.DESCRIPTION
+	@cp $(SMPEG_32_PKG_INSTALL_SCRIPT) $(SMPEG_32_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SMPEG_32_PKG)/.REQUIRES
+	@echo "pkgname=$(SMPEG_32_PKG_NAME)"                            >  $(SMPEG_32_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SMPEG_32_PKG_VERSION)"                          >> $(SMPEG_32_PKG)/.PKGINFO ; \
+	 echo "arch=$(SMPEG_32_PKG_ARCH)"                               >> $(SMPEG_32_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SMPEG_32_PKG_DISTRO_NAME)"                  >> $(SMPEG_32_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SMPEG_32_PKG_DISTRO_VERSION)"                >> $(SMPEG_32_PKG)/.PKGINFO ; \
+	 echo "group=$(SMPEG_32_PKG_GROUP)"                             >> $(SMPEG_32_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SMPEG_32_PKG_SHORT_DESCRIPTION)\"" >> $(SMPEG_32_PKG)/.PKGINFO ; \
+	 echo "url=$(SMPEG_32_PKG_URL)"                                 >> $(SMPEG_32_PKG)/.PKGINFO ; \
+	 echo "license=$(SMPEG_32_PKG_LICENSE)"                         >> $(SMPEG_32_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SMPEG_32_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/libs/smpeg/0.4.5-x86_32/PATCHES b/libs/smpeg/0.4.5-x86_32/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/libs/smpeg/0.4.5-x86_32/smpeg-x32-pkg-description.in b/libs/smpeg/0.4.5-x86_32/smpeg-x32-pkg-description.in
new file mode 100644
index 000000000..14337086b
--- /dev/null
+++ b/libs/smpeg/0.4.5-x86_32/smpeg-x32-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+         |-----handy-ruler------------------------------------------------------|
+smpeg-x32: smpeg-x32 @VERSION@ (x86_32 SDL MPEG Player Library)
+smpeg-x32:
+smpeg-x32: SMPEG is a free MPEG1 video player library with sound support. Video
+smpeg-x32: playback is based on the ubiquitous Berkeley MPEG player, mpeg_play
+smpeg-x32: v2.2. Audio is played through a slightly modified mpegsound library,
+smpeg-x32: part of Splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
+smpeg-x32: and MPEG system streams.
+smpeg-x32:
+smpeg-x32: Homepage: http://icculus.org/smpeg
+smpeg-x32:
+smpeg-x32:
diff --git a/libs/smpeg/0.4.5-x86_32/smpeg-x32-pkg-install.sh b/libs/smpeg/0.4.5-x86_32/smpeg-x32-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/libs/smpeg/0.4.5-x86_32/smpeg-x32-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/libs/smpeg/0.4.5/Makefile b/libs/smpeg/0.4.5/Makefile
new file mode 100644
index 000000000..74c5a4bc1
--- /dev/null
+++ b/libs/smpeg/0.4.5/Makefile
@@ -0,0 +1,231 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC32)
+COMPONENT_TARGETS += $(HARDWARE_PC64)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXQ)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BT1)
+
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/m/smpeg
+
+REQUIRES           = X11/libs/sdl/sdl/1.2.15
+REQUIRES          += X11/libs/glu/9.0.0
+REQUIRES          += X11/libs/gtk+2/2.24.25
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 0.4.5
+tar_gz_archive     = $(SRC_PACKAGE_PATH)/packages/m/smpeg/smpeg-$(version).tar.gz
+SRC_ARCHIVE        = $(tar_gz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/smpeg-$(version)
+src_dir_name       = smpeg-$(version)
+doc_dir_name       = smpeg-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_dir          = $(TARGET_BUILD_DIR)/build
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = libs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+SMPEG_PKG_NAME                = smpeg
+SMPEG_PKG_VERSION             = 0.4.5
+SMPEG_PKG_ARCH                = $(TOOLCHAIN)
+SMPEG_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+SMPEG_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+SMPEG_PKG_GROUP               = $(PKG_GROUP)
+###                            |---handy-ruler-------------------------------|
+SMPEG_PKG_SHORT_DESCRIPTION   = SDL MPEG Player Library
+SMPEG_PKG_URL                 = $(BUG_URL)
+SMPEG_PKG_LICENSE             = LGPLv2.1
+SMPEG_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(SMPEG_PKG_NAME)-pkg-description
+SMPEG_PKG_DESCRIPTION_FILE_IN = $(SMPEG_PKG_NAME)-pkg-description.in
+SMPEG_PKG_INSTALL_SCRIPT      = $(SMPEG_PKG_NAME)-pkg-install.sh
+
+SMPEG_PKG        = $(CURDIR)/$(TARGET_BUILD_DIR)/$(SMPEG_PKG_NAME)-package
+
+pkg_basename     = $(SMPEG_PKG_NAME)-$(SMPEG_PKG_VERSION)-$(SMPEG_PKG_ARCH)-$(SMPEG_PKG_DISTRO_NAME)-$(SMPEG_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(SMPEG_PKG)
+
+
+extra_configure_switches  = --libdir=/usr/lib$(LIBSUFFIX)
+extra_configure_switches += --docdir=/usr/share/doc/$(doc_dir_name)
+extra_configure_switches += --infodir=/usr/share/info
+extra_configure_switches += --mandir=/usr/share/man
+extra_configure_switches += --disable-dependency-tracking
+
+extra_configure_switches += --with-pic
+
+extra_configure_switches += --disable-sdltest
+extra_configure_switches += --enable-gtk-player
+extra_configure_switches += --disable-gtktest
+extra_configure_switches += --enable-opengl-player
+
+extra_configure_switches += --enable-shared=yes
+extra_configure_switches += --enable-static=yes
+
+
+extra_environment  = SDL_CONFIG=$(TARGET_DEST_DIR)/usr/bin/sdl-config
+
+
+TARGET_BIN_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX)
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@mkdir -p $(build_dir)
+	@cd $(build_dir) && \
+	  $(BUILD_ENVIRONMENT) $(extra_environment) ../$(src_dir_name)/configure \
+	  --prefix=/usr               \
+	  --build=$(BUILD)            \
+	  --host=$(TARGET)            \
+	  $(extra_configure_switches)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(SMPEG_PKG)
+	@cd $(build_dir) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	# ======= Install Documentation =======
+	@if [ -d $(SMPEG_PKG)/usr/share/man ]; then \
+	  ( cd $(SMPEG_PKG)/usr/share/man ; \
+	    for manpagedir in `find . -type d -name "man*"` ; do \
+	      ( cd $$manpagedir ; \
+	        for eachpage in `find . -type l -maxdepth 1` ; do \
+	          ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+	          rm $$eachpage ; \
+	        done ; \
+	        gzip -9 *.? ; \
+	      ) \
+	    done \
+	  ) \
+	 fi
+	@mkdir -p $(SMPEG_PKG)/usr/doc/$(doc_dir_name)
+	@cp -a $(SRC_DIR)/COPYING \
+	       $(SMPEG_PKG)/usr/doc/$(doc_dir_name)
+	@mkdir -p $(SMPEG_PKG)/usr/share/doc/$(doc_dir_name)
+	@( cd $(SRC_DIR) ; \
+	   cp -a COPYING README* TODO \
+	         $(SMPEG_PKG)/usr/share/doc/$(doc_dir_name) ; \
+	 )
+	@( cd $(SRC_DIR) ; \
+	   if [ -r ChangeLog ]; then \
+	     DOCSDIR=`echo $(SMPEG_PKG)/usr/share/doc/$(doc_dir_name)` ; \
+	     cat ChangeLog | head -n 1000 > $$DOCSDIR/ChangeLog ; \
+	     touch -r ChangeLog $$DOCSDIR/ChangeLog ; \
+	   fi \
+	 )
+	# ======= remove toolchain path from target libtool *.la files =======
+	@( cd $(SMPEG_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,$(TARGET_DEST_DIR),,g" libsmpeg.la ; \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(SMPEG_PKG))
+	# ======= tune libtool *.la search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX) ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" libsmpeg.la ; \
+	   sed -i "s,L/lib,L$(TARGET_DEST_DIR)/lib,g" libsmpeg.la ; \
+	 )
+	# ======= tune libmicmod-config script for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/bin ; \
+	   sed -i "s,=/usr,=$(TARGET_DEST_DIR)/usr,g" smpeg-config ; \
+	   sed -i "s,L/usr,L$(TARGET_DEST_DIR)/usr,g" smpeg-config ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(SMPEG_PKG) ; \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "current ar archive" | cut -f 1 -d : | xargs $(STRIP) -g 2> /dev/null \
+	 )
+ifneq ($(CHRPATH),)
+	# ======= Set RPATH/RUNPATH for target binaries =======
+	@( cd $(SMPEG_PKG)/usr/bin ; \
+	   for file in `find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_BIN_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+	# ======= Set RPATH/RUNPATH for target shared objects =======
+	@( cd $(SMPEG_PKG)/usr/lib$(LIBSUFFIX) ; \
+	   for file in `find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs echo` ; do \
+	     rpath=`$(CHRPATH) -l $$file 2> /dev/null | grep "R*PATH"` ; \
+	     if echo "$$rpath" | grep -q "$(TARGET_DEST_DIR)" ; then \
+	       $(CHRPATH) -r $(TARGET_LIB_RPATH) $$file 1> /dev/null 2> /dev/null ; \
+	     fi ; \
+	   done ; \
+	 )
+endif
+	@touch $@
+
+$(SMPEG_PKG_DESCRIPTION_FILE): $(SMPEG_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(SMPEG_PKG_DESCRIPTION_FILE) $(SMPEG_PKG_INSTALL_SCRIPT)
+	@cp $(SMPEG_PKG_DESCRIPTION_FILE) $(SMPEG_PKG)/.DESCRIPTION
+	@cp $(SMPEG_PKG_INSTALL_SCRIPT) $(SMPEG_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(SMPEG_PKG)/.REQUIRES
+	@echo "pkgname=$(SMPEG_PKG_NAME)"                            >  $(SMPEG_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(SMPEG_PKG_VERSION)"                          >> $(SMPEG_PKG)/.PKGINFO ; \
+	 echo "arch=$(SMPEG_PKG_ARCH)"                               >> $(SMPEG_PKG)/.PKGINFO ; \
+	 echo "distroname=$(SMPEG_PKG_DISTRO_NAME)"                  >> $(SMPEG_PKG)/.PKGINFO ; \
+	 echo "distrover=$(SMPEG_PKG_DISTRO_VERSION)"                >> $(SMPEG_PKG)/.PKGINFO ; \
+	 echo "group=$(SMPEG_PKG_GROUP)"                             >> $(SMPEG_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(SMPEG_PKG_SHORT_DESCRIPTION)\"" >> $(SMPEG_PKG)/.PKGINFO ; \
+	 echo "url=$(SMPEG_PKG_URL)"                                 >> $(SMPEG_PKG)/.PKGINFO ; \
+	 echo "license=$(SMPEG_PKG_LICENSE)"                         >> $(SMPEG_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(SMPEG_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/libs/smpeg/0.4.5/PATCHES b/libs/smpeg/0.4.5/PATCHES
new file mode 100644
index 000000000..e69de29bb
diff --git a/libs/smpeg/0.4.5/smpeg-pkg-description.in b/libs/smpeg/0.4.5/smpeg-pkg-description.in
new file mode 100644
index 000000000..9ce132b40
--- /dev/null
+++ b/libs/smpeg/0.4.5/smpeg-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+     |-----handy-ruler------------------------------------------------------|
+smpeg: smpeg @VERSION@ (SDL MPEG Player Library)
+smpeg:
+smpeg: SMPEG is a free MPEG1 video player library with sound support. Video
+smpeg: playback is based on the ubiquitous Berkeley MPEG player, mpeg_play
+smpeg: v2.2. Audio is played through a slightly modified mpegsound library,
+smpeg: part of Splay v0.8.2. SMPEG supports MPEG audio (MP3), MPEG-1 video,
+smpeg: and MPEG system streams.
+smpeg:
+smpeg: Homepage: http://icculus.org/smpeg
+smpeg:
+smpeg:
diff --git a/libs/smpeg/0.4.5/smpeg-pkg-install.sh b/libs/smpeg/0.4.5/smpeg-pkg-install.sh
new file mode 100755
index 000000000..b44c4e648
--- /dev/null
+++ b/libs/smpeg/0.4.5/smpeg-pkg-install.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Preserve new files
+install_file() {
+  NEW="$1"
+  OLD="`dirname $NEW`/`basename $NEW .new`"
+  # If there's no file by that name, mv it over:
+  if [ ! -r $OLD ]; then
+    mv $NEW $OLD
+  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+    rm $NEW
+  fi
+  # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/products/X11/Makefile b/products/X11/Makefile
index d02ea000a..5ea2e166d 100644
--- a/products/X11/Makefile
+++ b/products/X11/Makefile
@@ -765,6 +765,10 @@ REQUIRES += libs/libsoxr/0.1.2
 ifeq ($(HARDWARE),$(HARDWARE_PC64))
 REQUIRES += libs/libsoxr/0.1.2-x86_32
 endif
+REQUIRES += libs/libmikmod/3.1.20
+ifeq ($(HARDWARE),$(HARDWARE_PC64))
+REQUIRES += libs/libmikmod/3.1.20-x86_32
+endif
 
 REQUIRES += libs/schroedinger/1.0.11
 ifeq ($(HARDWARE),$(HARDWARE_PC64))
@@ -1418,6 +1422,27 @@ ifeq ($(HARDWARE),$(HARDWARE_PC64))
 REQUIRES += X11/libs/libva-vdpau-driver/0.7.4-x86_32
 endif
 
+#######
+####### SDL Libraries:
+#######
+
+REQUIRES += X11/libs/sdl/sdl-image/1.2.12
+ifeq ($(HARDWARE),$(HARDWARE_PC64))
+REQUIRES += X11/libs/sdl/sdl-image/1.2.12-x86_32
+endif
+REQUIRES += X11/libs/sdl/sdl-mixer/1.2.12
+ifeq ($(HARDWARE),$(HARDWARE_PC64))
+REQUIRES += X11/libs/sdl/sdl-mixer/1.2.12-x86_32
+endif
+REQUIRES += X11/libs/sdl/sdl-net/1.2.8
+ifeq ($(HARDWARE),$(HARDWARE_PC64))
+REQUIRES += X11/libs/sdl/sdl-net/1.2.8-x86_32
+endif
+REQUIRES += X11/libs/sdl/sdl-ttf/2.0.11
+ifeq ($(HARDWARE),$(HARDWARE_PC64))
+REQUIRES += X11/libs/sdl/sdl-ttf/2.0.11-x86_32
+endif
+
 
 #######
 ####### Development:
diff --git a/products/base/Makefile b/products/base/Makefile
index f1f70817f..cae302b8e 100644
--- a/products/base/Makefile
+++ b/products/base/Makefile
@@ -765,6 +765,10 @@ REQUIRES += libs/libsoxr/0.1.2
 ifeq ($(HARDWARE),$(HARDWARE_PC64))
 REQUIRES += libs/libsoxr/0.1.2-x86_32
 endif
+REQUIRES += libs/libmikmod/3.1.20
+ifeq ($(HARDWARE),$(HARDWARE_PC64))
+REQUIRES += libs/libmikmod/3.1.20-x86_32
+endif
 
 REQUIRES += libs/schroedinger/1.0.11
 ifeq ($(HARDWARE),$(HARDWARE_PC64))
diff --git a/sources/packages/m/mikmod/Makefile b/sources/packages/m/mikmod/Makefile
new file mode 100644
index 000000000..78f51bc23
--- /dev/null
+++ b/sources/packages/m/mikmod/Makefile
@@ -0,0 +1,13 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+SOURCE_REQUIRES += ALL_DIRS
+
+
+include ../../../../build-system/core.mk
+
+
+download_clean:
+	@true
+
+.PHONY: download_clean
diff --git a/sources/packages/m/mikmod/lib/Makefile b/sources/packages/m/mikmod/lib/Makefile
new file mode 100644
index 000000000..9ae76e50c
--- /dev/null
+++ b/sources/packages/m/mikmod/lib/Makefile
@@ -0,0 +1,56 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/packages/m/mikmod/lib
+
+versions    = 3.1.20
+pkgname     = libmikmod
+suffix      = tar.gz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+patches     = $(CURDIR)/patches/libmikmod-3.1.20-64bit.patch
+
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
+
+
+include ../../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) -i & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) -i & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-3.1.20-64bit-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s) $(patches)
diff --git a/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/create.patch.sh b/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/create.patch.sh
new file mode 100755
index 000000000..57f77b297
--- /dev/null
+++ b/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/create.patch.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=3.1.20
+
+tar --files-from=file.list -xzvf ../libmikmod-$VERSION.tar.gz
+mv libmikmod-$VERSION libmikmod-$VERSION-orig
+
+cp -rf ./libmikmod-$VERSION-new ./libmikmod-$VERSION
+
+diff -b --unified -Nr  libmikmod-$VERSION-orig  libmikmod-$VERSION > libmikmod-$VERSION-64bit.patch
+
+mv libmikmod-$VERSION-64bit.patch ../patches
+
+rm -rf ./libmikmod-$VERSION
+rm -rf ./libmikmod-$VERSION-orig
diff --git a/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/file.list b/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/file.list
new file mode 100644
index 000000000..59f58ee02
--- /dev/null
+++ b/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/file.list
@@ -0,0 +1 @@
+libmikmod-3.1.20/include/mikmod_internals.h
diff --git a/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/libmikmod-3.1.20-new/include/mikmod_internals.h b/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/libmikmod-3.1.20-new/include/mikmod_internals.h
new file mode 100644
index 000000000..253b0f479
--- /dev/null
+++ b/sources/packages/m/mikmod/lib/create-3.1.20-64bit-patch/libmikmod-3.1.20-new/include/mikmod_internals.h
@@ -0,0 +1,716 @@
+/*	MikMod sound library
+	(c) 1998, 1999, 2000 Miodrag Vallat and others - see file AUTHORS for
+	complete list.
+
+	This library is free software; you can redistribute it and/or modify
+	it under the terms of the GNU Library General Public License as
+	published by the Free Software Foundation; either version 2 of
+	the License, or (at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+	GNU Library General Public License for more details.
+
+	You should have received a copy of the GNU Library General Public
+	License along with this library; if not, write to the Free Software
+	Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+	02111-1307, USA.
+*/
+
+/*==============================================================================
+
+  MikMod sound library internal definitions
+
+  ==============================================================================*/
+
+#ifndef _MIKMOD_INTERNALS_H
+#define _MIKMOD_INTERNALS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
+#include <stdarg.h>
+
+#if defined(_MSC_VER) && !defined(__cplusplus) && !defined(HAVE_CONFIG_H)
+#define inline __inline
+#endif
+
+#ifndef MIKMOD_UNIX
+#if (defined(unix) || defined(__unix__) || defined(__unix) || \
+        (defined(__APPLE__) && defined(__MACH__))) && \
+   !(defined(__DJGPP__) || defined(_WIN32) || defined(__OS2__) || defined(__EMX__))
+#define MIKMOD_UNIX 1
+#endif
+#endif /* MIKMOD_UNIX */
+
+#include "mikmod.h"
+
+/*========== More type definitions */
+
+/* SLONGLONG: 64bit, signed */
+#if !defined(_WIN32) && \
+   (defined(_LP64) || defined(__LP64__) || defined(__arch64__) || defined(__alpha) || defined(__x64_64) || defined(__powerpc64__))
+typedef long long       SLONGLONG;
+#define NATIVE_64BIT_INT
+#elif defined(_WIN64) /* win64 is LLP64, not LP64  */
+#define NATIVE_64BIT_INT
+typedef long long       SLONGLONG;
+#elif defined(__WATCOMC__)
+typedef __int64         SLONGLONG;
+#elif defined(_WIN32) && !defined(__MWERKS__)
+typedef LONGLONG        SLONGLONG;
+#elif defined(macintosh) && !TYPE_LONGLONG
+#include <Types.h>
+typedef SInt64          SLONGLONG;
+#else
+typedef long long       SLONGLONG;
+#endif
+typedef int __s64_typetest [(sizeof(SLONGLONG)==8) * 2 - 1];
+
+/* pointer-sized signed int (ssize_t/intptr_t) : */
+#if defined(_WIN64) /* win64 is LLP64, not LP64  */
+typedef long long       SINTPTR_T;
+#else
+/* long should be pointer-sized for all others : */
+typedef long            SINTPTR_T;
+#endif
+typedef int __iptr_typetest [(sizeof(SINTPTR_T)==sizeof(void*)) * 2 - 1];
+
+/*========== Error handling */
+
+#define _mm_errno MikMod_errno
+#define _mm_critical MikMod_critical
+extern MikMod_handler_t _mm_errorhandler;
+
+/*========== Memory allocation */
+
+/* _mm_malloc and _mm_free clash with Windows malloc.h */
+#undef _mm_malloc
+#undef _mm_calloc
+#undef _mm_free
+
+extern void* _mm_malloc(size_t);
+extern void* _mm_calloc(size_t,size_t);
+#define _mm_free(p) do { if (p) free(p); p = NULL; } while(0)
+
+/*========== MT stuff */
+
+#ifdef HAVE_PTHREAD
+#include <pthread.h>
+#define DECLARE_MUTEX(name) \
+        extern pthread_mutex_t _mm_mutex_##name
+#define MUTEX_LOCK(name)    \
+        pthread_mutex_lock(&_mm_mutex_##name)
+#define MUTEX_UNLOCK(name)  \
+        pthread_mutex_unlock(&_mm_mutex_##name)
+
+#elif defined(__OS2__)||defined(__EMX__)
+#define DECLARE_MUTEX(name) \
+        extern HMTX _mm_mutex_##name
+#define MUTEX_LOCK(name)    \
+        if(_mm_mutex_##name)\
+            DosRequestMutexSem(_mm_mutex_##name,SEM_INDEFINITE_WAIT)
+#define MUTEX_UNLOCK(name)  \
+        if(_mm_mutex_##name)\
+            DosReleaseMutexSem(_mm_mutex_##name)
+
+#elif defined(_WIN32)
+#include <windows.h>
+#define DECLARE_MUTEX(name) \
+        extern HANDLE _mm_mutex_##name
+#define MUTEX_LOCK(name)    \
+        if(_mm_mutex_##name)\
+            WaitForSingleObject(_mm_mutex_##name,INFINITE)
+#define MUTEX_UNLOCK(name)  \
+        if(_mm_mutex_##name)\
+            ReleaseMutex(_mm_mutex_##name)
+
+#else
+#define DECLARE_MUTEX(name) \
+        extern void *_mm_mutex_##name
+#define MUTEX_LOCK(name)
+#define MUTEX_UNLOCK(name)
+#endif
+
+DECLARE_MUTEX(lists);
+DECLARE_MUTEX(vars);
+
+/*========== Replacement funcs */
+
+extern int _mm_strcasecmp (const char *__s1, const char *__s2);
+extern char * _mm_strdup (const char *__s);
+
+/*========== Portable file I/O */
+
+extern MREADER* _mm_new_file_reader(FILE* fp);
+extern void _mm_delete_file_reader(MREADER*);
+
+extern MWRITER* _mm_new_file_writer(FILE *fp);
+extern void _mm_delete_file_writer(MWRITER*);
+
+extern BOOL _mm_FileExists(const CHAR *fname);
+
+#define _mm_write_SBYTE(x,y)    y->Put(y,(int)x)
+#define _mm_write_UBYTE(x,y)    y->Put(y,(int)x)
+
+#define _mm_read_SBYTE(x)       (SBYTE)x->Get(x)
+#define _mm_read_UBYTE(x)       (UBYTE)x->Get(x)
+#define _mm_skip_BYTE(x)        (void)x->Get(x)
+
+#define _mm_write_SBYTES(x,y,z) z->Write(z,(void *)x,y)
+#define _mm_write_UBYTES(x,y,z) z->Write(z,(void *)x,y)
+#define _mm_read_SBYTES(x,y,z)  z->Read(z,(void *)x,y)
+#define _mm_read_UBYTES(x,y,z)  z->Read(z,(void *)x,y)
+
+#define _mm_fseek(x,y,z)        x->Seek(x,y,z)
+#define _mm_ftell(x)            x->Tell(x)
+#define _mm_rewind(x)           _mm_fseek(x,0,SEEK_SET)
+
+#define _mm_eof(x)              x->Eof(x)
+
+extern void _mm_iobase_setcur(MREADER*);
+extern void _mm_iobase_revert(void);
+extern FILE* _mm_fopen(const CHAR *, const CHAR *);
+extern int  _mm_fclose(FILE *);
+extern void _mm_write_string(CHAR*,MWRITER*);
+extern BOOL _mm_read_string (CHAR*,int,MREADER*);
+
+extern SWORD _mm_read_M_SWORD(MREADER*);
+extern SWORD _mm_read_I_SWORD(MREADER*);
+extern UWORD _mm_read_M_UWORD(MREADER*);
+extern UWORD _mm_read_I_UWORD(MREADER*);
+
+extern SLONG _mm_read_M_SLONG(MREADER*);
+extern SLONG _mm_read_I_SLONG(MREADER*);
+extern ULONG _mm_read_M_ULONG(MREADER*);
+extern ULONG _mm_read_I_ULONG(MREADER*);
+
+extern BOOL _mm_read_M_SWORDS(SWORD*,int,MREADER*);
+extern BOOL _mm_read_I_SWORDS(SWORD*,int,MREADER*);
+extern BOOL _mm_read_M_UWORDS(UWORD*,int,MREADER*);
+extern BOOL _mm_read_I_UWORDS(UWORD*,int,MREADER*);
+
+extern BOOL _mm_read_M_SLONGS(SLONG*,int,MREADER*);
+extern BOOL _mm_read_I_SLONGS(SLONG*,int,MREADER*);
+extern BOOL _mm_read_M_ULONGS(ULONG*,int,MREADER*);
+extern BOOL _mm_read_I_ULONGS(ULONG*,int,MREADER*);
+
+extern void _mm_write_M_SWORD(SWORD,MWRITER*);
+extern void _mm_write_I_SWORD(SWORD,MWRITER*);
+extern void _mm_write_M_UWORD(UWORD,MWRITER*);
+extern void _mm_write_I_UWORD(UWORD,MWRITER*);
+
+extern void _mm_write_M_SLONG(SLONG,MWRITER*);
+extern void _mm_write_I_SLONG(SLONG,MWRITER*);
+extern void _mm_write_M_ULONG(ULONG,MWRITER*);
+extern void _mm_write_I_ULONG(ULONG,MWRITER*);
+
+extern void _mm_write_M_SWORDS(SWORD*,int,MWRITER*);
+extern void _mm_write_I_SWORDS(SWORD*,int,MWRITER*);
+extern void _mm_write_M_UWORDS(UWORD*,int,MWRITER*);
+extern void _mm_write_I_UWORDS(UWORD*,int,MWRITER*);
+
+extern void _mm_write_M_SLONGS(SLONG*,int,MWRITER*);
+extern void _mm_write_I_SLONGS(SLONG*,int,MWRITER*);
+extern void _mm_write_M_ULONGS(ULONG*,int,MWRITER*);
+extern void _mm_write_I_ULONGS(ULONG*,int,MWRITER*);
+
+/*========== Samples */
+
+/* This is a handle of sorts attached to any sample registered with
+   SL_RegisterSample.  Generally, this only need be used or changed by the
+   loaders and drivers of mikmod. */
+typedef struct SAMPLOAD {
+    struct SAMPLOAD *next;
+
+    ULONG    length;       /* length of sample (in samples!) */
+    ULONG    loopstart;    /* repeat position (relative to start, in samples) */
+    ULONG    loopend;      /* repeat end */
+    UWORD    infmt,outfmt;
+    int      scalefactor;
+    SAMPLE*  sample;
+    MREADER* reader;
+} SAMPLOAD;
+
+/*========== Sample and waves loading interface */
+
+extern void      SL_HalveSample(SAMPLOAD*,int);
+extern void      SL_Sample8to16(SAMPLOAD*);
+extern void      SL_Sample16to8(SAMPLOAD*);
+extern void      SL_SampleSigned(SAMPLOAD*);
+extern void      SL_SampleUnsigned(SAMPLOAD*);
+extern int       SL_LoadSamples(void);
+extern SAMPLOAD* SL_RegisterSample(SAMPLE*,int,MREADER*);
+extern int       SL_Load(void*,SAMPLOAD*,ULONG);
+extern BOOL      SL_Init(SAMPLOAD*);
+extern void      SL_Exit(SAMPLOAD*);
+
+/*========== Internal module representation (UniMod) interface */
+
+/* number of notes in an octave */
+#define OCTAVE 12
+
+extern void   UniSetRow(UBYTE*);
+extern UBYTE  UniGetByte(void);
+extern UWORD  UniGetWord(void);
+extern UBYTE* UniFindRow(UBYTE*,UWORD);
+extern void   UniSkipOpcode(void);
+extern void   UniReset(void);
+extern void   UniWriteByte(UBYTE);
+extern void   UniWriteWord(UWORD);
+extern void   UniNewline(void);
+extern UBYTE* UniDup(void);
+extern BOOL   UniInit(void);
+extern void   UniCleanup(void);
+extern void   UniEffect(UWORD,UWORD);
+#define UniInstrument(x)   UniEffect(UNI_INSTRUMENT,x)
+#define UniNote(x)         UniEffect(UNI_NOTE,x)
+extern void   UniPTEffect(UBYTE,UBYTE);
+extern void   UniVolEffect(UWORD,UBYTE);
+
+/*========== Module Commands */
+
+enum {
+ /* Simple note */
+    UNI_NOTE = 1,
+ /* Instrument change */
+    UNI_INSTRUMENT,
+ /* Protracker effects */
+    UNI_PTEFFECT0,  /* arpeggio */
+    UNI_PTEFFECT1,  /* porta up */
+    UNI_PTEFFECT2,  /* porta down */
+    UNI_PTEFFECT3,  /* porta to note */
+    UNI_PTEFFECT4,  /* vibrato */
+    UNI_PTEFFECT5,  /* dual effect 3+A */
+    UNI_PTEFFECT6,  /* dual effect 4+A */
+    UNI_PTEFFECT7,  /* tremolo */
+    UNI_PTEFFECT8,  /* pan */
+    UNI_PTEFFECT9,  /* sample offset */
+    UNI_PTEFFECTA,  /* volume slide */
+    UNI_PTEFFECTB,  /* pattern jump */
+    UNI_PTEFFECTC,  /* set volume */
+    UNI_PTEFFECTD,  /* pattern break */
+    UNI_PTEFFECTE,  /* extended effects */
+    UNI_PTEFFECTF,  /* set speed */
+ /* Scream Tracker effects */
+    UNI_S3MEFFECTA, /* set speed */
+    UNI_S3MEFFECTD, /* volume slide */
+    UNI_S3MEFFECTE, /* porta down */
+    UNI_S3MEFFECTF, /* porta up */
+    UNI_S3MEFFECTI, /* tremor */
+    UNI_S3MEFFECTQ, /* retrig */
+    UNI_S3MEFFECTR, /* tremolo */
+    UNI_S3MEFFECTT, /* set tempo */
+    UNI_S3MEFFECTU, /* fine vibrato */
+    UNI_KEYOFF,     /* note off */
+ /* Fast Tracker effects */
+    UNI_KEYFADE,    /* note fade */
+    UNI_VOLEFFECTS, /* volume column effects */
+    UNI_XMEFFECT4,  /* vibrato */
+    UNI_XMEFFECT6,  /* dual effect 4+A */
+    UNI_XMEFFECTA,  /* volume slide */
+    UNI_XMEFFECTE1, /* fine porta up */
+    UNI_XMEFFECTE2, /* fine porta down */
+    UNI_XMEFFECTEA, /* fine volume slide up */
+    UNI_XMEFFECTEB, /* fine volume slide down */
+    UNI_XMEFFECTG,  /* set global volume */
+    UNI_XMEFFECTH,  /* global volume slide */
+    UNI_XMEFFECTL,  /* set envelope position */
+    UNI_XMEFFECTP,  /* pan slide */
+    UNI_XMEFFECTX1, /* extra fine porta up */
+    UNI_XMEFFECTX2, /* extra fine porta down */
+ /* Impulse Tracker effects */
+    UNI_ITEFFECTG,  /* porta to note */
+    UNI_ITEFFECTH,  /* vibrato */
+    UNI_ITEFFECTI,  /* tremor (xy not incremented) */
+    UNI_ITEFFECTM,  /* set channel volume */
+    UNI_ITEFFECTN,  /* slide / fineslide channel volume */
+    UNI_ITEFFECTP,  /* slide / fineslide channel panning */
+    UNI_ITEFFECTT,  /* slide tempo */
+    UNI_ITEFFECTU,  /* fine vibrato */
+    UNI_ITEFFECTW,  /* slide / fineslide global volume */
+    UNI_ITEFFECTY,  /* panbrello */
+    UNI_ITEFFECTZ,  /* resonant filters */
+    UNI_ITEFFECTS0,
+ /* UltraTracker effects */
+    UNI_ULTEFFECT9, /* Sample fine offset */
+ /* OctaMED effects */
+    UNI_MEDSPEED,
+    UNI_MEDEFFECTF1,/* play note twice */
+    UNI_MEDEFFECTF2,/* delay note */
+    UNI_MEDEFFECTF3,/* play note three times */
+ /* Oktalyzer effects */
+    UNI_OKTARP,     /* arpeggio */
+
+    UNI_LAST
+};
+
+extern const UWORD unioperands[UNI_LAST];
+
+/* IT / S3M Extended SS effects: */
+enum {
+    SS_GLISSANDO = 1,
+    SS_FINETUNE,
+    SS_VIBWAVE,
+    SS_TREMWAVE,
+    SS_PANWAVE,
+    SS_FRAMEDELAY,
+    SS_S7EFFECTS,
+    SS_PANNING,
+    SS_SURROUND,
+    SS_HIOFFSET,
+    SS_PATLOOP,
+    SS_NOTECUT,
+    SS_NOTEDELAY,
+    SS_PATDELAY
+};
+
+/* IT Volume column effects */
+enum {
+    VOL_VOLUME = 1,
+    VOL_PANNING,
+    VOL_VOLSLIDE,
+    VOL_PITCHSLIDEDN,
+    VOL_PITCHSLIDEUP,
+    VOL_PORTAMENTO,
+    VOL_VIBRATO
+};
+
+/* IT resonant filter information */
+
+#define UF_MAXMACRO     0x10
+#define UF_MAXFILTER    0x100
+
+#define FILT_CUT        0x80
+#define FILT_RESONANT   0x81
+
+typedef struct FILTER {
+    UBYTE filter,inf;
+} FILTER;
+
+/*========== Instruments */
+
+/* Instrument format flags */
+#define IF_OWNPAN       1
+#define IF_PITCHPAN     2
+
+/* Envelope flags: */
+#define EF_ON           1
+#define EF_SUSTAIN      2
+#define EF_LOOP         4
+#define EF_VOLENV       8
+
+/* New Note Action Flags */
+#define NNA_CUT         0
+#define NNA_CONTINUE    1
+#define NNA_OFF         2
+#define NNA_FADE        3
+
+#define NNA_MASK        3
+
+#define DCT_OFF         0
+#define DCT_NOTE        1
+#define DCT_SAMPLE      2
+#define DCT_INST        3
+
+#define DCA_CUT         0
+#define DCA_OFF         1
+#define DCA_FADE        2
+
+#define KEY_KICK        0
+#define KEY_OFF         1
+#define KEY_FADE        2
+#define KEY_KILL        (KEY_OFF|KEY_FADE)
+
+#define KICK_ABSENT     0
+#define KICK_NOTE       1
+#define KICK_KEYOFF     2
+#define KICK_ENV        4
+
+#define AV_IT           1   /* IT vs. XM vibrato info */
+
+/*========== Playing */
+
+#define POS_NONE        (-2)    /* no loop position defined */
+
+#define LAST_PATTERN    (UWORD)(-1) /* special ``end of song'' pattern */
+
+typedef struct ENVPR {
+    UBYTE  flg;     /* envelope flag */
+    UBYTE  pts;     /* number of envelope points */
+    UBYTE  susbeg;  /* envelope sustain index begin */
+    UBYTE  susend;  /* envelope sustain index end */
+    UBYTE  beg;     /* envelope loop begin */
+    UBYTE  end;     /* envelope loop end */
+    SWORD  p;       /* current envelope counter */
+    UWORD  a;       /* envelope index a */
+    UWORD  b;       /* envelope index b */
+    ENVPT* env;     /* envelope points */
+} ENVPR;
+
+typedef struct MP_CHANNEL {
+    INSTRUMENT* i;
+    SAMPLE *s;
+    UBYTE  sample;      /* which sample number */
+    UBYTE  note;        /* the audible note as heard, direct rep of period */
+    SWORD  outvolume;   /* output volume (vol + sampcol + instvol) */
+    SBYTE  chanvol;     /* channel's "global" volume */
+    UWORD  fadevol;     /* fading volume rate */
+    SWORD  panning;     /* panning position */
+    UBYTE  kick;        /* if true = sample has to be restarted */
+    UWORD  period;      /* period to play the sample at */
+    UBYTE  nna;         /* New note action type + master/slave flags */
+
+    UBYTE  volflg;      /* volume envelope settings */
+    UBYTE  panflg;      /* panning envelope settings */
+    UBYTE  pitflg;      /* pitch envelope settings */
+
+    UBYTE  keyoff;      /* if true = fade out and stuff */
+    SWORD  handle;      /* which sample-handle */
+    UBYTE  notedelay;   /* (used for note delay) */
+    SLONG  start;       /* The starting byte index in the sample */
+} MP_CHANNEL;
+
+typedef struct MP_CONTROL {
+    struct MP_CHANNEL   main;
+
+    struct MP_VOICE*    slave;  /* Audio Slave of current effects control channel */
+
+    UBYTE   slavechn;   /* Audio Slave of current effects control channel */
+    UBYTE   muted;      /* if set, channel not played */
+    UWORD   ultoffset;  /* fine sample offset memory */
+    UBYTE   anote;      /* the note that indexes the audible */
+    UBYTE   oldnote;
+    SWORD   ownper;
+    SWORD   ownvol;
+    UBYTE   dca;        /* duplicate check action */
+    UBYTE   dct;        /* duplicate check type */
+    UBYTE*  row;        /* row currently playing on this channel */
+    SBYTE   retrig;     /* retrig value (0 means don't retrig) */
+    ULONG   speed;      /* what finetune to use */
+    SWORD   volume;     /* amiga volume (0 t/m 64) to play the sample at */
+
+    SWORD   tmpvolume;  /* tmp volume */
+    UWORD   tmpperiod;  /* tmp period */
+    UWORD   wantedperiod;/* period to slide to (with effect 3 or 5) */
+
+    UBYTE   arpmem;     /* arpeggio command memory */
+    UBYTE   pansspd;    /* panslide speed */
+    UWORD   slidespeed;
+    UWORD   portspeed;  /* noteslide speed (toneportamento) */
+
+    UBYTE   s3mtremor;  /* s3m tremor (effect I) counter */
+    UBYTE   s3mtronof;  /* s3m tremor ontime/offtime */
+    UBYTE   s3mvolslide;/* last used volslide */
+    SBYTE   sliding;
+    UBYTE   s3mrtgspeed;/* last used retrig speed */
+    UBYTE   s3mrtgslide;/* last used retrig slide */
+
+    UBYTE   glissando;  /* glissando (0 means off) */
+    UBYTE   wavecontrol;
+
+    SBYTE   vibpos;     /* current vibrato position */
+    UBYTE   vibspd;     /* "" speed */
+    UBYTE   vibdepth;   /* "" depth */
+
+    SBYTE   trmpos;     /* current tremolo position */
+    UBYTE   trmspd;     /* "" speed */
+    UBYTE   trmdepth;   /* "" depth */
+
+    UBYTE   fslideupspd;
+    UBYTE   fslidednspd;
+    UBYTE   fportupspd; /* fx E1 (extra fine portamento up) data */
+    UBYTE   fportdnspd; /* fx E2 (extra fine portamento dn) data */
+    UBYTE   ffportupspd;/* fx X1 (extra fine portamento up) data */
+    UBYTE   ffportdnspd;/* fx X2 (extra fine portamento dn) data */
+
+    ULONG   hioffset;   /* last used high order of sample offset */
+    UWORD   soffset;    /* last used low order of sample-offset (effect 9) */
+
+    UBYTE   sseffect;   /* last used Sxx effect */
+    UBYTE   ssdata;     /* last used Sxx data info */
+    UBYTE   chanvolslide;/* last used channel volume slide */
+
+    UBYTE   panbwave;   /* current panbrello waveform */
+    UBYTE   panbpos;    /* current panbrello position */
+    SBYTE   panbspd;    /* "" speed */
+    UBYTE   panbdepth;  /* "" depth */
+
+    UWORD   newsamp;    /* set to 1 upon a sample / inst change */
+    UBYTE   voleffect;  /* Volume Column Effect Memory as used by IT */
+    UBYTE   voldata;    /* Volume Column Data Memory */
+
+    SWORD   pat_reppos; /* patternloop position */
+    UWORD   pat_repcnt; /* times to loop */
+} MP_CONTROL;
+
+/* Used by NNA only player (audio control.  AUDTMP is used for full effects
+   control). */
+typedef struct MP_VOICE {
+    struct MP_CHANNEL   main;
+
+    ENVPR   venv;
+    ENVPR   penv;
+    ENVPR   cenv;
+
+    UWORD   avibpos;    /* autovibrato pos */
+    UWORD   aswppos;    /* autovibrato sweep pos */
+
+    ULONG   totalvol;   /* total volume of channel (before global mixings) */
+
+    BOOL    mflag;
+    SWORD   masterchn;
+    UWORD   masterperiod;
+
+    MP_CONTROL* master; /* index of "master" effects channel */
+} MP_VOICE;
+
+/*========== Loaders */
+
+typedef struct MLOADER {
+    struct MLOADER*     next;
+    CHAR*  type;
+    CHAR*  version;
+    BOOL  (*Init)(void);
+    BOOL  (*Test)(void);
+    BOOL  (*Load)(BOOL);
+    void  (*Cleanup)(void);
+    CHAR* (*LoadTitle)(void);
+} MLOADER;
+
+/* internal loader variables */
+extern MREADER* modreader;
+extern MODULE  of;                  /* static unimod loading space */
+extern const UWORD finetune[16];
+extern const UWORD npertab[7*OCTAVE];/* used by the original MOD loaders */
+
+extern SBYTE   remap[UF_MAXCHAN];   /* for removing empty channels */
+extern UBYTE*  poslookup;           /* lookup table for pattern jumps after
+                                       blank pattern removal */
+extern UWORD   poslookupcnt;
+extern UWORD*  origpositions;
+
+extern BOOL    filters;             /* resonant filters in use */
+extern UBYTE   activemacro;         /* active midi macro number for Sxx */
+extern UBYTE   filtermacros[UF_MAXMACRO];    /* midi macro settings */
+extern FILTER  filtersettings[UF_MAXFILTER]; /* computed filter settings */
+
+extern int*    noteindex;
+
+/*========== Internal loader interface */
+
+extern BOOL   ReadComment(UWORD);
+extern BOOL   ReadLinedComment(UWORD,UWORD);
+extern BOOL   AllocPositions(int);
+extern BOOL   AllocPatterns(void);
+extern BOOL   AllocTracks(void);
+extern BOOL   AllocInstruments(void);
+extern BOOL   AllocSamples(void);
+extern CHAR*  DupStr(CHAR*, UWORD, BOOL);
+
+/* loader utility functions */
+extern int*   AllocLinear(void);
+extern void   FreeLinear(void);
+extern int    speed_to_finetune(ULONG,int);
+extern void   S3MIT_ProcessCmd(UBYTE,UBYTE,unsigned int);
+extern void   S3MIT_CreateOrders(BOOL);
+
+/* flags for S3MIT_ProcessCmd */
+#define S3MIT_OLDSTYLE  1   /* behave as old scream tracker */
+#define S3MIT_IT        2   /* behave as impulse tracker */
+#define S3MIT_SCREAM    4   /* enforce scream tracker specific limits */
+
+/* used to convert c4spd to linear XM periods (IT and IMF loaders). */
+extern UWORD  getlinearperiod(UWORD,ULONG);
+extern ULONG  getfrequency(UWORD,ULONG);
+
+/* loader shared data */
+#define STM_NTRACKERS   3
+extern const CHAR *STM_Signatures[STM_NTRACKERS];
+
+/*========== Player interface */
+
+extern int    Player_Init(MODULE*);
+extern void   Player_Exit(MODULE*);
+extern void   Player_HandleTick(void);
+
+/*========== Drivers */
+
+/* max. number of handles a driver has to provide. (not strict) */
+#define MAXSAMPLEHANDLES    384
+
+/* These variables can be changed at ANY time and results will be immediate */
+extern UWORD md_bpm;         /* current song / hardware BPM rate */
+
+/* Variables below can be changed via MD_SetNumVoices at any time. However, a
+   call to MD_SetNumVoicess while the driver is active will cause the sound to
+   skip slightly. */
+extern UBYTE md_numchn;      /* number of song + sound effects voices */
+extern UBYTE md_sngchn;      /* number of song voices */
+extern UBYTE md_sfxchn;      /* number of sound effects voices */
+extern UBYTE md_hardchn;     /* number of hardware mixed voices */
+extern UBYTE md_softchn;     /* number of software mixed voices */
+
+/* This is for use by the hardware drivers only.  It points to the registered
+   tickhandler function. */
+extern void (*md_player)(void);
+
+extern SWORD  MD_SampleLoad(SAMPLOAD*,int);
+extern void   MD_SampleUnload(SWORD);
+extern ULONG  MD_SampleSpace(int);
+extern ULONG  MD_SampleLength(int,SAMPLE*);
+
+/* uLaw conversion */
+extern void unsignedtoulaw(char *,int);
+
+/* Parameter extraction helper */
+extern CHAR  *MD_GetAtom(CHAR*, CHAR*, BOOL);
+
+/* Internal software mixer stuff */
+extern void VC_SetupPointers(void);
+extern int  VC1_Init(void);
+extern int  VC2_Init(void);
+
+#if (MIKMOD_UNIX)
+/* POSIX helper functions */
+extern BOOL MD_Access(CHAR *);
+extern int  MD_DropPrivileges(void);
+#endif
+
+/* Macro to define a missing driver, yet allowing binaries to dynamically link
+   with the library without missing symbol errors */
+#define MISSING(a) MDRIVER a = { NULL, NULL, NULL, 0, 0 }
+
+/*========== Prototypes for non-MT safe versions of some public functions */
+
+extern void _mm_registerdriver(struct MDRIVER*);
+extern void _mm_registerloader(struct MLOADER*);
+extern BOOL MikMod_Active_internal(void);
+extern void MikMod_DisableOutput_internal(void);
+extern int  MikMod_EnableOutput_internal(void);
+extern void MikMod_Exit_internal(void);
+extern int  MikMod_SetNumVoices_internal(int,int);
+extern void Player_Exit_internal(MODULE*);
+extern void Player_Stop_internal(void);
+extern BOOL Player_Paused_internal(void);
+extern void Sample_Free_internal(SAMPLE*);
+extern void Voice_Play_internal(SBYTE,SAMPLE*,ULONG);
+extern void Voice_SetFrequency_internal(SBYTE,ULONG);
+extern void Voice_SetPanning_internal(SBYTE,ULONG);
+extern void Voice_SetVolume_internal(SBYTE,UWORD);
+extern void Voice_Stop_internal(SBYTE);
+extern BOOL Voice_Stopped_internal(SBYTE);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* ex:set ts=4: */
diff --git a/sources/packages/m/smpeg/Makefile b/sources/packages/m/smpeg/Makefile
new file mode 100644
index 000000000..7ed96301c
--- /dev/null
+++ b/sources/packages/m/smpeg/Makefile
@@ -0,0 +1,47 @@
+
+COMPONENT_TARGETS = $(HARDWARE_NOARCH)
+
+
+include ../../../../build-system/constants.mk
+
+
+url         = $(DOWNLOAD_SERVER)/sources/packages/m/smpeg
+
+versions    = 0.4.5
+pkgname     = smpeg
+suffix      = tar.gz
+
+tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
+sha1s       = $(addsuffix .sha1sum, $(tarballs))
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s)
+
+
+include ../../../../build-system/core.mk
+
+
+.PHONY: download_clean
+
+
+$(tarballs):
+	@echo -e "\n======= Downloading source tarballs =======" ; \
+	 for tarball in $(tarballs) ; do \
+	   echo "$(url)/$$tarball" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) -i & \
+	 done ; wait
+
+$(sha1s): $(tarballs)
+	@for sha in $@ ; do \
+	   echo -e "\n======= Downloading '$$sha' signature =======\n" ; \
+	   echo "$(url)/$$sha" | xargs -n 1 -P 100 wget $(WGET_OPTIONS) -i & wait %1 ; \
+	   touch $$sha ; \
+	   echo -e "\n======= Check the '$$sha' sha1sum =======\n" ; \
+	   sha1sum --check $$sha ; ret="$$?" ; \
+	   if [ "$$ret" == "1" ]; then \
+	     echo -e "\n======= ERROR: Bad '$$sha' sha1sum =======\n" ; \
+	     exit 1 ; \
+	   fi ; \
+	 done
+
+download_clean:
+	@rm -f $(tarballs) $(sha1s)