code:
# Build recipe for FriBidi.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=fribidi
version=1.0.11
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://github.com/fribidi/fribidi/releases/download/v${version}/$tarname

description="
A Free Implementation of the Unicode Bidirectional Algorithm.

This library implements the Unicode BiDirectional algorithm, which
is needed in order to support right-to-left languages such as Arabic
and Hebrew.  It is used in display software like KDE's SVG modules.
"

homepage=https://github.com/fribidi/fribidi/
license=LGPLv2.1

docs="AUTHORS ChangeLog COPYING NEWS README THANKS TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --infodir=$infodir \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} V=1 DESTDIR="$destdir" install-strip

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/fribidi/recipe


code:
# Updating gdk-pixbuf loaders
gdk-pixbuf-query-loaders --update-cache

repo_name: dustdfg/dragora

path: recipes/x-libs/gdk-pixbuf/post-install

license: mit


code:
# Build recipe for Gdk Pixbuf.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=gdk-pixbuf
version=2.42.6
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://download.gnome.org/sources/gdk-pixbuf/${versioN%.*}/$tarname"

description="
An image loading library.

The library provides image loading and saving facilities, fast scaling
and compositing of pixbufs, simple animation loading (i.e.
animated GIFs), and rendering the libart image buffer.
"

homepage=https://developer.gnome.org/gdk-pixbuf/stable/
license=LGPLv2+

# Source documentation
docs="COPYING NEWS"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir=lib${libSuffix} \
     --mandir=$mandir \
     --buildtype=release \
     --strip \
     --wrap-mode=nofallback \
     -Dman=true \
     -Dinstalled_tests=false \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/gdk-pixbuf/recipe


code:
# Build recipe for giflib.
#
# Copyright (C) 2019, 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=giflib
version=5.2.1
release=3

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://downloads.sourceforge.net/project/giflib/$tarname

description="
Main library for reading and writing GIF files.

The giflib package contains libraries for reading and writing GIFs
as well as programs for converting and working with GIF files.
"

homepage=https://giflib.sourceforge.net/
license="MIT Expat variant"

docs="COPYING ChangeLog NEWS README TODO"
docsdir="${docdir}/${program}-${version}"

# Limit parallel jobs to '1' for this build
jobs=1

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Apply patches from Debian (Thanks!)
    while read -r line
    do
        patch -p1 < "${worktree}/patches/giflib/${line}"
    done < "${worktree}/patches/giflib/series"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    make -j${jobs} V=1 CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS -fPIC" LDFLAGS="$QILDFLAGS"
    make -j${jobs} PREFIX=/usr LIBDIR=/usr/lib${libSuffix} \
                   DESTDIR="$destdir" install

    # Comment the following line if you want to preserve the static lib
    rm -f "${destdir}/usr/lib${libSuffix}/libgif.a"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/giflib/recipe


code:
echo "Updating ICON cache: gtk-update-icon-cache -q -f -i usr/share/icons/gnome"
chroot "$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i usr/share/icons/gnome 2> /dev/null


code:
# Build recipe for gnome-icon-theme-symbolic.
#
# Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=gnome-icon-theme-symbolic
version=3.12.0
arch=noarch
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://ftp.gnome.org/pub/gnome/sources/gnome-icon-theme-symbolic/${version%.*}/$tarname"

description="
The GNOME icon theme (symbolic).

The gnome-icon-theme-symbolic package contains
symbolic icons for the default GNOME icon theme.
"

homepage=https://www.gnome.org
license="CC-BY-SA 3.0"

