Compare commits

...

3 Commits

Author SHA1 Message Date
Amit D 2558e9c4a5 Update Users.md 4 years ago
Amit D 163a8cabb0 Update Users.md 4 years ago
Xavier Claessens 711969c3b5 wrap: Fix support of file:// URLs 4 years ago
  1. 8
      docs/markdown/Users.md
  2. 4
      mesonbuild/wrap/wrap.py
  3. 34
      run_unittests.py
  4. 4
      test cases/unit/73 wrap file url/meson.build
  5. BIN
      test cases/unit/73 wrap file url/subprojects/foo-patch.tar.xz
  6. BIN
      test cases/unit/73 wrap file url/subprojects/foo.tar.xz

@ -31,7 +31,7 @@ listed in the [`meson` GitHub topic](https://github.com/topics/meson).
- [fwupd](https://github.com/hughsie/fwupd), a simple daemon to allow session software to update firmware
- [GameMode](https://github.com/FeralInteractive/gamemode), a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS
- [Geary](https://wiki.gnome.org/Apps/Geary), an email application built around conversations, for the GNOME 3 desktop.
- [GLib](https://gitlab.gnome.org/GNOME/glib), cross-platform C library used by GTK+ and GStreamer (not the default yet)
- [GLib](https://gitlab.gnome.org/GNOME/glib), cross-platform C library used by GTK+ and GStreamer
- [GNOME Boxes](https://gitlab.gnome.org/GNOME/gnome-boxes), a GNOME hypervisor
- [GNOME Builder](https://gitlab.gnome.org/GNOME/gnome-builder), an IDE for the GNOME platform
- [GNOME MPV](https://github.com/gnome-mpv/gnome-mpv), GNOME frontend to the mpv video player
@ -42,7 +42,7 @@ listed in the [`meson` GitHub topic](https://github.com/topics/meson).
- [GNU FriBidi](https://github.com/fribidi/fribidi), the open source implementation of the Unicode Bidirectional Algorithm
- [Graphene](https://ebassi.github.io/graphene/), a thin type library for graphics
- [Grilo](https://git.gnome.org/browse/grilo) and [Grilo plugins](https://git.gnome.org/browse/grilo-plugins), the Grilo multimedia framework
- [GStreamer](https://cgit.freedesktop.org/gstreamer/gstreamer/), multimedia framework (not the default yet)
- [GStreamer](https://cgit.freedesktop.org/gstreamer/gstreamer/), multimedia framework
- [GTK+](https://gitlab.gnome.org/GNOME/gtk), the multi-platform toolkit used by GNOME
- [GtkDApp](https://gitlab.com/csoriano/GtkDApp), an application template for developing Flatpak apps with Gtk+ and D
- [GVfs](https://git.gnome.org/browse/gvfs/), a userspace virtual filesystem designed to work with the I/O abstraction of GIO
@ -84,11 +84,11 @@ format files
- [oomd](https://github.com/facebookincubator/oomd), a userspace Out-Of-Memory (OOM) killer for Linux systems
- [OpenH264](https://github.com/cisco/openh264), open source H.264 codec
- [OpenHMD](https://github.com/OpenHMD/OpenHMD), a free and open source API and drivers for immersive technology, such as head mounted displays with built in head tracking
- [Orc](http://cgit.freedesktop.org/gstreamer/orc/), the Optimized Inner Loop Runtime Compiler (not the default yet)
- [Orc](http://cgit.freedesktop.org/gstreamer/orc/), the Optimized Inner Loop Runtime Compiler
- [OTS](https://github.com/khaledhosny/ots), the OpenType Sanitizer, parses and serializes OpenType files (OTF, TTF) and WOFF and WOFF2 font files, validating and sanitizing them as it goes. Used by Chromium and Firefox
- [Outlier](https://github.com/kerolasa/outlier), a small Hello World style meson example project
- [Pacman](https://git.archlinux.org/pacman.git/tree/), a package manager for Arch Linux
- [Pango](https://git.gnome.org/browse/pango/), an Internationalized text layout and rendering library (not the default yet)
- [Pango](https://git.gnome.org/browse/pango/), an Internationalized text layout and rendering library
- [Parzip](https://github.com/jpakkane/parzip), a multithreaded reimplementation of Zip
- [Peek](https://github.com/phw/peek), simple animated GIF screen recorder with an easy to use interface
- [PicoLibc](https://github.com/keith-packard/picolibc), a standard C library for small embedded systems with limited RAM

@ -335,9 +335,7 @@ class Resolver:
h = hashlib.sha256()
tmpfile = tempfile.NamedTemporaryFile(mode='wb', dir=self.cachedir, delete=False)
url = urllib.parse.urlparse(urlstring)
if not url.hostname:
raise WrapException('{} is not a valid URL'.format(urlstring))
if url.hostname.endswith(whitelist_subdomain):
if url.hostname and url.hostname.endswith(whitelist_subdomain):
resp = open_wrapdburl(urlstring)
elif whitelist_subdomain in urlstring:
raise WrapException('{} may be a WrapDB-impersonating URL'.format(urlstring))

@ -32,6 +32,7 @@ import threading
import urllib.error
import urllib.request
import zipfile
import hashlib
from itertools import chain
from unittest import mock
from configparser import ConfigParser
@ -5918,6 +5919,39 @@ c = ['{0}']
def test_ld_environment_variable_fortran(self):
self._check_ld('ld.gold', 'gold', 'fortran', 'GNU ld.gold')
def compute_sha256(self, filename):
with open(filename,"rb") as f:
return hashlib.sha256(f.read()).hexdigest();
def test_wrap_with_file_url(self):
testdir = os.path.join(self.unit_test_dir, '73 wrap file url')
source_filename = os.path.join(testdir, 'subprojects', 'foo.tar.xz')
patch_filename = os.path.join(testdir, 'subprojects', 'foo-patch.tar.xz')
wrap_filename = os.path.join(testdir, 'subprojects', 'foo.wrap')
source_hash = self.compute_sha256(source_filename)
patch_hash = self.compute_sha256(patch_filename)
wrap = textwrap.dedent("""\
[wrap-file]
directory = foo
source_url = file://{}
source_filename = foo.tar.xz
source_hash = {}
patch_url = file://{}
patch_filename = foo-patch.tar.xz
patch_hash = {}
""".format(source_filename, source_hash, patch_filename, patch_hash))
with open(wrap_filename, 'w') as f:
f.write(wrap)
self.init(testdir)
self.build()
self.run_tests()
windows_proof_rmtree(os.path.join(testdir, 'subprojects', 'packagecache'))
windows_proof_rmtree(os.path.join(testdir, 'subprojects', 'foo'))
os.unlink(wrap_filename)
def should_run_cross_arm_tests():
return shutil.which('arm-linux-gnueabihf-gcc') and not platform.machine().lower().startswith('arm')

@ -0,0 +1,4 @@
project('test wrap with file url')
exe = subproject('foo').get_variable('foo_exe')
test('test1', exe)
Loading…
Cancel
Save