ftgl: Move to frankheckenbach fork + CMakePackage (#14221)
* Try to switch to a newer fork of ftgl * Allow ROOT to be more flexible about ftgl versions * Turn ftgl into a CMakePackage * Update ROOT ftgl dep since 2.1.3 isn't a thing anymore * Please flake8 * Try to bring back the doc variant * Comment it out instead of removing it
This commit is contained in:
parent
1a385a5178
commit
80ea96312f
@ -1,118 +0,0 @@
|
|||||||
diff -up ftgl-2.1.3~rc5/demo/Makefile.am.ldflags ftgl-2.1.3~rc5/demo/Makefile.am
|
|
||||||
--- ftgl-2.1.3~rc5/demo/Makefile.am.ldflags 2008-06-02 03:10:10.000000000 +0200
|
|
||||||
+++ ftgl-2.1.3~rc5/demo/Makefile.am 2010-02-14 15:02:19.670081290 +0100
|
|
||||||
@@ -9,14 +9,14 @@ simple_SOURCES = \
|
|
||||||
simple.cpp \
|
|
||||||
$(NULL)
|
|
||||||
simple_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-simple_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+simple_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS)
|
|
||||||
simple_LDADD = ../src/libftgl.la
|
|
||||||
|
|
||||||
c_demo_SOURCES = \
|
|
||||||
c-demo.c \
|
|
||||||
$(NULL)
|
|
||||||
c_demo_CFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-c_demo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+c_demo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS) -lm
|
|
||||||
c_demo_LDADD = ../src/libftgl.la
|
|
||||||
|
|
||||||
FTGLDemo_SOURCES = \
|
|
||||||
@@ -27,7 +27,7 @@ FTGLDemo_SOURCES = \
|
|
||||||
trackball.h \
|
|
||||||
$(NULL)
|
|
||||||
FTGLDemo_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-FTGLDemo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+FTGLDemo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS)
|
|
||||||
FTGLDemo_LDADD = ../src/libftgl.la
|
|
||||||
|
|
||||||
FTGLMFontDemo_SOURCES = \
|
|
||||||
@@ -38,7 +38,7 @@ FTGLMFontDemo_SOURCES = \
|
|
||||||
trackball.h \
|
|
||||||
$(NULL)
|
|
||||||
FTGLMFontDemo_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-FTGLMFontDemo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+FTGLMFontDemo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS)
|
|
||||||
FTGLMFontDemo_LDADD = ../src/libftgl.la
|
|
||||||
|
|
||||||
NULL =
|
|
||||||
diff -up ftgl-2.1.3~rc5/demo/Makefile.in.ldflags ftgl-2.1.3~rc5/demo/Makefile.in
|
|
||||||
--- ftgl-2.1.3~rc5/demo/Makefile.in.ldflags 2008-06-12 16:33:01.000000000 +0200
|
|
||||||
+++ ftgl-2.1.3~rc5/demo/Makefile.in 2010-02-14 15:02:01.866831398 +0100
|
|
||||||
@@ -242,14 +242,14 @@ simple_SOURCES = \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
simple_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-simple_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+simple_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS)
|
|
||||||
simple_LDADD = ../src/libftgl.la
|
|
||||||
c_demo_SOURCES = \
|
|
||||||
c-demo.c \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
c_demo_CFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-c_demo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+c_demo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS) -lm
|
|
||||||
c_demo_LDADD = ../src/libftgl.la
|
|
||||||
FTGLDemo_SOURCES = \
|
|
||||||
FTGLDemo.cpp \
|
|
||||||
@@ -260,7 +260,7 @@ FTGLDemo_SOURCES = \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
FTGLDemo_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-FTGLDemo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+FTGLDemo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS)
|
|
||||||
FTGLDemo_LDADD = ../src/libftgl.la
|
|
||||||
FTGLMFontDemo_SOURCES = \
|
|
||||||
FTGLMFontDemo.cpp \
|
|
||||||
@@ -271,7 +271,7 @@ FTGLMFontDemo_SOURCES = \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
FTGLMFontDemo_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-FTGLMFontDemo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+FTGLMFontDemo_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS)
|
|
||||||
FTGLMFontDemo_LDADD = ../src/libftgl.la
|
|
||||||
NULL =
|
|
||||||
all: all-am
|
|
||||||
diff -up ftgl-2.1.3~rc5/test/Makefile.am.ldflags ftgl-2.1.3~rc5/test/Makefile.am
|
|
||||||
--- ftgl-2.1.3~rc5/test/Makefile.am.ldflags 2010-02-14 14:43:14.819077822 +0100
|
|
||||||
+++ ftgl-2.1.3~rc5/test/Makefile.am 2010-02-14 14:43:49.227081230 +0100
|
|
||||||
@@ -51,7 +51,7 @@ AM_CPPFLAGS = \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
CXXTest_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-CXXTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) -lcppunit
|
|
||||||
+CXXTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS) -lcppunit
|
|
||||||
CXXTest_LDADD = ../src/libftgl.la
|
|
||||||
|
|
||||||
CTest_SOURCES = \
|
|
||||||
@@ -64,7 +64,7 @@ CTest_CPPFLAGS = \
|
|
||||||
-I$(top_srcdir)/src/FTFont \
|
|
||||||
-I$(top_srcdir)/src/FTLayout
|
|
||||||
CTest_CFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-CTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+CTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS)
|
|
||||||
CTest_LDADD = ../src/libftgl.la
|
|
||||||
|
|
||||||
NULL =
|
|
||||||
diff -up ftgl-2.1.3~rc5/test/Makefile.in.ldflags ftgl-2.1.3~rc5/test/Makefile.in
|
|
||||||
--- ftgl-2.1.3~rc5/test/Makefile.in.ldflags 2010-02-14 14:43:20.365077958 +0100
|
|
||||||
+++ ftgl-2.1.3~rc5/test/Makefile.in 2010-02-14 14:44:13.653078013 +0100
|
|
||||||
@@ -294,7 +294,7 @@ AM_CPPFLAGS = \
|
|
||||||
$(NULL)
|
|
||||||
|
|
||||||
CXXTest_CXXFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-CXXTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) -lcppunit
|
|
||||||
+CXXTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS) -lcppunit
|
|
||||||
CXXTest_LDADD = ../src/libftgl.la
|
|
||||||
CTest_SOURCES = \
|
|
||||||
CTest.c \
|
|
||||||
@@ -308,7 +308,7 @@ CTest_CPPFLAGS = \
|
|
||||||
-I$(top_srcdir)/src/FTLayout
|
|
||||||
|
|
||||||
CTest_CFLAGS = $(FT2_CFLAGS) $(GL_CFLAGS)
|
|
||||||
-CTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS)
|
|
||||||
+CTest_LDFLAGS = $(FT2_LIBS) $(GLUT_LIBS) $(GL_LIBS)
|
|
||||||
CTest_LDADD = ../src/libftgl.la
|
|
||||||
NULL =
|
|
||||||
all: all-am
|
|
@ -3,74 +3,47 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Ftgl(AutotoolsPackage):
|
class Ftgl(CMakePackage):
|
||||||
"""Library to use arbitrary fonts in OpenGL applications."""
|
"""Library to use arbitrary fonts in OpenGL applications."""
|
||||||
|
|
||||||
homepage = "http://ftgl.sourceforge.net/docs/html/"
|
homepage = "https://github.com/frankheckenbach/ftgl"
|
||||||
url = "https://sourceforge.net/projects/ftgl/files/FTGL%20Source/2.1.2/ftgl-2.1.2.tar.gz/download"
|
git = "https://github.com/frankheckenbach/ftgl.git"
|
||||||
list_url = "https://sourceforge.net/projects/ftgl/files/FTGL%20Source/"
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
version('2.1.3-rc5', sha256='5458d62122454869572d39f8aa85745fc05d5518001bcefa63bd6cbb8d26565b')
|
version('master', branch='master')
|
||||||
version('2.1.2', sha256='2759cbd5fac0b631e8b012923cd0d2add320f6e541b399a7cda37163ad034075')
|
version('2.4.0', commit='483639219095ad080538e07ceb5996de901d4e74')
|
||||||
|
version('2.3.1', commit='3c0fdf367824b6381f29df3d8b4590240db62ab7')
|
||||||
|
|
||||||
variant('doc', default=False, description='Build docs')
|
# FIXME: Doc generation is broken in upstream build system
|
||||||
conflicts('+doc', when='@2.1.3-rc5')
|
# variant('doc', default=False, description='Build the documentation')
|
||||||
|
variant('shared', default=True, description='Build as a shared library')
|
||||||
# Ftgl does not come with a configure script
|
|
||||||
depends_on('autoconf', type='build')
|
|
||||||
depends_on('automake', type='build')
|
|
||||||
depends_on('libtool', type='build')
|
|
||||||
depends_on('m4', type='build')
|
|
||||||
|
|
||||||
|
depends_on('cmake@2.8:', type='build')
|
||||||
|
# depends_on('doxygen', type='build', when='+doc') -- FIXME, see above
|
||||||
depends_on('pkgconfig', type='build')
|
depends_on('pkgconfig', type='build')
|
||||||
depends_on('gl')
|
depends_on('gl')
|
||||||
depends_on('glu')
|
depends_on('glu')
|
||||||
depends_on('freetype@2.0.9:')
|
depends_on('freetype@2.0.9:')
|
||||||
depends_on('doxygen', type='build', when='+doc')
|
|
||||||
|
|
||||||
# Fix unnecessary qualifier in 2.1.2.
|
# Fix oversight in CMakeLists
|
||||||
patch('remove-extra-qualifier.diff', when='@2.1.2')
|
patch('remove-ftlibrary-from-sources.diff', when='@:2.4.0')
|
||||||
# Add missing GL libraries to LDFLAGS.
|
|
||||||
patch('ftgl-2.1.3-rc5-ldflags.patch', when='@2.1.3-rc5')
|
|
||||||
|
|
||||||
# Deactivate docs if we're not building them.
|
def cmake_args(self):
|
||||||
@when('@2.1.2~doc')
|
spec = self.spec
|
||||||
def patch(self):
|
args = ['-DBUILD_SHARED_LIBS={0}'.format(spec.satisfies('+shared'))]
|
||||||
filter_file('SUBDIRS = src demo docs',
|
|
||||||
'SUBDIRS = src demo', os.path.join('unix', 'Makefile'))
|
|
||||||
|
|
||||||
@when('@2.1.3-rc5~doc')
|
|
||||||
def patch(self):
|
|
||||||
filter_file('SUBDIRS = src test demo docs',
|
|
||||||
'SUBDIRS = src test demo', 'Makefile.am')
|
|
||||||
filter_file('SUBDIRS = src test demo docs',
|
|
||||||
'SUBDIRS = src test demo', 'Makefile.in')
|
|
||||||
|
|
||||||
@property
|
|
||||||
def configure_directory(self):
|
|
||||||
if self.spec.satisfies('@2.1.2'):
|
|
||||||
subdir = 'mac' if sys.platform == 'darwin' else 'unix'
|
|
||||||
return os.path.join(self.stage.source_path, subdir)
|
|
||||||
else:
|
|
||||||
return self.stage.source_path
|
|
||||||
|
|
||||||
def configure_args(self):
|
|
||||||
args = ['--enable-shared', '--disable-static',
|
|
||||||
'--with-gl-inc={0}'.format(
|
|
||||||
self.spec['gl'].prefix.include),
|
|
||||||
'--with-gl-lib={0}'.format(
|
|
||||||
self.spec['gl'].prefix.lib),
|
|
||||||
'--with-freetype={0}'.format(
|
|
||||||
self.spec['freetype'].prefix),
|
|
||||||
'--with-glut-inc={0}'.format(
|
|
||||||
self.spec['glu'].prefix.include),
|
|
||||||
'--with-glut-lib={0}'.format(
|
|
||||||
self.spec['glu'].prefix.lib),
|
|
||||||
'--with-x']
|
|
||||||
return args
|
return args
|
||||||
|
|
||||||
|
# FIXME: See doc variant comment
|
||||||
|
# @run_after('build')
|
||||||
|
# def build_docs(self):
|
||||||
|
# if '+doc' in self.spec:
|
||||||
|
# cmake = self.spec['cmake'].command
|
||||||
|
# cmake('--build', '../spack-build', '--target', 'doc')
|
||||||
|
#
|
||||||
|
# @run_after('install')
|
||||||
|
# def install_docs(self):
|
||||||
|
# if '+doc' in self.spec:
|
||||||
|
# cmake = self.spec['cmake'].command
|
||||||
|
# cmake('--install', '../spack-build', '--target', 'doc')
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
--- FTGL/include/FTTextureGlyph.h 2018-07-26 08:30:55.144488976 +0000
|
|
||||||
+++ FTGL/include/FTTextureGlyph.h 2018-07-26 08:29:42.072489186 +0000
|
|
||||||
@@ -52,7 +52,7 @@
|
|
||||||
* Reset the currently active texture to zero to get into a known state before
|
|
||||||
* drawing a string. This is to get round possible threading issues.
|
|
||||||
*/
|
|
||||||
- static void FTTextureGlyph::ResetActiveTexture(){ activeTextureID = 0;}
|
|
||||||
+ static void ResetActiveTexture(){ activeTextureID = 0;}
|
|
||||||
|
|
||||||
private:
|
|
||||||
/**
|
|
@ -0,0 +1,10 @@
|
|||||||
|
--- a/src/CMakeLists.txt
|
||||||
|
+++ b/src/CMakeLists.txt
|
||||||
|
@@ -26,7 +26,6 @@ SET(libftgl_la_SOURCES
|
||||||
|
FTGlyphContainer.h
|
||||||
|
FTInternals.h
|
||||||
|
FTLibrary.cpp
|
||||||
|
- FTLibrary.h
|
||||||
|
FTList.h
|
||||||
|
FTPoint.cpp
|
||||||
|
FTSize.cpp
|
@ -192,7 +192,7 @@ class Root(CMakePackage):
|
|||||||
depends_on('libsm', when="+x")
|
depends_on('libsm', when="+x")
|
||||||
|
|
||||||
# OpenGL
|
# OpenGL
|
||||||
depends_on('ftgl@2.1.3-rc5', when="+x+opengl")
|
depends_on('ftgl@2.4.0:', when="+x+opengl")
|
||||||
depends_on('glew', when="+x+opengl")
|
depends_on('glew', when="+x+opengl")
|
||||||
depends_on('gl', when="+x+opengl")
|
depends_on('gl', when="+x+opengl")
|
||||||
depends_on('glu', when="+x+opengl")
|
depends_on('glu', when="+x+opengl")
|
||||||
|
Loading…
Reference in New Issue
Block a user