# -*- ruby -*- # # Copyright (C) 2012-2014 Ruby-GNOME2 Project Team # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

$LOAD_PATH.unshift(“./../glib2/lib”) require “gnome2/rake/package-task”

package_task = GNOME2::Rake::PackageTask.new do |package|

package.summary = "Ruby/Clutter is a Ruby binding of Clutter."
package.description = "Ruby/Clutter is a Ruby binding of Clutter."
package.dependency.gem.runtime = ["cairo-gobject", "gobject-introspection"]
package.dependency.gem.development = ["test-unit-notify"]
package.windows.packages = []
package.windows.dependencies = []
package.windows.build_dependencies = [
  "glib2",
  "atk",
  "pango",
  "gdk_pixbuf2",
  "gobject-introspection",
]
package.windows.gobject_introspection_dependencies = [
  "atk",
  "pango",
]
package.external_packages = [
  # Build note:
  #   We need to modify /usr/i686-w64-mingw32/include/GL/ directory because
  #   MinGW w64 bundles old OpenGL headers. Here are changes to build Cogl:
  #
  #   (1) Put the latest glext.h that can be downloaded from
  #       http://www.opengl.org/registry/api/glext.h into
  #       /usr/i686-w64-mingw32/include/GL/ directory:
  #
  #         % wget http://www.opengl.org/registry/api/glext.h
  #         % sudo cp glext.h /usr/i686-w64-mingw32/include/GL/
  #         % sudo chown root:root /usr/i686-w64-mingw32/include/GL/glext.h
  #
  #   (2) Add missing declarations and includes to
  #       /usr/i686-w64-mingw32/include/GL/gl.h:
  #
  #       Before:
  #         ...
  #         typedef double GLdouble;
  #         typedef double GLclampd;
  #         typedef void GLvoid;
  #
  #         #define GL_VERSION_1_1 1
  #         ...
  #
  #       After
  #         ...
  #         typedef double GLdouble;
  #         typedef double GLclampd;
  #         typedef void GLvoid;
  #
  #         typedef ptrdiff_t GLintptr;
  #         typedef ptrdiff_t GLsizeiptr;
  #         typedef char GLchar;
  #         #include <GL/glext.h>
  #
  #         #define GL_VERSION_1_1 1
  #         ...
  {
    :name => "cogl",
    :download_site => :gnome,
    :label => "Cogl",
    :version => "1.18.2",
    :compression_method => "xz",
    :windows => {
      :configure_args => [
        "--disable-glibtest",
        "--enable-introspection",
      ],
      :built_file => "bin/libcogl-20.dll",
    },
  },
  {
    :name => "json-glib",
    :download_site => :gnome,
    :label => "JSON-GLib",
    :version => "1.0.2",
    :compression_method => "xz",
    :windows => {
      :configure_args => [
        "--enable-introspection",
      ],
      :patches => [
        "json-glib-1.0.2-add-missing-config-h.diff",
      ],
      :need_autoreconf => true,
      :built_file => "bin/libjson-glib-1.0-0.dll",
    },
  },
  {
    :name => "clutter",
    :download_site => :gnome,
    :label => "Clutter",
    :version => "1.20.0",
    :compression_method => "xz",
    :windows => {
      :configure_args => [
        "--enable-introspection",
      ],
      :build_concurrently => false,
      :built_file => "bin/libclutter-1.0-0.dll",
    },
  }
]
package.cross_compiling do |spec|
  if /mingw|mswin/ =~ spec.platform.to_s
    spec.add_runtime_dependency("atk", "= #{package.version}")
    spec.add_runtime_dependency("pango", "= #{package.version}")
    spec.add_runtime_dependency("gdk_pixbuf2", "= #{package.version}")
  end
end

end package_task.define

if Rake::Task.task_defined?(“native:clutter:i386-mingw32”)

Rake::Task["native:clutter:i386-mingw32"].prerequisites.clear

end

namespace :dependency do

desc "Install depenencies"
task :install do
  # TODO: Install gir1.2-clutter-1.0 on Debian.
end

end

task :build => “dependency:install”