From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- third_party/python/gyp/test/mac/postbuilds/copy.sh | 3 + third_party/python/gyp/test/mac/postbuilds/file.c | 4 + .../python/gyp/test/mac/postbuilds/file_g.c | 4 + .../python/gyp/test/mac/postbuilds/file_h.c | 4 + .../postbuilds/script/shared_library_postbuild.sh | 23 ++++++ .../postbuilds/script/static_library_postbuild.sh | 23 ++++++ .../mac/postbuilds/subdirectory/copied_file.txt | 1 + .../mac/postbuilds/subdirectory/nested_target.gyp | 53 ++++++++++++ .../python/gyp/test/mac/postbuilds/test.gyp | 93 ++++++++++++++++++++++ 9 files changed, 208 insertions(+) create mode 100755 third_party/python/gyp/test/mac/postbuilds/copy.sh create mode 100644 third_party/python/gyp/test/mac/postbuilds/file.c create mode 100644 third_party/python/gyp/test/mac/postbuilds/file_g.c create mode 100644 third_party/python/gyp/test/mac/postbuilds/file_h.c create mode 100755 third_party/python/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh create mode 100755 third_party/python/gyp/test/mac/postbuilds/script/static_library_postbuild.sh create mode 100644 third_party/python/gyp/test/mac/postbuilds/subdirectory/copied_file.txt create mode 100644 third_party/python/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp create mode 100644 third_party/python/gyp/test/mac/postbuilds/test.gyp (limited to 'third_party/python/gyp/test/mac/postbuilds') diff --git a/third_party/python/gyp/test/mac/postbuilds/copy.sh b/third_party/python/gyp/test/mac/postbuilds/copy.sh new file mode 100755 index 0000000000..ecad0381db --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/copy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cp "$@" diff --git a/third_party/python/gyp/test/mac/postbuilds/file.c b/third_party/python/gyp/test/mac/postbuilds/file.c new file mode 100644 index 0000000000..653e71ff7e --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/file.c @@ -0,0 +1,4 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +void f() {} diff --git a/third_party/python/gyp/test/mac/postbuilds/file_g.c b/third_party/python/gyp/test/mac/postbuilds/file_g.c new file mode 100644 index 0000000000..0f7849d208 --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/file_g.c @@ -0,0 +1,4 @@ +// Copyright (c) 2012 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +void g() {} diff --git a/third_party/python/gyp/test/mac/postbuilds/file_h.c b/third_party/python/gyp/test/mac/postbuilds/file_h.c new file mode 100644 index 0000000000..521d1f4d56 --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/file_h.c @@ -0,0 +1,4 @@ +// Copyright (c) 2012 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +void h() {} diff --git a/third_party/python/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh b/third_party/python/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh new file mode 100755 index 0000000000..c623c8bf21 --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/script/shared_library_postbuild.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +set -e + +lib="${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" +nm ${lib} > /dev/null # Just make sure this works. + +pattern="${1}" + +if [ $pattern != "a|b" ]; then + echo "Parameter quoting is broken" + exit 1 +fi + +if [ "${2}" != "arg with spaces" ]; then + echo "Parameter space escaping is broken" + exit 1 +fi + +touch "${lib}"_touch diff --git a/third_party/python/gyp/test/mac/postbuilds/script/static_library_postbuild.sh b/third_party/python/gyp/test/mac/postbuilds/script/static_library_postbuild.sh new file mode 100755 index 0000000000..2bf09b34e1 --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/script/static_library_postbuild.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +set -e + +lib="${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME}" +nm ${lib} > /dev/null # Just make sure this works. + +pattern="${1}" + +if [ $pattern != "a|b" ]; then + echo "Parameter quote escaping is broken" + exit 1 +fi + +if [ "${2}" != "arg with spaces" ]; then + echo "Parameter space escaping is broken" + exit 1 +fi + +touch "${lib}"_touch.a diff --git a/third_party/python/gyp/test/mac/postbuilds/subdirectory/copied_file.txt b/third_party/python/gyp/test/mac/postbuilds/subdirectory/copied_file.txt new file mode 100644 index 0000000000..a634f85b6c --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/subdirectory/copied_file.txt @@ -0,0 +1 @@ +This file should be copied to the products dir. diff --git a/third_party/python/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp b/third_party/python/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp new file mode 100644 index 0000000000..6d4f2395e3 --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/subdirectory/nested_target.gyp @@ -0,0 +1,53 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'targets': [ + { + 'target_name': 'nest_el', + 'type': 'static_library', + 'sources': [ '../file_g.c', ], + 'postbuilds': [ + { + 'postbuild_name': 'Static library postbuild', + 'variables': { + 'some_regex': 'a|b', + }, + 'action': [ + '../script/static_library_postbuild.sh', + '<(some_regex)', + 'arg with spaces', + ], + }, + ], + }, + { + 'target_name': 'nest_dyna', + 'type': 'shared_library', + 'mac_bundle': 1, + 'sources': [ '../file_h.c', ], + 'postbuilds': [ + { + 'postbuild_name': 'Dynamic library postbuild', + 'variables': { + 'some_regex': 'a|b', + }, + 'action': [ + '../script/shared_library_postbuild.sh', + '<(some_regex)', + 'arg with spaces', + ], + }, + { + 'postbuild_name': 'Test paths relative to gyp file', + 'action': [ + '../copy.sh', + './copied_file.txt', + '${BUILT_PRODUCTS_DIR}/copied_file_2.txt', + ], + }, + ], + }, + ], +} + diff --git a/third_party/python/gyp/test/mac/postbuilds/test.gyp b/third_party/python/gyp/test/mac/postbuilds/test.gyp new file mode 100644 index 0000000000..7c0b523f86 --- /dev/null +++ b/third_party/python/gyp/test/mac/postbuilds/test.gyp @@ -0,0 +1,93 @@ +# Copyright (c) 2011 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'targets': [ + { + 'target_name': 'el', + 'type': 'static_library', + 'sources': [ 'file.c', ], + 'postbuilds': [ + { + 'postbuild_name': 'Static library postbuild', + 'variables': { + 'some_regex': 'a|b', + }, + 'action': [ + 'script/static_library_postbuild.sh', + '<(some_regex)', + 'arg with spaces', + ], + }, + { + 'postbuild_name': 'Test variable in gyp file', + 'action': [ + 'cp', + '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}', + '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}_gyp_touch.a', + ], + }, + ], + }, + { + 'target_name': 'dyna', + 'type': 'shared_library', + 'mac_bundle': 1, + 'sources': [ 'file.c', ], + 'dependencies': [ + 'subdirectory/nested_target.gyp:nest_dyna', + 'subdirectory/nested_target.gyp:nest_el', + ], + 'postbuilds': [ + { + 'postbuild_name': 'Dynamic library postbuild', + 'variables': { + 'some_regex': 'a|b', + }, + 'action': [ + 'script/shared_library_postbuild.sh', + '<(some_regex)', + 'arg with spaces', + ], + }, + { + 'postbuild_name': 'Test variable in gyp file', + 'action': [ + 'cp', + '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}', + '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}_gyp_touch', + ], + }, + { + 'postbuild_name': 'Test paths relative to gyp file', + 'action': [ + './copy.sh', + 'subdirectory/copied_file.txt', + '${BUILT_PRODUCTS_DIR}', + ], + }, + ], + }, + { + 'target_name': 'dyna_standalone', + 'type': 'shared_library', + 'sources': [ 'file.c', ], + 'postbuilds': [ + { + 'postbuild_name': 'Test variable in gyp file', + 'action': [ + 'cp', + '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}', + '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}_gyp_touch.dylib', + ], + }, + ], + }, + { + 'target_name': 'EmptyBundle', + 'product_extension': 'bundle', + 'type': 'executable', + 'mac_bundle': 1, + }, + ], +} -- cgit v1.2.3