Skip to content

Commit

Permalink
Merge r178672 - [GTK] Generate the make dist manifest from a CMake te…
Browse files Browse the repository at this point in the history
…mplate file

https://bugs.webkit.org/show_bug.cgi?id=139387

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-01-19
Reviewed by Martin Robinson.

.:

Generate manifest.txt from manifest.txt.in. Only expose the dist and
distcheck targets for developer builds, as they won't work when
building from a tarball because the manifest is not distributed.

* Source/PlatformGTK.cmake:

Tools:

Remove the code that performs variable substitution on manifest.txt.
Replace the custom variables used in that file with CMake variables.

* gtk/make-dist.py:
(Manifest.add_directory):
(Manifest.get_full_source_path):
(Manifest.process_line):
(Manifest.resolve_variables): Deleted.
(Manifest.get_full_tarball_path): Deleted.
* gtk/manifest.txt.in: Renamed from Tools/gtk/manifest.txt.

Canonical link: https://commits.webkit.org/154760.296@webkitgtk/2.6
git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@182380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
mcatanzaro authored and carlosgcampos committed Apr 6, 2015
1 parent 2f535ef commit e86a21d
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 55 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
@@ -1,3 +1,16 @@
2015-01-19 Michael Catanzaro <mcatanzaro@igalia.com>

[GTK] Generate the make dist manifest from a CMake template file
https://bugs.webkit.org/show_bug.cgi?id=139387

Reviewed by Martin Robinson.

Generate manifest.txt from manifest.txt.in. Only expose the dist and
distcheck targets for developer builds, as they won't work when
building from a tarball because the manifest is not distributed.

* Source/PlatformGTK.cmake:

2015-01-15 Carlos Garcia Campos <cgarcia@igalia.com>

Unreviewed. Update OptionsGTK.cmake and NEWS for 2.6.5 release.
Expand Down
72 changes: 39 additions & 33 deletions Source/PlatformGTK.cmake
Expand Up @@ -51,40 +51,46 @@ add_custom_target(check
COMMAND ${TOOLS_DIR}/gtk/check-for-webkitdom-api-breaks
)

if (DEVELOPER_MODE)
configure_file(
${TOOLS_DIR}/gtk/manifest.txt.in
${CMAKE_BINARY_DIR}/manifest.txt
)

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
DEPENDS ${TOOLS_DIR}/gtk/manifest.txt
DEPENDS WebKit2
DEPENDS gtkdoc
COMMAND ${TOOLS_DIR}/gtk/make-dist.py
--source-dir=${CMAKE_SOURCE_DIR}
--build-dir=${CMAKE_BINARY_DIR}
--version=${PROJECT_VERSION}
${TOOLS_DIR}/gtk/manifest.txt
)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
DEPENDS ${CMAKE_BINARY_DIR}/manifest.txt
DEPENDS WebKit2
DEPENDS gtkdoc
COMMAND ${TOOLS_DIR}/gtk/make-dist.py
--source-dir=${CMAKE_SOURCE_DIR}
--build-dir=${CMAKE_BINARY_DIR}
--version=${PROJECT_VERSION}
${CMAKE_BINARY_DIR}/manifest.txt
)

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
)

add_custom_target(dist
DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
)
add_custom_target(dist
DEPENDS ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar.xz
)

add_custom_target(distcheck
DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
DEPENDS ${TOOLS_DIR}/gtk/manifest.txt
DEPENDS WebKit2
DEPENDS gtkdoc
COMMAND ${TOOLS_DIR}/gtk/make-dist.py
--check
--source-dir=${CMAKE_SOURCE_DIR}
--build-dir=${CMAKE_BINARY_DIR}
--version=/webkitgtk-${PROJECT_VERSION}
${TOOLS_DIR}/gtk/manifest.txt
COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
)
add_custom_target(distcheck
DEPENDS ${TOOLS_DIR}/gtk/make-dist.py
DEPENDS ${CMAKE_BINARY_DIR}/manifest.txt
DEPENDS WebKit2
DEPENDS gtkdoc
COMMAND ${TOOLS_DIR}/gtk/make-dist.py
--check
--source-dir=${CMAKE_SOURCE_DIR}
--build-dir=${CMAKE_BINARY_DIR}
--version=${PROJECT_VERSION}
${CMAKE_BINARY_DIR}/manifest.txt
COMMAND xz -f ${CMAKE_BINARY_DIR}/webkitgtk-${PROJECT_VERSION}.tar
)
endif ()
18 changes: 18 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,21 @@
2015-01-19 Michael Catanzaro <mcatanzaro@igalia.com>

