Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cl 2812 pascom gstreamer build #1

Open
wants to merge 53 commits into
base: pascom
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
66ccc91
glib: Fix Visual Studio 2019 build error
seungha-yang Apr 22, 2021
d872ccf
glib: Add workaround for Visual Studio 2019 ARM build
seungha-yang Apr 22, 2021
79c819c
glib: Fix hang on Windows when G_SLICE env is configured
seungha-yang Jul 8, 2021
5d41849
bootstrap: fix build_tools error
leeys888 Jul 2, 2021
84fea3f
config/ios: put iphone sdk version minimum into CPPFLAGS
ystreet Jul 13, 2021
162724e
ffmpeg: actually use gas-preprocessor on ios
ystreet Jul 13, 2021
98adb45
Add Linux mint platforms based on Ubuntu Focal
Jul 9, 2021
98c9296
gobject-introspection: Backport patch for Python 3.9 compat
nirbheek Jul 14, 2021
a6d6711
srt.recipe: Bump to 1.4.3, fixes build on Fedora 34
nirbheek Jul 14, 2021
4383951
meson: Bump to 0.58.1
nirbheek Jul 14, 2021
bd71f93
glib-networking: Update options and backport c_std=c99
nirbheek Jul 14, 2021
c713896
moltenvk: update to 1.2.182.0
ystreet Jul 15, 2021
edf59ba
freetype: update to 2.11.0
tp-m Jul 20, 2021
90f0fde
openssl.recipe: Bump to 1.1.1k
nirbheek Jul 22, 2021
0217c0b
Removed dash in wildcard selection of libunwind*.pc files.
Aug 8, 2021
35c69db
cerbero: Add a dotted progress bar for urllib downloads
nirbheek Aug 17, 2021
3407333
ladspa.recipe: Add a comment about mirroring tarballs
nirbheek Sep 6, 2021
b2e6ce7
openssl.recipe: upgrade to version 1.1.1l
Sep 13, 2021
bb02671
bzip2.recipe: bump version to 1.0.8
Sep 13, 2021
e5ff9a1
Build 1.19.2 release
tp-m Sep 23, 2021
6b999a4
recipes: Add patches to fix UWP build
nirbheek Sep 23, 2021
2e9d12a
Back to development
xclaesse Sep 24, 2021
a242e4a
source: Take recipes_remotes value from config
xclaesse Jun 3, 2021
951fcde
Use unified GStreamer repository
xclaesse Oct 31, 2020
5932e2e
ci: Move needed scripts from gst-ci to cerbero
xclaesse Nov 1, 2020
714cdd6
gst-plugins-bad: Ship libgstwinrt-1.0 when wasapi2 plugin is enabled
seungha-yang Sep 28, 2021
aeed459
Bump windows docker to lastest from gstreamer/ repo
ndufresne Oct 1, 2021
59bd91b
boostrap: remove sudo as root user
Sep 23, 2021
003dd60
cerbero: Don't close stdin for interactive bootstrap
nirbheek Oct 6, 2021
3adb4ee
openssl.recipe: Fix crash on iOS TestFlight
nirbheek Sep 23, 2021
f9c1ff3
gstreamer: disable git submodule init
Oct 6, 2021
ffe4f36
Revert "recipes: Add patches to fix UWP build"
nirbheek Sep 23, 2021
37295cb
meson.recipe: Bump to 0.59.2
nirbheek Oct 12, 2021
629c930
cerbero: Fix for removed loop param of PriorityQueue()
seungha-yang Oct 15, 2021
6112a95
recipe: gst-plugins-bad: assrender is not GPL
tp-m Oct 14, 2021
a9ccba6
libffi: use fdo meson port repository
Oct 1, 2021
665160c
libass: update to 0.15.2
tp-m Oct 15, 2021
a63bc7e
ffmpeg: update to v4.4
tp-m Oct 15, 2021
00fbc6a
recipes: gst-plugins-bad: update for removal of ofa plugin
tp-m Oct 14, 2021
58e5e7b
libogg: update to 1.3.5
tp-m Oct 16, 2021
f875214
android: set ANDROID_NDK_HOME instead of ANDROID_NDK
JonasVautherin Oct 13, 2021
a922437
recipes: gst-plugins-bad, gst-plugins-ugly: update for explicit GPL o…
tp-m Oct 14, 2021
e7b897d
Remove mmssrc plugin and libmms
tp-m Oct 19, 2021
0e586bb
gst-plugins-bad: Fix for UWP build
seungha-yang Oct 20, 2021
7fb4953
Add support for Visual Studio 2022
seungha-yang Oct 25, 2021
c4036c9
shell-utils: decode output on subprocess error
tp-m Oct 28, 2021
0b2add0
Build 1.19.3 release
tp-m Nov 3, 2021
6600a95
gst-plugins-bad: fix up license path for tarballs
tp-m Nov 3, 2021
60701ab
CL-2812 safe progress
May 16, 2022
1b10679
CL-2812 safe progress
May 16, 2022
c0aa500
CL-2812 fix adjustments
May 18, 2022
7204bd8
CL-2812 build from git
May 20, 2022
aaf5064
CL-2812 adjust version to match meson build
May 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
481 changes: 480 additions & 1 deletion .gitlab-ci.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cerbero/bootstrap/build_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def insert_python_site(self):
except ImportError:
return

