From nobody Fri Oct 25 19:25:03 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XZt5r1Znlz5b4BH; Fri, 25 Oct 2024 19:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XZt5r12nYz4fwQ; Fri, 25 Oct 2024 19:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729884304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5KAtfc6FLpmwDZN8IbxswQ0CJG6pwtPuvAu76pIpPjo=; b=Qv4V26OcHJ5vlNJchDmAWXwuoZ2GhQIhKeA7kE7TwJcng7zy0Dlw30geHn1VO2LPDc4iUx bIA22fh/BzSXA1YQz5ZxrfdW2HFnaizdu7q7aEzzdDb3CeD7H5YM74N2wIPqtHNYk4LBUW VVKuVYFCubw9l+kJyE9Oc1DbH4GYW5Nbobb2KcDacbLVGswNFoNv0PrpUItceW24u0rfoA dkweno4CbyUK0DPht+j46br5pIEcyhpIH8yj3LYWS+fpe4rCl1lUYaqJh4/kJgtarivYYG GYkNB+S1qiDdBtobSSGOmjQSh133HvYfFV2riztzpOR4D/2ThAiMPajSCLzk5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729884304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5KAtfc6FLpmwDZN8IbxswQ0CJG6pwtPuvAu76pIpPjo=; b=TXdZLoViQoPRa1Z/oBt3Uf1AgIvLSu967VjewK0tLIaJ2miywognDA4zDbI8N5zoAc38hS aJ/Cs3Il7b58LXZdD4hEF13AGB9WNjQk2xBSyjV5AwWmptzGyrgUUex6gb76SHoRzyPENW 5ecTJ5wECzSj1pIPU+Kqu1Nudsio6lM8S3pL9wcight6F3hDrIh9z5DBuZn71uLQHVsp/B 80UXY8FXYfKlJlahMi6/U9HaE4IN7fd2S9J1gi3cxMx88mwjNAr7O+CUX9j3u/Law1PCxt +iktaSsx+rHEQJBDSTjqN8oJeOuvoqVc6xsrtJBWAZSoTECuW4DdNqesE+kRvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729884304; a=rsa-sha256; cv=none; b=TQT4f4/GCBq5hL6kST5hqfHyJLB8tJmlMPVh54JEE5mvjBQHeOGw2fwcNoxFvR0bGf6IUA skMqBj4aJlEuuoypdlN+599nsQlM3DqVimzjzh7b5d20LEua8hOLJ6OFoXWvsVmFisMacY cCS8UTzihxxdl+bUnab6DhMg9ODY8Yt4Qve5SjDdU3L+GB7icNNuPaQtYIGD5VEEGinz4m 5Rhm9XqRaolQced+/uLw3+/AJRX5rjjM8fJINg8gQIakJzHCC3DwdNarWc2BuY9QpkDs+G mkVeS2KSkawmwdnS+g/IG1wsOhDAb9fwLeVGy+z5IhrFV4RU7sjwjp58C5Af2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XZt5r0Wvlzf5k; Fri, 25 Oct 2024 19:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49PJP3xb014716; Fri, 25 Oct 2024 19:25:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49PJP3iZ014713; Fri, 25 Oct 2024 19:25:03 GMT (envelope-from git) Date: Fri, 25 Oct 2024 19:25:03 GMT Message-Id: <202410251925.49PJP3iZ014713@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gleb Popov Subject: git: 156ebeeb9c32 - main - ports-mgmt/appstream-generator: Tool to generate AppStream metadata from a package repository List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 156ebeeb9c32c636068c325e57be748be04143fe Auto-Submitted: auto-generated The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=156ebeeb9c32c636068c325e57be748be04143fe commit 156ebeeb9c32c636068c325e57be748be04143fe Author: Gleb Popov AuthorDate: 2023-04-20 16:04:27 +0000 Commit: Gleb Popov CommitDate: 2024-10-25 19:24:43 +0000 ports-mgmt/appstream-generator: Tool to generate AppStream metadata from a package repository Sponsored by: Future Crew, LLC --- ports-mgmt/Makefile | 1 + ports-mgmt/appstream-generator/Makefile | 46 +++++++++++++++ ports-mgmt/appstream-generator/distinfo | 3 + .../patch-contrib_setup_meson-install-templates.sh | 14 +++++ .../files/poudriere-hook-bulk.sh | 65 ++++++++++++++++++++++ ports-mgmt/appstream-generator/pkg-descr | 4 ++ ports-mgmt/appstream-generator/pkg-plist | 27 +++++++++ 7 files changed, 160 insertions(+) diff --git a/ports-mgmt/Makefile b/ports-mgmt/Makefile index a28c7229e54a..2de6e02f145d 100644 --- a/ports-mgmt/Makefile +++ b/ports-mgmt/Makefile @@ -1,5 +1,6 @@ COMMENT = Ports for managing, installing, and developing FreeBSD ports and packages + SUBDIR += appstream-generator SUBDIR += bsdadminscripts2 SUBDIR += caronade SUBDIR += create-rb-port diff --git a/ports-mgmt/appstream-generator/Makefile b/ports-mgmt/appstream-generator/Makefile new file mode 100644 index 000000000000..6f8669cbc2c2 --- /dev/null +++ b/ports-mgmt/appstream-generator/Makefile @@ -0,0 +1,46 @@ +PORTNAME= appstream-generator +DISTVERSIONPREFIX= v +DISTVERSION= 0.9.1 +PORTREVISION= 1 +CATEGORIES= ports-mgmt + +MAINTAINER= arrowd@FreeBSD.org +COMMENT= Fast AppStream metadata generator +WWW= https://github.com/ximion/appstream-generator + +LICENSE= LGPL3 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= girtod:lang/gir-to-d \ + ldc2:lang/ldc \ + xsltproc:textproc/libxslt \ + ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl +LIB_DEPENDS= libappstream.so:devel/appstream \ + libappstream-compose.so:devel/appstream-compose \ + libcurl.so:ftp/curl \ + libglibd-2.0.so:devel/glibd \ + liblmdb.so:databases/lmdb \ + libphobos2-ldc-shared.so:lang/ldc + +USES= gnome libarchive meson pkgconfig + +USE_GNOME= glib20 + +USE_GITHUB= yes +GH_ACCOUNT= arrowd +GH_TAGNAME= 6645648126427ebdfe6debc45760ba8a351c3a5d + +OPTIONS_DEFINE= MANPAGES +MANPAGES_BUILD_DEPENDS= xsltproc:textproc/libxslt + +MESON_ARGS= -Ddownload-js=false -Dlocalbase=${LOCALBASE} -Drpmmd=false + +DATADIR= ${PREFIX}/share/appstream +OPTIONS_SUB= yes + +post-install: + cd ${WRKSRC}/data && \ + ${COPYTREE_SHARE} templates ${STAGEDIR}${DATADIR} + ${INSTALL_SCRIPT} ${PATCHDIR}/poudriere-hook-bulk.sh ${STAGEDIR}${DATADIR} + +.include diff --git a/ports-mgmt/appstream-generator/distinfo b/ports-mgmt/appstream-generator/distinfo new file mode 100644 index 000000000000..78f0c2bbc4a2 --- /dev/null +++ b/ports-mgmt/appstream-generator/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1729881137 +SHA256 (arrowd-appstream-generator-v0.9.1-6645648126427ebdfe6debc45760ba8a351c3a5d_GH0.tar.gz) = 9561d36f067650a84d6363a11795c4459fb8e460f56d1550b3303d2c45620177 +SIZE (arrowd-appstream-generator-v0.9.1-6645648126427ebdfe6debc45760ba8a351c3a5d_GH0.tar.gz) = 548743 diff --git a/ports-mgmt/appstream-generator/files/patch-contrib_setup_meson-install-templates.sh b/ports-mgmt/appstream-generator/files/patch-contrib_setup_meson-install-templates.sh new file mode 100644 index 000000000000..a05bbcd76a2d --- /dev/null +++ b/ports-mgmt/appstream-generator/files/patch-contrib_setup_meson-install-templates.sh @@ -0,0 +1,14 @@ +--- contrib/setup/meson-install-templates.sh.orig 2023-04-20 11:44:26 UTC ++++ contrib/setup/meson-install-templates.sh +@@ -3,6 +3,8 @@ cd "$MESON_SOURCE_ROOT" + + cd "$MESON_SOURCE_ROOT" + +-echo "Installing templates..." +-install -d "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/appstream/templates" +-cp -dpru --no-preserve=ownership data/templates/* -t "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/appstream/templates" ++# FreeBSD: We do this ourselves in the port ++ ++#echo "Installing templates..." ++#install -d "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/appstream/templates" ++#cp -dpru --no-preserve=ownership data/templates/* -t "${DESTDIR}/${MESON_INSTALL_PREFIX}/share/appstream/templates" diff --git a/ports-mgmt/appstream-generator/files/poudriere-hook-bulk.sh b/ports-mgmt/appstream-generator/files/poudriere-hook-bulk.sh new file mode 100644 index 000000000000..805d9bab446a --- /dev/null +++ b/ports-mgmt/appstream-generator/files/poudriere-hook-bulk.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# /usr/local/etc/poudriere.d/hooks/bulk.sh + +status="$1" +shift + +if [ "$status" != "done" ]; then + exit 0 +fi + +ASGEN_CMD=/usr/local/bin/appstream-generator +# The location for the generated data +# This should be persistent across "poudriere bulk" runs and be specific to +# the given jail-ports-set combination (i.e. have ${MASTERNAME} in the path) +ASGEN_WORKSPACE=/asgen/${MASTERNAME} +ARCH=$(uname -p) + +# PACKAGES ends with "/.latest", so we chop it first +if [ "$(basename ${PACKAGES})" == ".latest" ]; then + suite=$(basename $(dirname ${PACKAGES})) +else + suite=$(basename ${PACKAGES}) +fi + +asgen_config=$(cat< ${ASGEN_WORKSPACE}/asgen-config.json + +# Generate the metainfo +echo Running $ASGEN_CMD -w "${ASGEN_WORKSPACE}" run "$suite" +$ASGEN_CMD -w "${ASGEN_WORKSPACE}" run "$suite" + +# TODO: Upstream recommends running cleanup once in a week +$ASGEN_CMD -w "${ASGEN_WORKSPACE}" cleanup + +# Copy the metadata archive back to Poudriere repository root +cp "${ASGEN_WORKSPACE}/export/data/${suite}/default/Components-${ARCH}.xml.gz" "${PACKAGES}/AppStreamComponents.xml.gz" + +# Link media files +ln -s "${ASGEN_WORKSPACE}/export/media" "${PACKAGES}/media" + +# Make a symlink to follow Poudriere layout +if [ "$(basename ${PACKAGES})" == ".latest" ]; then + ln -fs .latest/AppStreamComponents.xml.gz ${PACKAGES}/../AppStreamComponents.xml.gz +fi + +exit 0 diff --git a/ports-mgmt/appstream-generator/pkg-descr b/ports-mgmt/appstream-generator/pkg-descr new file mode 100644 index 000000000000..b64963928e3e --- /dev/null +++ b/ports-mgmt/appstream-generator/pkg-descr @@ -0,0 +1,4 @@ +AppStream is an effort to provide additional metadata and unique IDs for all +software available in the package repository. This package contains the +server-side of the AppStream infrastructure, a tool to generate metadata from +FreeBSD packages. diff --git a/ports-mgmt/appstream-generator/pkg-plist b/ports-mgmt/appstream-generator/pkg-plist new file mode 100644 index 000000000000..bc5426035f66 --- /dev/null +++ b/ports-mgmt/appstream-generator/pkg-plist @@ -0,0 +1,27 @@ +bin/appstream-generator +%%DATADIR%%/asgen-hints.json +%%DATADIR%%/hicolor-theme-index.theme +%%DATADIR%%/poudriere-hook-bulk.sh +%%DATADIR%%/templates/debian/base.html +%%DATADIR%%/templates/debian/main.html +%%DATADIR%%/templates/debian/static/css/highlight.css +%%DATADIR%%/templates/debian/static/css/style.css +%%DATADIR%%/templates/debian/static/img +%%DATADIR%%/templates/debian/static/js +%%DATADIR%%/templates/default/base.html +%%DATADIR%%/templates/default/issues_index.html +%%DATADIR%%/templates/default/issues_page.html +%%DATADIR%%/templates/default/main.html +%%DATADIR%%/templates/default/metainfo_index.html +%%DATADIR%%/templates/default/metainfo_page.html +%%DATADIR%%/templates/default/section_page.html +%%DATADIR%%/templates/default/sections_index.html +%%DATADIR%%/templates/default/static/css/highlight.css +%%DATADIR%%/templates/default/static/css/style.css +%%DATADIR%%/templates/default/static/img/asgen.png +%%DATADIR%%/templates/default/static/img/cpt-nogui.png +%%DATADIR%%/templates/default/static/img/favicon.png +%%DATADIR%%/templates/default/static/img/no-image.png +%%DATADIR%%/templates/ubuntu +%%MANPAGES%%share/man/man1/appstream-generator.1.gz +share/metainfo/org.freedesktop.appstream.generator.metainfo.xml