File eclipse-swt.spec of Package eclipse-swt
#
# spec file for package eclipse-swt
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{!?aarch64:%global aarch64 aarch64 arm64 armv8}
%define version_suffix 4.3.3.3
%define so_suffix 4333
Name: eclipse-swt
Version: 4.333
Release: 0
Summary: SWT Library for GTK2
License: EPL-1.0
Group: Development/Libraries/Other
Url: http://www.eclipse.org/swt/
Source0: libswt-%{version}.tar.bz2
Source1: org.eclipse.swt-4.3.1.tar.bz2
Source2: build.xml
Patch0: libswt-optflags.patch
Patch1: libswt-includes.patch
Patch2: libswt-build.patch
Patch3: libswt-plugindir.patch
Patch4: ppc64le.patch
Patch5: ppc64le_path_for_jre_1_7_0.patch
Patch6: libswt-4.333-libjawt.patch
Patch7: libswt-bootclasspath.patch
Patch8: aarch64.patch
BuildRequires: Mesa-devel
BuildRequires: ant
BuildRequires: cairo
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: glib2-devel
BuildRequires: gnome-vfs2-devel
BuildRequires: gtk2-devel
BuildRequires: java-devel >= 1.6
BuildRequires: jpackage-utils
BuildRequires: libgnome-devel
BuildRequires: libgnomeui-devel
BuildRequires: make
BuildRequires: mozilla-nspr-devel
BuildRequires: pkgconfig
BuildRequires: unzip
BuildRequires: zip
BuildRequires: pkgconfig(glu)
Requires: java >= 1.6
Provides: libswt3-gtk2 = %{version}
%if 0%{?suse_version} <= 1210
Requires: mozilla-xulrunner192
%endif
%if 0%{?suse_version} <= 1210
BuildRequires: libxslt
BuildRequires: mozilla-xulrunner192-devel
%else
BuildRequires: libXt-devel
BuildRequires: libXtst-devel
%endif
%description
SWT is the software component that delivers native widget functionality
for the Eclipse platform in an operating system independent manner. It
is analogous to AWT/Swing in Java with a difference - SWT uses a rich
set of native widgets.
%prep
%setup -q -n libswt-%{version}
%patch0
%patch1
%patch2
pushd org/eclipse
tar -xjf %{SOURCE1}
%patch3
%patch7
popd
%patch4
%patch5 -p1
%patch6 -p1
%patch8
pushd org/eclipse/swt
cp %{SOURCE2} .
# remove all third party jars
find . -iname '*.jar' | xargs rm -rf
popd
%build
export LIBDIR=%{_libdir}
export NO_STRIP=TRUE
export JAVA_HOME="%{_sysconfdir}/alternatives/java_sdk"
./build.sh
pushd org/eclipse/swt
%{ant} -v \
%ifnarch %{ix86} %{aarch64} %{arm} ppc64le
-Dswt.arch=%{_arch} \
%else
%ifarch %{ix86}
-Dswt.arch=x86 \
%endif
%ifarch %{arm}
-Dswt.arch=arm \
%endif
%ifarch %{aarch64}
-Dswt.arch=aarch64 \
%endif
%ifarch ppc64le
-Dswt.arch=ppc64 \
%endif
%endif
-DjavacTarget=1.6 -DjavacSource=1.6 \
-Dversion.suffix=%{version_suffix} \
-Djar.filename=swt-%{version}.jar \
build.jars
rm build.xml
popd
zip -u org/eclipse/swt/swt-%{version}.jar *.so
%install
install -d -m755 %{buildroot}%{_libdir}/eclipse
install -m644 *.so %{buildroot}%{_libdir}/eclipse
install -D -m644 org/eclipse/swt/swt-%{version}.jar %{buildroot}%{_libdir}/java/swt-gtk-%{version}.jar
pushd %{buildroot}%{_libdir}/eclipse
%if 0%{?suse_version} < 1210
for i in atk-gtk awt-gtk cairo-gtk glx-gtk gnome-gtk gtk mozilla-gtk pi-gtk webkit-gtk; do
ln -sf libswt-"$i"-%{so_suffix}.so libswt-"$i".so;
ln -sf libswt-"$i"-%{so_suffix}.so swt-"$i".so;
done
%else
# Drop mozilla-gtk in openSUSE 12.2 because of not existing mozilla-xulrunner192-devel
for i in atk-gtk awt-gtk cairo-gtk glx-gtk gnome-gtk gtk pi-gtk webkit-gtk; do
ln -sf libswt-"$i"-%{so_suffix}.so libswt-"$i".so;
ln -sf libswt-"$i"-%{so_suffix}.so swt-"$i".so;
done
%endif
popd
pushd %{buildroot}%{_libdir}/java
ln -sf swt-gtk-%{version}.jar swt.jar
ln -sf swt-gtk-%{version}.jar swt-gtk.jar
popd
%files
%{_libdir}/eclipse/libswt-atk-gtk-%{so_suffix}.so
%{_libdir}/eclipse/libswt-atk-gtk.so
%{_libdir}/eclipse/swt-atk-gtk.so
%{_libdir}/eclipse/libswt-awt-gtk-%{so_suffix}.so
%{_libdir}/eclipse/libswt-awt-gtk.so
%{_libdir}/eclipse/swt-awt-gtk.so
%{_libdir}/eclipse/libswt-cairo-gtk-%{so_suffix}.so
%{_libdir}/eclipse/libswt-cairo-gtk.so
%{_libdir}/eclipse/swt-cairo-gtk.so
%{_libdir}/eclipse/libswt-glx-gtk-%{so_suffix}.so
%{_libdir}/eclipse/libswt-glx-gtk.so
%{_libdir}/eclipse/swt-glx-gtk.so
%{_libdir}/eclipse/libswt-gnome-gtk-%{so_suffix}.so
%{_libdir}/eclipse/libswt-gnome-gtk.so
%{_libdir}/eclipse/swt-gnome-gtk.so
%{_libdir}/eclipse/libswt-gtk-%{so_suffix}.so
%{_libdir}/eclipse/libswt-gtk.so
%{_libdir}/eclipse/swt-gtk.so
%if 0%{?suse_version} < 1210
%{_libdir}/eclipse/libswt-mozilla-gtk.so
%{_libdir}/eclipse/swt-mozilla-gtk.so
%endif
%{_libdir}/eclipse/libswt-pi-gtk-%{so_suffix}.so
%{_libdir}/eclipse/libswt-pi-gtk.so
%{_libdir}/eclipse/swt-pi-gtk.so
%{_libdir}/eclipse/libswt-webkit-gtk-%{so_suffix}.so
%{_libdir}/eclipse/libswt-webkit-gtk.so
%{_libdir}/eclipse/swt-webkit-gtk.so
%{_libdir}/java/swt.jar
%{_libdir}/java/swt-gtk.jar
%{_libdir}/java/swt-gtk-%{version}.jar
%doc about_files/*
%dir %{_libdir}/eclipse
%dir %{_libdir}/java
%changelog