From nobody Tue Aug 22 06:11:13 2023 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 4RVJrL136jz4qQ6k; Tue, 22 Aug 2023 06:11:14 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RVJrL0d7Zz4Xgd; Tue, 22 Aug 2023 06:11:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692684674; 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=IXIi5AkqTE+8waGyBOZuJO+2l5G4nynkkEMFySh0H4c=; b=eQkQkxlRZlNZ8XsZODdfsVt/G25MfWlfpiPWisirPbYNH84MOypJIJjSjO3qiN1gmDLaVm 3AwJSVI5Bd+zzft5cFCNzdw+eKLV6LHD+QjZxRCuPLq8Y7qm8leLQKlO3OYBuizgN9cLuu R/fBeyHbquo2cnf4lCeFECHja6GOG7uXti7EKG3ht1slhIPWxWPUHVZp1KbkdS7T+tv/kE m38ik3twpB4Q2EgRCavOwNOTD6y3HfsYRdAyemKKq9UoCBHqr3PQ/S4/R4l1emfD9C0733 G401J6d4srL9kGadCdgt3iHYfpdU0Vt8FV4Z83vSxEtby/3MqbzukMDcMhhD6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692684674; 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=IXIi5AkqTE+8waGyBOZuJO+2l5G4nynkkEMFySh0H4c=; b=jYyX27C57p0TWqd7CZblZaAcCbTuRIVpnaSnlH83rGHooZnD1W2jbbIo8ciTMC9Q7LK7Vt LadR7kWcnuQ42YmLXwFAcwQirpGIVahqgmYzagdY0MmIjAAti8OPbxjz0WF2fPUs86SDvE lI7/PxwVmYEJnYamRScqIDPCbfHj8uqZY8K0KbUwWvfVTxjRpmbbQBZwpZ+iCIGPeyzrCs oz2XqpQrGdncNfhb8FaxAY61dPl1Qv3suphAEC2FyUnvZDnWl1pLN+wzAyXdL4Jt+7Yqt4 Y73vHazJ+7y6F3WJ6tydAKFyFiUJyQuUM4BPUqUZ6/PrJDYJF7fHuBnV/7dOjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692684674; a=rsa-sha256; cv=none; b=RPreb1g3pJV7dw1WpdMb36uVSw+tC8jY1gQAKDttGJq5Etm9hunwBdDU3G+GhvnpCHttHw PHdmUr8sSR8UFSjUwK6cQuvGFPK6216zNTDrnDeRMalxOjCyabFQ+vivn+ekdomnbxn4Kk Sk0cwlcwa8Qh5SG7wFbKSiwq9/B53+LCibFL+uLeppxo+q18iQUwaLCoo6ZfyY2y1BnYAZ bEj0MJN4cnGId0p7+PooKyajrQ9aYgqzcL8T3AVTw7bGtRb7aNW9DHeLewCe/MloFKabJ+ VHFVdxSbqKar+R0NXsujQfkXZFHboXIAOx+8CA/sdKwXM5DZXrx1B6s3gpLsTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RVJrK6qD2zrlY; Tue, 22 Aug 2023 06:11:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37M6BDJt003214; Tue, 22 Aug 2023 06:11:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37M6BDR0003211; Tue, 22 Aug 2023 06:11:13 GMT (envelope-from git) Date: Tue, 22 Aug 2023 06:11:13 GMT Message-Id: <202308220611.37M6BDR0003211@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mikhail Teterin Subject: git: 79ebd9b2cddf - main - archivers/lz4json: add new port 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: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mi X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 79ebd9b2cddf24f710e378d28e7aa4d38c32d4ab Auto-Submitted: auto-generated The branch main has been updated by mi: URL: https://cgit.FreeBSD.org/ports/commit/?id=79ebd9b2cddf24f710e378d28e7aa4d38c32d4ab commit 79ebd9b2cddf24f710e378d28e7aa4d38c32d4ab Author: Mikhail Teterin AuthorDate: 2023-08-22 06:10:19 +0000 Commit: Mikhail Teterin CommitDate: 2023-08-22 06:10:19 +0000 archivers/lz4json: add new port OpenBSD has had it for years, and so have various Linux distributions. --- archivers/Makefile | 1 + archivers/lz4json/Makefile | 18 ++++++++++++ archivers/lz4json/distinfo | 3 ++ archivers/lz4json/files/BSDmakefile | 11 ++++++++ archivers/lz4json/files/patch-warnings | 50 ++++++++++++++++++++++++++++++++++ archivers/lz4json/pkg-descr | 6 ++++ 6 files changed, 89 insertions(+) diff --git a/archivers/Makefile b/archivers/Makefile index 22e73d5ae510..aa9aa1032174 100644 --- a/archivers/Makefile +++ b/archivers/Makefile @@ -78,6 +78,7 @@ SUBDIR += lua-lzlib SUBDIR += lua-zlib SUBDIR += lxqt-archiver + SUBDIR += lz4json SUBDIR += lzfse SUBDIR += lzip SUBDIR += lziprecover diff --git a/archivers/lz4json/Makefile b/archivers/lz4json/Makefile new file mode 100644 index 000000000000..9792d938eb59 --- /dev/null +++ b/archivers/lz4json/Makefile @@ -0,0 +1,18 @@ +PORTNAME= lz4json +PORTVERSION= 20191229 +CATEGORIES= archivers www + +MAINTAINER= mi@aldan.algebra.com +COMMENT= Unpack Mozilla lz4json files, such as bookmarks and session restore +WWW= https://github.com/andikleen/lz4json + +USES= uidfix + +USE_GITHUB= yes +GH_ACCOUNT= andikleen +GH_TAGNAME= c44c5100 +PLIST_FILES= bin/lz4jsoncat man/man1/lz4jsoncat.1${COMPRESS_EXT} + +MAKEFILE= ${FILESDIR}/BSDmakefile + +.include diff --git a/archivers/lz4json/distinfo b/archivers/lz4json/distinfo new file mode 100644 index 000000000000..cd6261539be4 --- /dev/null +++ b/archivers/lz4json/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1692684009 +SHA256 (andikleen-lz4json-20191229-c44c5100_GH0.tar.gz) = 0aabebdad1963c9f04c2692993e71bf3cadb7007474e617a4435d424e449eca3 +SIZE (andikleen-lz4json-20191229-c44c5100_GH0.tar.gz) = 2036 diff --git a/archivers/lz4json/files/BSDmakefile b/archivers/lz4json/files/BSDmakefile new file mode 100644 index 000000000000..002b0e285465 --- /dev/null +++ b/archivers/lz4json/files/BSDmakefile @@ -0,0 +1,11 @@ +PROG= lz4jsoncat + +BINDIR= ${LOCALBASE}/bin +MANDIR= ${LOCALBASE}/man/man + +WARNS= 3 + +CFLAGS+=-isystem ${PREFIX}/include +LDADD= -L${PREFIX}/lib -llz4 + +.include diff --git a/archivers/lz4json/files/patch-warnings b/archivers/lz4json/files/patch-warnings new file mode 100644 index 000000000000..13c4f68607a7 --- /dev/null +++ b/archivers/lz4json/files/patch-warnings @@ -0,0 +1,50 @@ +--- lz4jsoncat.c 2019-12-29 00:44:09.000000000 -0500 ++++ lz4jsoncat.c 2023-08-22 01:48:00.646059000 -0400 +@@ -1,3 +1,3 @@ +-/* ++/* + * Dump mozilla style lz4json files. + * +@@ -30,15 +30,19 @@ + #include + #ifndef __APPLE__ ++# if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFlyBSD__) ++#include ++# else + #include ++# endif + #else + #define htole32(x) x /* assume apple targets are little endian */ + #endif + +-#include "lz4.h" ++#include + + int main(int ac, char **av) + { +- while (*++av) { +- int fd = open(*av, O_RDONLY); ++ while (--ac) { ++ int fd = open(*++av, O_RDONLY); + if (fd < 0) { + perror(*av); +@@ -56,5 +60,5 @@ + + char *map = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0); +- if (map == (char *)-1) { ++ if (map == MAP_FAILED) { + perror(*av); + exit(1); +@@ -64,5 +68,5 @@ + exit(1); + } +- size_t outsz = htole32(*(uint32_t *) (map + 8)); ++ ssize_t outsz = htole32(*(uint32_t *) (map + 8)); + char *out = malloc(outsz); + if (!out) { +@@ -88,5 +92,2 @@ + return 0; + } +- +- +- diff --git a/archivers/lz4json/pkg-descr b/archivers/lz4json/pkg-descr new file mode 100644 index 000000000000..501d1483c774 --- /dev/null +++ b/archivers/lz4json/pkg-descr @@ -0,0 +1,6 @@ +A little utility to unpack lz4json files as generated by Firefox's +bookmark backups and session restore. This is a different format +from what the normal lz4 utility expects. + +The input must be regular file(s) (accessible via mmap()). The +output is dumped to stdout.