* [gentoo-commits] repo/gentoo:master commit in: app-arch/createrepo_c/files/, app-arch/createrepo_c/
@ 2022-10-19 2:35 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2022-10-19 2:35 UTC (permalink / raw
To: gentoo-commits
commit: 0065c8d2fb3b3838fd8940725cd84fb15506ac43
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 19 02:11:46 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 19 02:11:46 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0065c8d2
app-arch/createrepo_c: add 0.20.1
Closes: https://bugs.gentoo.org/875698
Signed-off-by: Sam James <sam <AT> gentoo.org>
app-arch/createrepo_c/Manifest | 1 +
app-arch/createrepo_c/createrepo_c-0.20.1.ebuild | 42 ++++++++++++++++++++++
...0.1-Include-rpm-rpmstring.h-for-rasprintf.patch | 20 +++++++++++
3 files changed, 63 insertions(+)
diff --git a/app-arch/createrepo_c/Manifest b/app-arch/createrepo_c/Manifest
index 3207cc02e8ba..ad7a2616f3a4 100644
--- a/app-arch/createrepo_c/Manifest
+++ b/app-arch/createrepo_c/Manifest
@@ -1 +1,2 @@
DIST createrepo_c-0.16.2.tar.gz 601935 BLAKE2B 8b9f279d97744e9eeb68cfcc7e9a229ab5a4d8cfca74a2a3d444915eaae7a6d2fa113e517fdcd72b69d0343e541ccce8020f50162e4800c54ba989cea8d5756e SHA512 c63abc8aa6c65584b51a0aa337e261fe5d9a52d72287874f86531caa8133718290a4f44aa765979fa319973c4ba0681437a26f84f64bd5bf781c86a6daa8a39b
+DIST createrepo_c-0.20.1.tar.gz 614968 BLAKE2B 8eb35c121e1beaa960310d10bfe616799b3a6b13d99f1e8c9d4077975cc929c9f786dec7d26a17d7efbd1859e2e7d8a614147c36a0a82c87f1c1c1a652afa6f3 SHA512 54a2cc7c7cd3f3b9a0c23cd8c136ae1331e7fa7cc995189088e7e6f2276c78b2b84e21c2a2b93f4528b5e9e4018dd6525262c8aaba3bc8a1412a51dfafd101f7
diff --git a/app-arch/createrepo_c/createrepo_c-0.20.1.ebuild b/app-arch/createrepo_c/createrepo_c-0.20.1.ebuild
new file mode 100644
index 000000000000..91a1e6965990
--- /dev/null
+++ b/app-arch/createrepo_c/createrepo_c-0.20.1.ebuild
@@ -0,0 +1,42 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="C implementation of createrepo"
+HOMEPAGE="https://github.com/rpm-software-management/createrepo_c"
+SRC_URI="https://github.com/rpm-software-management/createrepo_c/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+# Notes: Help with enabling the python support would be great
+
+DEPEND="app-arch/bzip2:=
+ app-arch/rpm
+ dev-db/sqlite:3
+ dev-libs/glib:2
+ dev-libs/libxml2
+ dev-libs/openssl:=
+ net-misc/curl
+ sys-apps/file
+ sys-libs/zlib:="
+RDEPEND="${DEPEND}
+ app-arch/lzma"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.20.1-Include-rpm-rpmstring.h-for-rasprintf.patch
+)
+
+src_configure() {
+ # Other than for python (where tests are failing) we have special no-in-tree dependencies.
+ local mycmakeargs=(
+ -DENABLE_DRPM=OFF
+ -DENABLE_PYTHON=OFF
+ -DWITH_ZCHUNK=OFF
+ -DWITH_LIBMODULEMD=OFF
+ )
+ cmake_src_configure
+}
diff --git a/app-arch/createrepo_c/files/createrepo_c-0.20.1-Include-rpm-rpmstring.h-for-rasprintf.patch b/app-arch/createrepo_c/files/createrepo_c-0.20.1-Include-rpm-rpmstring.h-for-rasprintf.patch
new file mode 100644
index 000000000000..f7df38935aed
--- /dev/null
+++ b/app-arch/createrepo_c/files/createrepo_c-0.20.1-Include-rpm-rpmstring.h-for-rasprintf.patch
@@ -0,0 +1,20 @@
+https://github.com/rpm-software-management/createrepo_c/pull/328
+
+From cddd4c161523cf4340aa59f832d130e7c34ffd14 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 19 Oct 2022 03:10:06 +0100
+Subject: [PATCH] Include <rpm/rpmstring.h> for rasprintf
+
+Fixes build with Clang 16.
+
+Bug: https://bugs.gentoo.org/875698
+--- a/src/xml_file.c
++++ b/src/xml_file.c
+@@ -20,6 +20,7 @@
+ #include <glib.h>
+ #include <glib/gstdio.h>
+ #include <assert.h>
++#include <rpm/rpmstring.h>
+ #include "xml_file.h"
+ #include <errno.h>
+ #include "error.h"
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-arch/createrepo_c/files/, app-arch/createrepo_c/
@ 2023-03-07 12:16 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-03-07 12:16 UTC (permalink / raw
To: gentoo-commits
commit: d72b56e47f333612712953b8fdaff615a6134b85
Author: Matt Jolly <Matt.Jolly <AT> footclan <DOT> ninja>
AuthorDate: Wed Jan 25 13:49:01 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 7 12:14:52 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d72b56e4
app-arch/createrepo_c: add 0.20.1-r1, 9999
- Added Delta-RPM, zchunk, and libmodulemd dependencies
- New 'legacy' USE to enable legacy-style (suse, mandriva) weakdeps and
hashes (MD5, SHA1)
Signed-off-by: Matt Jolly <Matt.Jolly <AT> footclan.ninja>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../createrepo_c/createrepo_c-0.20.1-r1.ebuild | 70 +++++++
app-arch/createrepo_c/createrepo_c-9999.ebuild | 65 ++++++
...createrepo_c-0.20.1-use-gio-instead-of-cp.patch | 229 +++++++++++++++++++++
app-arch/createrepo_c/metadata.xml | 3 +
4 files changed, 367 insertions(+)
diff --git a/app-arch/createrepo_c/createrepo_c-0.20.1-r1.ebuild b/app-arch/createrepo_c/createrepo_c-0.20.1-r1.ebuild
new file mode 100644
index 000000000000..9bd81ca8f784
--- /dev/null
+++ b/app-arch/createrepo_c/createrepo_c-0.20.1-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 2020-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="C implementation of createrepo"
+HOMEPAGE="https://github.com/rpm-software-management/createrepo_c"
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/rpm-software-management/createrepo_c.git"
+else
+ SRC_URI="https://github.com/rpm-software-management/createrepo_c/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="legacy test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ app-arch/bzip2:=
+ app-arch/drpm
+ app-arch/rpm
+ app-arch/xz-utils
+ app-arch/zchunk
+ dev-db/sqlite:3
+ dev-libs/glib:2
+ dev-libs/libxml2
+ dev-libs/openssl:=
+ net-misc/curl
+ sys-apps/file
+ sys-libs/libmodulemd
+ sys-libs/zlib:=
+"
+
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}/${P}-Include-rpm-rpmstring.h-for-rasprintf.patch"
+ "${FILESDIR}/${P}-use-gio-instead-of-cp.patch"
+)
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_DRPM=ON
+ # As best I can tell, this enables distribution as a wheel. No need for this on gentoo!
+ -DENABLE_PYTHON=OFF
+ # Upstream enables some 'Legacy' stuff by default, let's put that behind a USE flag
+ -DENABLE_LEGACY_WEAKDEPS=$(usex legacy ON OFF)
+ -DWITH_LEGACY_HASHES=$(usex legacy ON OFF)
+ -DWITH_LIBMODULEMD=ON
+ -DWITH_ZCHUNK=ON
+ )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ # Tests have a magic target!
+ use test && cmake_src_compile tests
+}
+
+src_test() {
+ "${S}"_build/tests/run_tests.sh || die "Failed to run C library tests"
+}
diff --git a/app-arch/createrepo_c/createrepo_c-9999.ebuild b/app-arch/createrepo_c/createrepo_c-9999.ebuild
new file mode 100644
index 000000000000..da19ee9ac2f3
--- /dev/null
+++ b/app-arch/createrepo_c/createrepo_c-9999.ebuild
@@ -0,0 +1,65 @@
+# Copyright 2020-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="C implementation of createrepo"
+HOMEPAGE="https://github.com/rpm-software-management/createrepo_c"
+if [[ ${PV} = 9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/rpm-software-management/createrepo_c.git"
+else
+ SRC_URI="https://github.com/rpm-software-management/createrepo_c/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+
+IUSE="legacy test"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ app-arch/bzip2:=
+ app-arch/drpm
+ app-arch/rpm
+ app-arch/xz-utils
+ app-arch/zchunk
+ dev-db/sqlite:3
+ dev-libs/glib:2
+ dev-libs/libxml2
+ dev-libs/openssl:=
+ net-misc/curl
+ sys-apps/file
+ sys-libs/libmodulemd
+ sys-libs/zlib:=
+"
+
+RDEPEND="${DEPEND}"
+
+src_configure() {
+ local mycmakeargs=(
+ -DENABLE_DRPM=ON
+ # As best I can tell, this enables distribution as a wheel. No need for this on gentoo!
+ -DENABLE_PYTHON=OFF
+ # Upstream enables some 'Legacy' stuff by default, let's put that behind a USE flag
+ -DENABLE_LEGACY_WEAKDEPS=$(usex legacy ON OFF)
+ -DWITH_LEGACY_HASHES=$(usex legacy ON OFF)
+ -DWITH_LIBMODULEMD=ON
+ -DWITH_ZCHUNK=ON
+ )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+ # Tests have a magic target!
+ use test && cmake_src_compile tests
+}
+
+src_test() {
+ "${S}"_build/tests/run_tests.sh || die "Failed to run C library tests"
+}
diff --git a/app-arch/createrepo_c/files/createrepo_c-0.20.1-use-gio-instead-of-cp.patch b/app-arch/createrepo_c/files/createrepo_c-0.20.1-use-gio-instead-of-cp.patch
new file mode 100644
index 000000000000..c0b92d6b9994
--- /dev/null
+++ b/app-arch/createrepo_c/files/createrepo_c-0.20.1-use-gio-instead-of-cp.patch
@@ -0,0 +1,229 @@
+https://github.com/rpm-software-management/createrepo_c/pull/341
+From: Matt Jolly <Matt.Jolly@footclan.ninja>
+Date: Thu, 26 Jan 2023 01:48:16 +1100
+Subject: [PATCH 1/3] Add `cr_gio_cp` and deprecate `cr_cp`
+
+It's preferable to use glib gio to copy files rather than
+rely on the behaviour of the system cp binary.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -32,7 +32,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+ SET(G_LOG_DOMAIN "C_CREATEREPOLIB")
+
+ # Find necessary libraries
+-
++find_package(PkgConfig)
+ find_package(BZip2 REQUIRED)
+ find_package(CURL REQUIRED)
+ find_package(LibXml2 REQUIRED)
+@@ -40,6 +40,7 @@ find_package(OpenSSL REQUIRED)
+ find_package(ZLIB REQUIRED)
+
+ pkg_check_modules(GLIB2 REQUIRED glib-2.0)
++pkg_check_modules(GIO REQUIRED gio-2.0)
+ pkg_check_modules(GTHREAD2 REQUIRED gthread-2.0)
+ pkg_check_modules(LZMA REQUIRED liblzma)
+ pkg_check_modules(SQLITE3 REQUIRED sqlite3)
+@@ -57,6 +58,7 @@ ENDIF()
+ include_directories(${BZIP2_INCLUDE_DIRS})
+ include_directories(${CURL_INCLUDE_DIRS})
+ include_directories(${GLIB2_INCLUDE_DIRS})
++include_directories(${GIO_INCLUDE_DIRS})
+ include_directories(${LIBXML2_INCLUDE_DIR})
+ include_directories(${OPENSSL_INCLUDE_DIR})
+ include_directories(${ZLIB_INCLUDE_DIR})
+@@ -154,4 +156,3 @@ ADD_SUBDIRECTORY (src)
+ ADD_SUBDIRECTORY (doc)
+ ENABLE_TESTING()
+ ADD_SUBDIRECTORY (tests EXCLUDE_FROM_ALL)
+-
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -70,6 +70,7 @@ ADD_LIBRARY(libcreaterepo_c ${createrepo_c_library_type} ${createrepo_c_SRCS})
+ TARGET_LINK_LIBRARIES(libcreaterepo_c ${BZIP2_LIBRARIES})
+ TARGET_LINK_LIBRARIES(libcreaterepo_c ${CURL_LIBRARY})
+ TARGET_LINK_LIBRARIES(libcreaterepo_c ${GLIB2_LIBRARIES})
++TARGET_LINK_LIBRARIES(libcreaterepo_c ${GIO_LIBRARIES})
+ TARGET_LINK_LIBRARIES(libcreaterepo_c ${LIBMAGIC_LIBRARIES})
+ TARGET_LINK_LIBRARIES(libcreaterepo_c ${LIBMODULEMD_LIBRARIES})
+ TARGET_LINK_LIBRARIES(libcreaterepo_c ${LIBXML2_LIBRARIES})
+--- a/src/helpers.c
++++ b/src/helpers.c
+@@ -19,6 +19,7 @@
+
+ #include <glib.h>
+ #include <glib/gstdio.h>
++#include <gio/gio.h>
+ #include <errno.h>
+ #include <string.h>
+ #include <time.h>
+@@ -448,10 +449,9 @@ cr_old_metadata_retention(const char *old_repo,
+ continue;
+ }
+
+- // COPY!
+- cr_cp(full_path,
+- new_full_path,
+- CR_CP_RECURSIVE|CR_CP_PRESERVE_ALL,
++ cr_gio_cp(g_file_new_for_path(full_path),
++ g_file_new_for_path(new_full_path),
++ G_FILE_COPY_ALL_METADATA,
+ NULL,
+ &tmp_err);
+
+@@ -476,5 +476,3 @@ cr_old_metadata_retention(const char *old_repo,
+
+ return ret;
+ }
+-
+-
+--- a/src/misc.c
++++ b/src/misc.c
+@@ -21,6 +21,7 @@
+
+ #include <glib/gstdio.h>
+ #include <glib.h>
++#include <gio/gio.h>
+ #include <arpa/inet.h>
+ #include <assert.h>
+ #include <curl/curl.h>
+@@ -794,8 +795,6 @@ cr_download(CURL *in_handle,
+ return CRE_OK;
+ }
+
+-
+-
+ gboolean
+ cr_better_copy_file(const char *src, const char *in_dst, GError **err)
+ {
+@@ -820,7 +819,6 @@ cr_better_copy_file(const char *src, const char *in_dst, GError **err)
+ return TRUE;
+ }
+
+-
+ int
+ cr_remove_dir_cb(const char *fpath,
+ G_GNUC_UNUSED const struct stat *sb,
+@@ -856,7 +854,7 @@ gboolean
+ cr_move_recursive(const char *srcDir, const char *dstDir, GError **err)
+ {
+ if (rename(srcDir, dstDir) == -1) {
+- if (!cr_cp(srcDir, dstDir, CR_CP_RECURSIVE, NULL, err))
++ if (!cr_gio_cp(g_file_new_for_path(srcDir), g_file_new_for_path(dstDir), G_FILE_COPY_ALL_METADATA, NULL, err))
+ return FALSE;
+ return (cr_remove_dir(srcDir, err) == CRE_OK);
+ }
+@@ -1425,6 +1423,44 @@ cr_cp(const char *src,
+ return ret;
+ }
+
++gboolean
++cr_gio_cp(GFile *src,
++ GFile *dst,
++ GFileCopyFlags flags,
++ GCancellable *cancellable,
++ GError **err)
++{
++ assert(src);
++ assert(dst);
++ assert(!err || *err == NULL);
++
++ GFileType type = g_file_query_file_type(src, G_FILE_QUERY_INFO_NONE, NULL);
++
++ if (type == G_FILE_TYPE_DIRECTORY) {
++ g_file_make_directory(dst, cancellable, err);
++ g_file_copy_attributes(src, dst, flags, cancellable, err);
++
++ GFileEnumerator *enumerator = g_file_enumerate_children(src, G_FILE_ATTRIBUTE_STANDARD_NAME, G_FILE_QUERY_INFO_NONE, cancellable, err);
++ for (GFileInfo *info = g_file_enumerator_next_file(enumerator, cancellable, err); info != NULL; info = g_file_enumerator_next_file(enumerator, cancellable, err)) {
++ const char *relative_path = g_file_info_get_name(info);
++ cr_gio_cp(
++ g_file_resolve_relative_path(src, relative_path),
++ g_file_resolve_relative_path(dst, relative_path),
++ flags, cancellable, err);
++ }
++ } else if (type == G_FILE_TYPE_REGULAR) {
++ g_file_copy(src, dst, flags, cancellable, NULL, NULL, err);
++ }
++
++ if (err != NULL) {
++ return TRUE;
++ }
++ else {
++ return FALSE;
++ }
++
++}
++
+ gboolean
+ cr_rm(const char *path,
+ cr_RmFlags flags,
+--- a/src/misc.h
++++ b/src/misc.h
+@@ -26,6 +26,7 @@ extern "C" {
+
+ #include <glib.h>
+ #include <string.h>
++#include <gio/gio.h>
+ #include <curl/curl.h>
+ #include "compression_wrapper.h"
+ #include "xml_parser.h"
+@@ -449,7 +450,7 @@ typedef enum {
+ preserve the all attributes (if possible) */
+ } cr_CpFlags;
+
+-/** Recursive copy of directory (works on files as well)
++/** Wrapper for cp
+ * @param src Source (supports wildcards)
+ * @param dst Destination (supports wildcards)
+ * @param flags Flags
+@@ -461,6 +462,20 @@ cr_cp(const char *src,
+ const char *dst,
+ cr_CpFlags flags,
+ const char *working_directory,
++ GError **err) __attribute__ ((deprecated ("please use `cr_gio_cp` instead")));
++
++/** Recursive copy of directory (works on files as well)
++ * @param src Source (supports wildcards)
++ * @param dst Destination (supports wildcards)
++ * @param flags Flags
++ * @param cancellable Can this be cancelled by another thread?
++ * @param err GError **
++ */
++gboolean
++cr_gio_cp(GFile *src,
++ GFile *dst,
++ GFileCopyFlags flags,
++ GCancellable *cancellable,
+ GError **err);
+
+ typedef enum {
+
+From 9fa5809150d2021186d4a822c38d5488cd4986dc Mon Sep 17 00:00:00 2001
+From: Matt Jolly <Matt.Jolly@footclan.ninja>
+Date: Fri, 27 Jan 2023 18:17:23 +1100
+Subject: [PATCH 2/3] Add to AUTHORS
+
+--- a/AUTHORS
++++ b/AUTHORS
+@@ -10,3 +10,4 @@ Neal Gompa <ngompa13@gmail.com>
+ Ralph Bean <rbean@redhat.com>
+ Frank Schreiner <schreiner@suse.de>
+ Daniel Alley <dalley@redhat.com>
++Matt Jolly <matt.jolly@footclan.ninja>
+
+From e6769f0e343cbeea1beee703b984307634691677 Mon Sep 17 00:00:00 2001
+From: Matt Jolly <Matt.Jolly@footclan.ninja>
+Date: Fri, 27 Jan 2023 20:06:21 +1100
+Subject: [PATCH 3/3] Update minimum CMake version
+
+Modern CMake warns of deprecation of <2.8.12, let's use that instead
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ PROJECT (createrepo_c C)
+-CMAKE_MINIMUM_REQUIRED (VERSION 2.8.10)
++CMAKE_MINIMUM_REQUIRED (VERSION 2.8.12)
+
+ include(GNUInstallDirs)
+
diff --git a/app-arch/createrepo_c/metadata.xml b/app-arch/createrepo_c/metadata.xml
index 142bf59db6a8..f2504159311a 100644
--- a/app-arch/createrepo_c/metadata.xml
+++ b/app-arch/createrepo_c/metadata.xml
@@ -9,6 +9,9 @@
<email>sam@gentoo.org</email>
<name>Sam James</name>
</maintainer>
+ <use>
+ <flag name="legacy">Build with support for legacy weakdeps and hashes (not recommended!)</flag>
+ </use>
<upstream>
<remote-id type="github">rpm-software-management/createrepo_c</remote-id>
</upstream>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-07 12:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-19 2:35 [gentoo-commits] repo/gentoo:master commit in: app-arch/createrepo_c/files/, app-arch/createrepo_c/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2023-03-07 12:16 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox