changeset 3253:e93d62840c08

Merged branches
author unexist
date Fri, 15 Dec 2017 14:22:00 +0100
parents fb24cc05de45 (current diff) 48b0d729d9f7 (diff)
children 8efcb56de0b3
files Rakefile src/shared/shared.h src/subtle/event.c src/subtle/ewmh.c src/subtle/ruby.c src/subtle/screen.c src/subtle/style.c src/subtle/subtle.c src/subtle/subtle.h src/subtlext/client.c src/subtlext/color.c src/subtlext/geometry.c src/subtlext/gravity.c src/subtlext/icon.c src/subtlext/screen.c src/subtlext/sublet.c src/subtlext/subtle.c src/subtlext/subtlext.h src/subtlext/tag.c src/subtlext/tray.c src/subtlext/view.c src/subtlext/window.c
diffstat 3 files changed, 32 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/Rakefile	Fri Dec 15 14:20:22 2017 +0100
+++ b/Rakefile	Fri Dec 15 14:22:00 2017 +0100
@@ -63,9 +63,9 @@
   "hdrdir"     => "",
   "archdir"    => "",
   "revision"   => "3224", #< Latest stable
-  "cflags"     => "-Wall -Werror -Wpointer-arith -Wstrict-prototypes -Wunused -Wshadow -std=gnu99",
-  "cpppath"    => "-I. -I$(builddir) -Isrc -Isrc/shared -Isrc/subtle -idirafter$(hdrdir) -idirafter$(archdir)",
-  "ldflags"    => "$(rpath) -L$(libdir) $(LIBS) -l$(RUBY_SO_NAME)",
+  "cflags"     => "-Wall -Wpointer-arith -Wstrict-prototypes -Wunused -Wshadow -std=gnu99 " + (ENV["CFLAGS"] || ""),
+  "cpppath"    => "-I. -I$(builddir) -Isrc -Isrc/shared -Isrc/subtle -idirafter$(hdrdir) -idirafter$(archdir) " + (ENV["CPPFLAGS"] || ""),
+  "ldflags"    => "$(rpath) -L$(libdir) $(LIBS) -l$(RUBY_SO_NAME) " + (ENV["LDFLAGS"] || ""),
   "extflags"   => "$(LDFLAGS) $(rpath) $(LIBS) -l$(RUBY_SO_NAME)",
   "rpath"      => "-L$(libdir) -Wl,-rpath=$(libdir)",
   "checksums"  => []
@@ -393,23 +393,35 @@
 
     # Check pkg-config for Xft
     if "yes" == @options["xft"]
-      checking_for("X11/Xft/Xft.h") do
-        ret = false
+      {
+        "freetype": "freetype2/ftbuild.h",
+        "xft":      "X11/Xft/Xft.h"
+      }.each do |pkg, header|
+        checking_for(header) do
+          ret = false
 
-        cflags, ldflags, libs = pkg_config("xft")
-        unless libs.nil?
-          # Update flags
-          @options["cpppath"] << " %s" % [ cflags ]
-          @options["ldflags"] << " %s %s" % [ ldflags, libs ]
-          @options["extflags"] << " %s %s" % [ ldflags, libs ]
+          cflags, ldflags, libs = pkg_config(pkg)
 
-          $defs.push("-DHAVE_X11_XFT_XFT_H")
-          ret = true
-        else
-          @options["xft"] = "no"
+          # Fix a bug in ruby 2.2.0 (https://bugs.ruby-lang.org/issues/10651)
+          if cflags.empty?
+            cflags << `#{$PKGCONFIG} --cflags xft`.chomp
+          end
+
+          unless libs.nil?
+            # Update flags
+            @options["cpppath"] << " %s" % [ cflags ]
+            @options["ldflags"] << " %s %s" % [ ldflags, libs ]
+            @options["extflags"] << " %s %s" % [ ldflags, libs ]
+
+            $defs.push("-DHAVE_X11_XFT_XFT_H")
+            ret = true
+          else
+            @options["xft"] = "no"
+          end
+
+          ret
+
         end
-
-        ret
       end
     end
 
--- a/data/subtler/runner.rb	Fri Dec 15 14:20:22 2017 +0100
+++ b/data/subtler/runner.rb	Fri Dec 15 14:22:00 2017 +0100
@@ -4,7 +4,7 @@
 # @package subtler
 #
 # @file Subtle remote
-# @copyright (c) 2005-2013 Christoph Kappel <unexist@subforge.org>
+# @copyright (c) 2005-2017 Christoph Kappel <unexist@subforge.org>
 # @version $Id$
 #
 # This program can be distributed under the terms of the GNU GPLv2.
@@ -499,7 +499,7 @@
 
       def version # {{{
         puts <<-EOF
-  subtler #{Subtlext::VERSION} - Copyright (c) 2005-2013 Christoph Kappel
+  subtler #{Subtlext::VERSION} - Copyright (c) 2005-2017 Christoph Kappel
   Released under the GNU General Public License
   Using Ruby #{RUBY_VERSION}
         EOF
--- a/src/subtle/subtle.c	Fri Dec 15 14:20:22 2017 +0100
+++ b/src/subtle/subtle.c	Fri Dec 15 14:22:00 2017 +0100
@@ -82,7 +82,7 @@
 static void
 SubtleVersion(void)
 {
-  printf("%s %s - Copyright (c) 2005-2013 Christoph Kappel\n" \
+  printf("%s %s - Copyright (c) 2005-2017 Christoph Kappel\n" \
          "Released under the GNU General Public License\n" \
          "Compiled for X%dR%d and Ruby %s\n",
          PKG_NAME, PKG_VERSION, X_PROTOCOL, X_PROTOCOL_REVISION, RUBY_VERSION);