From 51b293900d5a02683529b75ae8f637f45229e91a Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 24 Feb 2014 15:56:09 +1100 Subject: [PATCH] Add initial winnt glfw-2.7.7 --- media-libs/glfw/Manifest | 7 + media-libs/glfw/files/glfw-2.6-dyn.patch | 22 ++++ media-libs/glfw/files/glfw-2.6-ldflags.patch | 21 +++ media-libs/glfw/files/glfw-2.7.7-dyn.patch | 31 +++++ .../glfw/files/glfw-2.7.7-pkgconfig.patch | 37 ++++++ media-libs/glfw/glfw-2.7.7.ebuild | 124 ++++++++++++++++++ media-libs/glfw/metadata.xml | 5 + 7 files changed, 247 insertions(+) create mode 100644 media-libs/glfw/Manifest create mode 100644 media-libs/glfw/files/glfw-2.6-dyn.patch create mode 100644 media-libs/glfw/files/glfw-2.6-ldflags.patch create mode 100644 media-libs/glfw/files/glfw-2.7.7-dyn.patch create mode 100644 media-libs/glfw/files/glfw-2.7.7-pkgconfig.patch create mode 100644 media-libs/glfw/glfw-2.7.7.ebuild create mode 100644 media-libs/glfw/metadata.xml diff --git a/media-libs/glfw/Manifest b/media-libs/glfw/Manifest new file mode 100644 index 0000000..9d1601b --- /dev/null +++ b/media-libs/glfw/Manifest @@ -0,0 +1,7 @@ +AUX glfw-2.6-dyn.patch 963 SHA256 bb91028d524ea357407bc91d4b09db0568e237954109f8fa5db2973ec449fbdd SHA512 1716466639351ee89cc69c156708e7ccdabb558caf38273d666c601d4bda0f4592f458b8b3ed70b0d022f176ef422be60304ca5df8ee177eeb28c16267d02c87 WHIRLPOOL 32b0b2ce0718a47356efe5219dda8fade0f7f28d30004be7441eab82e042dcd618c2c00d5b3af22991c4d59bfa64be81da40d9423ba7a85c31326a42f4a1fe04 +AUX glfw-2.6-ldflags.patch 467 SHA256 b484dc94e838d696056d0008fb5e3d40a531a41408b3aa006d8ad955f1b5c67b SHA512 8b1b1e98c01f6d7ff4e0265bf89a431176a285e1b529392ac47327bfb18d6ff674136649b0ae4c981c9287c84ca557c0a9bc997a278aaa008d84a2a7cdc36411 WHIRLPOOL 96c15b29aa9edcbb51c0f03c6c7e55ef0411a6883904e46feb1016074da254459941e6f16a89bd57295d1e1d4b78e0f2cdc330bd3da0be68c4b18cc82874ac7d +AUX glfw-2.7.7-dyn.patch 1021 SHA256 dc5d666357c996ace5a649fba817f943e9ec2764d7a5b0c78445060da330c868 SHA512 388ea7941dc60fa94e6527e0e6f2d4b027bfe260893b329d5cc5854336a126a4ebb7392b862f0158c08ebc88ef4737b68e2091cbd1706075c04a55e51c28bbfb WHIRLPOOL 91e71a9461b418990b0a8c0478b206157ecba15f2dd89ee715f910eece462f1711648a907d7b9803c3c1311da4343f32ae4ca597464359b659c45beed424d6ec +AUX glfw-2.7.7-pkgconfig.patch 1144 SHA256 e080c095839dc365d1a54974ea38164d7dacb7371277674619ab102086f67422 SHA512 3083e333e45ffd1cb427be63f37cf896ec629b24904400ba63333f1ab3f9e7664b1c63f60a7b547867bb9f4924e17754851089bffd2de4af00d9eaecbe27883f WHIRLPOOL 171927efed27b78b5293020af843b22484b4fc19b392017dc2bee67a9004336f6eb6ab4408bfaf53ec071057e86b70ae77d3a28d8dda0bb570d57d5b56c85746 +DIST glfw-2.7.7.tar.bz2 927805 SHA256 422e755979524a1da28e4addcae723b7132998ca15e89be41bf34964d9360aa2 SHA512 1b51b9d88c8eed9da8084421949b561a4779410a6369ffdf482c2d8a166bab8c58bbb087ef6f32180d3fe9430988549be5c183b338dd0e1191b2c4b4a7b55379 WHIRLPOOL 646d38fd3ea88e8aa19dcbfa8f8b933adc530ea946cd51c3e03971ed6cdb294dadf5020a876ba298c378896179a4a7ba0129b858fc7f1273a574fe1c2c388a77 +EBUILD glfw-2.7.7.ebuild 2914 SHA256 0af71ee58e1384aa73af49156c91d0f65c077df5d060e50d13c89952094f11c9 SHA512 a02eeddd8d611b3cf09d001f9c1e0bba83cca01f1ff140b9fe67705622e247fa03fc66dbf562b410cff228304fc5ef162eae899bb6002567c0d255f19ec15551 WHIRLPOOL e0a29e7aeb0fa52c1d6e4988b8ead553c8d5d3dc8d36808fe7d568d418c9937792a2d6ad964382518ddccec1ebdfd8b47c85e3ec3d02e9372b3b8e569b55c667 +MISC metadata.xml 158 SHA256 1423a4fdd4a79b1728a2056d9e300f7e1074253095d82726218d9e9b953888a3 SHA512 d954564236b67b6ab97846b73f74e715e8f1bec2dba6595e9a5046c2e8c3b93f4879c293f9d1d02d99a533bee56156dae3f31a485697128c51af14cdbfdada8a WHIRLPOOL d03e7293d09d794d61c095a423f945b3644355a247f270a73ca8d30b4dfe9c98244297536bfd1a4bd6c14794aa1152eca20fd83bfdf3e1e74d4f676152d35ada diff --git a/media-libs/glfw/files/glfw-2.6-dyn.patch b/media-libs/glfw/files/glfw-2.6-dyn.patch new file mode 100644 index 0000000..d816f9f --- /dev/null +++ b/media-libs/glfw/files/glfw-2.6-dyn.patch @@ -0,0 +1,22 @@ +--- lib/x11/Makefile.x11.in.old 2007-11-11 07:56:34.000000000 +0100 ++++ lib/x11/Makefile.x11.in 2007-11-11 08:00:22.000000000 +0100 +@@ -8,7 +8,7 @@ + ########################################################################## + # Default: Build GLFW static library + ########################################################################## +-default: libglfw.a libglfw.so ++default: libglfw.a libglfw.so.2.6 + + + ########################################################################## +@@ -104,8 +104,8 @@ + ########################################################################## + # Rule for building shared library + ########################################################################## +-libglfw.so: $(SHARED_OBJS) +- $(CC) $(LDFLAGS) -o $@ $(SHARED_OBJS) $(LFLAGS) $(LIBS) ++libglfw.so.2.6: $(SHARED_OBJS) ++ $(CC) $(LDFLAGS) -o $@ $(SHARED_OBJS) $(LFLAGS) $(LIBS) -Wl,-soname=$@ + + + ########################################################################## diff --git a/media-libs/glfw/files/glfw-2.6-ldflags.patch b/media-libs/glfw/files/glfw-2.6-ldflags.patch new file mode 100644 index 0000000..3fcebe5 --- /dev/null +++ b/media-libs/glfw/files/glfw-2.6-ldflags.patch @@ -0,0 +1,21 @@ +--- compile.sh.old 2010-09-13 13:51:19.000000000 +0200 ++++ compile.sh 2010-09-13 13:51:34.000000000 +0200 +@@ -85,7 +85,7 @@ + case "x`uname 2> /dev/null`" in + xLinux) + CFLAGS="$CFLAGS -Dlinux" +- LDFLAGS="-shared" ++ LDFLAGS="${LDFLAGS} -shared" + echo " Linux" 1>&6 + ;; + xDarwin) +--- compile.sh.old 2010-09-13 13:58:07.000000000 +0200 ++++ compile.sh 2010-09-13 13:58:20.000000000 +0200 +@@ -65,7 +65,6 @@ + + CFLAGS= + LFLAGS= +-LDFLAGS= + INCS= + LIBS="-lGL -lX11" + diff --git a/media-libs/glfw/files/glfw-2.7.7-dyn.patch b/media-libs/glfw/files/glfw-2.7.7-dyn.patch new file mode 100644 index 0000000..4dc4cc2 --- /dev/null +++ b/media-libs/glfw/files/glfw-2.7.7-dyn.patch @@ -0,0 +1,31 @@ +--- lib/x11/Makefile.x11.in ++++ lib/x11/Makefile.x11.in +@@ -8,7 +8,7 @@ + ########################################################################## + # Default: Build GLFW static library + ########################################################################## +-all: libglfw.a libglfw.so ++all: libglfw.a libglfw.so.2.7.7 + + + ########################################################################## +@@ -112,7 +112,7 @@ + ########################################################################## + # Rule for building shared library + ########################################################################## +-libglfw.so: $(SHARED_OBJS) ++libglfw.so.2.7.7: $(SHARED_OBJS) + $(CC) $(SOFLAGS) -o $@ $(SHARED_OBJS) $(LFLAGS) $(LIBS) + + +--- compile.sh ++++ compile.sh +@@ -88,7 +88,7 @@ + case "x`uname 2> /dev/null`" in + xLinux) + GLFW_LIB_CFLAGS="$GLFW_LIB_CFLAGS -D_GLFW_USE_LINUX_JOYSTICKS" +- SOFLAGS="-shared -Wl,-soname,libglfw.so" ++ SOFLAGS="-shared -Wl,-soname,libglfw.so.2.7.7" + echo "Linux" 1>&6 + ;; + xDarwin) diff --git a/media-libs/glfw/files/glfw-2.7.7-pkgconfig.patch b/media-libs/glfw/files/glfw-2.7.7-pkgconfig.patch new file mode 100644 index 0000000..e880995 --- /dev/null +++ b/media-libs/glfw/files/glfw-2.7.7-pkgconfig.patch @@ -0,0 +1,37 @@ +support libsuffix, fix version + +--- lib/x11/Makefile.x11.in ++++ lib/x11/Makefile.x11.in +@@ -3,6 +3,7 @@ + # Installation prefix (default to /usr/local) + ########################################################################## + PREFIX ?= /usr/local ++LIBDIR ?= lib + + + ########################################################################## +@@ -99,7 +100,7 @@ + # Rule for building libglfw.pc + ########################################################################## + libglfw.pc: libglfw.pc.in +- $(SED) -e 's,\@PREFIX\@,$(PREFIX),' libglfw.pc.in > libglfw.pc ++ $(SED) -e 's,\@PREFIX\@,$(PREFIX),' -e 's,\@LIBDIR@,$(LIBDIR),' libglfw.pc.in > libglfw.pc + + + ########################################################################## +--- compile.sh ++++ compile.sh +@@ -734,11 +734,11 @@ + prefix=@PREFIX@ + exec_prefix=\${prefix} + includedir=\${prefix}/include +-libdir=\${exec_prefix}/lib ++libdir=\${exec_prefix}/@LIBDIR@ + + Name: GLFW + Description: A portable framework for OpenGL development +-Version: 2.7.4 ++Version: 2.7.7 + URL: http://www.glfw.org/ + Requires.private: gl x11 $PKG_LIBS + Libs: -L\${libdir} -lglfw $LFLAGS_THREAD $LFLAGS_CLOCK diff --git a/media-libs/glfw/glfw-2.7.7.ebuild b/media-libs/glfw/glfw-2.7.7.ebuild new file mode 100644 index 0000000..15b487b --- /dev/null +++ b/media-libs/glfw/glfw-2.7.7.ebuild @@ -0,0 +1,124 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/glfw/glfw-2.7.7.ebuild,v 1.2 2013/02/04 20:28:40 mr_bones_ Exp $ + +EAPI=5 +inherit eutils multilib toolchain-funcs + +DESCRIPTION="The Portable OpenGL FrameWork" +HOMEPAGE="http://glfw.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~x86-winnt" +IUSE="examples static-libs" + +DEPEND="!x86-winnt? ( + x11-libs/libX11 + x11-libs/libXrandr + ) + virtual/glu + virtual/opengl" +RDEPEND="${DEPEND}" + +src_prepare() { + sed -i \ + -e "s:\"docs/:\"/usr/share/doc/${PF}/pdf/:" \ + readme.html || die + + epatch "${FILESDIR}"/${P}-{dyn,pkgconfig}.patch + + # find key paths for our CHOST + case ${CHOST} in + *-mingw*) + # TODO: makefile could be set based on CBUILD + libdir="win32" + makefile="Makefile.win32.cross-mgw" + ;; + + *) + libdir="x11" + makefile="Makefile.x11.in" + esac + + # respect ldflags + sed -i \ + -e "s/\$(LFLAGS)/\$(LDFLAGS) \$(LFLAGS)/" \ + {lib/$libdir,examples}/$makefile || die + + # respect cflags in linking command + # build system is messing up CFLAGS variable, so sed is the easy way to go + sed -i \ + -e "/^libglfw.so/{n;s/\$(CC)/\$(CC) ${CFLAGS}/;}" \ + lib/$libdir/$makefile || die + + if use !static-libs ; then + sed -i \ + -e '/^all:/s/libglfw.a//' \ + lib/$libdir/$makefile || die + fi +} + +src_configure() { + [[ ${CHOST} != *-mingw* ]] && sh ./compile.sh +} + +src_compile() { + makefile="${makefile%.in}" + + local env="AR=$(tc-getAR) CC=$(tc-getCC) PREFIX=/usr LIBDIR=$(get_libdir)" + if [[ ${CHOST} == *-mingw* ]]; then + env="$env TARGET= DLLTOOL=${CHOST}-dlltool" + fi + + emake -C lib/$libdir $env -f $makefile all libglfw.pc + use examples && emake -C examples CC=$(tc-getCC) -f $makefile all +} + +src_install() { + local dynlib + if [[ ${CHOST} = *-mingw* ]]; then + dynlib="glfw.dll" + else + dynlib="libglfw.so.2.7.7" + fi + + use static-libs && dolib.a lib/$libdir/libglfw.a + dolib.so "lib/$libdir/$dynlib" + [[ ${CHOST} != *-mingw* ]] && dosym $dynlib /usr/$(get_libdir)/${dynlib%.$PV} + + insinto /usr/$(get_libdir)/pkgconfig + doins lib/$libdir/libglfw.pc + doheader -r include/GL + dohtml -r readme.html + insinto /usr/share/doc/${PF}/pdf + doins docs/*.pdf + dodoc docs/readme.txt + + if use examples; then + local f + local MY_EXAMPLES="boing gears listmodes mipmaps + mtbench mthello particles pong3d splitview + triangle wave" + local MY_PICS="mipmaps.tga pong3d_field.tga pong3d_instr.tga + pong3d_menu.tga pong3d_title.tga + pong3d_winner1.tga pong3d_winner2.tga" + + docompress -x /usr/share/doc/${PF}/examples + insinto /usr/share/doc/${PF}/examples + + doins examples/$makefile + for f in $MY_EXAMPLES; do + doins examples/${f}.c + done + for f in $MY_PICS; do + doins examples/${f} + done + + insopts -m0755 + for f in $MY_EXAMPLES; do + doins examples/${f}${exesuffix} + done + fi +} diff --git a/media-libs/glfw/metadata.xml b/media-libs/glfw/metadata.xml new file mode 100644 index 0000000..d3c2cc9 --- /dev/null +++ b/media-libs/glfw/metadata.xml @@ -0,0 +1,5 @@ + + + +games +