# Source documentation
docs="AUTHORS COPYING NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure $configure_args --docdir=$docsdir

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
    chmod 644 "${destdir}/${docsdir}"/*
}


code:
# Build recipe for gnome-icon-theme.
#
# Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=gnome-icon-theme
version=3.12.0
arch=noarch
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://ftp.gnome.org/pub/gnome/sources/gnome-icon-theme/${version%.*}/$tarname"

description="
The GNOME icon theme.

The gnome-icon-theme package contains an assortment of
non-scalable icons of different sizes and themes.
"

homepage=https://www.gnome.org
license="LGPLv3+, CC-BY-SA 3.0"

# Source documentation
docs="AUTHORS COPYING* NEWS README TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure $configure_args --docdir=$docsdir --disable-nls

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
    chmod 644 "${destdir}/${docsdir}"/*
}

path: recipes/x-libs/gnome-icon-theme/recipe


code:
echo "Updating ICON cache: gtk-update-icon-cache -q -f -i usr/share/icons/HighContrast"
chroot "$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i usr/share/icons/HighContrast 2> /dev/null


code:
# Build recipe for gnome-themes-extra.
#
# Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=gnome-themes-extra
version=3.28
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://ftp.gnome.org/pub/gnome/sources/gnome-themes-extra/${version%.*}/$tarname"

description="
GNOME extra themes.

The GNOME Themes extra package, formerly known as GNOME Themes
Standard, contains various components of the default GNOME theme.
"

homepage=https://www.gnome.org
license=LGPLv2.1

# Source documentation
docs="ChangeLog LICENSE NEWS README.md"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --docdir=$docsdir \
     --disable-nls \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install-strip

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
    chmod 644 "${destdir}/${docsdir}"/*
}


code:
# Build recipe for GObject Introspection.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=gobject-introspection
version=1.70.0
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://download.gnome.org/sources/gobject-introspection/${version%.*}/$tarname"

description="
A layer between C libraries (using GObject) and language bindings.

GObject Introspection is a project for providing machine readable
introspection data of the API of C libraries.  This introspection data
can be used for automatic code generation for bindings, API
verification, and documentation generation.
"

homepage=https://wiki.gnome.org/Projects/GObjectIntrospection/
license="GPLv2+ | LGPLv2+, some MIT code in giscanner/"

# Copy documentation
docs="COPYING* NEWS TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Apply a patch that allows building with Meson version 0.61 or above
    # Thanks to "Beyond Linux From Scratch"
    patch -Np1 -i "${worktree}/patches/gobject-introspection/gobject-introspection-1.70.0-build_fix-1.patch"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir /usr/lib${libSuffix} \
     --buildtype=release \
     --strip \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}


code:
# Update GTK+-2.0 modules cache
chroot "$rootdir" gtk-query-immodules-2.0 --update-cache 2> /dev/null

# Update GDK pixbuf loaders cache, just in case
chroot "$rootdir" /usr/bin/gdk-pixbuf-query-loaders --update-cache > /dev/null 2>&1


code:
# Build recipe for GTK+2.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (C) 2018-2019, 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=gtk+
version=2.24.33
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

# Difference package name with other series
pkgname=gtk2

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://download.gnome.org/sources/gtk+/${version%.*}/$tarname"

description="
A multi-platform toolkit for creating graphical user interfaces.

Offering a complete set of widgets, GTK+ is suitable for projects
ranging from small one-off projects to complete application suites.
"

homepage=https://www.gtk.org
license=GPLv2+

# Copy documentation
docs="AUTHORS COPYING NEWS README* HACKING"
docsdir="${docdir}/${pkgname}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --enable-static=no \
     --enable-shared=yes \
     --enable-debug=no \
     --enable-introspection=yes \
     --enable-xkb=yes \
     --with-xinput=yes \
     --disable-glibtest \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1 \
     RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false

    make -j${jobs} \
     RUN_QUERY_IMMODULES_TEST=false RUN_QUERY_LOADER_TEST=false \
     DESTDIR="$destdir" install-strip

    # Add a basic configuration
cat << EOF > "${destdir}/etc/gtk-2.0/gtkrc"
gtk-icon-theme-name = "hicolor"

EOF

    # Manage dot new file(s) via graft(8)
    touch "${destdir}/etc/gtk-2.0/.graft-config"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}


code:
# Update GTK+-3.0 modules cache
gtk-query-immodules-3.0 --update-cache

# Update GLIB schemas
for schema_directory in /usr/local/share/glib* /usr/share/glib*
do
    test -d "$schema_directory" || continue;
    glib-compile-schemas "${schema_directory}"/schemas
done
unset schema_directory

# Update GDK pixbuf loaders cache, just in case
chroot . /usr/bin/gdk-pixbuf-query-loaders --update-cache > /dev/null 2>&1

echo "Updating desktop database: update-desktop-database -q usr/share/applications"
chroot "$rootdir" /usr/bin/update-desktop-database -q usr/share/applications 2> /dev/null

echo "Updating ICON cache: gtk-update-icon-cache -q -f -i usr/share/icons/hicolor"
chroot "$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i usr/share/icons/hicolor 2> /dev/null


code:
# Build recipe for GTK+3.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=gtk+
version=3.24.31
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

# Difference package name with other series
pkgname=gtk3

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="
  https://ftp.gnome.org/pub/gnome/sources/gtk+/${version%.*}/$tarname
  ftp://ftp.acc.umu.se/pub/gnome/sources/gtk+/${version%.*}/$tarname
"

description="
The version 3 of the GTK+ toolkit.

The GTK+3 package contains libraries used for creating graphical user
interfaces for applications.
"

homepage=https://www.gtk.org
license=GPLv2+

# Copy documentation
docs="AUTHORS COPYING NEWS README* HACKING"
docsdir="${docdir}/${pkgname}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    # TODO: cups: -Dprint_backends="file,lpr,cups"

    CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir=lib${libSuffix} \
     --mandir=$mandir \
     --buildtype=release \
     --strip \
     -Dcolord=no \
     -Dgtk_doc=false \
     -Dman=true \
     -Dx11_backend=true \
     -Dbroadway_backend=true \
     -Dwayland_backend=false \
     -Dxinerama=yes \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Add a basic configuration
cat << EOF > "${destdir}/etc/gtk-3.0/gtkrc"
gtk-theme-name = "gnome"

EOF

    # Manage dot new file(s) via graft(8)
    touch "${destdir}/etc/gtk-3.0/.graft-config"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}


code:
# Build recipe for HarfBuzz.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=harfbuzz
version=3.3.1
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="
  https://github.com/harfbuzz/harfbuzz/releases/download/${version}/$tarname
  https://www.freedesktop.org/software/harfbuzz/release/$tarname
"

description="
An OpenType text shaping engine.

The harfbuzz package contains an OpenType text shaping engine.
"

homepage=https://www.freedesktop.org/wiki/Software/HarfBuzz/
license=BSD

docs="AUTHORS COPYING NEWS README THANKS TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    mkdir BUILD
    cd BUILD

    CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir=lib${libSuffix} \
     --mandir=$mandir \
     --buildtype=release \
     --strip \
     -Dbenchmark=disabled \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/harfbuzz/recipe


code:
echo "Updating ICON cache: gtk-update-icon-cache -q -f -i usr/share/icons/hicolor"
chroot "$rootdir" /usr/bin/gtk-update-icon-cache -q -f -i usr/share/icons/hicolor 2> /dev/null


code:
# Build recipe for hicolor-icon-theme.
#
# Copyright (c) 2018 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=hicolor-icon-theme
version=0.17
arch=noarch
release=2

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://icon-theme.freedesktop.org/releases/$tarname

description="
Icon theme specification.

The hicolor-icon-theme package contains a default fallback theme
for implementations of the icon theme specification.
"

homepage=https://icon-theme.freedesktop.org
license=GPLv2+

# Source documentation
docs="COPYING ChangeLog NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure $configure_args

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
    chmod 644 "${destdir}/${docsdir}"/*
}


code:
# Build recipe for icon-naming-utils.
#
# Copyright (C) 2019, 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=icon-naming-utils
version=0.8.90
arch=noarch
release=2

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=http://tango.freedesktop.org/releases/$tarname

description="
Perl script used for the Icon Naming Specification.

icon-naming-utils is a script for maintaining backwards compatibility with
current desktop icon themes, while migrating to the names specified in the
Icon Naming Specification:

https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-
latest.html
"

homepage=https://tango.freedesktop.org
license=GPLv2+

docs="AUTHORS COPYING NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Apply a patch from Fedora to correct the installation paths and .pc
    patch -p1 < "${worktree}/patches/icon-naming-utils/icon-naming-utils-0.8.7-paths.patch"

    autoreconf

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure $configure_args

    make -j${jobs} DESTDIR="$destdir" install

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/icon-naming-utils/recipe


code:
# Build recipe for imath.
#
# Copyright (c) 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=imath
version=3.1.4
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://github.com/AcademySoftwareFoundation/Imath/archive/v${version}/$tarname

description="
A C++ and Python library of 2D and 3D vector, matrix for computer graphics.

Imath is a basic, light-weight, and efficient C++ representation of 2D and
3D vectors and matrices and other simple but useful mathematical objects,
functions, and data types common in computer graphics applications,
including the half 16-bit floating-point type.

Imath also includes optional Python bindings for all types and functions,
including optimized implementations of vector and matrix arrays.
"

homepage=https://www.openexr.com
license="BSD 3-clause"

# Source documentation
docs="CHANGES.md CODE_OF_CONDUCT.md CONTRIB* LICENSE.md README.md SECURITY.md"
docsdir="${docdir}/${program}-${version}"

# The source has a custom directory
srcdir=Imath-${version}

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    cmake \
     -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS"   \
     -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS"     \
     -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"  \
     -DCMAKE_INSTALL_PREFIX=/usr                      \
     -DCMAKE_INSTALL_LIBDIR=/usr/lib${libSuffix}      \
     -DCMAKE_INSTALL_MANDIR=$mandir                   \
     -DCMAKE_INSTALL_DOCDIR=$docsdir                  \
     -DCMAKE_BUILD_TYPE=Release                       \
     -DCMAKE_VERBOSE_MAKEFILE=ON                      \
     -DCMAKE_SKIP_INSTALL_RPATH=YES                   \
     -DPYTHON=ON                                      \
     -G Ninja ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    cd ..

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/imath/recipe


code:
# Build recipe for imlib2.
#
# Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
# Copyright (c) 2018-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=imlib2
version=1.7.5
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://sourceforge.net/projects/enlightenment/files/imlib2-src/${version}/$tarname

description="
Imlib2 is the (intended) successor to Imlib.

Imlib2 can load image files from disk in one of many formats, save
images to disk in one of many formats, render image data onto other
images, render images to an X-Windows drawable, produce pixmaps and
pixmap masks of images, apply filters to images, rotate images,
accept RGBA data for images, scale images, and more.
"

homepage=https://www.enlightenment.org/
license=BSD

# Source documentation
docs="AUTHORS COPYING COPYING-PLAIN ChangeLog README TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    case $arch in
    i?86)
        assembly_opts=--enable-mmx
        ;;
    amd64 | x32 )
        assembly_opts=--enable-amd64
        ;;
    esac

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args --libdir=/usr/lib${libSuffix} \
     --with-id3 --with-x --build="$(gcc -dumpmachine)" \
     $assembly_opts

    unset -v assembly_opts
    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install-strip

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}


code:
# Build recipe for jasper.
#
# Copyright (c) 2018-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=jasper
version=2.0.33
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://github.com/jasper-software/jasper/releases/download/version-${version}/$tarname

description="
Jasper image processing toolkit.

The JasPer Project is an open-source initiative to provide a free
software-based reference implementation of the JPEG-2000 codec.
"

homepage=https://www.ece.uvic.ca/~frodo/jasper/
license=Custom

# Source documentation
docs="COPYRIGHT LICENSE README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Fix a problem that happens due to cmake-3.22
    # Thanks to "Beyond Linux From Scratch"
    sed -i '/GLUT_glut_LIBRARY/s/^/#/' build/cmake/modules/JasOpenGL.cmake

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    cmake \
     -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS"       \
     -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS"     \
     -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"  \
     -DCMAKE_INSTALL_PREFIX=/usr                      \
     -DLIB_SUFFIX=/usr/lib${libSuffix}                \
     -DCMAKE_INSTALL_MANDIR=$mandir                   \
     -DCMAKE_INSTALL_DOCDIR=$docsdir                  \
     -DCMAKE_BUILD_TYPE=Release                       \
     -DCMAKE_VERBOSE_MAKEFILE=ON                      \
     -DCMAKE_SKIP_INSTALL_RPATH=YES                   \
     -DJAS_ENABLE_DOC=NO                              \
     -G Ninja ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    cd ..

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/jasper/recipe


code:
# Build recipe for lcms.
#
# Copyright (c) 2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=lcms2
version=2.13
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://sourceforge.net/projects/lcms/files/lcms/${version}/$tarname

description="
An ICC-based CMM for color management.

Little CMS intends to be an OPEN SOURCE small-footprint color
management engine, with special focus on accuracy and performance.

It uses the International Color Consortium standard (ICC), which is
the modern standard when regarding to color management.  The ICC
specification is widely used and is referred to in many International
and other de-facto standards.  It was approved as an International
Standard, ISO 15076-1, in 2005.
"

homepage=https://www.littlecms.com
license=MIT

# Source documentation
docs="AUTHORS COPYING ChangeLog"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --enable-static=no \
     --enable-shared=yes \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}


code:
# Build recipe for libcroco.
#
# Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=libcroco
version=0.6.13
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://ftp.acc.umu.se/pub/gnome/sources/libcroco/${version%.*}/$tarname"

description="
CSS2 parsing library.

The libcroco package contains a standalone CSS2 parsing and
manipulation library.
"

homepage=https://github.com/GNOME/libcroco
license="GPLv2+, LGPLv2+"

# Source documentation
docs="AUTHORS COPYING* ChangeLog HACKING NEWS README TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --docdir=$docsdir \
     --enable-static=no \
     --enable-shared=yes \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install-strip

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/libcroco/recipe


code:
# Build recipe for libglade.
#
# Copyright (c) 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=libglade
version=2.6.4
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch="https://download.gnome.org/sources/libglade/${version%.*}/$tarname"

description="
A library for dynamically loading GLADE interface files.

This library allows you to load glade interface files in a program at
runtime.  It doesn't require GLADE to be used, but GLADE is by far the
easiest way to create the interface files.
"

homepage=https://gnome.org
license="GPLv2+, LGPLv2+"

# Source documentation
docs="AUTHORS COPYING* ChangeLog NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Update for hosts based on musl
    cp -f "${worktree}/archive/common/config.guess" config.guess
    cp -f "${worktree}/archive/common/config.sub" config.sub

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --docdir=$docsdir \
     --enable-static=no \
     --enable-shared=yes \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install-strip

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/libglade/recipe


code:
# Build recipe for libgudev.
#
# Copyright (c) 2018-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=libgudev
version=237
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://download.gnome.org/sources/libgudev/${version}/$tarname

description="
GObject bindings for libudev.

It was originally part of udev-extras, then udev, then systemd.
It is now a project on its own.
"

homepage=https://wiki.gnome.org/Projects/libgudev
license=LGPLv2.1

# Source documentation
docs="COPYING NEWS README*"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir /usr/lib${libSuffix} \
     --buildtype=release \
     --strip \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/libgudev/recipe


code:
# Build recipe for libical.
#
# Copyright (c) 2019-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=libical
version=3.0.13
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://github.com/libical/libical/releases/download/v${version}/$tarname

description="
Libical is an implementation of the iCalendar protocols.

The libical package contains an implementation of the iCalendar
protocols and data formats.
"

homepage=https://github.com/libical/libical
license="MPLv2.0, LGPLv2.1"

# Source documentation
docs="AUTHORS COPYING LICENSE* README* ReleaseNotes.txt THANKS TODO"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    cmake \
     -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS"       \
     -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS"   \
     -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS"     \
     -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"  \
     -DCMAKE_INSTALL_PREFIX=/usr                      \
     -DCMAKE_INSTALL_MANDIR=$mandir                   \
     -DCMAKE_INSTALL_DOCDIR=$docsdir                  \
     -DCMAKE_BUILD_TYPE=Release                       \
     -DCMAKE_VERBOSE_MAKEFILE=ON                      \
     -DSHARED_ONLY=yes                                \
     -DICAL_BUILD_DOCS=false                          \
     -DGOBJECT_INTROSPECTION=true                     \
     -DICAL_GLIB_VAPI=true                            \
     -G Ninja ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    cd ..

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/libical/recipe


code:
# Build recipe for libmng.
#
# Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=libmng
version=2.0.3
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://downloads.sourceforge.net/project/libmng/libmng-devel/${version}/$tarname

description="
A PNG-like image format.

The libmng libraries are used by programs wanting to read and write
Multiple-image Network Graphics (MNG) files which are the animation
equivalents to PNG files.
"

homepage=https://www.libmng.com
license="BSD 3-Clause"

# Source documentation
docs="CHANGES LICENSE README doc/libmng.txt"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --mandir=$mandir \
     --enable-static=no \
     --enable-shared=yes \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/libmng/recipe


code:
# Build recipe for libnotify.
#
# Copyright (C) 2018-2019, 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=libnotify
version=0.7.9
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://ftp.gnome.org/pub/gnome/sources/libnotify/${version%.*}/$tarname"

description="
A notification library to send desktop notifications.

The libnotify library is used to send desktop notifications to
a notification daemon, as defined in the Desktop Notifications
specification.  These notifications can be used to inform the
user about an event or display some form of information without
getting in the user's way.
"

homepage=https://www.gnome.org
license=LGPLv2.1

docs="AUTHORS COPYING NEWS SPECIFICATION"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    mkdir BUILD
    cd BUILD

    CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir /usr/lib${libSuffix} \
     --buildtype=release \
     --strip \
     -Dgtk_doc=false \
     -Dman=false \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/libnotify/recipe


code:
# Build recipe for libwnck.
#
# Copyright (c) 2018-2019, 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=libwnck
version=3.36.0
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://ftp.gnome.org/pub/gnome/sources/libwnck/${version%.*}/$tarname"

description="
A Window Navigator Construction Kit.

The libwnck package contains a Window Navigator Construction Kit.
"

homepage=https://www.gnome.org
license=LGPLv2+

# Source documentation
docs="AUTHORS COPYING ChangeLog HACKING NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    mkdir BUILD
    cd BUILD

    CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir /usr/lib${libSuffix} \
     --buildtype=release \
     --strip \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/libwnck/recipe


code:
# Build recipe for libxklavier.
#
# Copyright (C) 2018 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=libxklavier
version=5.4
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://people.freedesktop.org/~svu/$tarname

description="
API for the X Keyboard Extension.

Libxklavier is a library providing high-level API for the
X Keyboard Extension known as XKB.
"

homepage=https://www.freedesktop.org/software/libxklavier
license=LGPLv2+

docs="AUTHORS COPYING* CREDITS ChangeLog NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --enable-static=no \
     --enable-shared=yes \
     --enable-introspection=yes \
     --enable-vala=yes \
     --enable-xmodmap-support

    make -j${jobs} V=1
    make -j${jobs} V=1 DESTDIR="$destdir" install-strip

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/libxklavier/recipe


code:
# Build recipe for openexr.
#
# Copyright (c) 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=openexr
version=3.0.5
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://github.com/AcademySoftwareFoundation/openexr/archive/v${version}/$tarname

description="
Implementation of the EXR file format.

OpenEXR provides the specification and reference implementation of the
EXR file format, the professional-grade image storage format of the
motion picture industry.

The purpose of EXR format is to accurately and efficiently represent
high-dynamic-range scene-linear image data and associated metadata,
with strong support for multi-part, multi-channel use cases.
"

homepage=https://www.openexr.com
license="BSD 3-clause"

# Source documentation
docs="
    CHANGES.md CODE_OF_CONDUCT.md CONTRIB* GOVERNANCE.md LICENSE.md PATENTS
    README.md SECURITY.md
"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    cmake \
     -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS"   \
     -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS"     \
     -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"  \
     -DCMAKE_INSTALL_PREFIX=/usr                      \
     -DCMAKE_INSTALL_LIBDIR=/usr/lib${libSuffix}      \
     -DCMAKE_INSTALL_MANDIR=$mandir                   \
     -DCMAKE_INSTALL_DOCDIR=$docsdir                  \
     -DCMAKE_BUILD_TYPE=Release                       \
     -DCMAKE_VERBOSE_MAKEFILE=ON                      \
     -DCMAKE_SKIP_INSTALL_RPATH=YES                   \
     -G Ninja ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    cd ..

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/openexr/recipe


code:
# Build recipe for openjpeg.
#
# Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
# Copyright (c) 2021 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=openjpeg
version=2.4.0
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://github.com/uclouvain/openjpeg/archive/v${version}/$tarname

description="
OpenJPEG is an open-source JPEG 2000 codec.

OpenJPEG is written in C language.  It has been developed in order to
promote the use of JPEG 2000, a still-image compression standard from
the Joint Photographic Experts Group (JPEG).  Since may 2015, it is
officially recognized by ISO/IEC and ITU-T as a JPEG 2000 Reference
Software.
"

homepage=https://www.openjpeg.org
license="BSD 2-clause"

# Source documentation
docs="AUTHORS.md LICENSE CHANGELOG.md NEWS.md README.md THANKS.md"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    cmake \
     -DCMAKE_C_FLAGS:STRING="$QICFLAGS"               \
     -DCMAKE_CXX_FLAGS:STRING="$QICXXFLAGS"           \
     -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS"     \
     -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"  \
     -DCMAKE_INSTALL_PREFIX=/usr                      \
     -DOPENJPEG_INSTALL_LIB_DIR=lib${libSuffix}       \
     -DCMAKE_INSTALL_MANDIR=$mandir                   \
     -DCMAKE_INSTALL_DOCDIR=$docsdir                  \
     -DCMAKE_BUILD_TYPE=Release                       \
     -DCMAKE_VERBOSE_MAKEFILE=ON                      \
     -DCMAKE_SKIP_INSTALL_RPATH=YES                   \
     -DBUILD_STATIC_LIBS=OFF                          \
     -G Ninja ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    # Leave the temporary BUILD directory
    cd ..

    # Install manual pages (manually)
    cd doc
    for file in man/man?/*
    do
        install -p -m 644 "$file" -D "${destdir}/usr/share/$file"
    done
    unset -v file
    cd ..

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 '{}' +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/openjpeg/recipe


code:
# Build recipe for Pango.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (C) 2018-2019, 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=pango
version=1.50.3
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch="https://ftp.gnome.org/pub/gnome/sources/pango/${version%.*}/$tarname"

description="
A library for layout and rendering of text.

Pango can be used anywhere that text layout is needed; however, most of
the work on Pango was done using the GTK+ widget toolkit as a test
platform.  Pango forms the core of text and font handling for GTK+-2.
"

homepage=https://www.pango.org/Introduction/
license=LGPLv2+

# Copy documentation
docs="CODING_STYLE.md COPYING NEWS README.md THANKS"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    CPPFLAGS="$QICPPFLAGS" \
    CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir /usr/lib${libSuffix} \
     --mandir $mandir \
     --buildtype=release \
     --strip \
     --wrap-mode=nofallback \
     -Dintrospection=enabled \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi
}

path: recipes/x-libs/pango/recipe


code:
# Build recipe for poppler-data.
#
# Copyright (c) 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=poppler-data
version=0.4.11
arch=noarch
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://poppler.freedesktop.org/$tarname

description="
Encoding data for poppler.

This package contains encoding files for use with poppler.
"

homepage=https://poppler.freedesktop.org/
license="GPLv2+, MIT | BSD 3-clause"

# Source documentation
docs="COPYING* README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    make -j${jobs} prefix=/usr DESTDIR="$destdir" install

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/poppler-data/recipe


code:
# Build recipe for poppler.
#
# Copyright (c) 2018 Markus Tornow, <tornow@riseup.net>.
# Copyright (c) 2021-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=poppler
version=22.01.0
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.xz

# Remote source(s)
fetch=https://poppler.freedesktop.org/"$tarname"

description="
A PDF rendering library based on the XPDF-3.0 code base.

The poppler package contains a PDF rendering library and command line
tools used to manipulate PDF files.  This is useful for providing PDF
rendering functionality as a shared library.
"

homepage=https://poppler.freedesktop.org/
license="GPLv2+, GPLv3+"

# Source documentation
docs="AUTHORS COPYING* ChangeLog NEWS README*"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    cmake \
     -DCMAKE_C_FLAGS_RELEASE:STRING="$QICFLAGS"       \
     -DCMAKE_CXX_FLAGS_RELEASE:STRING="$QICXXFLAGS"   \
     -DCMAKE_EXE_LINKER_FLAGS:STRING="$QILDFLAGS"     \
     -DCMAKE_SHARED_LINKER_FLAGS:STRING="$QILDFLAGS"  \
     -DCMAKE_INSTALL_PREFIX=/usr                      \
     -DLIB_SUFFIX=/usr/lib${libSuffix}                \
     -DCMAKE_INSTALL_MANDIR=$mandir                   \
     -DCMAKE_INSTALL_DOCDIR=$docsdir                  \
     -DCMAKE_BUILD_TYPE=Release                       \
     -DCMAKE_VERBOSE_MAKEFILE=ON                      \
     -DCMAKE_SKIP_INSTALL_RPATH=YES                   \
     -DENABLE_UNSTABLE_API_ABI_HEADERS=ON             \
     -DENABLE_BOOST=OFF                               \
     -G Ninja ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 '{}' +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Leave the temporary BUILD directory
    cd ..

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/poppler/recipe


code:
# Update MIME database in background
if test -d usr/share/mime
then
    echo "Updating mime database:  update-mime-database usr/share/mime & ..."
    chroot "$rootdir" /usr/bin/update-mime-database usr/share/mime 2> /dev/null &
fi


code:
# Build recipe for Shared Mime Info.
#
# Copyright (C) 2018, MMPG <mmpg@vp.pl>
# Copyright (C) 2018-2022 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=shared-mime-info
version=20210729_3c064c8
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.lz

# Remote source(s)
#fetch=https://gitlab.freedesktop.org/xdg/shared-mime-info/uploads/b27eb88e4155d8fccb8bb3cd12025d5b/$tarname
fetch="
 https://dragora.mirror.garr.it/current/sources/$tarname
 rsync://rsync.dragora.org/current/sources/$tarname
"

description="
A MIME database.

The shared-mime-info package contains a MIME database.

This allows central updates of MIME information for all
supporting applications.
"

homepage=https://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec/
license=GPLv2+

# Source documentation
docs="COPYING HACKING.md MAINTAINERS NEWS README.md"
docsdir="${docdir}/${program}-${version}"

# Limit parallel jobs for this build
jobs=1

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    rm -rf BUILD
    mkdir BUILD
    cd BUILD

    CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" CXXFLAGS="$QICXXFLAGS" LDFLAGS="$QILDFLAGS" \
    meson setup $configure_args \
     --libdir /usr/lib${libSuffix} \
     --mandir $mandir \
     --buildtype=release \
     --strip \
     -Dupdate-mimedb=false \
     ..

    ninja -j${jobs}
    DESTDIR="$destdir" ninja -j${jobs} install

    cd ..

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/x-libs/shared-mime-info/recipe


code:
# Build recipe for startup-notification.
#
# Copyright (C) 2018 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=startup-notification
version=0.12
release=1

# Define a category for the output of the package name
pkgcategory=x-libs

tarname=${program}-${version}.tar.gz

# Remote source(s)
fetch=https://www.freedesktop.org/software/startup-notification/releases/$tarname

description="
Notification libraries used by programs.

The startup-notification package contains notification libraries.
These are useful for building a consistent manner to notify the user
through the cursor that the application is loading.
"

homepage=https://www.freedesktop.org/software/startup-notification
license=LGPLv2+

docs="AUTHORS COPYING ChangeLog NEWS README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    # Update for hosts based on musl
    cp -f "${worktree}/archive/common/config.guess" config.guess
    cp -f "${worktree}/archive/common/config.sub" config.sub

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --enable-static=no \
     --enable-shared=yes \
     --with-x \
     --build="$(gcc -dumpmachine)"

    make -j${jobs} V=1
    make -j${jobs} V=1 DESTDIR="$destdir" install-strip

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}


code:
# Build recipe for appres.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=appres
version=1.0.5
release=1

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
List X application resource database.

The appres program prints the resources seen by an application with
the specified class and instance names.  It can be used to determine
which resources a particular program will load.
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="AUTHORS COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        if test -e $file
        then
            cp -p $file "${destdir}/$docsdir"
        fi
    done
}

path: recipes/xorg/app/appres/recipe


code:
# Build recipe for bdftopcf.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=bdftopcf
version=1.1
release=1

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
A font compiler for the X server and font server.

bdftopcf converts X fonts from Bitmap Distribution Format
to Portable Compiled Format.
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="AUTHORS COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        if test -e $file
        then
            cp -p $file "${destdir}/$docsdir"
        fi
    done
}

path: recipes/xorg/app/bdftopcf/recipe


code:
# Build recipe for bitmap.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017, 2019 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=bitmap
version=1.0.9
release=1

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
Editor and converter utilities for the X Window System.

The bitmap program is a rudimentary tool for creating or editing
rectangular images made up of 1's and 0's.  Bitmaps are used in X for
defining clipping regions, cursor shapes, icon shapes, and tile and
stipple patterns.
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="AUTHORS COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     --with-appdefaultdir=/etc/X11/app-defaults \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    touch "${destdir}/etc/X11/app-defaults/.graft-config"

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        if test -e $file
        then
            cp -p $file "${destdir}/$docsdir"
        fi
    done
}

path: recipes/xorg/app/bitmap/recipe


code:
# Build recipe for editres.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017-2019 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=editres
version=1.0.7
release=2

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
A dynamic resource editor for X Toolkit applications.

Editres is a tool that allows users and application developers to view
the full widget hierarchy of any X Toolkit application that speaks the
Editres protocol.

For more iformation, type: man editres
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="AUTHORS COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     --with-appdefaultdir=/etc/X11/app-defaults \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    touch "${destdir}/etc/X11/app-defaults/.graft-config"

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"
    cp -p $docs "${destdir}/$docsdir"
}

path: recipes/xorg/app/editres/recipe


code:
# Build recipe for fslsfonts.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=fslsfonts
version=1.0.5
release=1

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
List fonts served by X font server.

fslsfonts produces a list of fonts served by an X font server.
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        if test -e $file
        then
            cp -p $file "${destdir}/$docsdir"
        fi
    done
}

path: recipes/xorg/app/fslsfonts/recipe


code:
# Build recipe for fstobdf.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=fstobdf
version=1.0.6
release=1

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
Generate BDF font from X font server.

The fstobdf program reads a font from a font server and prints a BDF
file on the standard output that may be used to recreate the font.
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        if test -e $file
        then
            cp -p $file "${destdir}/$docsdir"
        fi
    done
}

path: recipes/xorg/app/fstobdf/recipe


code:
# Build recipe for iceauth.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=iceauth
version=1.0.8
release=1

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
ICE authority file utility.

The iceauth program is used to edit and display the authorization
information used in connecting with ICE.
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        if test -e $file
        then
            cp -p $file "${destdir}/$docsdir"
        fi
    done
}

path: recipes/xorg/app/iceauth/recipe


code:
# Build recipe for listres.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017-2018 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=listres
version=1.0.4
release=1

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
List resources in widgets.

The listres program enerates a list of X resources for a widget in
an X client written using a toolkit based on libXt.
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        if test -e $file
        then
            cp -p $file "${destdir}/$docsdir"
        fi
    done
}

path: recipes/xorg/app/listres/recipe


code:
# Build recipe for luit.
#
# Copyright (c) 2017 Mateus P. Rodrigues <mprodrigues@dragora.org>.
# Copyright (c) 2017 Matias Fonzo, <selk@dragora.org>.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Exit immediately on any error
set -e

program=luit
version=1.1.1
release=1

# Define a category for the output of the package name
pkgcategory=xorg_app

tarname=${program}-${version}.tar.bz2

# Remote source(s)
fetch=https://www.x.org/releases/individual/app/$tarname

description="
Locale and ISO 2022 support for Unicode terminals.

Luit is a filter that can be run between an arbitrary application and
a UTF-8 terminal emulator such as xterm(1).
"

homepage=https://www.x.org
license="MIT X Consortium"

# Source documentation
docs="COPYING ChangeLog README"
docsdir="${docdir}/${program}-${version}"

build()
{
    unpack "${tardir}/$tarname"

    cd "$srcdir"

    # Set sane permissions
    chmod -R u+w,go-w,a+rX-s .

    ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
     $configure_args \
     --libdir=/usr/lib${libSuffix} \
     --infodir=$infodir \
     --mandir=$mandir \
     --docdir=$docsdir \
     || true

    make -j${jobs} V=1
    make -j${jobs} DESTDIR="$destdir" install

    # Compress info documents deleting index file for the package
    if test -d "${destdir}/$infodir"
    then
        rm -f "${destdir}/${infodir}/dir"
        lzip -9 "${destdir}/${infodir}"/*
    fi

    # Compress and link man pages (if needed)
    if test -d "${destdir}/$mandir"
    then
        (
            cd "${destdir}/$mandir"
            find . -type f -exec lzip -9 {} +
            find . -type l | while read -r file
            do
                ln -sf "$(readlink -- "$file").lz" "${file}.lz"
                rm -- "$file"
            done
        )
    fi

    # Copy documentation
    mkdir -p "${destdir}/$docsdir"

    for file in $docs
    do
        if test -e $file
        then
            cp -p $file "${destdir}/$docsdir"
        fi
    done
}

path: recipes/xorg/app/luit/recipe