summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/ftgl/ftgl-2.1.3-rc5-ldflags.patch118
-rw-r--r--var/spack/repos/builtin/packages/ftgl/package.py58
2 files changed, 161 insertions, 15 deletions
diff --git a/var/spack/repos/builtin/packages/ftgl/ftgl-2.1.3-rc5-ldflags.patch b/var/spack/repos/builtin/packages/ftgl/ftgl-2.1.3-rc5-ldflags.patch
new file mode 100644
index 0000000000..871990a234
--- /dev/null
+++ b/var/spack/repos/builtin/packages/ftgl/ftgl-2.1.3-rc5-ldflags.patch
@@ -0,0 +1,118 @@
+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
diff --git a/var/spack/repos/builtin/packages/ftgl/package.py b/var/spack/repos/builtin/packages/ftgl/package.py
index 6fa8cffeee..b1dbd03a99 100644
--- a/var/spack/repos/builtin/packages/ftgl/package.py
+++ b/var/spack/repos/builtin/packages/ftgl/package.py
@@ -3,9 +3,9 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-from spack import *
-import sys
import os
+import sys
+from spack import *
class Ftgl(AutotoolsPackage):
@@ -16,10 +16,11 @@ class Ftgl(AutotoolsPackage):
list_url = "https://sourceforge.net/projects/ftgl/files/FTGL%20Source/"
list_depth = 1
+ version('2.1.3-rc5', sha256='5458d62122454869572d39f8aa85745fc05d5518001bcefa63bd6cbb8d26565b')
version('2.1.2', 'f81c0a7128192ba11e036186f9a968f2')
- # There is an unnecessary qualifier around, which makes modern GCC sad
- patch('remove-extra-qualifier.diff')
+ variant('doc', default=False, description='Build docs')
+ conflicts('+doc', when='@2.1.3-rc5')
# Ftgl does not come with a configure script
depends_on('autoconf', type='build')
@@ -31,18 +32,45 @@ class Ftgl(AutotoolsPackage):
depends_on('gl')
depends_on('glu')
depends_on('freetype@2.0.9:')
+ depends_on('doxygen', type='build', when='+doc')
- # Currently, "make install" will fail if the docs weren't built
- #
- # FIXME: Can someone with autotools experience fix the build system
- # so that it doesn't fail when that happens?
- #
- depends_on('doxygen', type='build')
+ # Fix unnecessary qualifier in 2.1.2.
+ patch('remove-extra-qualifier.diff', when='@2.1.2')
+ # 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.
+ @when('@2.1.2~doc')
+ def patch(self):
+ 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
- @when('@2.1.2')
def configure_directory(self):
- subdir = 'unix'
- if sys.platform == 'darwin':
- subdir = 'mac'
- return os.path.join(self.stage.source_path, subdir)
+ 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