Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppStream 1.0 #47

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,21 @@ strip desktop-file-install desktop-file-validate update-desktop-database
cd ../..

# Build appstreamcli
apk add glib-static meson libxml2-dev yaml-dev yaml-static gperf
# Compile liblmdb from source as Alpine only ship it as a .so
wget https://git.openldap.org/openldap/openldap/-/archive/LMDB_0.9.29/openldap-LMDB_0.9.29.tar.gz
tar xf openldap-LMDB_*.tar.gz
cd openldap-LMDB_*/libraries/liblmdb
make liblmdb.a
install -D -m 644 liblmdb.a /usr/local/lib/liblmdb.a
install -D -m 644 lmdb.h /usr/local/include/lmdb.h
apk add glib-static meson libxml2-dev libxml2-static yaml-dev yaml-static gperf curl-dev curl-static curl itstool # libxmlb-dev
# libxmlb-static is missing, need to build our own
wget https://github.com/hughsie/libxmlb/releases/download/0.3.15/libxmlb-0.3.15.tar.xz
tar xf libxmlb-0.3.15.tar.xz
cd libxmlb-*
meson build --default-library=static -Dintrospection=false -Dgtkdoc=false -Dcli=false
ninja -C build
ninja -C build install
# ldconfig # segfaults
cd -
wget -O appstream.tar.gz https://github.com/ximion/appstream/archive/v0.12.9.tar.gz
wget -O appstream.tar.gz https://github.com/ximion/appstream/archive/v1.0.2.tar.gz # Keep at v1.0.x so as to not have a moving target
tar xf appstream.tar.gz
cd appstream-*/
# Ask for static dependencies
sed -i -E -e "s|(dependency\('.*')|\1, static: true|g" meson.build
# Disable po, docs and tests
sed -i -e "s|subdir('po/')||" meson.build
sed -i -e "s|subdir('docs/')||" meson.build
sed -i -e "s|subdir('tests/')||" meson.build
# -no-pie is required to statically link to libc
CFLAGS=-no-pie LDFLAGS=-static meson setup build --buildtype=release --default-library=static --prefix="$(pwd)/prefix" --strip -Db_lto=true -Db_ndebug=if-release -Dstemming=false -Dgir=false -Dapidocs=false
CFLAGS=-no-pie LDFLAGS=-static meson setup build --buildtype=release --default-library=static --prefix="$(pwd)/prefix" --strip -Db_lto=true -Db_ndebug=if-release -Dstemming=false -Dgir=false -Dapidocs=false -Dinstall-docs=false -Dsystemd=false
# Install in a staging enviroment
meson install -C build
file prefix/bin/appstreamcli
Expand Down
4 changes: 2 additions & 2 deletions chroot_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -ex
# Download and extract minimal Alpine system
#############################################

wget "http://dl-cdn.alpinelinux.org/alpine/v3.15/releases/${ARCHITECTURE}/alpine-minirootfs-3.15.4-${ARCHITECTURE}.tar.gz"
wget "http://dl-cdn.alpinelinux.org/alpine/v3.19/releases/${ARCHITECTURE}/alpine-minirootfs-3.19.1-${ARCHITECTURE}.tar.gz"
sudo rm -rf ./miniroot true # Clean up from previous runs
mkdir -p ./miniroot
cd ./miniroot
Expand Down Expand Up @@ -67,5 +67,5 @@ sudo find miniroot/ -type f -executable -name 'bsdtar' -exec cp {} out/bsdtar-$A
sudo find miniroot/ -type f -executable -name 'desktop-file-install' -exec cp {} out/desktop-file-install-$ARCHITECTURE \;
sudo find miniroot/ -type f -executable -name 'desktop-file-validate' -exec cp {} out/desktop-file-validate-$ARCHITECTURE \;
sudo find miniroot/ -type f -executable -name 'update-desktop-database' -exec cp {} out/update-desktop-database-$ARCHITECTURE \;
sudo cp miniroot/appstream-0.12.9/prefix/bin/appstreamcli out/appstreamcli-$ARCHITECTURE
sudo cp miniroot/appstream-*/prefix/bin/appstreamcli out/appstreamcli-$ARCHITECTURE
sudo rm -rf miniroot/
Loading