#!/usr/bin/env beesh

# BEE_VERSION glib-1.2.10-2

## this file was created by bee init and should be executed to build a
## bee-package. (Additional hints are located at the end of this file.)

###############################################################################
## The source URL(s) define the location of the sources that will be
## downloaded. Version variables may be used to simplify reuse of this bee-file.

SRCURL[0]="https://ftp.gtk.org/pub/gtk/v${PKGVERSION[2]}/glib-${PKGVERSION}.tar.gz"

###############################################################################
## Add URLs/pathes to patch files to the PATCHURL array.
## The sources will be patched in the order of the array.

# PATCHURL+=()

PATCHURL+=("/src/mariux/md5repo/81bd6526dcb780444b41d916a0d2197b/glib-1.2.10-isowarning.patch.gz")
PATCHURL+=("/src/mariux/md5repo/7d1debeec4fe98902cd145d7401694cc/glib-1.2.10-gcc34.patch.gz")
PATCHURL+=("/src/mariux/md5repo/920ae88a61bac9e5bcf0f8df6e504924/glib-1.2.10-underquoted.patch.gz")
PATCHURL+=("/src/mariux/md5repo/27efdfc73a7d8790965fdeb13e9ec583/glib-1.2.10-no_undefined.patch.gz")
PATCHURL+=("/src/mariux/md5repo/0d1d3ccfadfc653899948237989ffb60/glib-1.2.10-multilib.patch.gz")
PATCHURL+=("/src/mariux/md5repo/cf7a430ef31dcb901457bfab051f7d2e/glib-1.2.10-unused-dep.patch.gz")
PATCHURL+=("/src/mariux/md5repo/78d4e99209c40e7654ae1808a3c29773/glib-1.2.10-autotools.patch.gz")
PATCHURL+=("/src/mariux/md5repo/07867923b21680ea1a0c8fd85cc8f6b8/glib-1.2.10-format.patch.gz")
PATCHURL+=("/src/mariux/md5repo/a4eae0c33d4c0cc861d756c3288039a5/glib-1.2.10-gcc5.patch.gz")
PATCHURL+=("/src/mariux/md5repo/077b4dadf1e272ad0e9b7b6736941941/glib-1.2.10-gcc9.patch.gz")

###############################################################################
## Uncomment the next statement, if the software may not be able to be built
## outside the source directory and needs to be built inside the source
## directory.

# build_in_sourcedir

###############################################################################
## bee cannot detect buildtypes specified in subdirectories.
## Sometimes packages "hide" the real sources in a subdirectory named
## 'src' or 'cmake' or ..
## use 'sourcesubdir_append' to specify this directory if known.

# sourcesubdir_append src


###############################################################################
## Change the default (auto-detected) steps to
## extract, patch, configure/setup, build and install the software.
## Make sure the mee_install function does install everything to the
## image directory "${D}"

#mee_extract() {
#    bee_extract "${@}"
#}

mee_patch() {
    bee_patch "${@}"
    cp -p /usr/share/automake-1.15/config.{guess,sub} .
}

export CFLAGS='-O2 -fPIC'
#mee_configure() {
#    bee_configure
#}

mee_build() {
    bee_build LIBTOOL=/usr/bin/libtool
}

#mee_install() {
#    bee_install
#}
## by default this may be 'make install DESTDIR="${D}"'

mee_install_post() {
    patchelf --remove-rpath ${D}/usr/lib/libgmodule-1.2.so.0.0.10
    patchelf --remove-rpath ${D}/usr/lib/libgthread-1.2.so.0.0.10
    chmod -v 0755 ${D}/usr/lib/libgmodule-1.2.so.0.0.10
}

###############################################################################
##
## Additional hints:
##
## The name of this bee-file should follow the following naming convention:
##     pkgname-pkgversion-pkgrevision.bee
##
## You may remove all comments as long as SRCURL[0] is set.
##
## Everything in this file will be executed in a bash environment.
##
## Build the package by executing
##     './pkg-version-N.bee' or
##     'beesh ./pkg-version-N.bee'
##
## see http://beezinga.org/
##