[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/10: gnu: libblockdev: Prepare for GLib 2.58.
From: |
guix-commits |
Subject: |
10/10: gnu: libblockdev: Prepare for GLib 2.58. |
Date: |
Sat, 22 May 2021 10:08:37 -0400 (EDT) |
mbakke pushed a commit to branch master
in repository guix.
commit d58e2f2723cb97954837821e425324fa34ab6ddf
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Sat May 22 16:00:35 2021 +0200
gnu: libblockdev: Prepare for GLib 2.58.
* gnu/packages/patches/libblockdev-glib-compat.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/disk.scm (libblockdev)[source](patches): New field.
---
gnu/local.mk | 1 +
gnu/packages/disk.scm | 1 +
gnu/packages/patches/libblockdev-glib-compat.patch | 61 ++++++++++++++++++++++
3 files changed, 63 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1c8bc22..0551cb5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1274,6 +1274,7 @@ dist_patch_DATA =
\
%D%/packages/patches/jsoncpp-fix-inverted-case.patch \
%D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \
%D%/packages/patches/kdbusaddons-kinit-file-name.patch \
+ %D%/packages/patches/libblockdev-glib-compat.patch \
%D%/packages/patches/libffi-3.3-powerpc-fixes.patch \
%D%/packages/patches/libffi-float128-powerpc64le.patch \
%D%/packages/patches/libvirt-add-install-prefix.patch \
diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 040aa38..006cb8e 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -925,6 +925,7 @@ to create devices with respective mappings for the ATARAID
sets discovered.")
(uri (string-append "https://github.com/storaged-project/"
"libblockdev/releases/download/"
version "-1/libblockdev-" version ".tar.gz"))
+ (patches (search-patches "libblockdev-glib-compat.patch"))
(sha256
(base32
"0s0nazkpzpn4an00qghjkk9n7gdm5a8dqfr5hfnlk5mk5lma8njm"))))
diff --git a/gnu/packages/patches/libblockdev-glib-compat.patch
b/gnu/packages/patches/libblockdev-glib-compat.patch
new file mode 100644
index 0000000..bb25d5d
--- /dev/null
+++ b/gnu/packages/patches/libblockdev-glib-compat.patch
@@ -0,0 +1,61 @@
+Don't use g_memdup() which is removed in newer versions of GLib.
+
+See <https://github.com/storaged-project/libblockdev/pull/623>.
+
+Taken from upstream:
+https://github.com/storaged-project/libblockdev/commit/5528baef6ccc835a06c45f9db34a2c9c3f2dd940
+
+diff --git a/src/lib/plugin_apis/vdo.api b/src/lib/plugin_apis/vdo.api
+--- a/src/lib/plugin_apis/vdo.api
++++ b/src/lib/plugin_apis/vdo.api
+@@ -170,7 +170,22 @@ void bd_vdo_stats_free (BDVDOStats *stats) {
+ * Deprecated: 2.24: Use LVM-VDO integration instead.
+ */
+ BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) {
+- return g_memdup (stats, sizeof (BDVDOStats));
++ if (stats == NULL)
++ return NULL;
++
++ BDVDOStats *new_stats = g_new0 (BDVDOStats, 1);
++
++ new_stats->block_size = stats->block_size;
++ new_stats->logical_block_size = stats->logical_block_size;
++ new_stats->physical_blocks = stats->physical_blocks;
++ new_stats->data_blocks_used = stats->data_blocks_used;
++ new_stats->overhead_blocks_used = stats->overhead_blocks_used;
++ new_stats->logical_blocks_used = stats->logical_blocks_used;
++ new_stats->used_percent = stats->used_percent;
++ new_stats->saving_percent = stats->saving_percent;
++ new_stats->write_amplification_ratio = stats->write_amplification_ratio;
++
++ return new_stats;
+ }
+
+ GType bd_vdo_stats_get_type () {
+diff --git a/src/plugins/vdo.c b/src/plugins/vdo.c
+--- a/src/plugins/vdo.c
++++ b/src/plugins/vdo.c
+@@ -81,7 +81,22 @@ void bd_vdo_stats_free (BDVDOStats *stats) {
+ }
+
+ BDVDOStats* bd_vdo_stats_copy (BDVDOStats *stats) {
+- return g_memdup (stats, sizeof (BDVDOStats));
++ if (stats == NULL)
++ return NULL;
++
++ BDVDOStats *new_stats = g_new0 (BDVDOStats, 1);
++
++ new_stats->block_size = stats->block_size;
++ new_stats->logical_block_size = stats->logical_block_size;
++ new_stats->physical_blocks = stats->physical_blocks;
++ new_stats->data_blocks_used = stats->data_blocks_used;
++ new_stats->overhead_blocks_used = stats->overhead_blocks_used;
++ new_stats->logical_blocks_used = stats->logical_blocks_used;
++ new_stats->used_percent = stats->used_percent;
++ new_stats->saving_percent = stats->saving_percent;
++ new_stats->write_amplification_ratio = stats->write_amplification_ratio;
++
++ return new_stats;
+ }
+
+
- branch master updated (7003b2d -> d58e2f2), guix-commits, 2021/05/22
- 01/10: gnu: ntp: Prepare for GCC 10., guix-commits, 2021/05/22
- 02/10: gnu: sharutils: Prepare for GCC 10., guix-commits, 2021/05/22
- 03/10: gnu: sharutils: 'which' is a native input., guix-commits, 2021/05/22
- 04/10: gnu: python-coverage-test-runner: Add Python 3 variant., guix-commits, 2021/05/22
- 05/10: gnu: python2-cliapp: Add Python 3 variant., guix-commits, 2021/05/22
- 08/10: gnu: cmdtest: Do not propagate any inputs., guix-commits, 2021/05/22
- 09/10: gnu: ucx: Restore (and adapt) ioctl fallback patch., guix-commits, 2021/05/22
- 10/10: gnu: libblockdev: Prepare for GLib 2.58.,
guix-commits <=
- 06/10: gnu: python2-ttystatus: Add Python 3 variant., guix-commits, 2021/05/22
- 07/10: gnu: cmdtest: Update to 0.32-14-gcdfe14e., guix-commits, 2021/05/22