Migrate MinGW build to native package.
This commit is contained in:
parent
6ab01c0d48
commit
2c3f3989da
158
fltk.spec
158
fltk.spec
@ -1,6 +1,9 @@
|
||||
# trim changelog included in binary rpms
|
||||
%global _changelog_trimtime %(date +%s -d "1 year ago")
|
||||
|
||||
# MinGW is enabled by default, to disable use '--without mingw'
|
||||
%bcond_without mingw
|
||||
|
||||
Name: fltk
|
||||
Version: 1.3.8
|
||||
Release: 4%{?dist}
|
||||
@ -16,10 +19,14 @@ Source1: fltk-config.sh
|
||||
Patch0: fltk-cmake.patch
|
||||
# add lib64 support, drop extraneous libs (bug #708185) and ldflags (#1112930)
|
||||
Patch1: fltk-1.3.4-fltk_config.patch
|
||||
# Fix cmake install location for MinGW build
|
||||
Patch2: mingw-fltk-cmake.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: doxygen
|
||||
# For MinGW builds
|
||||
BuildRequires: fltk-fluid
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: make
|
||||
BuildRequires: texlive-latex
|
||||
@ -33,39 +40,95 @@ BuildRequires: pkgconfig(xcursor)
|
||||
BuildRequires: pkgconfig(xproto)
|
||||
BuildRequires: pkgconfig(zlib)
|
||||
|
||||
%description
|
||||
FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit.
|
||||
It provides modern GUI functionality without the bloat, and supports
|
||||
%if %{with mingw}
|
||||
# MinGW
|
||||
BuildRequires: mingw32-filesystem >= 95
|
||||
BuildRequires: mingw32-gcc
|
||||
BuildRequires: mingw32-binutils
|
||||
BuildRequires: mingw32-gettext
|
||||
BuildRequires: mingw32-win-iconv
|
||||
BuildRequires: mingw32-zlib
|
||||
# Libraries
|
||||
BuildRequires: mingw32-libpng
|
||||
BuildRequires: mingw32-libjpeg
|
||||
|
||||
BuildRequires: mingw64-filesystem >= 95
|
||||
BuildRequires: mingw64-gcc
|
||||
BuildRequires: mingw64-binutils
|
||||
BuildRequires: mingw64-gettext
|
||||
BuildRequires: mingw64-win-iconv
|
||||
BuildRequires: mingw64-zlib
|
||||
# Libraries
|
||||
BuildRequires: mingw64-libpng
|
||||
BuildRequires: mingw64-libjpeg
|
||||
%endif
|
||||
|
||||
|
||||
%global _description \
|
||||
FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit. \
|
||||
It provides modern GUI functionality without the bloat, and supports \
|
||||
3D graphics via OpenGL and its built-in GLUT emulation.
|
||||
|
||||
%description
|
||||
%{_description}
|
||||
|
||||
%package devel
|
||||
Summary: Development files for %{name}
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: libstdc++-devel
|
||||
Requires: pkgconfig(fontconfig)
|
||||
Requires: pkgconfig(gl) pkgconfig(glu)
|
||||
Requires: pkgconfig(ice) pkgconfig(sm)
|
||||
Requires: pkgconfig(xft) pkgconfig(xt) pkgconfig(x11)
|
||||
Requires: pkgconfig(libjpeg)
|
||||
Requires: pkgconfig(libpng)
|
||||
Requires: pkgconfig(zlib)
|
||||
Summary: Development files for %{name}
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: libstdc++-devel
|
||||
Requires: pkgconfig(fontconfig)
|
||||
Requires: pkgconfig(gl) pkgconfig(glu)
|
||||
Requires: pkgconfig(ice) pkgconfig(sm)
|
||||
Requires: pkgconfig(xft) pkgconfig(xt) pkgconfig(x11)
|
||||
Requires: pkgconfig(libjpeg)
|
||||
Requires: pkgconfig(libpng)
|
||||
Requires: pkgconfig(zlib)
|
||||
%description devel
|
||||
%{summary}.
|
||||
|
||||
%package static
|
||||
Summary: Static libraries for %{name}
|
||||
Requires: %{name}-devel = %{version}-%{release}
|
||||
Summary: Static libraries for %{name}
|
||||
Requires: %{name}-devel = %{version}-%{release}
|
||||
%description static
|
||||
%{summary}.
|
||||
|
||||
%package fluid
|
||||
Summary: Fast Light User Interface Designer
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-devel
|
||||
Summary: Fast Light User Interface Designer
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-devel
|
||||
%description fluid
|
||||
%{summary}, an interactive GUI designer for %{name}.
|
||||
|
||||
%if %{with mingw}
|
||||
%package -n mingw32-fltk
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n mingw32-fltk
|
||||
%{_description}
|
||||
|
||||
# Win64
|
||||
%package -n mingw64-fltk
|
||||
Summary: MinGW compiled fltk for the Win64 target
|
||||
|
||||
%description -n mingw64-fltk
|
||||
%{_description}
|
||||
|
||||
%package -n mingw32-fltk-static
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n mingw32-fltk-static
|
||||
%{_description}
|
||||
|
||||
# Win64
|
||||
%package -n mingw64-fltk-static
|
||||
Summary: MinGW compiled fltk for the Win64 target
|
||||
|
||||
%description -n mingw64-fltk-static
|
||||
%{_description}
|
||||
|
||||
%{?mingw_debug_package}
|
||||
%endif
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
@ -82,10 +145,18 @@ Requires: %{name}-devel
|
||||
|
||||
make docs -C %{_vpath_builddir}
|
||||
|
||||
%if %{with mingw}
|
||||
%mingw_cmake -DOPTION_BUILD_SHARED_LIBS=TRUE
|
||||
%mingw_make_build
|
||||
%endif
|
||||
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
|
||||
# Deal with license file of same name
|
||||
mv src/xutf8/COPYING ./COPYING.xutf8
|
||||
|
||||
# we only apply this hack to multilib arch's
|
||||
%ifarch x86_64 %{ix86}
|
||||
%global arch %(uname -m 2>/dev/null || echo undefined)
|
||||
@ -94,6 +165,11 @@ mv $RPM_BUILD_ROOT%{_bindir}/fltk-config \
|
||||
install -p -m755 -D %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/fltk-config
|
||||
%endif
|
||||
|
||||
%if %{with mingw}
|
||||
%mingw_make_install
|
||||
%mingw_debug_install_post
|
||||
%endif
|
||||
|
||||
|
||||
%check
|
||||
desktop-file-validate %{buildroot}%{_datadir}/applications/fluid.desktop
|
||||
@ -104,7 +180,7 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/fluid.desktop
|
||||
|
||||
%files
|
||||
%doc ANNOUNCEMENT CHANGES CREDITS README
|
||||
%license COPYING
|
||||
%license COPYING COPYING.xutf8
|
||||
%{_libdir}/libfltk.so.1.3*
|
||||
%{_libdir}/libfltk_forms.so.1.3*
|
||||
%{_libdir}/libfltk_gl.so.1.3*
|
||||
@ -137,6 +213,50 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/fluid.desktop
|
||||
%{_datadir}/mime/packages/fluid.xml
|
||||
%{_datadir}/icons/hicolor/*/*/*
|
||||
|
||||
%if %{with mingw}
|
||||
%files -n mingw32-fltk
|
||||
%license COPYING COPYING.xutf8
|
||||
%{mingw32_bindir}/fltk-config
|
||||
%{mingw32_bindir}/libfltk.dll
|
||||
%{mingw32_libdir}/libfltk.dll.a
|
||||
%{mingw32_bindir}/libfltk_forms.dll
|
||||
%{mingw32_libdir}/libfltk_forms.dll.a
|
||||
%{mingw32_bindir}/libfltk_images.dll
|
||||
%{mingw32_libdir}/libfltk_images.dll.a
|
||||
%{mingw32_bindir}/libfltk_gl.dll
|
||||
%{mingw32_libdir}/libfltk_gl.dll.a
|
||||
%{mingw32_includedir}/FL/
|
||||
%{mingw32_datadir}/cmake/fltk/
|
||||
%exclude %{mingw32_datadir}/man/*
|
||||
|
||||
%files -n mingw64-fltk
|
||||
%license COPYING COPYING.xutf8
|
||||
%{mingw64_bindir}/fltk-config
|
||||
%{mingw64_bindir}/libfltk.dll
|
||||
%{mingw64_libdir}/libfltk.dll.a
|
||||
%{mingw64_bindir}/libfltk_forms.dll
|
||||
%{mingw64_libdir}/libfltk_forms.dll.a
|
||||
%{mingw64_bindir}/libfltk_images.dll
|
||||
%{mingw64_libdir}/libfltk_images.dll.a
|
||||
%{mingw64_bindir}/libfltk_gl.dll
|
||||
%{mingw64_libdir}/libfltk_gl.dll.a
|
||||
%{mingw64_includedir}/FL/
|
||||
%{mingw64_datadir}/cmake/fltk/
|
||||
%exclude %{mingw64_datadir}/man/*
|
||||
|
||||
%files -n mingw32-fltk-static
|
||||
%{mingw32_libdir}/libfltk.a
|
||||
%{mingw32_libdir}/libfltk_forms.a
|
||||
%{mingw32_libdir}/libfltk_images.a
|
||||
%{mingw32_libdir}/libfltk_gl.a
|
||||
|
||||
%files -n mingw64-fltk-static
|
||||
%{mingw64_libdir}/libfltk.a
|
||||
%{mingw64_libdir}/libfltk_forms.a
|
||||
%{mingw64_libdir}/libfltk_images.a
|
||||
%{mingw64_libdir}/libfltk_gl.a
|
||||
%endif
|
||||
|
||||
|
||||
%changelog
|
||||
* Sat Aug 27 2022 Richard Shaw <hobbes1069@gmail.com> - 1.3.8-4
|
||||
|
22
mingw-fltk-cmake.patch
Normal file
22
mingw-fltk-cmake.patch
Normal file
@ -0,0 +1,22 @@
|
||||
Index: fltk-1.3.8/CMake/setup.cmake
|
||||
===================================================================
|
||||
--- fltk-1.3.8.orig/CMake/setup.cmake
|
||||
+++ fltk-1.3.8/CMake/setup.cmake
|
||||
@@ -57,13 +57,15 @@ set (FLTK_DOCDIR ${CMAKE_INSTALL_DATADIR
|
||||
#######################################################################
|
||||
|
||||
# set where config files go
|
||||
-if (WIN32 AND NOT CYGWIN)
|
||||
+if (MINGW)
|
||||
+ set (FLTK_CONFIG_PATH ${FLTK_DATADIR}/cmake/fltk)
|
||||
+elseif (WIN32 AND NOT CYGWIN)
|
||||
set (FLTK_CONFIG_PATH CMake)
|
||||
elseif (APPLE AND NOT OPTION_APPLE_X11)
|
||||
set (FLTK_CONFIG_PATH FLTK.framework/Resources/CMake)
|
||||
else ()
|
||||
set (FLTK_CONFIG_PATH ${FLTK_DATADIR}/fltk CACHE FILEPATH "Install location for cmake files.")
|
||||
-endif (WIN32 AND NOT CYGWIN)
|
||||
+endif (MINGW)
|
||||
|
||||
include(TestBigEndian)
|
||||
TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
|
Loading…
Reference in New Issue
Block a user