Skip to content

Commit e4c7797

Browse files
authored
Merge pull request #5009 from OpenShot/new-linux-appimage
Support for New Linux Build Server + Update AppImage Support
2 parents 504debc + a164f2d commit e4c7797

File tree

6 files changed

+80
-76
lines changed

6 files changed

+80
-76
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ linux-builder:
3333
except:
3434
- tags
3535
tags:
36-
- linux-bionic
36+
- linux-focal
3737

3838
mac-builder:
3939
stage: build

freeze.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def find_files(directory, patterns):
258258
external_so_files.append((filename, os.path.relpath(filename, start=libopenshot_path)))
259259

260260
# Add libresvg (if found)
261-
resvg_path = "/usr/local/lib/libresvg.so"
261+
resvg_path = "/usr/lib/libresvg.so"
262262
if os.path.exists(resvg_path):
263263
external_so_files.append((resvg_path, os.path.basename(resvg_path)))
264264

@@ -287,7 +287,7 @@ def find_files(directory, patterns):
287287

288288
# Manually add BABL extensions (used in ChromaKey effect) - these are loaded at runtime,
289289
# and thus cx_freeze is not able to detect them
290-
babl_ext_path = "/usr/local/lib/babl-0.1"
290+
babl_ext_path = ARCHLIB + "babl-0.1/"
291291
for filename in find_files(babl_ext_path, ["*.so"]):
292292
src_files.append((filename, os.path.join("lib", "babl-ext", os.path.relpath(filename, start=babl_ext_path))))
293293

@@ -305,7 +305,7 @@ def find_files(directory, patterns):
305305
pyqt5_mod_files = []
306306
from importlib import import_module
307307
for submod in ['Qt', 'QtSvg', 'QtWidgets', 'QtCore', 'QtGui', 'QtDBus']:
308-
mod_name = "PyQt5.{}".format(submod)
308+
mod_name = "PyQt5.{}".format(submod)
309309
mod = import_module(mod_name)
310310
pyqt5_mod_files.append(inspect.getfile(mod))
311311
# Optional additions
@@ -321,7 +321,6 @@ def find_files(directory, patterns):
321321
except ImportError as ex:
322322
log.warning("Skipping {}: {}".format(mod_name, ex))
323323

324-
325324
lib_list = pyqt5_mod_files
326325
for lib_name in [
327326
os.path.join(libopenshot_path, "libopenshot.so"),
@@ -339,6 +338,7 @@ def find_files(directory, patterns):
339338

340339
# Loop through each line of output (which outputs dependencies - one per line)
341340
for line in depends:
341+
log.info("ldd raw line: %s" % line)
342342
lineparts = line.split("=>")
343343
libname = lineparts[0].strip()
344344

@@ -356,11 +356,16 @@ def find_files(directory, patterns):
356356
# And ignore paths that start with /lib
357357
libpath = libdetailsparts[0].strip()
358358
libpath_file = os.path.basename(libpath)
359+
log.info("libpath: %s, libpath_file: %s" % (libpath, libpath_file))
360+
359361
if (libpath
360362
and os.path.exists(libpath)
361-
and not libpath.startswith("/lib")
362363
and "libnvidia-glcore.so" not in libpath
363364
and libpath_file not in [
365+
"libdl.so.2",
366+
"librt.so.1",
367+
"libpthread.so.0",
368+
"libc.so.6",
364369
"libstdc++.so.6",
365370
"libGL.so.1",
366371
"libxcb.so.1",
@@ -401,8 +406,8 @@ def find_files(directory, patterns):
401406
"libselinux.so.1",
402407
]:
403408
external_so_files.append((libpath, libpath_file))
404-
# Any other lib deps that fail to meet the inclusion
405-
# criteria above will be silently skipped over
409+
else:
410+
log.info("Skipping external library: %s" % libpath)
406411

407412
# Append all source files
408413
src_files.append((os.path.join(PATH, "installer", "qt.conf"), "qt.conf"))
@@ -470,7 +475,7 @@ def find_files(directory, patterns):
470475
"pydoc_data",
471476
"pycparser",
472477
"pkg_resources"]
473-
if sys.platform != "win32":
478+
if sys.platform == "darwin":
474479
build_exe_options["excludes"].append("sentry_sdk.integrations.django")
475480

476481
# Set options

installer/build_server.py

+19-12
Original file line numberDiff line numberDiff line change
@@ -340,54 +340,61 @@ def main():
340340
# Install MIME handler
341341
dest = os.path.join(app_dir_path, "usr", "share", "mime", "packages")
342342
os.makedirs(dest, exist_ok=True)
343-
344343
shutil.copyfile(os.path.join(PATH, "xdg", "org.openshot.OpenShot.xml"),
345-
os.path.join(dest, "openshot-qt.xml"))
344+
os.path.join(dest, "org.openshot.OpenShot.xml"))
345+
346+
# Install AppStream XML metadata
347+
dest = os.path.join(app_dir_path, "usr", "share", "metainfo")
348+
os.makedirs(dest, exist_ok=True)
349+
shutil.copyfile(os.path.join(PATH, "xdg", "org.openshot.OpenShot.appdata.xml"),
350+
os.path.join(dest, "org.openshot.OpenShot.appdata.xml"))
346351

