Compare commits

...

3 Commits

Author SHA1 Message Date
Amit D cfc2b92e92 Update Users.md 4 years ago
Nirbheek Chauhan 04e275cdcc find_program: Always use USERPROFILE instead of HOME 4 years ago
Michael Hirsch, Ph.D c7cc734132 dependency: add curses 4 years ago
  1. 2
      docs/markdown/Users.md
  2. 4
      mesonbuild/dependencies/__init__.py
  3. 5
      mesonbuild/dependencies/base.py
  4. 23
      mesonbuild/dependencies/misc.py
  5. 8
      run_unittests.py
  6. 7
      test cases/frameworks/31 curses/main.c
  7. 9
      test cases/frameworks/31 curses/meson.build

@ -108,7 +108,7 @@ format files
- [Terminology](https://github.com/billiob/terminology), a terminal emulator based on the Enlightenment Foundation Libraries
- [Tilix](https://github.com/gnunn1/tilix), a tiling terminal emulator for Linux using GTK+ 3
- [Valum](https://github.com/valum-framework/valum), a micro web framework written in Vala
- [Wayland and Weston](https://lists.freedesktop.org/archives/wayland-devel/2016-November/031984.html), a next generation display server (not merged yet)
- [Wayland](https://github.com/wayland-project/wayland) and [Weston](https://github.com/wayland-project/weston), a next generation display server
- [wlroots](https://github.com/swaywm/wlroots), a modular Wayland compositor library
- [wxFormBuilder](https://github.com/wxFormBuilder/wxFormBuilder), RAD tool for wxWidgets GUI design
- [xi-gtk](https://github.com/eyelash/xi-gtk), a GTK+ front-end for the Xi editor

@ -23,7 +23,8 @@ from .dev import GMockDependency, GTestDependency, LLVMDependency, ValgrindDepen
from .coarrays import CoarrayDependency
from .mpi import MPIDependency
from .scalapack import ScalapackDependency
from .misc import (BlocksDependency, NetCDFDependency, OpenMPDependency, Python3Dependency, ThreadDependency, PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency, GpgmeDependency, ShadercDependency)
from .misc import (BlocksDependency, CursesDependency, NetCDFDependency, OpenMPDependency, Python3Dependency, ThreadDependency,
PcapDependency, CupsDependency, LibWmfDependency, LibGCryptDependency, GpgmeDependency, ShadercDependency)
from .platform import AppleFrameworks
from .ui import GLDependency, GnuStepDependency, Qt4Dependency, Qt5Dependency, SDL2Dependency, WxDependency, VulkanDependency
@ -46,6 +47,7 @@ packages.update({
# From misc:
'blocks': BlocksDependency,
'curses': CursesDependency,
'netcdf': NetCDFDependency,
'openmp': OpenMPDependency,
'python3': Python3Dependency,

@ -1817,10 +1817,13 @@ class ExternalProgram:
@staticmethod
@functools.lru_cache(maxsize=None)
def _windows_sanitize_path(path: str) -> str:
# Ensure that we use USERPROFILE even when inside MSYS, MSYS2, Cygwin, etc.
if 'USERPROFILE' not in os.environ:
return path
# Ignore executables in the WindowsApps directory which are
# zero-sized wrappers that magically open the Windows Store to
# install the application.
appstore_dir = Path.home() / 'AppData' / 'Local' / 'Microsoft' / 'WindowsApps'
appstore_dir = Path(os.environ['USERPROFILE']) / 'AppData' / 'Local' / 'Microsoft' / 'WindowsApps'
paths = []
for each in path.split(os.pathsep):
if Path(each) != appstore_dir:

@ -557,3 +557,26 @@ class ShadercDependency(ExternalDependency):
@staticmethod
def get_methods():
return [DependencyMethods.SYSTEM, DependencyMethods.PKGCONFIG]
class CursesDependency(ExternalDependency):
def __init__(self, environment, kwargs):
super().__init__('curses', environment, None, kwargs)
self.name = 'curses'
self.is_found = False
methods = listify(self.methods)
if set([DependencyMethods.AUTO, DependencyMethods.PKGCONFIG]).intersection(methods):
pkgconfig_files = ['ncurses', 'ncursesw']
for pkg in pkgconfig_files:
pkgdep = PkgConfigDependency(pkg, environment, kwargs)
if pkgdep.found():
self.compile_args = pkgdep.get_compile_args()
self.link_args = pkgdep.get_link_args()
self.version = pkgdep.get_version()
self.is_found = True
self.pcdep = pkgdep
return
@staticmethod
def get_methods():
return [DependencyMethods.AUTO, DependencyMethods.PKGCONFIG]

@ -4542,6 +4542,14 @@ class WindowsTests(BasePlatformTests):
self.assertTrue(prog.found(), msg='test-script-ext.py not found in PATH')
self.assertPathEqual(prog.get_command()[0], python_command[0])
self.assertPathBasenameEqual(prog.get_path(), 'test-script-ext.py')
# Ensure that WindowsApps gets removed from PATH
path = os.environ['PATH']
if 'WindowsApps' not in path:
username = os.environ['USERNAME']
appstore_dir = r'C:\Users\{}\AppData\Local\Microsoft\WindowsApps'.format(username)
path = os.pathsep + appstore_dir
path = ExternalProgram._windows_sanitize_path(path)
self.assertNotIn('WindowsApps', path)
def test_ignore_libs(self):
'''

@ -0,0 +1,7 @@
#include "curses.h"
int main(void) {
initscr();
endwin();
return 0;
}

@ -0,0 +1,9 @@
project('curses', 'c')
curses = dependency('curses', required: false)
if not curses.found()
error('MESON_SKIP_TEST: Curses library not found')
endif
exec = executable('basic', 'main.c', dependencies: curses)
# didn't run the test because in general graphics fail on CI
Loading…
Cancel
Save