version = [int(v) for v in stv.__version__.split('.')]
if len(version) < 1 or version[:1] < [49]:
version = stv.__version__.split('.', 1)
if len(version) < 1 or int(version[0]) < 49:
return

m.warning('detected setuptools >= 49.0.0, installing fallback site.py file. '
Expand Down
8 changes: 6 additions & 2 deletions cerbero/bootstrap/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from cerbero.bootstrap.bootstrapper import register_system_bootstrapper
from cerbero.enums import Platform, Architecture, Distro, DistroVersion
from cerbero.errors import ConfigurationError
from cerbero.utils import shell
from cerbero.utils import user_is_root, shell
from cerbero.utils import messages as m

import shlex
Expand All @@ -37,6 +37,8 @@ class UnixBootstrapper (BootstrapperBase):
def __init__(self, config, offline, assume_yes):
BootstrapperBase.__init__(self, config, offline)
self.assume_yes = assume_yes
if user_is_root() and 'sudo' in self.tool: # no need for sudo as root user
self.tool.remove('sudo')

def start(self, jobs=0):
for c in self.checks:
Expand All @@ -54,7 +56,7 @@ def start(self, jobs=0):
tool += self.command;
cmd = tool + self.packages
m.message("Running command '%s'" % ' '.join(cmd))
shell.new_call(cmd)
shell.new_call(cmd, interactive=True)


class DebianBootstrapper (UnixBootstrapper):
Expand Down Expand Up @@ -127,6 +129,8 @@ def __init__(self, config, offline, assume_yes):
self.packages.append('glibc.i686')
if self.config.distro_version in [DistroVersion.FEDORA_24, DistroVersion.FEDORA_25]:
self.packages.append('libncurses-compat-libs.i686')
if user_is_root():
return
# Use sudo to gain root access on everything except RHEL
if self.config.distro_version == DistroVersion.REDHAT_6:
self.tool = ['su', '-c', shlex.join(self.tool)]
Expand Down
11 changes: 5 additions & 6 deletions cerbero/build/oven.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ async def build_recipe_steps(step):
all_steps = ["init"] + [s[1] for s in next(iter(recipes)).steps]

# async queues used for each step
loop = asyncio.get_event_loop()
default_queue = asyncio.PriorityQueue(loop=loop)
default_queue = asyncio.PriorityQueue()
queues = {step : default_queue for step in all_steps}

# find the install steps for ensuring consistency between all of them
Expand All @@ -330,7 +329,7 @@ async def build_recipe_steps(step):
# allocate jobs
job_allocation = collections.defaultdict(lambda : 0)
if self.jobs > 4:
queues[BuildSteps.COMPILE[1]] = asyncio.PriorityQueue(loop=loop)
queues[BuildSteps.COMPILE[1]] = asyncio.PriorityQueue()
job_allocation[BuildSteps.COMPILE[1]] = 2
if self.jobs > 5:
job_allocation[BuildSteps.COMPILE[1]] = 3
Expand All @@ -340,7 +339,7 @@ async def build_recipe_steps(step):
# the job allocation since we can run more of them in parallel
job_allocation[BuildSteps.COMPILE[1]] = self.jobs // 2
if self.jobs > 7:
install_queue = asyncio.PriorityQueue(loop=loop)
install_queue = asyncio.PriorityQueue()
for step in install_steps:
queues[step] = install_queue
job_allocation[BuildSteps.INSTALL[1]] = 1
Expand All @@ -350,13 +349,13 @@ async def build_recipe_steps(step):
# fast, so we shouldn't parallelize.
if self.config.platform != Platform.WINDOWS:
job_allocation[BuildSteps.EXTRACT[1]] = 1
queues[BuildSteps.EXTRACT[1]] = asyncio.PriorityQueue(loop=loop)
queues[BuildSteps.EXTRACT[1]] = asyncio.PriorityQueue()
if self.jobs > 9:
# Two jobs is the same allocation as fetch-package/bootstrap, which
# is a good idea to avoid getting bottlenecked if one of the
# download mirrors is slow.
job_allocation[BuildSteps.FETCH[1]] = 2
queues[BuildSteps.FETCH[1]] = asyncio.PriorityQueue(loop=loop)
queues[BuildSteps.FETCH[1]] = asyncio.PriorityQueue()

# async locks used to synchronize step execution
locks = collections.defaultdict(lambda : None)
Expand Down
40 changes: 34 additions & 6 deletions cerbero/build/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import zipfile
import tarfile
import urllib.request, urllib.parse, urllib.error
import collections
import asyncio
from hashlib import sha256

from cerbero.config import Platform, DEFAULT_MIRRORS
Expand Down Expand Up @@ -302,6 +304,10 @@ class GitCache (Source):

remotes = None
commit = None
use_submodules = True

_fetch_locks = collections.defaultdict(asyncio.Lock)
_fetch_done = set()

def __init__(self):
Source.__init__(self)
Expand All @@ -322,8 +328,20 @@ def __init__(self):
(self.config.git_root, self.name)
self.repo_dir = os.path.join(self.config.local_sources, self.name)
self._previous_env = None
# For forced commits in the config
self.commit = self.config.recipe_commit(self.name) or self.commit
self.remotes.update(self.config.recipes_remotes.get(self.name, {}))

async def fetch(self, checkout=True):
# Could have multiple recipes using the same repo.
lock = self._fetch_locks[self.repo_dir]
async with lock:
if self.repo_dir in self._fetch_done:
return
await self.fetch_impl(checkout)
self._fetch_done.add(self.repo_dir)

async def fetch_impl(self, checkout):
# First try to get the sources from the cached dir if there is one
cached_dir = os.path.join(self.config.cached_sources, self.name)

Expand All @@ -347,9 +365,9 @@ async def fetch(self, checkout=True):
if not self.offline:
await git.fetch(self.repo_dir, fail=False, logfile=get_logfile(self))
if checkout:
commit = self.config.recipe_commit(self.name) or self.commit
await git.checkout(self.repo_dir, commit, logfile=get_logfile(self))
await git.submodules_update(self.repo_dir, cached_dir, fail=False, offline=self.offline, logfile=get_logfile(self))
await git.checkout(self.repo_dir, self.commit, logfile=get_logfile(self))
if self.use_submodules:
await git.submodules_update(self.repo_dir, cached_dir, fail=False, offline=self.offline, logfile=get_logfile(self))


def built_version(self):
Expand All @@ -361,15 +379,25 @@ class Git (GitCache):
Source handler for git repositories
'''

_extract_locks = collections.defaultdict(asyncio.Lock)
_extract_done = set()

def __init__(self):
GitCache.__init__(self)
if self.commit is None:
# Used by recipes in recipes/toolchain/
self.commit = 'origin/sdk-%s' % self.version
# For forced commits in the config
self.commit = self.config.recipe_commit(self.name) or self.commit

async def extract(self):
# Could have multiple recipes using the same repo.
lock = self._extract_locks[self.config_src_dir]
async with lock:
if self.config_src_dir in self._extract_done:
return
await self.extract_impl()
self._extract_done.add(self.config_src_dir)

async def extract_impl(self):
if os.path.exists(self.config_src_dir):
try:
commit_hash = git.get_hash(self.repo_dir, self.commit, logfile=get_logfile(self))
Expand All @@ -383,7 +411,7 @@ async def extract(self):
os.makedirs(self.config_src_dir)

# checkout the current version
await git.local_checkout(self.config_src_dir, self.repo_dir, self.commit, logfile=get_logfile(self))
await git.local_checkout(self.config_src_dir, self.repo_dir, self.commit, logfile=get_logfile(self), use_submodules=self.use_submodules)

for patch in self.patches:
if not os.path.isabs(patch):
Expand Down
4 changes: 3 additions & 1 deletion cerbero/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


# Safest place to define this since this file imports very few modules
CERBERO_VERSION = '1.19.1.1'
CERBERO_VERSION = '1.19.3'

class Platform:
''' Enumeration of supported platforms '''
Expand Down Expand Up @@ -142,6 +142,8 @@ class DistroVersion:
OS_X_MOJAVE = 'osx_mojave'
OS_X_CATALINA = 'osx_catalina'
OS_X_BIG_SUR = 'osx_big_sur'
OS_X_MONTEREY = 'osx_monterey'
# further osx versions are generated automatically
IOS_8_0 = 'ios_08_0'
IOS_8_1 = 'ios_08_1'
IOS_8_2 = 'ios_08_2'
Expand Down
12 changes: 12 additions & 0 deletions cerbero/ide/vs/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
),
r'VC\Auxiliary\Build\vcvarsall.bat'
),
'vs17': (
(
r'Microsoft Visual Studio\2022\Community',
r'Microsoft Visual Studio\2022\Professional',
r'Microsoft Visual Studio\2022\Enterprise',
r'Microsoft Visual Studio\2022\BuildTools',
r'Microsoft Visual Studio\2022\Preview',
),
r'VC\Auxiliary\Build\vcvarsall.bat'
),
}

def get_program_files_dir():
Expand All @@ -72,6 +82,8 @@ def get_vs_year_version(vcver):
return '2017'
if vcver == 'vs16':
return '2019'
if vcver == 'vs17':
return '2022'
raise RuntimeError('Unknown toolset value {!r}'.format(vcver))

def _get_custom_vs_install(vs_version, vs_install_path):
Expand Down
6 changes: 4 additions & 2 deletions cerbero/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def system_info():
distro_version = DistroVersion.UBUNTU_DISCO
elif distro_version in ['eoan']:
distro_version = DistroVersion.UBUNTU_EOAN
elif distro_version in ['focal', 'ulyana']:
elif distro_version in ['focal'] or (distro_version[0] == 'u' and d[1].startswith('20.')):
distro_version = DistroVersion.UBUNTU_FOCAL
elif d[1].startswith('6.'):
distro_version = DistroVersion.DEBIAN_SQUEEZE
Expand Down Expand Up @@ -359,7 +359,9 @@ def system_info():
elif platform == Platform.DARWIN:
distro = Distro.OS_X
ver = pplatform.mac_ver()[0]
if ver.startswith(('11.', '10.16')):
if ver.startswith(('12.')):
distro_version = DistroVersion.OS_X_MONTEREY
elif ver.startswith(('11.', '10.16')):
distro_version = DistroVersion.OS_X_BIG_SUR
elif ver.startswith('10.15'):
distro_version = DistroVersion.OS_X_CATALINA
Expand Down
5 changes: 3 additions & 2 deletions cerbero/utils/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def get_hash(git_dir, commit, logfile=None):
fail=False, quiet=True, logfile=logfile).rstrip()


async def local_checkout(git_dir, local_git_dir, commit, logfile=None):
async def local_checkout(git_dir, local_git_dir, commit, logfile=None, use_submodules=True):
'''
Clone a repository for a given commit in a different location

Expand All @@ -224,7 +224,8 @@ async def local_checkout(git_dir, local_git_dir, commit, logfile=None):
await shell.async_call([GIT, 'clone', local_git_dir, '-s', '-b', branch_name, '.'],
git_dir, logfile=logfile)
ensure_user_is_set(git_dir, logfile=logfile)
await submodules_update(git_dir, local_git_dir, logfile=logfile)
if use_submodules:
await submodules_update(git_dir, local_git_dir, logfile=logfile)

def add_remote(git_dir, name, url, logfile=None):
'''
Expand Down
29 changes: 24 additions & 5 deletions cerbero/utils/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def check_output(cmd, cmd_dir=None, fail=True, logfile=None, env=None, quiet=Fal
try:
o = subprocess.check_output(cmd, cwd=cmd_dir, env=env, stderr=stderr)
except SUBPROCESS_EXCEPTIONS as e:
msg = getattr(e, 'output', '')
msg = getattr(e, 'output', '').decode(sys.stdout.encoding, errors='replace')
if not fail:
return msg
if logfile:
Expand All @@ -181,17 +181,21 @@ def check_output(cmd, cmd_dir=None, fail=True, logfile=None, env=None, quiet=Fal
return o


def new_call(cmd, cmd_dir=None, fail=True, logfile=None, env=None, verbose=False):
def new_call(cmd, cmd_dir=None, fail=True, logfile=None, env=None, verbose=False, interactive=False):
cmd = _cmd_string_to_array(cmd, env)
if logfile:
logfile.write('Running command {!r}\n'.format(cmd))
logfile.flush()
if verbose:
m.message('Running {!r}\n'.format(cmd))
if not interactive:
stdin = subprocess.DEVNULL
else:
stdin = None
try:
subprocess.check_call(cmd, cwd=cmd_dir, env=env,
stdout=logfile, stderr=subprocess.STDOUT,
stdin=subprocess.DEVNULL)
stdin=stdin)
except SUBPROCESS_EXCEPTIONS as e:
returncode = getattr(e, 'returncode', -1)
if not fail:
Expand Down Expand Up @@ -382,6 +386,8 @@ async def download_urllib2(url, destination=None, check_cert=True, overwrite=Fal
@param destination: destination where the file will be saved
@type destination: str
'''
# 1MiB chunk size (same as dot:giga for wget)
chunk_size = 1024 * 1024
ctx = None
if not check_cert:
import ssl
Expand All @@ -392,12 +398,25 @@ async def download_urllib2(url, destination=None, check_cert=True, overwrite=Fal
if not destination:
destination = os.path.basename(url)

from datetime import datetime
start_time = datetime.now()

try:
with open(destination, 'wb') as d:
req = urllib.request.Request(url)
req.add_header('User-Agent', USER_AGENT)
f = urllib.request.urlopen(req, context=ctx)
d.write(f.read())
f = urllib.request.urlopen(req, timeout=20, context=ctx)
while True:
chunk = f.read(chunk_size)
if not chunk:
break
d.write(chunk)
print('.', end='', file=logfile, flush=True)
total_time = (datetime.now() - start_time).total_seconds()
size = d.tell() / 1024
speed = size / total_time
print('\nDownloaded {:2,.2f} KiB in {:2,.2f} seconds at {:2,.2f} KiB/s'
.format(size, total_time, speed), file=logfile, flush=True)
except urllib.error.HTTPError as e:
if os.path.exists(destination):
os.remove(destination)
Expand Down
Loading