Static libraries are too hard to get linked correctly with cmake.
+++ /dev/null
-Index: CMakeLists.txt
-===================================================================
-diff --git a/CMakeLists.txt b/CMakeLists.txt
---- a/CMakeLists.txt (revision 9965)
-+++ b/CMakeLists.txt (working copy)
-@@ -138,6 +139,7 @@
- #######################################################################
- # libraries
- find_library(LIB_CAIRO cairo)
-+find_library(LIB_dl dl)
- find_library(LIB_fontconfig fontconfig)
- find_library(LIB_freetype freetype)
- find_library(LIB_GL GL)
-@@ -146,7 +148,7 @@
- find_library(LIB_png png)
- find_library(LIB_zlib z)
-
--mark_as_advanced(LIB_CAIRO LIB_fontconfig LIB_freetype)
-+mark_as_advanced(LIB_CAIRO LIB_dl LIB_fontconfig LIB_freetype)
- mark_as_advanced(LIB_GL LIB_MesaGL)
- mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)
-
-Index: src/CMakeLists.txt
-===================================================================
-diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
---- a/src/CMakeLists.txt (revision 9965)
-+++ b/src/CMakeLists.txt (working copy)
-@@ -220,7 +220,7 @@
- endif(MSVC)
-
- if(USE_THREADS)
-- target_link_libraries(fltk ${CMAKE_THREAD_LIBS_INIT})
-+ target_link_libraries(fltk ${CMAKE_THREAD_LIBS_INIT} ${LIB_dl})
- endif(USE_THREADS)
-
- if(USE_X11)
-@@ -334,7 +334,7 @@
- endif(MSVC)
-
- if(USE_THREADS)
-- target_link_libraries(fltk_SHARED ${CMAKE_THREAD_LIBS_INIT})
-+ target_link_libraries(fltk_SHARED ${CMAKE_THREAD_LIBS_INIT} ${LIB_dl})
- endif(USE_THREADS)
-
- if(USE_X11)
-@@ -384,11 +384,11 @@
- endif(MSVC)
-
- if(USE_THREADS)
-- target_link_libraries(fltk_SHARED ${CMAKE_THREAD_LIBS_INIT})
-+ target_link_libraries(fltk_forms_SHARED ${CMAKE_THREAD_LIBS_INIT} ${LIB_dl})
- endif(USE_THREADS)
-
- if(USE_X11)
-- target_link_libraries(fltk_SHARED ${X11_LIBRARIES})
-+ target_link_libraries(fltk_forms_SHARED ${X11_LIBRARIES})
- endif(USE_X11)
-
- #######################################################################
-diff -Naur a/CMake/FindDL.cmake b/CMake/FindDL.cmake
---- a/CMake/FindDL.cmake 1969-12-31 19:00:00.000000000 -0500
-+++ b/CMake/FindDL.cmake 2014-10-29 23:00:18.000000000 -0400
-@@ -0,0 +1,37 @@
-+# - Find dl functions
-+# This module finds dl libraries.
-+#
-+# It sets the following variables:
-+# DL_FOUND - Set to false, or undefined, if dl libraries aren't found.
-+# DL_INCLUDE_DIR - The dl include directory.
-+# DL_LIBRARY - The dl library to link against.
-+
-+INCLUDE(CheckFunctionExists)
-+
-+FIND_PATH(DL_INCLUDE_DIR NAMES dlfcn.h)
-+FIND_LIBRARY(DL_LIBRARY NAMES dl)
-+
-+IF (DL_LIBRARY)
-+ SET(DL_FOUND TRUE)
-+ELSE (DL_LIBRARY)
-+ # if dlopen can be found without linking in dl then,
-+ # dlopen is part of libc, so don't need to link extra libs.
-+ CHECK_FUNCTION_EXISTS(dlopen DL_FOUND)
-+ SET(DL_LIBRARY "")
-+ENDIF (DL_LIBRARY)
-+
-+IF (DL_FOUND)
-+
-+ # show which dl was found only if not quiet
-+ IF (NOT DL_FIND_QUIETLY)
-+ MESSAGE(STATUS "Found dl: ${DL_LIBRARY}")
-+ ENDIF (NOT DL_FIND_QUIETLY)
-+
-+ELSE (DL_FOUND)
-+
-+ # fatal error if dl is required but not found
-+ IF (DL_FIND_REQUIRED)
-+ MESSAGE(FATAL_ERROR "Could not find dl")
-+ ENDIF (DL_FIND_REQUIRED)
-+
-+ENDIF (DL_FOUND)
+++ /dev/null
---- fltk-1.3.2/src/CMakeLists.txt 2014-09-02 22:05:40.000000000 -0400
-+++ fltk-1.3.2/src/CMakeLists.txt 2014-09-02 22:12:35.000000000 -0400
-@@ -223,10 +223,6 @@
- target_link_libraries(fltk ${CMAKE_THREAD_LIBS_INIT} ${LIB_dl})
- endif(USE_THREADS)
-
--if(USE_X11)
-- target_link_libraries(fltk ${X11_LIBRARIES})
--endif(USE_X11)
--
- if(WIN32)
- target_link_libraries(fltk comctl32)
- endif(WIN32)
-@@ -239,10 +235,6 @@
- target_link_libraries(fltk ${X11_Xinerama_LIB})
- endif(HAVE_XINERAMA)
-
--if(HAVE_XFIXES)
-- target_link_libraries(fltk ${X11_Xfixes_LIB})
--endif(HAVE_XFIXES)
--
- if(HAVE_XCURSOR)
- target_link_libraries(fltk ${X11_Xcursor_LIB})
- endif(HAVE_XCURSOR)
-@@ -251,10 +243,30 @@
- target_link_libraries(fltk ${X11_Xft_LIB})
- endif(USE_XFT)
-
-+if(HAVE_XFIXES)
-+ target_link_libraries(fltk ${X11_Xfixes_LIB})
-+endif(HAVE_XFIXES)
-+
-+if(X11_Xrender_FOUND)
-+ target_link_libraries(fltk ${X11_Xrender_LIB})
-+endif(X11_Xrender_FOUND)
-+
-+if(USE_X11)
-+ target_link_libraries(fltk ${X11_LIBRARIES} -lxcb -lXdmcp -lXau)
-+endif(USE_X11)
-+
- if(LIB_fontconfig)
- target_link_libraries(fltk ${LIB_fontconfig})
- endif(LIB_fontconfig)
-
-+if(LIB_EXPAT)
-+ target_link_libraries(fltk ${LIB_EXPAT})
-+endif(LIB_EXPAT)
-+
-+if(LIB_freetype)
-+ target_link_libraries(fltk ${LIB_freetype} ${LIB_dl})
-+endif(LIB_freetype)
-+
- #######################################################################
- add_library(fltk_forms STATIC ${FLCPPFILES})
- target_link_libraries(fltk_forms fltk)
---- fltk-1.3.2/CMakeLists.txt 2014-09-02 22:56:47.000000000 -0400
-+++ fltk-1.3.2/CMakeLists.txt 2014-09-02 22:57:19.000000000 -0400
-@@ -147,6 +147,7 @@
- find_library(LIB_jpeg jpeg)
- find_library(LIB_png png)
- find_library(LIB_zlib z)
-+find_library(LIB_EXPAT expat)
-
- mark_as_advanced(LIB_CAIRO LIB_dl LIB_fontconfig LIB_freetype)
- mark_as_advanced(LIB_GL LIB_MesaGL)
-@@ -383,7 +383,7 @@
-
- if(OPENGL_FOUND)
- set(CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIR}/GL)
-- set(CMAKE_REQUIRED_LIBRARIES -lGLU -lGL)
-+ set(CMAKE_REQUIRED_LIBRARIES -lGLU -lGL -lXdmcp -lXau)
- CHECK_FUNCTION_EXISTS(glXGetProcAddressARB HAVE_GLXGETPROCADDRESSARB)
- set(FLTK_GL_FOUND TRUE)
- else()
Patch12: tigervnc14-static-build-fixes.patch
# fltk patches
-Patch124: fltk-1.3.2-libdl.patch
-Patch125: fltk-1.3.2-static-libs.patch
+Patch15: fltk-1.3.3-static-libs.patch
# freetype patches
Patch20: freetype-2.1.10-enable-ft2-bci.patch
tar xzf %SOURCE11
pushd fltk-*
-# Search paths for X11 are hard coded into FindX11.cmake
-cp %SOURCE9 CMake/
-sed -i -e "s#@_includedir@#%{xorg_buildroot}%{_includedir}#" CMake/FindX11.cmake
-sed -i -e "s#@_libdir@#%{xorg_buildroot}%{_libdir}#" CMake/FindX11.cmake
-%patch124 -p1 -b .libdl
-%patch125 -p1 -b .static-libs
+%patch15 -p1 -b .static-libs
popd
tar xzf %SOURCE12
export CMAKE_PREFIX_PATH="%{xorg_buildroot}%{_prefix}:%{_prefix}"
export CMAKE_EXE_LINKER_FLAGS=$LDFLAGS
export PKG_CONFIG="pkg-config --static"
-%{cmake28} -G"Unix Makefiles" \
- -DCMAKE_INSTALL_PREFIX=%{_prefix} \
- -DOPTION_PREFIX_LIB=%{_libdir} \
- -DCMAKE_BUILD_TYPE=Release \
- -DOPTION_USE_THREADS=off \
- -DOPTION_BUILD_EXAMPLES=off \
- -DOPTION_USE_SYSTEM_LIBPNG=on \
- -DPNG_LIBRARY=%{_libdir}/libpng.a \
- -DPNG_INCLUDE_DIR=%{_includedir} \
- -DOPTION_USE_GL=off
+CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" ./configure \
+ --prefix=%{_prefix} \
+ --libdir=%{_libdir} \
+ --enable-x11 \
+ --enable-gl \
+ --disable-shared \
+ --enable-localjpeg \
+ --enable-localzlib \
+ --enable-localpng \
+ --enable-xinerama \
+ --enable-xft \
+ --enable-xdbe \
+ --enable-xfixes \
+ --enable-xcursor \
+ --with-x
make %{?_smp_mflags}
make DESTDIR=%{xorg_buildroot} install
popd