[GTK] Generate the make dist manifest from a CMake template file
https://bugs.webkit.org/show_bug.cgi?id=139387

Reviewed by Martin Robinson.

Remove the code that performs variable substitution on manifest.txt.
Replace the custom variables used in that file with CMake variables.

* gtk/make-dist.py:
(Manifest.add_directory):
(Manifest.get_full_source_path):
(Manifest.process_line):
(Manifest.resolve_variables): Deleted.
(Manifest.get_full_tarball_path): Deleted.
* gtk/manifest.txt.in: Renamed from Tools/gtk/manifest.txt.

2015-01-07 Michael Catanzaro <mcatanzaro@igalia.com>

[GTK] Build gtk-doc without gtkdoc-mktmpl
Expand Down
27 changes: 7 additions & 20 deletions Tools/gtk/make-dist.py
Expand Up @@ -159,27 +159,14 @@ def add_directory(self, directory):
self.current_directory = directory
self.directories.append(directory)

def resolve_variables(self, string, strip=False):
if strip:
return string.replace('$source', '').replace('$build', '')

string = string.replace('$source', self.source_root)
if self.build_root:
string = string.replace('$build', self.build_root)
elif string.find('$build') != -1:
raise Exception('Manifest has $build but build root not given.')
return string

def get_full_source_path(self, source_path):
full_source_path = self.resolve_variables(source_path)
if not os.path.exists(full_source_path):
full_source_path = os.path.join(self.source_root, source_path)
if not os.path.exists(full_source_path):
raise Exception('Could not find directory %s' % full_source_path)
return full_source_path
if not os.path.exists(source_path):
source_path = os.path.join(self.source_root, source_path)
if not os.path.exists(source_path):
raise Exception('Could not find directory %s' % source_path)
return source_path

def get_full_tarball_path(self, path):
path = self.resolve_variables(path, strip=True)
return self.tarball_root + path

def get_source_and_tarball_paths_from_parts(self, parts):
Expand All @@ -202,9 +189,9 @@ def process_line(self, line):
elif parts[0] == "file" and len(parts) > 1:
self.add_directory(File(*self.get_source_and_tarball_paths_from_parts(parts)))
elif parts[0] == "exclude" and len(parts) > 1:
self.add_rule(Rule(Rule.Result.EXCLUDE, self.resolve_variables(parts[1])))
self.add_rule(Rule(Rule.Result.EXCLUDE, parts[1]))
elif parts[0] == "include" and len(parts) > 1:
self.add_rule(Rule(Rule.Result.INCLUDE, self.resolve_variables(parts[1])))
self.add_rule(Rule(Rule.Result.INCLUDE, parts[1]))

def should_skip_file(self, directory, filename):
# Only allow files that are not in version control when they are explicitly included in the manifest from the build dir.
Expand Down
4 changes: 2 additions & 2 deletions Tools/gtk/manifest.txt → Tools/gtk/manifest.txt.in
Expand Up @@ -106,5 +106,5 @@ file Tools/Scripts/webkit-build-directory
file Tools/Scripts/webkitdirs.pm
file Tools/jhbuild/jhbuildutils.py

directory $build/Documentation/webkit2gtk/html Documentation/webkit2gtk/html
directory $build/Documentation/webkitdomgtk/html Documentation/webkitdomgtk/html
directory ${CMAKE_BINARY_DIR}/Documentation/webkit2gtk/html Documentation/webkit2gtk/html
directory ${CMAKE_BINARY_DIR}/Documentation/webkitdomgtk/html Documentation/webkitdomgtk/html

0 comments on commit e86a21d

Please sign in to comment.