347352
# Copy the entire frozen app
348353
shutil.copytree(os.path.join(PATH, "build", exe_dir),
349354
os.path.join(app_dir_path, "usr", "bin"))
350355

351356
# Copy .desktop file, replacing Exec= commandline
352357
desk_in = os.path.join(PATH, "xdg", "org.openshot.OpenShot.desktop")
353-
desk_out = os.path.join(app_dir_path, "openshot-qt.desktop")
358+
desk_out = os.path.join(app_dir_path, "org.openshot.OpenShot.desktop")
354359
with open(desk_in, "r") as inf, open(desk_out, "w") as outf:
355360
for line in inf:
356361
if line.startswith("Exec="):
357-
outf.write("Exec=openshot-qt-launch.wrapper %F\n")
362+
outf.write("Exec=openshot-qt-launch %F\n")
358363
else:
359364
outf.write(line)
365+
# Copy modified .desktop file to usr/share/applciations
366+
dest = os.path.join(app_dir_path, "usr", "share", "applications")
367+
os.makedirs(dest, exist_ok=True)
368+
shutil.copyfile(os.path.join(app_dir_path, "org.openshot.OpenShot.desktop"),
369+
os.path.join(dest, "org.openshot.OpenShot.desktop"))
360370

361-
# Copy desktop integration wrapper (prompts users to install shortcut)
371+
# Rename executable launcher script
362372
launcher_path = os.path.join(app_dir_path, "usr", "bin", "openshot-qt-launch")
363373
os.rename(os.path.join(app_dir_path, "usr", "bin", "launch-linux.sh"), launcher_path)
364-
desktop_wrapper = os.path.join(app_dir_path, "usr", "bin", "openshot-qt-launch.wrapper")
365-
shutil.copyfile("/home/ubuntu/apps/AppImageKit/desktopintegration", desktop_wrapper)
366374

367-
# Create AppRun.64 file (the real one)
375+
# Create AppRun file
368376
app_run_path = os.path.join(app_dir_path, "AppRun")
369377
shutil.copyfile("/home/ubuntu/apps/AppImageKit/AppRun", app_run_path)
370378

371379
# Add execute bit to file mode for AppRun and scripts
372380
st = os.stat(app_run_path)
373381
os.chmod(app_run_path, st.st_mode | stat.S_IEXEC)
374-
os.chmod(desktop_wrapper, st.st_mode | stat.S_IEXEC)
375382
os.chmod(launcher_path, st.st_mode | stat.S_IEXEC)
376383

377384
# Create AppImage (OpenShot-%s-x86_64.AppImage)
378385
app_image_success = False
379386
for line in run_command(" ".join([
380-
'/home/ubuntu/apps/AppImageKit/AppImageAssistant',
387+
'/home/ubuntu/apps/AppImageKit/appimagetool-x86_64.AppImage',
381388
'"%s"' % app_dir_path,
382-
'"%s"' % app_build_path,
389+
'"%s"' % app_build_path
383390
])):
384391
output(line)
385392
app_image_success = os.path.exists(app_build_path)
386393

