From ac132d2a7b5d44c39febde4f31267ca64d2bae17 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sun, 4 Apr 2021 14:27:09 +0900 Subject: [PATCH] Kill no-gi --- pango-create-no-gi-src.sh | 30 ------- pango-no-gi-3.3.7-backport-def.patch | 83 ------------------ rubygem-pango.spec | 122 +-------------------------- sources | 2 +- 4 files changed, 5 insertions(+), 232 deletions(-) delete mode 100644 pango-create-no-gi-src.sh delete mode 100644 pango-no-gi-3.3.7-backport-def.patch diff --git a/pango-create-no-gi-src.sh b/pango-create-no-gi-src.sh deleted file mode 100644 index 34a466a..0000000 --- a/pango-create-no-gi-src.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -usage() { - echo "$0 " -} - -set -e -set -x - -if [ $# -lt 1 ] ; then - usage - exit 1 -fi - -VERSION=$1 - -TMPDIR=$(mktemp -d /tmp/pango-nogi-XXXXXX) -CURDIR=$(pwd) - -pushd $TMPDIR - -git clone https://github.com/ruby-gnome2/ruby-gnome2.git -cd ruby-gnome2/ - -git reset --hard $VERSION -tar czf $CURDIR/pango-no-gi-${VERSION}.tar.gz glib2/ pango-no-gi/ - -popd -rm -rf $TMPDIR - diff --git a/pango-no-gi-3.3.7-backport-def.patch b/pango-no-gi-3.3.7-backport-def.patch deleted file mode 100644 index 40aafe3..0000000 --- a/pango-no-gi-3.3.7-backport-def.patch +++ /dev/null @@ -1,83 +0,0 @@ -diff -urp pango-no-gi-3.3.7.orig/ext/pango/rbpango.h pango-no-gi-3.3.7.new/ext/pango/rbpango.h ---- pango-no-gi-3.3.7.orig/ext/pango/rbpango.h 2019-09-06 16:06:39.000000000 +0900 -+++ pango-no-gi-3.3.7.new/ext/pango/rbpango.h 2019-09-06 16:11:02.031086838 +0900 -@@ -93,3 +93,5 @@ extern GType pango_script_iter_get_type( - - extern VALUE pango_get_attribute_klass(VALUE attr_type); - extern void pango_add_attribute(int attr_type, VALUE klass); -+ -+VALUE rbpango_attribute_to_ruby(PangoAttribute *attribute); -diff -urp pango-no-gi-3.3.7.orig/ext/pango/rbpangoattribute.c pango-no-gi-3.3.7.new/ext/pango/rbpangoattribute.c ---- pango-no-gi-3.3.7.orig/ext/pango/rbpangoattribute.c 2019-09-06 16:06:39.000000000 +0900 -+++ pango-no-gi-3.3.7.new/ext/pango/rbpangoattribute.c 2019-09-06 17:54:26.143794321 +0900 -@@ -82,6 +82,41 @@ pango_get_attribute(VALUE attr) - return gattr; - } - -+#if !PANGO_VERSION_CHECK(1, 44, 0) -+static GType -+pango_attribute_get_type(void) -+{ -+ static GType our_type = 0; -+ if (our_type == 0) -+ our_type = g_boxed_type_register_static("PangoAttribute", -+ (GBoxedCopyFunc)pango_attribute_copy, -+ (GBoxedFreeFunc)pango_attribute_destroy); -+ return our_type; -+} -+#endif -+ -+VALUE -+rbpango_attribute_to_ruby(PangoAttribute *attribute) -+{ -+ VALUE rb_attr_type; -+ ID id_to_class; -+ VALUE klass; -+ -+ rb_attr_type = GENUM2RVAL(attribute->klass->type, PANGO_TYPE_ATTR_TYPE); -+ CONST_ID(id_to_class, "to_class"); -+ klass = rb_funcall(rb_attr_type, id_to_class, 0); -+ return rbgobj_make_boxed_raw(pango_attribute_copy(attribute), -+ pango_attribute_get_type(), -+ klass, -+ 0); -+} -+ -+PangoAttribute * -+rbpango_attribute_from_ruby(VALUE rb_attribute) -+{ -+ return rbgobj_boxed_get(rb_attribute, pango_attribute_get_type()); -+} -+ - /***********************************************/ - static VALUE - rg_s_allocate(VALUE klass) -diff -urp pango-no-gi-3.3.7.orig/ext/pango/rbpangofontsetsimple.c pango-no-gi-3.3.7.new/ext/pango/rbpangofontsetsimple.c ---- pango-no-gi-3.3.7.orig/ext/pango/rbpangofontsetsimple.c 2019-09-06 16:06:39.000000000 +0900 -+++ pango-no-gi-3.3.7.new/ext/pango/rbpangofontsetsimple.c 2019-09-06 17:54:57.094194781 +0900 -@@ -22,6 +22,7 @@ - #include "rbpangoprivate.h" - - #ifdef PANGO_ENABLE_BACKEND -+#if !PANGO_VERSION_CHECK(1, 44, 0) - - #define RG_TARGET_NAMESPACE cFontsetSimple - #define _SELF(self) (RVAL2PANGOFONTSETSIMPLE(self)) -@@ -47,14 +48,17 @@ rg_size(VALUE self) - } - - #endif -+#endif - void - Init_pango_fontset_simple(VALUE mPango) - { - #ifdef PANGO_ENABLE_BACKEND -+#if !PANGO_VERSION_CHECK(1, 44, 0) - VALUE RG_TARGET_NAMESPACE = G_DEF_CLASS(PANGO_TYPE_FONTSET_SIMPLE, "FontsetSimple", mPango); - - RG_DEF_METHOD(initialize, 1); - RG_DEF_METHOD(append, 1); - RG_DEF_METHOD(size, 0); - #endif -+#endif - } diff --git a/rubygem-pango.spec b/rubygem-pango.spec index 8107a8e..30076a4 100644 --- a/rubygem-pango.spec +++ b/rubygem-pango.spec @@ -13,17 +13,11 @@ Summary: Ruby binding of pango-1.x Name: rubygem-%{gem_name} Version: 3.4.3 -Release: 3%{?dist} +Release: 4%{?dist} # from README License: LGPLv2 URL: http://ruby-gnome2.sourceforge.jp/ Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem -# no-gi version -Source1: pango-no-gi-%{version}.tar.gz -# Source1 is created from Source2 -Source2: pango-create-no-gi-src.sh -# Backport rbpango_attribute_{to,from}_ruby definition -Patch10: pango-no-gi-3.3.7-backport-def.patch Requires: ruby(release) BuildRequires: ruby(release) @@ -58,27 +52,6 @@ Requires: %{name} = %{version}-%{release} %description doc This package contains documentation for %{name}. -# Create no-gi for now -%package -n rubygem-%{gem_name_no_gi} -Summary: Ruby binding of pango-1.x with no-gi version -BuildRequires: rubygem(rake) -BuildRequires: rubygem(mechanize) -# For now, explicitly -Requires: rubygem(glib2) -Requires: rubygem(cairo) -Provides: rubygem(pango-no-gi) = %{version}-%{release} - -%description -n rubygem-%{gem_name_no_gi} -Ruby/Pango is a Ruby binding of pango-1.x. -This package contains no-gi implementation of Ruby/Pango. - -%package -n rubygem-%{gem_name_no_gi}-doc -Summary: Documentation for %{name} no-gi -Requires: rubygem-%{gem_name_no_gi} = %{version}-%{release} - -%description -n rubygem-%{gem_name_no_gi}-doc -This package contains documentation for ubygem-%{gem_name_no_gi}. - %package devel Summary: Ruby/pango development environment Requires: %{name} = %{version}-%{release} @@ -112,46 +85,6 @@ export CONFIGURE_ARGS="$CONFIGURE_ARGS --with-pkg-config-dir=$(pwd)%{_libdir}/pk gem build %{gem_name}.gemspec %gem_install -###### -# Create no-gi for now -rm -rf no-gi -mkdir no-gi -pushd no-gi - -tar xf %{SOURCE1} -chmod ugo+rX . -pushd pango-no-gi -cat %PATCH10 | patch -p1 -mv ext/pango ext/pango-no-gi -rake gem -popd - -cp -a pango-no-gi/pkg/%{gem_name_no_gi}-%{version}.gem . - -# Change for now -%global gem_name %gem_name_no_gi -gem unpack %{gem_name}-%{version}.gem -pushd %{gem_name}-%{version} - -# Kill shebang -grep -rl '#!.*/usr/bin' sample | \ - xargs sed -i -e '\@#![ ]*/usr/bin@d' -find sample/ -name \*.rb | xargs chmod 0644 - -gem spec ../%{gem_name}-%{version}.gem -l --ruby > %{gem_name}.gemspec -sed -i -e 's|= 3\.4\.3|>= 3.4.3|' %{gem_name}.gemspec -export CONFIGURE_ARGS="--with-cflags='%{optflags}'" -export CONFIGURE_ARGS="$CONFIGURE_ARGS --with-pkg-config-dir=$(pwd)%{_libdir}/pkgconfig" -gem build %{gem_name}.gemspec -mv %{gem_name}-%{version}.gem .. -popd - -%gem_install -n ./%{gem_name}-%{version}.gem -chmod -R ugo+rX . - -# Back -%global gem_name %gem_name_gi -popd %install # Once copy all @@ -180,35 +113,6 @@ rm -rf .%{gem_instdir}/ext/ rm -f .%{gem_instdir}/extconf.rb popd -### For no-gi -%global gem_name %gem_name_no_gi - -pushd no-gi -cp -a .%{gem_dir}/* \ - %{buildroot}%{gem_dir}/ - -# move header files, C extension files to the correct directory -mkdir -p %{buildroot}%{gem_extdir_mri} -cp -a ./%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/ - -pushd %{buildroot} -# mv .%{gem_extdir_mri}/*.h .%{header_dir}/ -rm -f ./%{gem_extdir_mri}/*.h -rm -f .%{gem_extdir_mri}/{gem_make.out,mkmf.log} -popd - -# Cleanups -pushd %{buildroot} -rm -rf .%{gem_instdir}/ext/ -rm -rf .%{gem_instdir}/test/ -rm -f .%{gem_instdir}/Rakefile -rm -f .%{gem_instdir}/extconf.rb -popd -popd - -%global gem_name %gem_name_gi - - %check pushd .%{gem_instdir} @@ -256,28 +160,10 @@ ruby -Ilib:test:ext/%{gem_name} ./test/run-test.rb \ %exclude %{gem_instdir}/Rakefile %{gem_instdir}/test/ -# Again: -%global gem_name %gem_name_no_gi -%files -n rubygem-%{gem_name_no_gi} -%dir %{gem_instdir} -%dir %{gem_instdir}/lib/ - -%doc %{gem_instdir}/[A-Z]* - -# The following should be "pango.rb" -%{gem_instdir}/lib/pango.rb -%{gem_extdir_mri} -%exclude %{gem_cache} -%{gem_spec} - -%files -n rubygem-%{gem_name_no_gi}-doc -%{gem_docdir} -%{gem_instdir}/sample/ - -%global gem_name %gem_name_gi - - %changelog +* Sun Apr 4 2021 Mamoru TASAKA - 3.4.3-4 +- Kill no-gi + * Wed Jan 27 2021 Fedora Release Engineering - 3.4.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 05f3104..ad4a1ec 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ SHA512 (pango-3.4.3.gem) = a4389a0601388983ebafa9aa708e5ad750b2f1434e697955221688ad62611e4c390c9cdfa955355ba9eab65c10d0cf7aeed79c02d48bc31b3a31e4a8cf33306e -SHA512 (pango-no-gi-3.4.3.tar.gz) = 612fb319565772a10d827b04abebdac8d77448d6a6c68e5db64b9e1daed5e72e7ce2d1a817ed25a60caf4489fa654f951a57b1d351da2fce9f3bc828e4121226 +