From bc5e1eeb16687380ba1d0bcfa63fb1b03750b08c Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Tue, 4 Feb 2025 20:45:05 +0100 Subject: [PATCH] build: remove gst-indent as a subproject gst-indent is now installable with pip. Remove it as a subproject and update the documentation. Part-of: --- .gitlab-image-tags.yml | 2 +- ci/docker/checks/prepare.sh | 35 +------------------ gst-env.py | 8 ----- meson.build | 2 -- meson_options.txt | 1 - .../gst-docs/markdown/contribute/index.md | 11 ++---- .../frequently-asked-questions/developing.md | 6 ++-- subprojects/gst-indent.wrap | 8 ----- 8 files changed, 7 insertions(+), 66 deletions(-) delete mode 100644 subprojects/gst-indent.wrap diff --git a/.gitlab-image-tags.yml b/.gitlab-image-tags.yml index 73bba18ef2..4ba7127c55 100644 --- a/.gitlab-image-tags.yml +++ b/.gitlab-image-tags.yml @@ -9,7 +9,7 @@ variables: DEBIAN_TAG: '2025-01-11.0' - CHECKS_TAG: '2025-01-22.0' + CHECKS_TAG: '2025-02-04.0' ABI_CHECK_TAG: '2025-01-29.0' diff --git a/ci/docker/checks/prepare.sh b/ci/docker/checks/prepare.sh index 6dbb930176..74df814de7 100755 --- a/ci/docker/checks/prepare.sh +++ b/ci/docker/checks/prepare.sh @@ -18,45 +18,12 @@ apt install -y dotnet-sdk-7.0 dotnet tool install --global dotnet-format ln -s ~/.dotnet/tools/dotnet-format /usr/local/bin/dotnet-format -# Build and install gst-indent-1.0 +# Install build dependencies echo "deb-src http://deb.debian.org/debian/ bookworm main" >> /etc/apt/sources.list apt update apt-get install --assume-yes devscripts build-essential dpkg-dev wget meson ninja-build pkg-config libssl-dev -apt-get build-dep --assume-yes indent - -git clone https://gitlab.freedesktop.org/gstreamer/gst-indent.git -cd gst-indent - -meson setup --prefix=/usr _build -meson install -C _build - -# Try it -wget -O gstbayer2rgb.c "https://gitlab.freedesktop.org/gstreamer/gstreamer/-/raw/main/subprojects/gst-plugins-bad/gst/bayer/gstbayer2rgb.c?inline=false" - -for i in 1 2; do -gst-indent-1.0 \ - --braces-on-if-line \ - --case-brace-indentation0 \ - --case-indentation2 \ - --braces-after-struct-decl-line \ - --line-length80 \ - --no-tabs \ - --cuddle-else \ - --dont-line-up-parentheses \ - --continuation-indentation4 \ - --honour-newlines \ - --tab-size8 \ - --indent-level2 \ - --leave-preprocessor-space \ - gstbayer2rgb.c -done; - -# Clean up gst-indent -cd .. -rm -rf gst-indent - export PIP_BREAK_SYSTEM_PACKAGES=1 # Install pre-commit python3 -m pip install --upgrade pip diff --git a/gst-env.py b/gst-env.py index 2da1adbb05..6fb4726d01 100755 --- a/gst-env.py +++ b/gst-env.py @@ -322,14 +322,6 @@ def get_subprocess_env(options, gst_version): prepend_env_var(env, "PKG_CONFIG_PATH", os.path.join(PREFIX_DIR, 'lib', 'pkgconfig'), options.sysroot) - # gst-indent-1.0 - prepend_env_var(env, "PATH", os.path.join(options.builddir, 'subprojects', - 'gst-indent', 'src'), - options.sysroot) - # gst-indent (FIXME: remove or move into gst-indent module) - prepend_env_var(env, "PATH", os.path.join(SCRIPTDIR, 'scripts'), - options.sysroot) - # tools: gst-launch-1.0, gst-inspect-1.0 prepend_env_var(env, "PATH", os.path.join(options.builddir, 'subprojects', 'gstreamer', 'tools'), diff --git a/meson.build b/meson.build index 0c1bce46a1..da5d287519 100644 --- a/meson.build +++ b/meson.build @@ -686,8 +686,6 @@ if dotnet_format.found() ) endif -indent = find_program('gst-indent-1.0', native: true, required: get_option('gst-indent').allowed()) - summary({ 'gstreamer-full library': building_full, 'gstreamer-full target type': get_option('gst-full-target-type'), diff --git a/meson_options.txt b/meson_options.txt index 6baaed6cbe..d73d9cce34 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -45,7 +45,6 @@ option('gst-full-target-type', type : 'combo', value : 'shared_library', choices option('orc-source', type: 'combo', choices: ['system', 'subproject', 'auto'], value: 'subproject') option('build-tools-source', type: 'combo', choices: ['system', 'subproject'], value: 'subproject') option('virtme_kernel_image', type: 'string', value: '', description: 'Path to a Linux kernel image to be used for virtme testing') -option('gst-indent', type: 'feature', value: 'auto', description: 'Whether to build the gst-indent tool') # License-related feature options option('gpl', type: 'feature', value: 'disabled', diff --git a/subprojects/gst-docs/markdown/contribute/index.md b/subprojects/gst-docs/markdown/contribute/index.md index cffde35373..f90fa66879 100644 --- a/subprojects/gst-docs/markdown/contribute/index.md +++ b/subprojects/gst-docs/markdown/contribute/index.md @@ -427,8 +427,8 @@ In the simplest case, you might be able to get away with just doing a `git pull #### Coding Style Try to stick to the GStreamer indentation and coding style. There is an -application called [`gst-indent-1.0`][gst-indent] which should be available -in a GStreamer development environment and which you can run over your `.c` or +application called [`gst-indent-1.0`][gst-indent] that can be installed +with `pip install gst-indent`. You can run it over your `.c` or `.cpp` files if you want your code auto-indented before making the patch. Please do _not_ run `gst-indent-1.0` on header files, our header file @@ -439,13 +439,6 @@ checks if your commit conforms to the required style. You can bypass that local indentation check hook by using `git commit -n`, but it will still be checked again later on the CI when you submit your changes through GitLab for merging. -If `gst-indent-1.0` is not found on your system at setup time, it will be -supplied from the Meson wrap in the main project; you must build GStreamer -once, and that will make `gst-indent-1.0` available to the developer -environment. - -We are working on making this less hasslesome. - Compiler requirements: - we are targetting the C99 compiler and preprocesser feature subset supported by gcc 5.4, clang and vs2017. Newer features can be diff --git a/subprojects/gst-docs/markdown/frequently-asked-questions/developing.md b/subprojects/gst-docs/markdown/frequently-asked-questions/developing.md index c103933b92..47b29d329e 100644 --- a/subprojects/gst-docs/markdown/frequently-asked-questions/developing.md +++ b/subprojects/gst-docs/markdown/frequently-asked-questions/developing.md @@ -120,9 +120,9 @@ Rust source files (.rs files) are indented with the standard `rustfmt`. One way to make sure you are following our coding style is to run your code (remember, only the `*.c` files, not the headers) through the `gst-indent-1.0` -tool, which should be available in the uninstalled GStreamer development -environment from version 1.23.1 onwards. Alternatively you can also get the -tool from the [gst-indent repository](https://gitlab.freedesktop.org/gstreamer/gst-indent/) +tool, which can be installed with `pip install gst-indent`. +Alternatively you can also get the tool from the +[gst-indent repository](https://gitlab.freedesktop.org/gstreamer/gst-indent/) and build it yourself. The easiest way to get the indenting right is probably to develop against a git diff --git a/subprojects/gst-indent.wrap b/subprojects/gst-indent.wrap deleted file mode 100644 index ac1430fd60..0000000000 --- a/subprojects/gst-indent.wrap +++ /dev/null @@ -1,8 +0,0 @@ -[wrap-git] -directory=gst-indent -url=https://gitlab.freedesktop.org/gstreamer/gst-indent.git -push-url=git@gitlab.freedesktop.org:gstreamer/gst-indent.git -revision=main - -[provide] -program_names = gst-indent-1.0