2019-07-25 01:52:11 -06:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2019-07-27 04:47:08 -06:00
|
|
|
# Grab the package version.
|
|
|
|
read -r version _ < "${0%/*}/version"
|
2019-07-25 01:52:11 -06:00
|
|
|
|
2019-07-27 04:47:08 -06:00
|
|
|
mkdir -p "$1/usr/share/mime/packages" \
|
|
|
|
"$1/usr/share/pkgconfig" \
|
|
|
|
"$1/usr/bin"
|
2019-07-25 01:52:11 -06:00
|
|
|
|
2019-07-27 04:47:08 -06:00
|
|
|
# Install with only English support.
|
|
|
|
sed -e 's/_comment/comment/g' freedesktop.org.xml.in \
|
|
|
|
> "$1/usr/share/mime/packages/freedesktop.org.xml"
|
2019-07-25 01:52:11 -06:00
|
|
|
|
2019-07-27 04:47:08 -06:00
|
|
|
# Replace markers in the file.
|
|
|
|
sed -e 's|@prefix@|/usr|' -e "s|@VERSION@|$version|" shared-mime-info.pc.in \
|
|
|
|
> "$1/usr/share/pkgconfig/shared-mime-info.pc"
|
|
|
|
|
|
|
|
# Define our own config.h statically.
|
|
|
|
cat << EOF > config.h
|
|
|
|
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
|
|
|
|
#define HAVE_FDATASYNC 1
|
|
|
|
#define HAVE_GETTEXT 0
|
|
|
|
#define HAVE_INTTYPES_H 1
|
|
|
|
#define HAVE_LC_MESSAGES 1
|
|
|
|
#define HAVE_LOCALE_H 1
|
|
|
|
#define HAVE_MEMORY_H 1
|
|
|
|
#define HAVE_STDINT_H 1
|
|
|
|
#define HAVE_STDLIB_H 1
|
|
|
|
#define HAVE_STRINGS_H 1
|
|
|
|
#define HAVE_STRING_H 1
|
|
|
|
#define HAVE_SYS_STAT_H 1
|
|
|
|
#define HAVE_SYS_TYPES_H 1
|
|
|
|
#define HAVE_UNISTD_H 1
|
|
|
|
#define PACKAGE "shared-mime-info"
|
|
|
|
#define PACKAGE_BUGREPORT ""
|
|
|
|
#define PACKAGE_NAME "shared-mime-info"
|
|
|
|
#define PACKAGE_STRING "shared-mime-info $version"
|
|
|
|
#define PACKAGE_TARNAME "shared-mime-info"
|
|
|
|
#define PACKAGE_URL ""
|
|
|
|
#define PACKAGE_VERSION "$version"
|
|
|
|
#define STDC_HEADERS 1
|
|
|
|
#define VERSION "$version"
|
|
|
|
EOF
|
|
|
|
|
|
|
|
# Fix config.h include.
|
|
|
|
sed -i"" 's/<config.h>/"config.h"/' update-mime-database.c
|
|
|
|
|
|
|
|
# shellcheck disable=2046
|
|
|
|
gcc -o "$1/usr/bin/update-mime-database" \
|
|
|
|
$(pkg-config --libs --cflags glib-2.0 libxml-2.0) \
|
|
|
|
update-mime-database.c
|