387394
# Was the AppImage creation successful
388395
if not app_image_success or errors_detected:
389396
# AppImage failed
390-
error("AppImageKit Error: AppImageAssistant did not output the AppImage file")
397+
error("AppImageKit Error: appimagetool did not output the AppImage file")
391398
needs_upload = False
392399

393400
# Delete build (since something failed)

installer/launch-linux.sh

-25
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
#!/bin/bash
22

3-
# Query the current display DPI
4-
# Fix the AppImage devicePixelRatio and scale the UI correctly
5-
# for High DPI displays. Ignore this logic if QT_SCREEN_SCALE_FACTORS
6-
# is already defined as an environment. The format is a
7-
# semicolon-separated list of scale factors in the same order as
8-
# QGuiApplication::screens().
9-
if [[ -z "${QT_SCREEN_SCALE_FACTORS}" ]]; then
10-
11-
regex="^.*resolution:\s*([0-9]*)x"
12-
while read line; do
13-
# Loop through display results, looking for regex matches
14-
[[ $line =~ $regex ]]
15-
if [[ -n "${BASH_REMATCH[1]}" ]]; then
16-
# Found a DPI results match
17-
SCALE_FACTOR=$(bc <<<"scale=2;${BASH_REMATCH[1]}/92")
18-
SCREENS+="${SCALE_FACTOR}"
19-
echo "Detected scale factor: ${SCALE_FACTOR}"
20-
SCREENS+=";"
21-
fi
22-
done <<< $(xdpyinfo | grep resolution)
23-
24-
echo "Setting QT_SCREEN_SCALE_FACTORS='${SCREENS}'"
25-
export QT_SCREEN_SCALE_FACTORS="${SCREENS}"
26-
fi
27-
283
# Add the current folder the library path
294
HERE=$(dirname "$(realpath "$0")")
305
export LD_LIBRARY_PATH="${HERE}"

src/launch.py

+7
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@
4444
import os
4545
import argparse
4646

47+
try:
48+
# This needs to be imported before PyQt5
49+
# To prevent some issues on AppImage build: wrapping/forcing older glibc versions
50+
import openshot
51+
except ImportError:
52+
pass
53+
4754
from PyQt5.QtCore import Qt
4855
from PyQt5.QtWidgets import QApplication
4956

xdg/org.openshot.OpenShot.appdata.xml

