diff --git a/01_g_assert_nonnull.diff b/01_g_assert_nonnull.diff new file mode 100644 index 0000000..434815b --- /dev/null +++ b/01_g_assert_nonnull.diff @@ -0,0 +1,52 @@ +Index: libmirage-3.0.5/images/image-ccd/parser.c +=================================================================== +--- libmirage-3.0.5.orig/images/image-ccd/parser.c 2016-10-19 20:45:47.238020045 +0200 ++++ libmirage-3.0.5/images/image-ccd/parser.c 2016-10-19 20:46:38.188531986 +0200 +@@ -927,7 +927,7 @@ + + CCD_RegexRule *new_rule = g_new(CCD_RegexRule, 1); + new_rule->regex = g_regex_new(rule, G_REGEX_OPTIMIZE, 0, NULL); +- g_assert_nonnull(new_rule->regex); ++ g_assert(new_rule->regex != NULL); + new_rule->callback_func = callback; + /* Append to the list */ + list = g_list_append(list, new_rule); +Index: libmirage-3.0.5/images/image-cue/parser.c +=================================================================== +--- libmirage-3.0.5.orig/images/image-cue/parser.c 2016-10-19 20:45:47.238020045 +0200 ++++ libmirage-3.0.5/images/image-cue/parser.c 2016-10-19 20:46:38.188531986 +0200 +@@ -767,7 +767,7 @@ + + CUE_RegexRule *new_rule = g_new(CUE_RegexRule, 1); + new_rule->regex = g_regex_new(rule, G_REGEX_OPTIMIZE, 0, NULL); +- g_assert_nonnull(new_rule->regex); ++ g_assert(new_rule->regex != NULL); + new_rule->callback_func = callback; + /* Append to the list */ + list = g_list_append(list, new_rule); +Index: libmirage-3.0.5/images/image-toc/parser.c +=================================================================== +--- libmirage-3.0.5.orig/images/image-toc/parser.c 2016-10-19 20:45:47.238020045 +0200 ++++ libmirage-3.0.5/images/image-toc/parser.c 2016-10-19 20:46:38.188531986 +0200 +@@ -863,7 +863,7 @@ + + TOC_RegexRule *new_rule = g_new(TOC_RegexRule, 1); + new_rule->regex = g_regex_new(rule, G_REGEX_OPTIMIZE, 0, NULL); +- g_assert_nonnull(new_rule->regex); ++ g_assert(new_rule->regex != NULL); + new_rule->callback_func = callback; + /* Append to the list */ + list = g_list_append(list, new_rule); +Index: libmirage-3.0.5/images/image-xcdroast/parser.c +=================================================================== +--- libmirage-3.0.5.orig/images/image-xcdroast/parser.c 2016-10-19 20:45:47.238020045 +0200 ++++ libmirage-3.0.5/images/image-xcdroast/parser.c 2016-10-19 20:46:38.188531986 +0200 +@@ -496,7 +496,7 @@ + + XCDROAST_RegexRule *new_rule = g_new(XCDROAST_RegexRule, 1); + new_rule->regex = g_regex_new(rule, G_REGEX_OPTIMIZE, 0, NULL); +- g_assert_nonnull(new_rule->regex); ++ g_assert(new_rule->regex != NULL); + new_rule->callback_func = callback; + /* Append to the list */ + list = g_list_append(list, new_rule); diff --git a/libmirage-3.0.5-glib-2.28-workaround.patch b/libmirage-3.0.5-glib-2.28-workaround.patch new file mode 100644 index 0000000..585bf14 --- /dev/null +++ b/libmirage-3.0.5-glib-2.28-workaround.patch @@ -0,0 +1,71 @@ +--- a/images/image-ccd/parser.c 2016-10-10 02:01:03.000000000 +0100 ++++ b/images/image-ccd/parser.c 2017-03-20 02:40:11.000000000 +0100 +@@ -1033,7 +1033,7 @@ + gsize line_length; + + /* Read line */ +- line_string = g_data_input_stream_read_line_utf8(data_stream, &line_length, NULL, &local_error); ++ line_string = g_data_input_stream_read_line(data_stream, &line_length, NULL, &local_error); + + /* Handle error */ + if (!line_string) { +--- a/images/image-cue/parser.c 2016-10-10 02:01:03.000000000 +0100 ++++ b/images/image-cue/parser.c 2017-03-20 02:40:56.000000000 +0100 +@@ -839,7 +839,7 @@ + gsize line_length; + + /* Read line */ +- line_string = g_data_input_stream_read_line_utf8(data_stream, &line_length, NULL, &local_error); ++ line_string = g_data_input_stream_read_line(data_stream, &line_length, NULL, &local_error); + + /* Handle error */ + if (!line_string) { +--- a/images/image-toc/parser.c 2016-10-10 02:01:03.000000000 +0100 ++++ b/images/image-toc/parser.c 2017-03-20 02:42:21.000000000 +0100 +@@ -1007,7 +1007,7 @@ + GMatchInfo *match_info = NULL; + + /* Read line */ +- line_string = g_data_input_stream_read_line_utf8(data_stream, &line_length, NULL, &local_error); ++ line_string = g_data_input_stream_read_line(data_stream, &line_length, NULL, &local_error); + + /* Handle error */ + if (!line_string) { +@@ -1166,7 +1166,7 @@ + GMatchInfo *match_info = NULL; + + /* Read line */ +- line_string = g_data_input_stream_read_line_utf8(data_stream, &line_length, NULL, &local_error); ++ line_string = g_data_input_stream_read_line(data_stream, &line_length, NULL, &local_error); + + /* Handle error */ + if (!line_string) { +--- a/images/image-xcdroast/parser.c 2016-10-10 02:01:03.000000000 +0100 ++++ b/images/image-xcdroast/parser.c 2017-03-20 02:42:52.000000000 +0100 +@@ -587,7 +587,7 @@ + gsize line_length; + + /* Read line */ +- line_string = g_data_input_stream_read_line_utf8(data_stream, &line_length, NULL, &local_error); ++ line_string = g_data_input_stream_read_line(data_stream, &line_length, NULL, &local_error); + + /* Handle error */ + if (!line_string) { +@@ -670,7 +670,7 @@ + gsize line_length; + + /* Read line */ +- line_string = g_data_input_stream_read_line_utf8(data_stream, &line_length, NULL, &local_error); ++ line_string = g_data_input_stream_read_line(data_stream, &line_length, NULL, &local_error); + + /* Handle error */ + if (!line_string) { +@@ -766,7 +766,7 @@ + GMatchInfo *match_info = NULL; + + /* Read line */ +- line_string = g_data_input_stream_read_line_utf8(data_stream, &line_length, NULL, &local_error); ++ line_string = g_data_input_stream_read_line(data_stream, &line_length, NULL, &local_error); + + /* Handle error */ + if (!line_string) { diff --git a/libmirage.changes b/libmirage.changes index c84780f..d59f835 100644 --- a/libmirage.changes +++ b/libmirage.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Sat Apr 06 08:39:43 UTC 2017 - zenitur@ya.ru + +- Fix SLES 11 build. We're also need Glib 2.28 instead of 2.22.5. + Most desktop and workstation users are turn on Packman + repository, so they're have Glib 2.28 installed from there. +- Added 01_g_assert_nonnull.diff patch taken from Cdemu PPA. +- Add glib2-devel as a required for the -devel package. That fixes + some rpmbuild warning. + ------------------------------------------------------------------- Mon Feb 6 18:08:02 UTC 2017 - jengelh@inai.de diff --git a/libmirage.spec b/libmirage.spec index dfb1d65..ac01d48 100644 --- a/libmirage.spec +++ b/libmirage.spec @@ -28,6 +28,23 @@ Url: http://cdemu.sf.net/about/libmirage/ #Git-Clone: git://git.code.sf.net/p/cdemu/code Source: http://downloads.sf.net/cdemu/%name-%version.tar.bz2 +# A patch taken from Cdemu PPA +Patch1: 01_g_assert_nonnull.diff +# SLES 11 is still supported +%if 0%{?sles_version} && 0%{?suse_version} == 1110 +Patch2: libmirage-3.0.5-glib-2.28-workaround.patch +# Dependencies list in an old style +BuildRequires: cmake >= 2.8.5 +BuildRequires: pkg-config >= 0.16 +BuildRequires: libbz2-devel >= 1.0.0 +BuildRequires: glib2-devel >= 2.28 +BuildRequires: gtk-doc >= 1.4 +BuildRequires: xz-devel >= 5.0.0 +BuildRequires: libsamplerate-devel >= 0.1.0 +BuildRequires: shared-mime-info +BuildRequires: libsndfile-devel >= 1.0.0 +BuildRequires: zlib-devel >= 1.2.0 +%else BuildRequires: cmake >= 2.8.5 BuildRequires: pkg-config >= 0.16 BuildRequires: pkgconfig(bzip2) >= 1.0.0 @@ -41,6 +58,8 @@ BuildRequires: pkgconfig(samplerate) >= 0.1.0 BuildRequires: pkgconfig(shared-mime-info) BuildRequires: pkgconfig(sndfile) >= 1.0.0 BuildRequires: pkgconfig(zlib) >= 1.2.0 +%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot %description A CD-ROM image access library part of the cdemu suite. @@ -80,6 +99,7 @@ This package provides the image format plugins for libmirage. Summary: Development files for libmirage, a CD-ROM image access library Group: Development/Libraries/C and C++ Requires: %lname = %version +Requires: glib2-devel %description devel A CD-ROM image access library part of the cdemu suite. @@ -95,7 +115,9 @@ Summary: MIME type definitions and documentation for libmirage Group: Development/Libraries/C and C++ Requires(post): shared-mime-info Requires(postun): shared-mime-info +%if 0%{?suse_version} >= 1130 BuildArch: noarch +%endif %description data libmirage provides uniform access to the data stored in different @@ -105,7 +127,7 @@ file. This package contains the MIME type definitions and documentation. %package -n typelib-1_0-libmirage-%pname -Summary: The libmirage CD-ROM image access library – introspection bindings +Summary: The libmirage CD-ROM image access library – introspection bindings Group: System/Libraries %description -n typelib-1_0-libmirage-%pname @@ -117,6 +139,10 @@ This package provides the GObject Introspection bindings for libmirage. %prep %setup -q +%patch1 -p1 +%if 0%{?sles_version} && 0%{?suse_version} == 1110 +%patch2 -p1 +%endif %build %cmake -DCMAKE_MODULE_LINKER_FLAGS="" @@ -129,10 +155,18 @@ make %{?_smp_mflags} %postun -n %lname -p /sbin/ldconfig %post data +%if 0%{?sles_version} && 0%{?suse_version} == 1110 +/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : +%else %mime_database_post +%endif %postun data +%if 0%{?sles_version} && 0%{?suse_version} == 1110 +/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || : +%else %mime_database_postun +%endif %files -n %lname %defattr(-,root,root) @@ -152,10 +186,12 @@ make %{?_smp_mflags} %_includedir/libmirage-3.0/ %_libdir/libmirage.so %_libdir/pkgconfig/libmirage.pc +%if 0%{?suse_version} > 1110 %_datadir/gir-1.0 %files -n typelib-1_0-libmirage-%pname %defattr(-,root,root) %_libdir/girepository-1.0 +%endif %changelog