summaryrefslogtreecommitdiff
path: root/gst-env.py
Commit message (Collapse)AuthorAgeFilesLines
* ptp-helper: Rewrite in Rust for portability and securitySebastian Dröge2023-04-071-1/+1
| | | | | | | | | | | | | | | | | 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>
* gst-env: Handle installing python modules to dist-packagesThibault Saunier2023-01-301-1/+6
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3826>
* gst-env.py: Output a setting for the prompt with --only-environmentNirbheek Chauhan2023-01-251-2/+7
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3708>
* gst-env.py: Output DYLD_LIBRARY_PATH with --only-environment on macOSNirbheek Chauhan2023-01-251-1/+5
| | | | | | | | | | | | | 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>
* gst-env: import exit from sysStéphane Cerveau2022-11-041-0/+1
| | | | | | | | | | | 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>
* gst-env.py: drop 'gst-' prefix from branch name in promptTim-Philipp Müller2022-06-151-6/+6
| | | | | | | | | | 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>
* gst-env: Add support for PowerShell 7Seungha Yang2022-06-031-3/+2
| | | | | | | | 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>
* gst-env: spawn a shell to execute commands on windowsJordan Petridis2022-05-151-9/+17
| | | | | | | | | | | | | | 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>
* Allow running gst-uninstalled when GStreamer is a subprojectSebastian Fricke2022-03-011-4/+10
| | | | | | | | | 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>
* Revert "Allow running gst-uninstalled when gst-build is a subproject"Sebastian Fricke2022-03-011-13/+1
| | | | | | This reverts commit 879126a31c77622f594e70f205fcefd4556d9865. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1743>
* gst-env: Improve coding style and cleanupSebastian Fricke2022-03-011-22/+30
| | | | | | | | | | | * 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>
* gst-env: extend PATH to include plugin scanner and generatorMark Nauwelaerts2022-01-121-0/+4
|
* env: Fix deprecations from python 3.10Thibault Saunier2021-11-181-3/+12
| | | | | | | 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>
* python: Fix using overrides when not building PyGObjectThibault Saunier2021-10-151-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* gst-env: Ignore SIGINT when running on the CI serverThibault Saunier2021-10-121-0/+4
| | | | | | We get spurious sigint and this is just a small temporary workaround Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1113>
* ci: Fix gst-indent pathXavier Claessens2021-10-051-1/+1
| | | | | | | 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>
* core: remove outdated mention to gst-buildStéphane Cerveau2021-09-301-2/+2
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/956>
* Cleanup root directory from misc filesThibault Saunier2021-09-241-2/+3
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/891>
* gst-env: Don't set DYLD_LIBRARY_PATH on macOSNirbheek Chauhan2021-08-281-1/+4
| | | | | | | | | | | | | | | | | | | | | 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>
* Allow running gst-uninstalled when gst-build is a subprojectOlivier Crete2021-08-271-1/+13
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/222>
* devenv: Add webrtc testsuite to pathsOlivier Crête2021-04-301-4/+13
| | | | | | This makes it a little easier to run it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/243>
* bash-completion: add completion for gstreamer toolsStéphane Cerveau2021-04-291-0/+22
| | | | | | | 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>
* gst-env: Windows: Fix looking for cmd_or_ps.ps1 in the wrong directoryAndrey Moiseev2021-04-061-1/+1
| | | | | | | | 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>
* Meson: Use generated -uninstalled.pc filesXavier Claessens2020-10-231-9/+0
|
* gst-env: use Path.open() in get_pkgconfig_variable_from_pcfile()Antonio Ospite2020-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* gst-env: Load gio modules in the devenvNirbheek Chauhan2020-08-031-2/+47
| | | | | | | 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>
* gst-env: Factor out some common codeNirbheek Chauhan2020-08-031-13/+15
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/180>
* gst-env: Prematurely skip all targets that aren't installedNirbheek Chauhan2020-08-031-4/+2
| | | | | | Simplifies the code a bit. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/180>
* gst-env.py: Sort path sets before using prepend_env_varJan Alexander Steffens (heftig)2020-07-211-6/+7
| | | | | | | | | | 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>
* gst-env: Copy instead of symlink on WindowsNirbheek Chauhan2020-06-151-2/+5
| | | | | | os.symlink needs admin privs in most cases. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/160>
* gst-env: Fix creation of gdb-autoload dirs on WindowsNirbheek Chauhan2020-06-151-7/+7
| | | | | | | | | | | `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>
* gst-env: Use meson-uninstalled pkgconfig files if availableNirbheek Chauhan2020-06-121-0/+5
| | | | | | | 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>
* gst-env: fix program name in argparseVíctor Manuel Jáquez Leal2020-05-111-1/+1
| | | | Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/145>
* gst-env: Remove non-existent directory from PKG_CONFIG_PATHPhilippe Normand2020-04-201-5/+0
| | | | There is no pkgconfig directory in -good.
* gst-env: Also look for `builddir` when hunting for a build dirNirbheek Chauhan2020-04-161-1/+3
|
* gst-env: Allow setting environment without gitNicolas Dufresne2020-03-251-2/+5
| | | | | | | 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.
* devenv: Fix path handling for gdb supportThibault Saunier2020-01-191-4/+9
| | | | And enable gdb support only when gdb is avalaible
* uninstalled: Add support for GStreamer and GLib gdb scriptsThibault Saunier2020-01-131-2/+37
|
* dev environment: allow printing only env without starting a shellCharlie Turner2020-01-061-1/+12
| | | | | | | | | 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.
* env: preprend gst-build/prefix/etc/xdg to XDG_CONFIG_DIRSJulien Isorce2019-12-231-1/+8
| | | | | | | | | | | | | | | 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
* gst-env: Automatically set the prompt for zsh tooNirbheek Chauhan2019-12-221-4/+15
|
* gst-env: Don't put helper binaries in PATHNirbheek Chauhan2019-12-191-3/+26
| | | | | | | 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
* gst-env: Fix shell name checkNirbheek Chauhan2019-12-191-2/+2
| | | | | | 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.
* gst-env: Set the prompt for fish to be same as bashNirbheek Chauhan2019-12-191-0/+7
|
* gst-env: Ignore SIGINT when using the fish shellNirbheek Chauhan2019-12-191-0/+6
| | | | | | | | | | | | | 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
* python: Avoid using 'is' to compare stringsJan Alexander Steffens (heftig)2019-11-111-3/+3
| | | | | | 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.
* gst-env: Fix the gst plugin file path regex for Linux platformsPhilippe Normand2019-11-061-1/+17
| | | | | | | | | | | | | 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
* gst-env: Ensure target install filename is a listPhilippe Normand2019-11-061-1/+1
| | | | | | 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.
* gst-env: Use locally built GStreamer utility programsPhilippe Normand2019-11-021-0/+8
| | | | | | | The host environment might not have gst-launch-1.0 and gst-inspect-1.0 installed. Fixes #52
* Add support for wine+mingw environmentsThibault Saunier2019-10-011-3/+37
|