!28 add loongarch support

From: @huajingyun 
Reviewed-by: @t_feng 
Signed-off-by: @t_feng
This commit is contained in:
openeuler-ci-bot 2022-11-30 06:09:36 +00:00 committed by Gitee
commit eef54d9939
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -9,11 +9,16 @@
%global pluginsver 6
%global php_extdir %(php-config --extension-dir 2>/dev/null || echo %{_libdir}/php4)
%ifarch loongarch64
%global OCAML 0
%else
%global OCAML 1
%endif
Name: graphviz
Version: 2.48.0
Release: 2
Release: 3
Summary: Graph Visualization Tools
License: EPL-1.0
URL: http://www.graphviz.org/
@ -22,11 +27,15 @@ Source0: https://gitlab.com/graphviz/graphviz/-/archive/%{version}/gr
Patch6000: backport-graphviz-2.48.0-gvpack-neato-static.patch
BuildRequires: gcc-g++
BuildRequires: ksh bison m4 flex ruby automake perl-Carp autoconf libtool qpdf ocaml urw-base35-fonts, perl-ExtUtils-Embed, perl-generators, librsvg2-devel swig >= 1.3.33
BuildRequires: ksh bison m4 flex ruby automake perl-Carp autoconf libtool qpdf urw-base35-fonts, perl-ExtUtils-Embed, perl-generators, librsvg2-devel swig >= 1.3.33
BuildRequires: zlib-devel libpng-devel libjpeg-devel expat-devel tk-devel fontconfig-devel libtool-ltdl-devel ruby-devel guile-devel freetype-devel >= 2 tcl-devel >= 8.3
BuildRequires: python3-devel libXaw-devel libSM-devel libXext-devel java-devel pango-devel gmp-devel lua-devel gtk2-devel cairo-devel >= 1.1.10
BuildRequires: ghostscript libgs-devel gd-devel perl-devel chrpath
%if %{OCAML}
BuildRequires: ocaml
%endif
%if %{with php}
BuildRequires: php-devel
%endif
@ -92,12 +101,14 @@ Requires: %{name} = %{version}-%{release} lua
%description lua
Lua extension for graphviz.
%if %{OCAML}
%package ocaml
Summary: Ocaml extension for graphviz
Requires: %{name} = %{version}-%{release} ocaml
%description ocaml
Ocaml extension for graphviz.
%endif
%package perl
Summary: Perl extension for graphviz
@ -111,11 +122,13 @@ Summary: Ruby extension for graphviz
Requires: %{name} = %{version}-%{release} ruby
%description ruby
Ruby extension for graphviz.
%ifnarch loongarch64
%package tcl
Summary: Tcl extension & tools for graphviz
Requires: %{name} = %{version}-%{release} tcl >= 8.3 tk
%description tcl
Various tcl packages (extensions) for the graphviz tools.
%endif
%if %{with php}
@ -152,6 +165,9 @@ export CPPFLAGS=-I`ruby -e "puts File.join(RbConfig::CONFIG['includedir'], RbCon
--without-mylibgd --with-ipsepcola --with-pangocairo \
--with-gdk-pixbuf --with-visio --disable-silent-rules \
--without-lasi --without-gts --disable-sharp --without-ming \
%if !%{OCAML}
--disable-ocaml \
%endif
--disable-r --without-devil --without-qt
# drop rpath
@ -199,6 +215,11 @@ mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
echo "%{_libdir}/graphviz" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
touch $RPM_BUILD_ROOT%{_libdir}/graphviz/config%{pluginsver}
%ifarch loongarch64
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/lua/5.4/
mv $RPM_BUILD_ROOT/usr/lib/lua/5.4/gv.so $RPM_BUILD_ROOT/usr/lib64/lua/5.4/gv.so
%endif
%check
%if %{with php}
LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir} \
@ -269,8 +290,10 @@ php --no-php-ini --define extension_dir=$RPM_BUILD_ROOT%{_libdir}/graphviz/php/
%{_libdir}/graphviz/lua/
%{_libdir}/lua*/*
%if %{OCAML}
%files ocaml
%{_libdir}/graphviz/ocaml/
%endif
%files perl
%{_libdir}/graphviz/perl/
@ -284,11 +307,16 @@ php --no-php-ini --define extension_dir=$RPM_BUILD_ROOT%{_libdir}/graphviz/php/
%{_libdir}/graphviz/ruby/
%{_libdir}/*ruby*/*
%ifnarch loongarch64
%files tcl
%{_libdir}/graphviz/tcl/
%{_libdir}/tcl*/*
%endif
%changelog
* Mon Nov 21 2022 huajingyun <huajingyun@loongson.cn> - 2.48.0-3
- add loongarch support
* Sat Jan 8 2022 wuchaochao <wuchaochao4@huawei.com> - 2.48.0-2
- delete redundant Provides and Obsoletes