From 0fe537c6c0f0dde8714f912596b769a06039d39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Fri, 13 Nov 2020 07:50:05 +0700 Subject: [PATCH] engrampa: update to 1.24.1. --- srcpkgs/engrampa/patches/zstd-mime-type.patch | 179 ++++++++++++++++++ srcpkgs/engrampa/template | 13 +- 2 files changed, 188 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/engrampa/patches/zstd-mime-type.patch diff --git a/srcpkgs/engrampa/patches/zstd-mime-type.patch b/srcpkgs/engrampa/patches/zstd-mime-type.patch new file mode 100644 index 0000000000..0e0a6cd4fb --- /dev/null +++ b/srcpkgs/engrampa/patches/zstd-mime-type.patch @@ -0,0 +1,179 @@ +diff --git caja/caja-engrampa.c caja/caja-engrampa.c +--- caja/caja-engrampa.c ++++ caja/caja-engrampa.c +@@ -191,7 +191,8 @@ static struct { + { "application/x-zip", TRUE }, + { "application/x-zip-compressed", TRUE }, + { "application/x-zoo", TRUE }, +- { ZSTD_MIME_TYPE, TRUE }, ++ { "application/zstd", TRUE }, ++ { "application/x-zstd", TRUE }, + { "application/x-zstd-compressed-tar", TRUE }, + { "application/zip", TRUE }, + { "multipart/x-zip", TRUE }, +diff --git configure.ac configure.ac +--- configure.ac ++++ configure.ac +@@ -141,7 +141,6 @@ AC_ARG_ENABLE([magic], + AS_HELP_STRING([--enable-magic], [use libmagic to detect file type]),, + [enable_magic=no]) + +-zstd_mime_type="application/zstd" + if test x"$enable_magic" = x"yes" ; then + save_LIBS="$LIBS" + LIBS="$LIBS -lmagic" +@@ -154,47 +153,6 @@ int main () { magic_t m = magic_open(MAGIC_NONE); } + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([libmagic is needed for magic])]) + +- dnl ******************************************* +- dnl This check can be removed with file >= 5.38 +- dnl ******************************************* +- AC_MSG_CHECKING([for zstd mime type]) +- AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include +-#include +-#include ]], +- [[ +- FILE *fptr; +- char *test_file = "test.zst"; +- char *default_mime_type = "application/zstd"; +- int status = 0; +- if ((fptr = fopen (test_file,"wb")) == NULL) { +- status = 1; +- } else { +- const unsigned char data[5] = "\x28\xb5\x2f\xfd\0"; +- int i; +- for (i = 0; i < strlen (data); i++) +- fwrite (&data[i], 1, 1, fptr); +- fclose (fptr); +- magic_t magic_cookie = magic_open (MAGIC_MIME_TYPE); +- if (magic_cookie == NULL) { +- status = 1; +- } else { +- if (magic_load (magic_cookie, NULL) != 0) { +- status = 1; +- } else { +- const char *mime = magic_file (magic_cookie, test_file); +- status = (strcmp (default_mime_type, mime) == 0); +- } +- magic_close(magic_cookie); +- } +- remove (test_file); +- } +- return status;]])], +- [zstd_mime_type="application/x-zstd"], +- [zstd_mime_type="application/zstd"] +- ) +- AC_MSG_RESULT($zstd_mime_type) +- dnl ******************************************* +- + LIBS="$save_LIBS" + + MAGIC_CFLAGS= +@@ -207,9 +165,6 @@ int main () { magic_t m = magic_open(MAGIC_NONE); } + fi + + AM_CONDITIONAL(ENABLE_MAGIC, test x"$enable_magic" != x"no") +-ZSTD_MIME_TYPE="$zstd_mime_type" +-AC_SUBST(ZSTD_MIME_TYPE) +-AC_DEFINE_UNQUOTED(ZSTD_MIME_TYPE, "$zstd_mime_type", [define zstd mime type]) + + AC_ARG_VAR([CPIO], [Path to the `cpio` command]) + AC_PATH_PROGS(CPIO, gcpio cpio, cpio) +diff --git data/engrampa.desktop.in.in data/engrampa.desktop.in.in +--- data/engrampa.desktop.in.in ++++ data/engrampa.desktop.in.in +@@ -11,7 +11,7 @@ Type=Application + Icon=engrampa + # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! + Categories=GTK;Utility;Archiving;Compression; +-MimeType=application/x-7z-compressed;application/x-7z-compressed-tar;application/x-ace;application/x-alz;application/x-arj;application/x-brotli;application/x-brotli-compressed-tar;application/x-bzip;application/x-bzip-compressed-tar;application/x-bzip1;application/x-bzip1-compressed-tar;application/x-cabinet;application/x-cbr;application/x-cbz;application/x-cd-image;application/x-compress;application/x-compressed-tar;application/x-cpio;application/vnd.debian.binary-package;application/x-ear;application/x-ms-dos-executable;application/x-gtar;application/x-gzip;application/x-gzpostscript;application/x-java-archive;application/x-lha;application/x-lzh-compressed;application/x-lrzip;application/x-lrzip-compressed-tar;application/x-lzip;application/x-lzip-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-lzop-compressed-tar;application/x-ms-wim;application/x-rar;application/x-rar-compressed;application/x-rpm;application/x-source-rpm;application/x-rzip;application/x-tar;application/x-tarz;application/x-stuffit;application/x-war;application/x-xz;application/x-xz-compressed-tar;application/x-zip;application/x-zip-compressed;application/x-zoo;@ZSTD_MIME_TYPE@;application/x-zstd-compressed-tar;application/zip;application/x-archive;application/vnd.ms-cab-compressed; ++MimeType=application/x-7z-compressed;application/x-7z-compressed-tar;application/x-ace;application/x-alz;application/x-arj;application/x-brotli;application/x-brotli-compressed-tar;application/x-bzip;application/x-bzip-compressed-tar;application/x-bzip1;application/x-bzip1-compressed-tar;application/x-cabinet;application/x-cbr;application/x-cbz;application/x-cd-image;application/x-compress;application/x-compressed-tar;application/x-cpio;application/vnd.debian.binary-package;application/x-ear;application/x-ms-dos-executable;application/x-gtar;application/x-gzip;application/x-gzpostscript;application/x-java-archive;application/x-lha;application/x-lzh-compressed;application/x-lrzip;application/x-lrzip-compressed-tar;application/x-lzip;application/x-lzip-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-lzop;application/x-lzop-compressed-tar;application/x-ms-wim;application/x-rar;application/x-rar-compressed;application/x-rpm;application/x-source-rpm;application/x-rzip;application/x-tar;application/x-tarz;application/x-stuffit;application/x-war;application/x-xz;application/x-xz-compressed-tar;application/x-zip;application/x-zip-compressed;application/x-zoo;application/zstd;application/x-zstd;application/x-zstd-compressed-tar;application/zip;application/x-archive;application/vnd.ms-cab-compressed; + # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! + Keywords=MATE;archive;manager;compression; + X-MATE-DocPath=engrampa/engrampa.xml +diff --git src/fr-command-cfile.c src/fr-command-cfile.c +--- src/fr-command-cfile.c ++++ src/fr-command-cfile.c +@@ -301,7 +301,8 @@ fr_command_cfile_add (FrCommand *comm, + compressed_filename = g_strconcat (filename, ".rz", NULL); + } + +- else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) { ++ else if (is_mime_type (comm->mime_type, "application/zstd") ++ || is_mime_type (comm->mime_type, "application/x-zstd")) { + fr_process_begin_command (comm->process, "zstd"); + fr_process_set_working_dir (comm->process, temp_dir); + fr_process_add_arg (comm->process, filename); +@@ -446,7 +447,8 @@ fr_command_cfile_extract (FrCommand *comm, + fr_process_end_command (comm->process); + } + +- else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) { ++ else if (is_mime_type (comm->mime_type, "application/zstd") ++ || is_mime_type (comm->mime_type, "application/x-zstd")) { + fr_process_begin_command (comm->process, "zstd"); + fr_process_add_arg (comm->process, "-f"); + fr_process_add_arg (comm->process, "-d"); +@@ -515,7 +517,8 @@ fr_command_cfile_test (FrCommand *comm) + else if (is_mime_type (comm->mime_type, "application/x-lzop")) { + compress_cmd = "lzop"; + } +- else if (is_mime_type (comm->mime_type, ZSTD_MIME_TYPE)) { ++ else if (is_mime_type (comm->mime_type, "application/zstd") ++ || is_mime_type (comm->mime_type, "application/x-zstd")) { + compress_cmd = "zstd"; + fr_process_begin_command (comm->process, compress_cmd); + fr_process_add_arg (comm->process, "-v"); +@@ -542,7 +545,8 @@ const char *cfile_mime_type[] = { "application/x-gzip", + "application/x-lzop", + "application/x-rzip", + "application/x-xz", +- ZSTD_MIME_TYPE, ++ "application/zstd", ++ "application/x-zstd", + NULL }; + + +@@ -599,7 +603,8 @@ fr_command_cfile_get_capabilities (FrCommand *comm, + if (is_program_available ("rzip", check_command)) + capabilities |= FR_COMMAND_CAN_READ_WRITE; + } +- else if (is_mime_type (mime_type, ZSTD_MIME_TYPE)) { ++ else if (is_mime_type (mime_type, "application/zstd") ++ || is_mime_type (mime_type, "application/x-zstd")) { + if (is_program_available ("zstd", check_command)) + capabilities |= FR_COMMAND_CAN_READ_WRITE; + } +@@ -642,7 +647,8 @@ fr_command_cfile_get_packages (FrCommand *comm, + return PACKAGES ("lzop"); + else if (is_mime_type (mime_type, "application/x-rzip")) + return PACKAGES ("rzip"); +- else if (is_mime_type (mime_type, ZSTD_MIME_TYPE)) ++ else if (is_mime_type (mime_type, "application/zstd") ++ || is_mime_type (mime_type, "application/x-zstd")) + return PACKAGES ("zstd"); + + return NULL; +diff --git src/fr-init.c src/fr-init.c +--- src/fr-init.c ++++ src/fr-init.c +@@ -108,7 +108,8 @@ FrMimeTypeDescription mime_type_desc[] = { + { "application/x-xz", ".xz", N_("Xz compressed file"), 0 }, + { "application/x-xz-compressed-tar", ".tar.xz", N_("Tar compressed with xz"), 0 }, + { "application/x-zoo", ".zoo", N_("Zoo"), 0 }, +- { ZSTD_MIME_TYPE, ".zst", N_("Zstandard compressed file"), 0 }, ++ { "application/zstd", ".zst", N_("Zstandard compressed file"), 0 }, ++ { "application/x-zstd", ".zst", N_("Zstandard compressed file"), 0 }, + { "application/x-zstd-compressed-tar", ".tar.zst", N_("Tar compressed with zstd"), 0 }, + { "application/zip", ".zip", N_("Zip"), 0 }, + { NULL, NULL, NULL, 0 } +@@ -181,7 +182,7 @@ FrExtensionType file_ext_type[] = { + { ".Z", "application/x-compress" }, + { ".zip", "application/zip" }, + { ".zoo", "application/x-zoo" }, +- { ".zst", ZSTD_MIME_TYPE }, ++ { ".zst", "application/zstd" }, + { NULL, NULL } + }; + diff --git a/srcpkgs/engrampa/template b/srcpkgs/engrampa/template index e41827d117..4178d5dc2d 100644 --- a/srcpkgs/engrampa/template +++ b/srcpkgs/engrampa/template @@ -1,16 +1,21 @@ # Template file for 'engrampa' pkgname=engrampa -version=1.24.0 +version=1.24.1 revision=1 build_style=gnu-configure configure_args="--enable-magic --disable-schemas-compile --disable-packagekit" -hostmakedepends="glib-devel intltool itstool pkg-config" +hostmakedepends="glib-devel intltool itstool pkg-config cpio automake + gettext-devel tar libtool mate-common autoconf-archive" makedepends="file-devel gtk+3-devel json-glib-devel libSM-devel libarchive-devel libcaja-devel" -depends="desktop-file-utils" +depends="desktop-file-utils cpio" short_desc="Archive manipulator for MATE" maintainer="Orphaned " license="GPL-2.0-or-later" homepage="https://mate-desktop.org" distfiles="https://pub.mate-desktop.org/releases/${version%.*}/${pkgname}-${version}.tar.xz" -checksum=d415f486edc9a5474024b3928ff1127ba4534a703a60993a3912fffcf0988a8d +checksum=fe24e04efb34a67374d2a46a3bf2a0a445b77e0ec43216e4c3f14e5cd0b7722a + +pre_configure() { + autoreconf -fi +}