2010-06-23 Leandro Pereira <leandro@profusion.mobi>
authorleandro@webkit.org <leandro@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jun 2010 20:07:10 +0000 (20:07 +0000)
committerleandro@webkit.org <leandro@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jun 2010 20:07:10 +0000 (20:07 +0000)
        Reviewed by Kenneth Rohde Christiansen.

        [EFL] Add support to CPack (to generate source tarballs)
        https://bugs.webkit.org/show_bug.cgi?id=41009

        * CMakeLists.txt:
        * cmake/OptionsEfl.cmake: Define the default source generator for
        the EFL port.
        * cmake/WebKitPackaging.cmake: Added. This file filters the source
        files so that only files relevant to the selected port are included
        in the source tarball. See comments for details.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@61708 268f45cc-cd09-0410-ab3c-d52691b4dbfc

CMakeLists.txt
ChangeLog
cmake/OptionsEfl.cmake
cmake/WebKitPackaging.cmake [new file with mode: 0644]

index ff3a0ad..996b457 100644 (file)
@@ -19,7 +19,8 @@ INCLUDE(WebKitFeatures)
 # -----------------------------------------------------------------------------
 # Determine which port will be built
 # -----------------------------------------------------------------------------
-OPTION(PORT "choose which WebKit port to build" "NOPORT")
+SET(ALL_PORTS Efl)
+OPTION(PORT "choose which WebKit port to build (one of ${ALL_PORTS})" "NOPORT")
 
 # -----------------------------------------------------------------------------
 # Find common packages (used by all ports)
@@ -90,6 +91,11 @@ INCLUDE(OptionsCommon)
 INCLUDE(Options${PORT})
 
 # -----------------------------------------------------------------------------
+# Define packaging
+# -----------------------------------------------------------------------------
+INCLUDE(WebKitPackaging)
+
+# -----------------------------------------------------------------------------
 # Add module directories
 # -----------------------------------------------------------------------------
 ADD_SUBDIRECTORY(JavaScriptCore)
index 7a8e673..6da8604 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2010-06-23  Leandro Pereira  <leandro@profusion.mobi>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Add support to CPack (to generate source tarballs)
+        https://bugs.webkit.org/show_bug.cgi?id=41009
+        
+        * CMakeLists.txt:
+        * cmake/OptionsEfl.cmake: Define the default source generator for
+        the EFL port.
+        * cmake/WebKitPackaging.cmake: Added. This file filters the source
+        files so that only files relevant to the selected port are included
+        in the source tarball. See comments for details.
+
 2010-06-22  Eric Seidel  <eric@webkit.org>
 
         Unreviewed.  Test commit for commit-queue@webkit.org.
index af181c8..c2b2637 100644 (file)
@@ -85,3 +85,5 @@ WEBKIT_FEATURE(ENABLE_WORKERS "Enable workers" DEFAULT ON)
 WEBKIT_FEATURE(ENABLE_XHTMLMP "Enable XHTMLMP" DEFAULT OFF)
 WEBKIT_FEATURE(ENABLE_XPATH "Enable XPath" DEFAULT ON)
 WEBKIT_FEATURE(ENABLE_XSLT "Enable XSLT" DEFAULT ON)
