summaryrefslogtreecommitdiff
path: root/gst-env.py
AgeCommit message (Collapse)Author
2023-11-11launcher: Fix ambigious python stringsJordan Petridis
``` gst-devtools/validate/launcher/baseclasses.py:2399: SyntaxWarning: invalid escape sequence '\.' if re.findall("%s\..*\.%s$" % (re.escape(mfile_bname), self.FILE_EXTENSION), f): gst-devtools/validate/launcher/apps/gstvalidate.py:1354: SyntaxWarning: invalid escape sequence '\.' ("file\.transcode.*mxf", ``` Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5541>
2023-07-16gst-omx: Retire the whole packageOlivier Crête
The OpenMAX standard is long dead and even the Raspberry Pi OS no longer supports it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4976>
2023-04-07ptp-helper: Rewrite in Rust for portability and securitySebastian Dröge
This works on Linux, Android, Windows, macOS, FreeBSD, NetBSD, OpenBSD, DragonFlyBSD, Solaris and Illumos. Newly supported compared to the C version is Windows. Compared to the C version various error paths are handled more correctly and a couple of memory leaks are fixed. Otherwise it should work identically. The minimum required Rust version for compiling this is 1.48, i.e. the version currently in Debian stable. On Windows, Rust 1.54 is needed at least. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1259 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3889>
2023-01-30gst-env: Handle installing python modules to dist-packagesThibault Saunier
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3826>
2023-01-25gst-env.py: Output a setting for the prompt with --only-environmentNirbheek Chauhan
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3708>
2023-01-25gst-env.py: Output DYLD_LIBRARY_PATH with --only-environment on macOSNirbheek Chauhan
DYLD_LIBRARY_PATH is considered a security risk by Apple, so shells filter it out, but we can set it when using --only-environment so people can use it like so: eval $(./gst-env.py --only-environment) This is currently the only way to build an app that links to gstreamer inside the devenv on macOS and have it run properly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3708>
2022-11-04gst-env: import exit from sysStéphane Cerveau
On windows the Cmd Prompt for VS 2019 complains that exit is not defined. File "C:/data/gstreamer/gst-env.py", line 622, in <module> exit(subprocess.call(args, close_fds=False, env=env)) NameError: name 'exit' is not defined Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3324>
2022-06-15gst-env.py: drop 'gst-' prefix from branch name in promptTim-Philipp Müller
Probably leftover from the days where we would have a gst-foo.sh script to set up the devenv for a particular checkout/branch. Kind of confusing now if you're working on a named branch and it just adds an extra gst- prefix in the prompt. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2594>
2022-06-03gst-env: Add support for PowerShell 7Seungha Yang
The executable binary name of "PowerShell 7" is "pwsh.exe" which is different from system default installed "Windows PowerShell (version 5.x or older)" Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2545>
2022-05-15gst-env: spawn a shell to execute commands on windowsJordan Petridis
On windows, if you are not using built-in commands you need to pass the full path of your executable into the subprocess.call/ Popen syscall. ex `c:/foo/bar/baz.exe`. This get's long and is not ergonomic when you want to run trivial task like: `gst-env.py ninja` or `gst-inspect0.0` or `gst-validate-launcher` Instead, on windows, always launch a shell to be able to resolve the executable from the PATH. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2397>
2022-03-01Allow running gst-uninstalled when GStreamer is a subprojectSebastian Fricke
As described in Merge request 222, the previous solution is not the best possible solution and was also missing documentation. Adjust the suggestion to the current GStreamer mono-repository. And apply this change after reverting the previous commit. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1743>
2022-03-01Revert "Allow running gst-uninstalled when gst-build is a subproject"Sebastian Fricke
This reverts commit 879126a31c77622f594e70f205fcefd4556d9865. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1743>
2022-03-01gst-env: Improve coding style and cleanupSebastian Fricke
* Remove unused variables * Remove unused imports * Apply pycodestyle style suggestions - Missing newlines - spaces before brackets - Wrong indentations Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1743>
2022-01-12gst-env: extend PATH to include plugin scanner and generatorMark Nauwelaerts
2021-11-18env: Fix deprecations from python 3.10Thibault Saunier
distutils is now deprecated and strtobool is simple enough for us to just vendor. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1358>
2021-10-15python: Fix using overrides when not building PyGObjectThibault Saunier
Since 547570cd790f2b2e390edc1dfb5df4c7a33de45c we do not always build PyGObject and our development environment is broken when trying to use GStreamer python when built against system PyGObject with the following error importing Gst in there: ``` 12345678** (gst-plugin-scanner:710617): CRITICAL **: 11:45:02.343: can't find gi.repository.Gst Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/gi/repository/__init__.py", line 23, in <module> from ..importer import DynamicImporter File "/usr/lib64/python3.9/site-packages/gi/importer.py", line 33, in <module> from .overrides import load_overrides ImportError: cannot import name 'load_overrides' from 'gi.overrides' (/var/home/thiblahute/devel/gstreamer/gstreamer/subprojects/gst-editing-services/bindings/python/gi/overrides/__init__.py) Factory Details: ``` The approach to fixing it is to implement override `gi` in `gst-python/gi/` which we add to `PYTHONPATH`) and in there reset the `gi` module to the right place and we get overrides from paths from `_GI_OVERRIDES_PATH` we set in `gst-env.py` which points to all the overrides that will be installed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1155>
2021-10-12gst-env: Ignore SIGINT when running on the CI serverThibault Saunier
We get spurious sigint and this is just a small temporary workaround Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1113>
2021-10-05ci: Fix gst-indent pathXavier Claessens
It used to be downloaded into PATH, but we can now instead run it from git. Also move it to top source dir instead of gstreamer subproject. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/931>
2021-09-30core: remove outdated mention to gst-buildStéphane Cerveau
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/956>
2021-09-24Cleanup root directory from misc filesThibault Saunier
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/891>
2021-08-28gst-env: Don't set DYLD_LIBRARY_PATH on macOSNirbheek Chauhan
This is not actually needed because everything we build is using @rpath already, and setting it causes dynamic linker path priority issues with macOS internals causing *all* programs to fail to run inside gst-env: ``` $ vim dyld: Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib Expected in: /Users/nirbheek/projects/repos/gst-build/_build_macos/subprojects/libjpeg-turbo-2.1.0/libJPEG.dylib in /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib Abort trap: 6 ``` In this case it is caused by libjpeg.dylib, but it can happen with other dylibs that conflict with dylibs used by macOS internally. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/257>
2021-08-27Allow running gst-uninstalled when gst-build is a subprojectOlivier Crete
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/222>
2021-04-30devenv: Add webrtc testsuite to pathsOlivier Crête
This makes it a little easier to run it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/243>
2021-04-29bash-completion: add completion for gstreamer toolsStéphane Cerveau
Allow to autocomplete with elements/properties in the devenv using gst-launch-1.0 etc. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/232>
2021-04-06gst-env: Windows: Fix looking for cmd_or_ps.ps1 in the wrong directoryAndrey Moiseev
At the point of get_windows_shell() execution, the current directory equals DEFAULT_BUILDDIR=./build. But cmd_or_ps.ps1 is in SCRIPTDIR=./ (repo root). Point subprocess.check_output() to the correct directory. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/238>
2020-10-23Meson: Use generated -uninstalled.pc filesXavier Claessens
2020-09-24gst-env: use Path.open() in get_pkgconfig_variable_from_pcfile()Antonio Ospite
The pcfile argument passed to get_target_install_filename() is guaranteed to be a Path() object so use the .open() method to open the file instead of the standard open() function. This makes it possible to run gst-env.py on older systems with pyhton3.5 where the standard open() function cannot handle Path arguments. The change fixes errors like the following: ----------------------------------------------------------------------- $ ninja -C build/ devenv ninja: Entering directory `build/' [0/1] Running external command devenv Traceback (most recent call last): File "/home/ao2/gst-build/gst-env.py", line 493, in <module> env = get_subprocess_env(options, gst_version) File "/home/ao2/gst-build/gst-env.py", line 342, in get_subprocess_env elif is_gio_module(target, filename, options.builddir): File "/home/ao2/gst-build/gst-env.py", line 121, in is_gio_module giomoduledir = PurePath(get_pkgconfig_variable(builddir, 'gio-2.0', 'giomoduledir')) File "/home/ao2/gst-build/gst-env.py", line 110, in get_pkgconfig_variable return get_pkgconfig_variable_from_pcfile(pcfile, varname) File "/home/ao2/gst-build/gst-env.py", line 89, in get_pkgconfig_variable_from_pcfile with open(pcfile, 'r', encoding='utf-8') as f: TypeError: invalid file: PosixPath('/home/ao2/gst-build/build/meson-private/gio-2.0.pc') FAILED: meson-devenv ----------------------------------------------------------------------- Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/192>
2020-08-03gst-env: Load gio modules in the devenvNirbheek Chauhan
By setting GIO_EXTRA_MODULES we can ensure that any gio modules we built are loaded by the devenv. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/180>
2020-08-03gst-env: Factor out some common codeNirbheek Chauhan
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/180>
2020-08-03gst-env: Prematurely skip all targets that aren't installedNirbheek Chauhan
Simplifies the code a bit. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/180>
2020-07-21gst-env.py: Sort path sets before using prepend_env_varJan Alexander Steffens (heftig)
Python `set`s have a random ordering. To avoid creating a random environment, create sorted lists before iterating over them. Our Rust crates instruct cargo to rebuild if `PKG_CONFIG_PATH` changes, so this has been causing unnecessary rebuilds. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/177>
2020-06-15gst-env: Copy instead of symlink on WindowsNirbheek Chauhan
os.symlink needs admin privs in most cases. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/160>
2020-06-15gst-env: Fix creation of gdb-autoload dirs on WindowsNirbheek Chauhan
`bdir[1:]` is supposed to convert `/path/to/bdir` to `path/to/bdir` which is only correct on UNIX. On Windows it will convert `C:\path\to\bdir` to `:\path\to\bdir` which is totally wrong. Use pathlib instead, which makes it trivial to do the conversion using `joinpath(*bdir.parts)` Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/160>
2020-06-12gst-env: Use meson-uninstalled pkgconfig files if availableNirbheek Chauhan
This allows people to use the development environment for building projects when glib is built as a subproject. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/158>
2020-05-11gst-env: fix program name in argparseVíctor Manuel Jáquez Leal
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/145>
2020-04-20gst-env: Remove non-existent directory from PKG_CONFIG_PATHPhilippe Normand
There is no pkgconfig directory in -good.
2020-04-16gst-env: Also look for `builddir` when hunting for a build dirNirbheek Chauhan
2020-03-25gst-env: Allow setting environment without gitNicolas Dufresne
This is needed to use gst-uninstalled mode over NFS when gst-build is a worktree. When this is the case, the .git is a file that links to the original git tree, but this tree is unlikely to be visible over NFS. Instead of forcing NFS contorsion, simply ignore the error.
2020-01-19devenv: Fix path handling for gdb supportThibault Saunier
And enable gdb support only when gdb is avalaible
2020-01-13uninstalled: Add support for GStreamer and GLib gdb scriptsThibault Saunier
2020-01-06dev environment: allow printing only env without starting a shellCharlie Turner
allow for workflows that don't want the gst scripts to start shells, this can be awkward for higher-level scripts setting up shells themselves. this is especially useful in combination with eval, and mimics the sort of thing you can do with ssh-agent -s.
2019-12-23env: preprend gst-build/prefix/etc/xdg to XDG_CONFIG_DIRSJulien Isorce
So gst-build/prefix/etc/xdg/tizonia/tizonia.conf can be found. Which one contains path to tizonia plugins. Useful when compiling tizonia-openmax-il and installing it in gst-build 's prefix location: autoreconf -ifs ./configure --disable-player --without-libspotify --prefix=path_to_gst-build/prefix/ make && make install Allows the following to work: gst-launch-1.0 videotestsrc ! vp8enc ! omxvp8dec ! xvimagesink
2019-12-22gst-env: Automatically set the prompt for zsh tooNirbheek Chauhan
2019-12-19gst-env: Don't put helper binaries in PATHNirbheek Chauhan
Check if the executable would be installed into bindir before adding it to PATH in the uninstalled shell. Fixes https://gitlab.freedesktop.org/gstreamer/gst-build/issues/67
2019-12-19gst-env: Fix shell name checkNirbheek Chauhan
We should use `endswith`, not `in`. Else we'll match paths like: `/home/arbash/.local/bin/fish` as a bash shell, not a fish shell.
2019-12-19gst-env: Set the prompt for fish to be same as bashNirbheek Chauhan
2019-12-19gst-env: Ignore SIGINT when using the fish shellNirbheek Chauhan
After discussion with fish upstream it looks like it will take some work to fix this issue. https://github.com/fish-shell/fish-shell/pull/6426#issuecomment-567174105 In the meantime, this only happens when there's no command running in the terminal, and in that case the shell just ignores it anyway. So just do that in `gst-env.py`. Fixes https://gitlab.freedesktop.org/gstreamer/gst-build/issues/18
2019-11-11python: Avoid using 'is' to compare stringsJan Alexander Steffens (heftig)
This is the wrong operator to use, which only seems to work because `os.name` and `'nt'` happen to be the same object. Python 3.8 also produces a `SyntaxWarning` when encountering this pattern.
2019-11-06gst-env: Fix the gst plugin file path regex for Linux platformsPhilippe Normand
On Linux, the library file is stored in the platform triplet directory under the lib directory (hence for example lib/x86_64-linux-gnu/gstreamer-1.0/libgstfoo.so) so the regex needs to take this into account. With this change the LD_LIBRARY_PATH on Linux now contains only the directories with gst libs, ignoring the plugins, as initially intended in c6613d8da2191aaf2bd7d1ddd4130a289b02e1ba. Fixes #56
2019-11-06gst-env: Ensure target install filename is a listPhilippe Normand
At least in Meson 0.49, the target['install_name'] is a string, not a list, so the heuristics declared in the is_library_target_and_not_plugin() can't apply because Python is actually happy to iterate over a string without any warning.