File mingw64-osgHimmel.spec of Package mingw64-osgHimmel

#
# spec file for package mingw64-OpenSceneGraph
#
# Copyright (c) 2015 SUSE LINUX Products 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/
#


%define _osg_so_nr	100
%define _opt_so_nr	20

%define _name   osgHimmel
Name:           mingw64-%{_name}
Version:        3.2.1_0.5.0
Release:        0
Summary:        OpenSceneGraph library featuring skies
License:        BSD-3-Clause
Group:          Productivity/Graphics/Other
Url:            https://github.com/cgcostume/osghimmel
Source:         %{_name}-%{version}.tar.xz
Patch0:		    %{_name}-gcc-win32-compile-fix.patch
Patch1:         %{_name}-nvidia-shader-macro-fix.patch
Patch2:         %{_name}-shared-library-version.diff
BuildRequires:  cmake
BuildRequires:  fdupes
BuildRequires:  mingw64-cross-binutils
BuildRequires:  mingw64-cross-gcc
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  mingw64-cross-pkg-config
BuildRequires:  mingw64-libdbus-1-3
BuildRequires:  mingw64-libOpenSceneGraph-devel
BuildRequires:  dos2unix
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%_mingw64_package_header_debug
Requires:       mingw64-libOpenSceneGraph%{_osg_so_nr}
Requires:       %{name}-examples
BuildArch:      noarch

%description
osgHimmel is a OpenSceneGraph (OSG) extending library that 
allows visualization of background imagery in arbitrary 
scenegraphs. Thereby two different techniques are available: 
First: real-time computation of a physical based model for 
topocentric observers on earth at a specific date-time. 
Sun, moon and star positions, atmosphere, and weather 
are procedurally generated. 
Second: various texture mapped skies with dynamic, time based 
texture transitions, rotation, horizon blending as well 
as an optional "faked" sun.

%package -n mingw64-libosgHimmel%{_osg_so_nr}
Summary:        Shared libraries for OpenSceneGraph Himmel
Group:          System/Libraries
Requires:       mingw64-libOpenSceneGraph%{_osg_so_nr}

%description -n mingw64-libosgHimmel%{_osg_so_nr}
osgHimmel is a OpenSceneGraph (OSG) extending library that 
allows visualization of background imagery in arbitrary 
scenegraphs. Thereby two different techniques are available: 
First: real-time computation of a physical based model for 
topocentric observers on earth at a specific date-time. 
Sun, moon and star positions, atmosphere, and weather 
are procedurally generated. 
Second: various texture mapped skies with dynamic, time based 
texture transitions, rotation, horizon blending as well 
as an optional "faked" sun.

This package contains the shared libraries for OpenSceneGraph Himmel.

%package -n mingw64-libosgHimmel-devel
Summary:        OpenSceneGraph Himmel development files
Group:          Development/Libraries/C and C++
Requires:       mingw64-libOpenSceneGraph%{_osg_so_nr} = %{version}

%description -n mingw64-libosgHimmel-devel
osgHimmel is a OpenSceneGraph (OSG) extending library that 
allows visualization of background imagery in arbitrary 
scenegraphs. Thereby two different techniques are available: 
First: real-time computation of a physical based model for 
topocentric observers on earth at a specific date-time. 
Sun, moon and star positions, atmosphere, and weather 
are procedurally generated. 
Second: various texture mapped skies with dynamic, time based 
texture transitions, rotation, horizon blending as well 
as an optional "faked" sun.

This package contains the header and development files for
OpenSceneGraph Himmel.

%package examples
Summary:        OpenSceneGraph example applications
Group:          Productivity/Graphics/Other
Requires:       mingw64-libOpenSceneGraph%{_osg_so_nr}
Requires:       mingw64-OpenSceneGraph-plugins

%description examples
osgHimmel is a OpenSceneGraph (OSG) extending library that 
allows visualization of background imagery in arbitrary 
scenegraphs. Thereby two different techniques are available: 
First: real-time computation of a physical based model for 
topocentric observers on earth at a specific date-time. 
Sun, moon and star positions, atmosphere, and weather 
are procedurally generated. 
Second: various texture mapped skies with dynamic, time based 
texture transitions, rotation, horizon blending as well 
as an optional "faked" sun.

This package contains some examples for OpenSceneGraph Himmel.

%_mingw64_debug_package

%prep
%setup -q -n %{_name}-%{version}
dos2unix  tests/test.h
dos2unix  CMakeLists.txt
dos2unix  examples/CMakeLists.txt
dos2unix  src/CMakeLists.txt
dos2unix  tests/CMakeLists.txt
%patch0 -p0
dos2unix src/shaderfragment/common.h
%patch1 -p0
%patch2 -p0


%build
export CFLAGS="%{optflags} -fno-strict-aliasing -D__STDC_CONSTANT_MACROS -UGTK_DISABLE_DEPRECATED"
export CXXFLAGS="%{optflags} -fno-strict-aliasing -D__STDC_CONSTANT_MACROS -UGTK_DISABLE_DEPRECATED"
mkdir build
cd build
%_mingw64_cmake \
        -DCMAKE_C_FLAGS_RELEASE="%{optflags}  -fno-strict-aliasing -D__STDC_CONSTANT_MACROS -UGTK_DISABLE_DEPRECATED" \
        -DCMAKE_CXX_FLAGS_RELEASE="%{optflags}  -fno-strict-aliasing -D__STDC_CONSTANT_MACROS -UGTK_DISABLE_DEPRECATED" \
        -DOSG_SOVERSION=%{_osg_so_nr} \
        -DCMAKE_BUILD_TYPE=Release \
        -DOPTION_MAKE_SKYBOX=OFF \
        -DOPTION_MAKE_TESTS=OFF \
        ..

# cmake Modules/opensuse_rules.cmake adds this
# result into linker failure  undefined __stack_chk_guard
# see http://wiki.osdev.org/Stack_Smashing_Protector for more details
sed -i 's,\-fstack-protector-strong,,g;s,\-fstack-protector,,g' CMakeCache.txt

%_mingw64_make %{?_smp_mflags} 

%install
cd build
%_mingw64_makeinstall DESTDIR=%{buildroot}

%files
%defattr(-,root,root)

%files -n mingw64-libosgHimmel%{_osg_so_nr}
%defattr(-,root,root)
%{_mingw64_bindir}/libosg*osgHimmel.dll

%files -n mingw64-libosgHimmel-devel
%defattr(-,root,root)
%{_mingw64_includedir}/osgHimmel/
%{_mingw64_libdir}/libosgHimmel.dll.a

%files examples
%defattr(-,root,root)
%{_mingw64_bindir}/demo_computed.exe
# FIXME needs resources
%{_mingw64_bindir}/demo_textured.exe
# FIXME needs resources from https://code.google.com/p/osghimmel/downloads/detail?name=osghimmel-0.5.10-win64-r261.zip&can=2&q=
# FIXME needs Qt4
# %{_mingw64_bindir}/skybox.exe

%changelog
openSUSE Build Service is sponsored by