+
+SET(CPACK_SOURCE_GENERATOR TBZ2)
diff --git a/cmake/WebKitPackaging.cmake b/cmake/WebKitPackaging.cmake
new file mode 100644 (file)
index 0000000..f111548
--- /dev/null
@@ -0,0 +1,184 @@
+# -----------------------------------------------------------------------------
+# This file defines the basics of CPack behavior for WebKit
+#
+# The following CPack variables will be defined if they were unset:
+#   - CPACK_PACKAGE_NAME to WebKit-${PORT}
+#   - CPACK_SOURCE_IGNORE_FILES to a known pattern of good files
+#
+# The following variables affect the behavior of packaging:
+#   - WEBKIT_CPACK_ALL_PORTS if defined and true, will not limit packaging
+#     to just include files of the port (affects CPACK_SOURCE_IGNORE_FILES,
+#     just if this variable was not defined before).
+#   - WEBKIT_CPACK_ADD_TESTS if defined and true, will also add tests
+#     (affects CPACK_SOURCE_IGNORE_FILES, just if this variable was
+#     not defined before)
+#   - WEBKIT_CPACK_ADD_TOOLS if defined and true, will also add tools
+#     (affects CPACK_SOURCE_IGNORE_FILES, just if this variable was
+#     not defined before)
+# -----------------------------------------------------------------------------
+
+IF(NOT DEFINED CPACK_PACKAGE_NAME)
+  SET(CPACK_PACKAGE_NAME WebKit-${PORT})
+ENDIF()
+
+IF(NOT DEFINED CPACK_SOURCE_IGNORE_FILES)
+  SET(CPACK_SOURCE_IGNORE_FILES
+    # Version control:
+    "/CVS/"
+    "/\\\\.svn/"
+    "/\\\\.bzr/"
+    "/\\\\.hg/"
+    "/\\\\.git/"
+    "\\\\.swp$"
+    "\\\\.#"
+    "/#"
+    "/\\\\.gitignore$"
+    "/\\\\.gitattributes$"
+
+    # SVN-only files should be ignored (site, examples...)
+    "/PlanetWebKit/"
+    "/SunSpider/"
+    "/WebKitExamplePlugins/"
+    "/WebKitSite/"
+    "/BugsSite/"
+
+    # Other build systems:
+    # - Makefiles (.mk/Makefile)
+    "\\\\.mk$"
+    "\\\\.make$"
+    "Makefile"
+    # - Autotools (GTK)
+    "/autotools/"
+    "/configure\\\\.ac"
+    "/autogen\\\\.sh"
+    "/autom4te\\\\.cache/"
+    "/aclocal\\\\.m4$"
+    "/GNUmakefile"
+    "/GNUmakefile"
+    # - XCode (Mac)
+    "\\\\.xcodeproj"
+    "\\\\.xcconfig"
+    # - GYP
+    "\\\\.gyp"
+    # - QMake (Qt)
+    "\\\\.pri$"
+    "\\\\.pro$"
+
+    # Development & Runtime created files
+    "~$"
+    "\\\\.mode"
+    "\\\\.pbxuser$"
+    "\\\\.perspective"
+    "\\\\.pyc$"
+    "\\\\.pyo$"
+    "/cmake-build/"
+    "/build/"
+    "/WebKitBuild/"
+    "/WebKitTools/Scripts/webkitpy/thirdparty/autoinstalled/"
+    )
+
+  IF(NOT WEBKIT_CPACK_ADD_TESTS)
+    LIST(APPEND CPACK_SOURCE_IGNORE_FILES
+      "/LayoutTests/"
+      "/manual-tests/"
+      "/tests/"
+      "/PageLoadTests/"
+      )
+  ENDIF(NOT WEBKIT_CPACK_ADD_TESTS)
+
+  IF(NOT WEBKIT_CPACK_ADD_TOOLS)
+    LIST(APPEND CPACK_SOURCE_IGNORE_FILES
+      "/WebKitTools/"
+      "/manual-tools/"
+      "/tools/"
+      "/PageLoadTools/"
+      )
+  ENDIF(NOT WEBKIT_CPACK_ADD_TOOLS)
+
+
+  IF(NOT WEBKIT_CPACK_ALL_PORTS)
+
+    # All file and directory patterns that Efl uses
+    SET(FILE_PATTERNS_Efl
+      "/cairo/" "/Cairo/" "cairo\\\\." "Cairo\\\\."
+      "/efl/" "/Efl/" "efl\\\\." "Efl\\\\."
+      "/glib/" "/Glib/" "glib\\\\." "Glib\\\\."
+      "/gobject/" "/Gobject/" "gobject\\\\." "Gobject\\\\."
+      "/icu/" "/Icu/" "icu\\\\." "Icu\\\\."
+      "/posix/" "/Posix/" "posix\\\\." "Posix\\\\."
+      "/soup/" "/Soup/" "soup\\\\." "Soup\\\\."
+      )
+
+    # File and Directory patterns that no CMake-ified port uses
+    SET(FILE_PATTERNS_UNKNOWN_PORTS
+      "/android/" "/Android/" "android\\\\." "Android\\\\."
+      "/brew/" "/Brew/" "brew\\\\." "Brew\\\\."
+      "/carbon/" "/Carbon/" "carbon\\\\." "Carbon\\\\."
+      "/cf/" "/Cf/" "cf\\\\." "Cf\\\\."
+      "/cg/" "/Cg/" "cg\\\\." "Cg\\\\."
+      "/chromium/" "/Chromium/" "chromium\\\\." "Chromium\\\\."
+      "/cocoa/" "/Cocoa/" "cocoa\\\\." "Cocoa\\\\."
+      "/Configurations/" "/Configurations/" "Configurations\\\\." "Configurations\\\\."
+      "/curl/" "/Curl/" "curl\\\\." "Curl\\\\."
+      "/gstreamer/" "/Gstreamer/" "gstreamer\\\\." "Gstreamer\\\\."
+      "/gtk/" "/Gtk/" "gtk\\\\." "Gtk\\\\."
+      "/haiku/" "/Haiku/" "haiku\\\\." "Haiku\\\\."
+      "/iphone/" "/Iphone/" "iphone\\\\." "Iphone\\\\."
+      "/mac/" "/Mac/" "mac\\\\." "Mac\\\\."
+      "/opentype/" "/Opentype/" "opentype\\\\." "Opentype\\\\."
+      "/openvg/" "/Openvg/" "openvg\\\\." "Openvg\\\\."
+      "/os-win32/" "/Os-Win32/" "os-win32\\\\." "Os-Win32\\\\."
+      "/qscriptengine/" "/Qscriptengine/" "qscriptengine\\\\." "Qscriptengine\\\\."
+      "/qscriptstring/" "/Qscriptstring/" "qscriptstring\\\\." "Qscriptstring\\\\."
+      "/qscriptvalue/" "/Qscriptvalue/" "qscriptvalue\\\\." "Qscriptvalue\\\\."
+      "/qt/" "/Qt/" "qt\\\\." "Qt\\\\."
+      "/qt4/" "/Qt4/" "qt4\\\\." "Qt4\\\\."
+      "/skia/" "/Skia/" "skia\\\\." "Skia\\\\."
+      "/symbian/" "/Symbian/" "symbian\\\\." "Symbian\\\\."
+      "/v8/" "/V8/" "v8\\\\." "V8\\\\."
+      "/V8/" "/V8/" "V8\\\\." "V8\\\\."
+      "/win/" "/Win/" "win\\\\." "Win\\\\."
+      "/wince/" "/Wince/" "wince\\\\." "Wince\\\\."
+      "/wx/" "/Wx/" "wx\\\\." "Wx\\\\."
+      "/wxcode/" "/Wxcode/" "wxcode\\\\." "Wxcode\\\\."
+      "/WebKitLibraries/"
+      "/English\\\\.lproj/"
+      "/WebKit2/"
+      "\\\\.a$"
+      "\\\\.exe$"
+      "\\\\.mm$"
+      )
+
+    # Append all Unknown port patterns
+    FOREACH(_pattern ${FILE_PATTERNS_UNKNOWN_PORTS})
+      LIST(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
+      IF(_pattern_index GREATER -1)
+        MESSAGE("pattern ${_pattern} declared of 'no-port' is actually used by ${PORT}")
+      ELSE()
+        LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
+      ENDIF()
+    ENDFOREACH()
+
+    # Append all "other-ports" patterns
+    FOREACH(_port ${ALL_PORTS})
+      IF(NOT ${_port} STREQUAL ${PORT})
+        FOREACH(_pattern ${FILE_PATTERNS_${_port}})
+
+          LIST(FIND FILE_PATTERNS_${PORT} ${_pattern} _pattern_index)
+          IF(_pattern_index GREATER -1)
+            MESSAGE("pattern ${_pattern} of port ${_port} is also used by ${PORT}")
+          ELSE()
+            LIST(APPEND CPACK_SOURCE_IGNORE_FILES ${_pattern})
+          ENDIF()
+        ENDFOREACH()
+      ENDIF()
+    ENDFOREACH()
+
+  ENDIF(NOT WEBKIT_CPACK_ALL_PORTS)
+
+ENDIF(NOT DEFINED CPACK_SOURCE_IGNORE_FILES)
+
+# -----------------------------------------------------------------------------
+# Include CPack that will define targets based on the variables defined before
+# -----------------------------------------------------------------------------
+INCLUDE(CPack)