+40-30
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,51 @@
66
<project_license>GPL-3.0-or-later</project_license>
77
<name>OpenShot Video Editor</name>
88
<developer_name>OpenShot Studios, LLC</developer_name>
9-
<summary>
10-
An easy to use, quick to learn, and surprisingly powerful video editor
11-
</summary>
9+
<summary>An easy to use, quick to learn, and surprisingly powerful video editor</summary>
1210
<description>
1311
<p>
14-
OpenShot Video Editor is a free, open-source, non-linear video editor. It
15-
can create and edit videos and movies using many popular video, audio,
16-
image formats. Create videos for YouTube, Flickr, Vimeo, Metacafe, iPod,
17-
Xbox, and more!
18-
</p>
19-
<p>
20-
Features include:
21-
<ul>
22-
<li>Multiple tracks (layers)</li>
23-
<li>Compositing, image overlays, and watermarks</li>
24-
<li>Audio mixing and editing</li>
25-
<li>Support for image sequences (rotoscoping)</li>
26-
<li>Key-frame animation</li>
27-
<li>Video effects (chroma-key)</li>
28-
<li>Transitions (lumas and masks)</li>
29-
<li>Titles with integrated editor and templates</li>
30-
<li>3D animation (titles and effects)</li>
31-
</ul>
12+
OpenShot Video Editor is an award-winning, open-source video editor, available on Linux, Mac, Chrome OS,
13+
and Windows. OpenShot can create stunning videos, films, and animations with an easy-to-use interface
14+
and rich set of features.
3215
</p>
16+
<p><em>Features include:</em></p>
17+
<ul>
18+
<li><em>Free &amp; open-source</em> (licensed under GPLv3)</li>
19+
<li><em>Cross-platform</em> (Linux, OS X, Chrome OS, and Windows)</li>
20+
<li><em>Easy-to-use user interface</em> (designed for beginners, built-in tutorial)</li>
21+
<li><em>Supports most video, audio, &amp; image formats</em> (based on FFmpeg)</li>
22+
<li><em>Includes popular video profiles &amp; presets</em> (over 70+ profiles, including YouTube HD)</li>
23+
<li><em>Advanced timeline</em> (including drag and drop, scrolling, panning, zooming, and snapping)</li>
24+
<li><em>Advanced clips</em> (including trimming, alpha, scaling, location, rotation, and shearing)</li>
25+
<li><em>Real-time preview</em> (multi-threaded, and optimized for performance)</li>
26+
<li><em>Simple &amp; advanced views</em> (or customize your own unique view)</li>
27+
<li><em>Powerful, curve-based Keyframe animations</em> (linear, Bézier, and constant interpolation)</li>
28+
<li><em>Compositing, image overlays, watermarks, &amp; transparency</em></li>
29+
<li><em>Unlimited tracks / layers</em> (support for complex projects)</li>
30+
<li><em>Video transitions, masks, &amp; wipes</em> (grayscale images and animated masks)</li>
31+
<li><em>Video &amp; audio effects</em> (including brightness, gamma, hue, chroma key / blue screen, and more)</li>
32+
<li><em>Image sequences &amp; 2D animations</em> (001.png, 002.png, 003.png, etc…)</li>
33+
<li><em>Blender 3D integration</em> (animated 3D title templates)</li>
34+
<li><em>Vector file support &amp; editing</em> (SVG / scalable vector graphics used for titles and credits)</li>
35+
<li><em>Audio mixing, waveform, &amp; editing</em></li>
36+
<li><em>Emojis</em> (open-source stickers &amp; artwork included)</li>
37+
<li><em>Frame accuracy</em> (step through each frame of video)</li>
38+
<li><em>Time mapping &amp; speed changes</em> (slow/fast, forward/backward)</li>
39+
<li><em>Advanced AI</em> (motion tracking, object detection, &amp; stabilization effects)</li>
40+
<li><em>Credits &amp; captions</em> (scrolling and animated)</li>
41+
<li><em>Hardware accelerated</em> (encoding &amp; decoding supports NVIDIA, AMD, Intel and more)</li>
42+
<li><em>Import &amp; export</em> (EDL and Final Cut Pro formats, supports most video editors)</li>
43+
<li><em>Customizable keyboard shortcuts</em></li>
44+
<li><em>Translations</em> (available in 100+ languages)</li>
45+
</ul>
3346
</description>
34-
<provides>
35-
<binary>openshot-qt</binary>
36-
</provides>
37-
<url type="donation">https://www.openshot.org/donate</url>
38-
<url type="help">https://www.openshot.org/user-guide</url>
39-
<url type="homepage">https://www.openshot.org</url>
40-
<url type="bugtracker">https://github.com/OpenShot/openshot-qt/issues</url>
47+
<url type="donation">https://www.openshot.org/donate/</url>
48+
<url type="help">https://www.openshot.org/user-guide/</url>
49+
<url type="homepage">https://www.openshot.org/</url>
50+
<url type="bugtracker">https://www.openshot.org/issues/new/</url>
4151
<screenshots>
4252
<screenshot type="default">
43-
<image height="637" width="975">https://www.openshot.org/static/img/gallery/ui-example.jpg</image>
53+
<image height="637" width="975">https://www.openshot.org/static/img/gallery/ui-example.jpg</image>
4454
</screenshot>
4555
<screenshot>
4656
<image height="555" width="780">https://www.openshot.org/static/img/gallery/title-editor.jpg</image>
@@ -51,7 +61,7 @@
5161
</content_rating>
5262
<provides>
5363
<binary>openshot-qt</binary>
54-
<id>openshot-qt</id>
64+
<id>org.openshot.OpenShot.desktop</id>
5565
</provides>
5666
<releases>
5767
<release version="2.6.1" date="2021-09-04"/>

0 commit comments

Comments
 (0)