diff --git a/.gitignore b/.gitignore index c818c6d95..ccc8bcad8 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,6 @@ build-* *.diff *.patch ffmpeg - *.7z +distfiles +backup diff --git a/.gitmodules b/.gitmodules index fe08cc7f9..df5be72f0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,9 @@ -[submodule "src/skia"] +[submodule "src/engine/skia"] path = src/engine/skia url = https://github.com/friction2d/skia [submodule "src/gperftools"] path = src/gperftools url = https://github.com/friction2d/gperftools -[submodule "src/plugins/shaders"] - path = src/plugins/shaders - url = https://github.com/friction2d/friction-shader-plugins [submodule "docs"] path = docs url = https://github.com/friction2d/friction2d.github.io diff --git a/CMakeLists.txt b/CMakeLists.txt index 44253874a..e63ccea93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ # along with this program. If not, see . # -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.12) project(friction.graphics) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/src/cmake") @@ -31,13 +31,13 @@ if(UNIX AND NOT APPLE) set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") set(CPACK_PACKAGE_NAME ${FRICTION_NAME}) - set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION}) + set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_SUMMARY}) set(CPACK_PACKAGE_VENDOR ${PROJECT_COPYRIGHT}) set(CPACK_STRIP_FILES TRUE) set(CPACK_RPM_SPEC_MORE_DEFINE "%define _build_id_links none") set(CPACK_RPM_PACKAGE_LICENSE ${PROJECT_LICENSE}) - set(CPACK_RPM_PACKAGE_SUMMARY ${PROJECT_DESCRIPTION}) + set(CPACK_RPM_PACKAGE_SUMMARY ${PROJECT_SUMMARY}) set(CPACK_RPM_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION}) set(CPACK_RPM_PACKAGE_URL ${PROJECT_HOMEPAGE_URL}) set(CPACK_RPM_FILE_NAME "${FRICTION_NAME}.rpm") @@ -53,6 +53,7 @@ endif() add_subdirectory(src/engine) if(UNIX) + option(BUILD_TESTING "Don't build gperftools tests" OFF) add_subdirectory(src/gperftools) endif() add_subdirectory(src/core) diff --git a/docs b/docs index ea0bd5cb6..7e886f6bf 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit ea0bd5cb695dbb507bf3c2a9766997347d70027e +Subproject commit 7e886f6bf434e0e62fa0f57d990f13f4ae26a912 diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index a44609bda..8f5100d80 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -19,7 +19,7 @@ # See 'README.md' for more information. # -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.12) project(friction LANGUAGES CXX) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") @@ -92,9 +92,9 @@ if(WIN32) set(WINDOWS_ICON_FILE ${FRICTION_NAME}.ico) set(ICON_FILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${FRICTION_NAME}.ico) set(GUI_TYPE WIN32) - set(PRODUCT_COMMENTS "${FRICTION_DISPLAY_NAME} ${PROJECT_DESCRIPTION}") + set(PRODUCT_COMMENTS "${FRICTION_DISPLAY_NAME}") set(PRODUCT_COMPANY_NAME ${FRICTION_DISPLAY_NAME}) - set(PRODUCT_FILE_DESCRIPTION "${FRICTION_DISPLAY_NAME} ${PROJECT_DESCRIPTION}") + set(PRODUCT_FILE_DESCRIPTION "${FRICTION_DISPLAY_NAME}") set(PRODUCT_VERSION "${PROJECT_VERSION}") set(PRODUCT_INTERNAL_NAME ${FRICTION_DISPLAY_NAME}) set(PRODUCT_COMPANY_COPYRIGHT ${PROJECT_COPYRIGHT}) @@ -404,6 +404,7 @@ set( boxtypemenu.h GUI/Settings/labeledslider.h GUI/uilayout.h + GUI/vlabel.h ) set( diff --git a/src/app/GUI/ColorWidgets/colorlabel.cpp b/src/app/GUI/ColorWidgets/colorlabel.cpp index 19765631f..50db1960f 100755 --- a/src/app/GUI/ColorWidgets/colorlabel.cpp +++ b/src/app/GUI/ColorWidgets/colorlabel.cpp @@ -57,6 +57,15 @@ void ColorLabel::setAlpha(const qreal alpha_t) { update(); } +void ColorLabel::addBookmark() +{ + const QColor col = QColor::fromHsvF(qreal(mHue), + qreal(mSaturation), + qreal(mValue), + mAlpha); + Document::sInstance->addBookmarkColor(col); +} + void ColorLabel::paintGL() { qreal pixelRatio = devicePixelRatioF(); glClear(GL_COLOR_BUFFER_BIT); diff --git a/src/app/GUI/ColorWidgets/colorlabel.h b/src/app/GUI/ColorWidgets/colorlabel.h index 00ec3840f..59c484f6f 100755 --- a/src/app/GUI/ColorWidgets/colorlabel.h +++ b/src/app/GUI/ColorWidgets/colorlabel.h @@ -37,6 +37,8 @@ class ColorLabel : public ColorWidget { void setLastColorHSV(GLfloat h, GLfloat s, GLfloat v); void mousePressEvent(QMouseEvent *e); void setAlpha(const qreal alpha_t); + void addBookmark(); + private: void paintGL(); qreal mAlpha = 1; diff --git a/src/app/GUI/ColorWidgets/colorsettingswidget.cpp b/src/app/GUI/ColorWidgets/colorsettingswidget.cpp index 844f7356f..a8b2818b9 100755 --- a/src/app/GUI/ColorWidgets/colorsettingswidget.cpp +++ b/src/app/GUI/ColorWidgets/colorsettingswidget.cpp @@ -34,6 +34,9 @@ #include "GUI/global.h" #include "GUI/actionbutton.h" #include "GUI/ColorWidgets/savedcolorswidget.h" +#include "appsupport.h" + +#include void ColorSettingsWidget::updateWidgetTargets() { @@ -275,6 +278,13 @@ ColorSettingsWidget::ColorSettingsWidget(QWidget *parent) : QWidget(parent) { mColorLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + const auto book = new QShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "colorBookmark", + "B").toString()), + this); + connect(book, &QShortcut::activated, + mColorLabel, &ColorLabel::addBookmark); + // mWheelWidget->setLayout(mWheelLayout); // mWheelLayout->setAlignment(Qt::AlignTop); // wheel_triangle_widget = new H_Wheel_SV_Triangle(this); diff --git a/src/app/GUI/RenderWidgets/renderinstancewidget.cpp b/src/app/GUI/RenderWidgets/renderinstancewidget.cpp index 546f7c207..458216b0a 100755 --- a/src/app/GUI/RenderWidgets/renderinstancewidget.cpp +++ b/src/app/GUI/RenderWidgets/renderinstancewidget.cpp @@ -26,6 +26,7 @@ #include "renderinstancewidget.h" #include "GUI/global.h" #include +#include "canvas.h" #include "outputsettingsdialog.h" #include "outputsettingsprofilesdialog.h" #include "outputsettingsdisplaywidget.h" @@ -389,6 +390,15 @@ void RenderInstanceWidget::read(eReadStream &src) { setChecked(checked); } +void RenderInstanceWidget::updateRenderSettings() +{ + const RenderSettings &renderSettings = mSettings.getRenderSettings(); + mRenderSettingsDisplayWidget->setRenderSettings(mSettings.getTargetCanvas(), + renderSettings); + const auto label = mSettings.getTargetCanvas()->prp_getName(); + if (!label.isEmpty()) { mNameLabel->setText(label); } +} + #include "Private/esettings.h" OutputProfilesListButton::OutputProfilesListButton(RenderInstanceWidget *parent) : QPushButton(parent) { diff --git a/src/app/GUI/RenderWidgets/renderinstancewidget.h b/src/app/GUI/RenderWidgets/renderinstancewidget.h index 3aa451d83..c6de37401 100755 --- a/src/app/GUI/RenderWidgets/renderinstancewidget.h +++ b/src/app/GUI/RenderWidgets/renderinstancewidget.h @@ -60,6 +60,8 @@ class RenderInstanceWidget : public ClosableContainer { void write(eWriteStream &dst) const; void read(eReadStream &src); + void updateRenderSettings(); + protected: void mousePressEvent(QMouseEvent* e); private: diff --git a/src/app/GUI/RenderWidgets/renderwidget.cpp b/src/app/GUI/RenderWidgets/renderwidget.cpp index 33921e75f..bf1808def 100755 --- a/src/app/GUI/RenderWidgets/renderwidget.cpp +++ b/src/app/GUI/RenderWidgets/renderwidget.cpp @@ -53,11 +53,11 @@ RenderWidget::RenderWidget(QWidget *parent) mMainLayout->setSpacing(0); setLayout(mMainLayout); - QWidget *bottomWidget = new QWidget(this); + const auto bottomWidget = new QWidget(this); bottomWidget->setContentsMargins(0, 0, 0, 0); const auto bottomLayout = new QHBoxLayout(bottomWidget); - const auto darkPal= AppSupport::getDarkPalette(); + const auto darkPal = AppSupport::getDarkPalette(); bottomWidget->setAutoFillBackground(true); bottomWidget->setPalette(darkPal); bottomWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); @@ -137,8 +137,8 @@ RenderWidget::RenderWidget(QWidget *parent) mScrollArea->setWidgetResizable(true); mScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - bottomLayout->addWidget(mRenderProgressBar); bottomLayout->addWidget(mStartRenderButton); + bottomLayout->addWidget(mRenderProgressBar); bottomLayout->addWidget(mStopRenderButton); bottomLayout->addWidget(mAddRenderButton); bottomLayout->addWidget(mClearQueueButton); @@ -289,6 +289,13 @@ void RenderWidget::read(eReadStream &src) } } +void RenderWidget::updateRenderSettings() +{ + for (const auto &wid: mRenderInstanceWidgets) { + wid->updateRenderSettings(); + } +} + void RenderWidget::render(RenderInstanceSettings &settings) { const RenderSettings &renderSettings = settings.getRenderSettings(); diff --git a/src/app/GUI/RenderWidgets/renderwidget.h b/src/app/GUI/RenderWidgets/renderwidget.h index 2e4afc24c..36708fbf6 100755 --- a/src/app/GUI/RenderWidgets/renderwidget.h +++ b/src/app/GUI/RenderWidgets/renderwidget.h @@ -51,6 +51,7 @@ class RenderWidget : public QWidget void clearRenderQueue(); void write(eWriteStream& dst) const; void read(eReadStream& src); + void updateRenderSettings(); signals: void progress(int frame, int total); diff --git a/src/app/GUI/mainwindow.cpp b/src/app/GUI/mainwindow.cpp index 070227244..2444be9d9 100755 --- a/src/app/GUI/mainwindow.cpp +++ b/src/app/GUI/mainwindow.cpp @@ -1641,6 +1641,9 @@ void MainWindow::setupToolBar() mLocalPivotAct = new QAction(mDocument.fLocalPivot ? QIcon::fromTheme("pivotLocal") : QIcon::fromTheme("pivotGlobal"), tr("Pivot Global / Local"), this); + mLocalPivotAct->setShortcut(QKeySequence(AppSupport::getSettings("shortcuts", + "localPivot", + "P").toString())); connect(mLocalPivotAct, &QAction::triggered, this, [this]() { mDocument.fLocalPivot = !mDocument.fLocalPivot; diff --git a/src/app/GUI/qdoubleslider.cpp b/src/app/GUI/qdoubleslider.cpp index bc562d722..782260269 100755 --- a/src/app/GUI/qdoubleslider.cpp +++ b/src/app/GUI/qdoubleslider.cpp @@ -92,7 +92,9 @@ void SliderEdit::lineEditingFinished() { QDoubleSlider::QDoubleSlider(const qreal minVal, const qreal maxVal, const qreal prefferedStep, - QWidget * const parent) : QWidget(parent) { + QWidget * const parent, + bool autoAdjust) : QWidget(parent) { + mAutoAdjustWidth = autoAdjust; mMinValue = minVal; mMaxValue = maxVal; mPrefferedValueStep = prefferedStep; @@ -142,7 +144,7 @@ void QDoubleSlider::setValueSliderVisible(const bool valueSliderVisible) { void QDoubleSlider::setNameVisible(const bool nameVisible) { mShowName = nameVisible; - fitWidthToContent(); + if (mAutoAdjustWidth) { fitWidthToContent(); } } void QDoubleSlider::setName(const QString &name) { @@ -152,7 +154,7 @@ void QDoubleSlider::setName(const QString &name) { void QDoubleSlider::setNumberDecimals(const int decimals) { mDecimals = decimals; - fitWidthToContent(); + if (mAutoAdjustWidth) { fitWidthToContent(); } updateValueString(); } @@ -172,7 +174,7 @@ void QDoubleSlider::setValueRange(const qreal min, const qreal max) { mMinValue = min; mMaxValue = max; setDisplayedValue(clamped(mValue)); - fitWidthToContent(); + if (mAutoAdjustWidth) { fitWidthToContent(); } } void QDoubleSlider::paint(QPainter * const p, const bool enabled) { diff --git a/src/app/GUI/qdoubleslider.h b/src/app/GUI/qdoubleslider.h index 1cd5bd974..8b150170c 100755 --- a/src/app/GUI/qdoubleslider.h +++ b/src/app/GUI/qdoubleslider.h @@ -53,7 +53,8 @@ class QDoubleSlider : public QWidget { QDoubleSlider(const qreal minVal, const qreal maxVal, const qreal prefferedStep, - QWidget * const parent = nullptr); + QWidget * const parent = nullptr, + bool autoAdjust = true); QDoubleSlider(const QString& name, const qreal minVal, const qreal maxVal, @@ -147,6 +148,7 @@ class QDoubleSlider : public QWidget { QPoint mGlobalPressPos; qreal mLastValue; bool mShowValueSlider = true; + bool mAutoAdjustWidth = true; }; #endif // QDOUBLESLIDER_H diff --git a/src/app/GUI/uilayout.cpp b/src/app/GUI/uilayout.cpp index 6f4e215fa..f13ab1627 100644 --- a/src/app/GUI/uilayout.cpp +++ b/src/app/GUI/uilayout.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -49,18 +48,17 @@ UIDock::UIDock(QWidget *parent, const bool &showHeader, const bool &darkHeader) : QWidget{parent} - , mWidget(widget) + , mLayout(nullptr) , mLabel(label) , mPos(pos) , mIndex(-1) { setObjectName(mLabel); - setContentsMargins(0, 0, 0, 0); - const auto mainLayout = new QVBoxLayout(this); - mainLayout->setContentsMargins(0, 0, 0, 0); - mainLayout->setMargin(0); - mainLayout->setSpacing(0); + mLayout = new QVBoxLayout(this); + mLayout->setContentsMargins(0, 0, 0, 0); + mLayout->setMargin(0); + mLayout->setSpacing(0); if (showHeader) { const auto headerWidget = new QWidget(this); @@ -126,7 +124,7 @@ UIDock::UIDock(QWidget *parent, headerLayout->addWidget(upButton); headerLayout->addWidget(downButton); - mainLayout->addWidget(headerWidget); + mLayout->addWidget(headerWidget); connect(leftButton, &QPushButton::clicked, this, [this]() { emit changePosition(mPos, Position::Left); }); @@ -137,7 +135,7 @@ UIDock::UIDock(QWidget *parent, connect(downButton, &QPushButton::clicked, this, [this]() { emit changePosition(mPos, Position::Down); }); } - mainLayout->addWidget(mWidget); + mLayout->addWidget(widget); } UIDock::~UIDock() @@ -175,6 +173,11 @@ const QString UIDock::getId() return AppSupport::filterTextAZW(mLabel); } +void UIDock::addWidget(QWidget *widget) +{ + mLayout->addWidget(widget); +} + void UIDock::writeSettings() { qDebug() << "==> write dock conf" << mLabel << mPos << mIndex; @@ -226,6 +229,7 @@ void UILayout::readSettings() { QSettings settings; settings.beginGroup(UI_CONF_GROUP); + bool firstrun = settings.value(UI_CONF_KEY_MAIN).isNull(); restoreState(settings.value(UI_CONF_KEY_MAIN).toByteArray()); mLeft->restoreState(settings.value(UI_CONF_KEY_LEFT).toByteArray()); mMiddle->restoreState(settings.value(UI_CONF_KEY_MIDDLE).toByteArray()); @@ -233,6 +237,10 @@ void UILayout::readSettings() mTop->restoreState(settings.value(UI_CONF_KEY_TOP).toByteArray()); mBottom->restoreState(settings.value(UI_CONF_KEY_BOTTOM).toByteArray()); settings.endGroup(); + + if (firstrun) { + setSizes({300, 1024, 300}); + } } void UILayout::writeSettings() @@ -307,6 +315,18 @@ void UILayout::addDocks(std::vector items) readSettings(); } +void UILayout::setDockVisible(const QString &label, + bool visible) +{ + emit updateDockVisibility(label, visible); +} + +void UILayout::addDockWidget(const QString &label, QWidget *widget) +{ + if (!widget) { return; } + emit updateDockWidget(label, widget); +} + void UILayout::addDock(const Item &item) { if (!item.widget) { return; } @@ -338,6 +358,23 @@ void UILayout::addDock(const Item &item) void UILayout::connectDock(UIDock *dock) { if (!dock) { return; } + connect(this, + &UILayout::updateDockVisibility, + this, + [dock](const QString &label, + bool visible) { + if (dock->getLabel() == label) { dock->setVisible(visible); } + }); + connect(this, + &UILayout::updateDockWidget, + this, + [dock](const QString &label, + QWidget *widget) { + if (dock->getLabel() == label) { + dock->addWidget(widget); + dock->setVisible(true); + } + }); connect(dock, &UIDock::changePosition, this, diff --git a/src/app/GUI/uilayout.h b/src/app/GUI/uilayout.h index 2977bd26b..ab8f1bd4a 100644 --- a/src/app/GUI/uilayout.h +++ b/src/app/GUI/uilayout.h @@ -26,6 +26,7 @@ #include #include +#include #include class UIDock : public QWidget @@ -54,13 +55,14 @@ class UIDock : public QWidget int getIndex(); const QString getLabel(); const QString getId(); + void addWidget(QWidget *widget); signals: void changePosition(const Position &pos, const Position &trigger); private: - QWidget *mWidget; + QVBoxLayout *mLayout; QString mLabel; Position mPos; int mIndex; @@ -91,6 +93,16 @@ class UILayout : public QSplitter void readSettings(); void writeSettings(); void addDocks(std::vector items); + void setDockVisible(const QString &label, + bool visible); + void addDockWidget(const QString &label, + QWidget *widget); + +signals: + void updateDockVisibility(const QString &label, + bool visible); + void updateDockWidget(const QString &label, + QWidget *widget); private: QSplitter *mLeft; diff --git a/src/app/GUI/vlabel.h b/src/app/GUI/vlabel.h new file mode 100644 index 000000000..d7e6b2797 --- /dev/null +++ b/src/app/GUI/vlabel.h @@ -0,0 +1,61 @@ +/* +# +# Friction - https://friction.graphics +# +# Copyright (c) Friction contributors +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# See 'README.md' for more information. +# +*/ + +#ifndef VLABEL_H +#define VLABEL_H + +#include +#include +#include + +class VLabel : public QLabel +{ + Q_OBJECT + +public: + explicit VLabel(QWidget *parent = nullptr) + : QLabel(parent) {} + explicit VLabel(const QString &text, + QWidget *parent = nullptr) + : QLabel(text, parent) {} + +protected: + void paintEvent(QPaintEvent*) + { + QStylePainter painter(this); + painter.rotate(90); + painter.drawText(0, -(sizeHint().width() / 2)-2, text()); + } + QSize sizeHint() const + { + const auto s = QLabel::sizeHint(); + return QSize(s.height(), s.width()); + } + QSize minimumSizeHint() const + { + const auto s = QLabel::minimumSizeHint(); + return QSize(s.height(), s.width()); + } +}; + +#endif // VLABEL_H diff --git a/src/app/GUI/window.cpp b/src/app/GUI/window.cpp index bebce667b..5eb6c7ebd 100644 --- a/src/app/GUI/window.cpp +++ b/src/app/GUI/window.cpp @@ -60,7 +60,7 @@ Window::Window(QWidget *parent, Window::~Window() { - saveState(); + //saveState(); } void Window::focusWindow() @@ -80,6 +80,7 @@ void Window::keyPressEvent(QKeyEvent *event) void Window::closeEvent(QCloseEvent *event) { + qDebug() << "closed window" << objectName(); saveState(); QDialog::closeEvent(event); } diff --git a/src/app/app.desktop.in b/src/app/app.desktop.in index 3ba5488ba..1992699c2 100755 --- a/src/app/app.desktop.in +++ b/src/app/app.desktop.in @@ -3,7 +3,7 @@ Version=1.0 Name=@FRICTION_DISPLAY_NAME@ Exec=@FRICTION_NAME@ %f Icon=@PROJECT_FREEDESKTOP@ -Comment=@PROJECT_DESCRIPTION@ +Comment=@PROJECT_SUMMARY@ GenericName=@FRICTION_NAME_GENERIC@ StartupNotify=true Terminal=false diff --git a/src/app/appdata.xml.in b/src/app/appdata.xml.in index 5b80d003c..b8ca47a19 100644 --- a/src/app/appdata.xml.in +++ b/src/app/appdata.xml.in @@ -5,11 +5,11 @@ @PROJECT_FREEDESKTOP@.desktop @FRICTION_DISPLAY_NAME@ @FRICTION_DISPLAY_NAME@ - @PROJECT_DESCRIPTION@ + @PROJECT_SUMMARY@ CC0-1.0 GPL-3.0-or-later -

Friction is a powerful and versatile free and open-source motion graphics application that allows you to create stunning vector and raster animations for web and video platforms with ease.

+

@PROJECT_DESCRIPTION@

diff --git a/src/app/evfileio.cpp b/src/app/evfileio.cpp index 015963d45..ff1eb172b 100755 --- a/src/app/evfileio.cpp +++ b/src/app/evfileio.cpp @@ -111,6 +111,7 @@ void MainWindow::loadEVFile(const QString &path) { } file.close(); addRecentFile(path); + mRenderWidget->updateRenderSettings(); } void MainWindow::saveToFile(const QString &path, diff --git a/src/cmake/friction-meta.cmake b/src/cmake/friction-meta.cmake index 10b3613ea..15de3155b 100644 --- a/src/cmake/friction-meta.cmake +++ b/src/cmake/friction-meta.cmake @@ -24,7 +24,8 @@ set(FRICTION_NAME_GENERIC "Motion Graphics") set(FRICTION_DISPLAY_NAME "Friction") set(PROJECT_COPYRIGHT "Friction contributors") set(PROJECT_IDENTIFIER "graphics.friction") -set(PROJECT_DESCRIPTION "Motion graphics software") +set(PROJECT_SUMMARY "Motion graphics and animation") +set(PROJECT_DESCRIPTION "Powerful and versatile motion graphics and animation application that allows you to create stunning vector and raster animations for web and video platforms with ease") set(PROJECT_LICENSE "GPLv3+") set(PROJECT_HOMEPAGE_URL "https://friction.graphics") set(PROJECT_FREEDESKTOP "${PROJECT_IDENTIFIER}.${FRICTION_DISPLAY_NAME}") diff --git a/src/core/Boxes/containerbox.cpp b/src/core/Boxes/containerbox.cpp index ec8183923..859c765dc 100755 --- a/src/core/Boxes/containerbox.cpp +++ b/src/core/Boxes/containerbox.cpp @@ -126,6 +126,9 @@ bool ContainerBox::SWT_dropInto(const int index, const QMimeData * const data) { if(box == this) continue; if(isAncestor(box)) continue; } + if (const auto box = enve_cast(iObj)) { + if (enve_cast(box->getFinalTarget()) == this) { continue; } + } insertContained((dropId++) - ca_getNumberOfChildren(), iObj->ref()); } diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 278685498..cfe7d5f9d 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -17,7 +17,7 @@ # along with this program. If not, see . # -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.12) project(frictioncore LANGUAGES CXX) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake") diff --git a/src/engine/CMakeLists.txt b/src/engine/CMakeLists.txt index 083af3bbb..55ea0f09d 100644 --- a/src/engine/CMakeLists.txt +++ b/src/engine/CMakeLists.txt @@ -17,7 +17,7 @@ # along with this program. If not, see . # -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.12) include(ExternalProject) include(ProcessorCount) @@ -25,6 +25,7 @@ include(ProcessorCount) ProcessorCount(N) option(USE_SKIA_SYSTEM_LIBS "Use skia (third-party) system libraries on Linux" ON) +option(LINUX_DEPLOY "Linux Deploy" OFF) set(SKIA_SRC "${CMAKE_CURRENT_SOURCE_DIR}/skia") set(SKIA_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/skia") @@ -50,9 +51,17 @@ if(WIN32) else() set(GN_PATH ${SKIA_SRC}/bin/gn) set(SKIA_BUILD_CMD ninja -j${N}) - set(SKIA_UPDATE_CMD true) + if(${USE_SKIA_SYSTEM_LIBS}) + set(SKIA_UPDATE_CMD true) + else() + set(SKIA_UPDATE_CMD python3 "tools/git-sync-deps") + endif() set(SKIA_ARGS "ar=\"${CMAKE_AR}\" cc=\"${CMAKE_C_COMPILER}\" cxx=\"${CMAKE_CXX_COMPILER}\"") - set(SKIA_ARGS "${SKIA_ARGS} extra_cflags=[\"-Wno-error\"]") + if (${LINUX_DEPLOY}) + set(SKIA_ARGS "${SKIA_ARGS} extra_cflags=[\"-Wno-error\"]") + else() + set(SKIA_ARGS "${SKIA_ARGS} extra_cflags=[\"-Wno-error\", \"-Wno-psabi\"]") + endif() endif() set(SKIA_ARGS "${SKIA_ARGS} is_official_build=true is_debug=false") @@ -63,7 +72,7 @@ set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_libpng=${SKIA_ENABLE_EXTERNAL}") set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_libwebp=${SKIA_ENABLE_EXTERNAL}") set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_icu=${SKIA_ENABLE_EXTERNAL}") set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_harfbuzz=${SKIA_ENABLE_EXTERNAL}") -if(WIN32) +if(WIN32 OR NOT ${USE_SKIA_SYSTEM_LIBS}) set(SKIA_ARGS "${SKIA_ARGS} skia_use_system_zlib=${SKIA_ENABLE_EXTERNAL}") endif() if(UNIX AND NOT APPLE) diff --git a/src/engine/skia b/src/engine/skia index eb2d64c54..c4284e9bd 160000 --- a/src/engine/skia +++ b/src/engine/skia @@ -1 +1 @@ -Subproject commit eb2d64c549ea52f9400721c579858c8810caa717 +Subproject commit c4284e9bdd1f794e1c72328924ad519fd0d736cf diff --git a/src/gperftools b/src/gperftools index 00c924553..b97c293c8 160000 --- a/src/gperftools +++ b/src/gperftools @@ -1 +1 @@ -Subproject commit 00c92455366c60d6f8ddceb0e846262e874b9ab4 +Subproject commit b97c293c812c7ec3cdeccd50a89769e746c01377 diff --git a/src/plugins/shaders b/src/plugins/shaders deleted file mode 160000 index a72a9a342..000000000 --- a/src/plugins/shaders +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a72a9a3426c871915c4da87175e3ab1268144995 diff --git a/src/scripts/Dockerfile.jammy b/src/scripts/Dockerfile.jammy index 3c24eaa3f..0e092872a 100644 --- a/src/scripts/Dockerfile.jammy +++ b/src/scripts/Dockerfile.jammy @@ -3,7 +3,7 @@ FROM ubuntu:jammy ARG DEBIAN_FRONTEND=noninteractive RUN apt update -y RUN apt upgrade -y -RUN apt install -y curl build-essential clang git libtool autoconf automake cmake python3 python-is-python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev qt5-image-formats-plugins libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev +RUN apt install -y curl build-essential file clang git cmake python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev COPY build_docker.sh / CMD [ "bash", "./build_docker.sh" ] diff --git a/src/scripts/Dockerfile.lunar b/src/scripts/Dockerfile.lunar deleted file mode 100644 index 46d953510..000000000 --- a/src/scripts/Dockerfile.lunar +++ /dev/null @@ -1,9 +0,0 @@ -FROM ubuntu:lunar - -ARG DEBIAN_FRONTEND=noninteractive -RUN apt update -y -RUN apt upgrade -y -RUN apt install -y curl build-essential clang git libtool autoconf automake cmake python3 python-is-python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev qt5-image-formats-plugins libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev - -COPY build_docker.sh / -CMD [ "bash", "./build_docker.sh" ] diff --git a/src/scripts/Dockerfile.mantic b/src/scripts/Dockerfile.mantic index ad104b86b..c2eb7da2f 100644 --- a/src/scripts/Dockerfile.mantic +++ b/src/scripts/Dockerfile.mantic @@ -3,7 +3,7 @@ FROM ubuntu:mantic ARG DEBIAN_FRONTEND=noninteractive RUN apt update -y RUN apt upgrade -y -RUN apt install -y curl build-essential clang git libtool autoconf automake cmake python3 python-is-python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev qt5-image-formats-plugins libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libglx-mesa0 libglx-dev libxcb-glx0-dev libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev +RUN apt install -y curl build-essential file clang git cmake python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libglx-mesa0 libglx-dev libxcb-glx0-dev libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev COPY build_docker.sh / CMD [ "bash", "./build_docker.sh" ] diff --git a/src/scripts/Dockerfile.noble b/src/scripts/Dockerfile.noble new file mode 100644 index 000000000..bacb1ab85 --- /dev/null +++ b/src/scripts/Dockerfile.noble @@ -0,0 +1,9 @@ +FROM ubuntu:noble + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt update -y +RUN apt upgrade -y +RUN apt install -y curl build-essential file clang git cmake python3 ninja-build libfontconfig1-dev libfreetype-dev libavcodec-dev libavformat-dev libavutil-dev libqscintilla2-qt5-dev libqt5opengl5-dev libqt5svg5-dev libswresample-dev libswscale-dev libunwind-dev libqt5multimedia5-plugins qtbase5-dev-tools qtbase5-dev qtdeclarative5-dev-tools qtdeclarative5-dev qtmultimedia5-dev qttools5-dev-tools libglx-mesa0 libglx-dev libxcb-glx0-dev libexpat1-dev libfreetype-dev libjpeg-turbo8-dev libpng-dev libwebp-dev zlib1g-dev libicu-dev libharfbuzz-dev + +COPY build_docker.sh / +CMD [ "bash", "./build_docker.sh" ] diff --git a/src/scripts/Dockerfile.vfxplatform b/src/scripts/Dockerfile.vfxplatform index 937dab52e..ad28e290c 100644 --- a/src/scripts/Dockerfile.vfxplatform +++ b/src/scripts/Dockerfile.vfxplatform @@ -4,7 +4,7 @@ FROM centos:centos7.9.2009 RUN yum -y update RUN yum -y install centos-release-scl RUN yum -y group install "Development Tools" -RUN yum -y install pulseaudio-libs-devel wget rpmdevtools git yasm python3 fontconfig-devel zlib-devel autoconf automake xz devtoolset-7 llvm-toolset-7.0 tree curl libICE-devel libSM-devel libX11-devel libXau-devel libXdamage-devel libXext-devel libXfixes-devel libXi-devel libXxf86vm-devel libdrm-devel libxcb-devel mesa-libGL-devel xorg-x11-proto-devel +RUN yum -y install pulseaudio-libs-devel wget rpmdevtools git yasm python3 fontconfig-devel zlib-devel autoconf automake xz devtoolset-7 llvm-toolset-7.0 tree curl libICE-devel libSM-devel libX11-devel libXau-devel libXdamage-devel libXext-devel libXfixes-devel libXi-devel libXxf86vm-devel libdrm-devel libxcb-devel mesa-libGL-devel xorg-x11-proto-devel xcb-proto libxcb-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel RUN ln -sf /usr/bin/python3 /usr/bin/python RUN rm -f /usr/lib64/pkgconfig/libpng.pc RUN rm -f /usr/lib64/pkgconfig/libpng15.pc @@ -14,6 +14,10 @@ RUN rm -f /usr/include/pnglibconf.h RUN sed -i '/.private/d' /usr/lib64/pkgconfig/freetype2.pc RUN echo "source scl_source enable devtoolset-7" >> /root/.bashrc -# COPY build_vfxplatform*.sh / -# COPY vfxplatform.spec / -# CMD [ "bash", "./build_vfxplatform.sh" ] +COPY build_vfxplatform.sh /root/ +COPY build_vfxplatform_sdk01.sh /root/ +COPY build_vfxplatform_sdk02.sh /root/ +COPY build_vfxplatform_sdk03.sh /root/ +COPY build_vfxplatform_package.sh /root/ +COPY build_vfxplatform_friction.sh /root/ +CMD [ "bash", "./root/build_vfxplatform.sh" ] diff --git a/src/scripts/README.md b/src/scripts/README.md new file mode 100644 index 000000000..7c40279ac --- /dev/null +++ b/src/scripts/README.md @@ -0,0 +1,29 @@ +# Script and files + +Various scripts and files used to build and maintain Friction. + +**NOTES:** + +* Some scripts may assume you are running Ubuntu 22.04 +* Scripts in this folder must be run from the root Friction folder! (`./src/scripts/script.sh`) +* Never run `build_vfxplatform*.sh` or `build_docker.sh` outside of docker! + +## build_ci.sh + +Our main CI script. This script build and package Friction on Ubuntu 22.04. + +Can also be used to easily build and package Friction on other Ubuntu systems. + +## run_docker.sh + +Script used to build and package Friction for supported Ubuntu releases using docker. + +## run_vfxplatform.sh + +Script used to build the universal Linux binaries using docker. + +## make_hicolor.sh + +Script used to update the Friction icon theme. Must be run after new icons are added. + +**NOTE: `inkscape` must be in `PATH`** diff --git a/src/scripts/build_ci.sh b/src/scripts/build_ci.sh index 35a61cfd4..49a9b470f 100755 --- a/src/scripts/build_ci.sh +++ b/src/scripts/build_ci.sh @@ -34,6 +34,7 @@ git \ clang \ build-essential \ cmake \ +python3 \ ninja-build \ libfontconfig1-dev \ libfreetype-dev \ diff --git a/src/scripts/build_docker.sh b/src/scripts/build_docker.sh index c619294c9..a1a1aa824 100755 --- a/src/scripts/build_docker.sh +++ b/src/scripts/build_docker.sh @@ -21,29 +21,15 @@ # Deploy Friction on Ubuntu. set -e -x -g++ --version clang++ --version cmake --version -python --version +python3 --version qmake-qt5 --version || qmake --version env cat /etc/os-release -SNAP=${SNAP:-0} REL=${REL:-0} MKJOBS=${MKJOBS:-4} -CLANG=${CLANG:-1} - -if [ "${REL}" = 0 ] && [ "${SNAP}" = 0 ]; then - echo "REL or SNAP?" - exit 1 -fi - -if [ "${REL}" = 1 ]; then - SNAP=0 -elif [ "${SNAP}" = 1 ]; then - REL=0 -fi DISTRO_ID=`cat /etc/os-release | sed '/^ID=/!d;s/ID=//;s/"//g'` if [ "${DISTRO_ID}" != "ubuntu" ]; then @@ -59,7 +45,6 @@ FRICTION_DIR="${FRICTION_ROOT}/friction" FRICTION_SRC_DIR="${FRICTION_DIR}/src" FRICTION_OUT_DIR="/snapshots" -FRICTION_DIST="${FRICTION_OUT_DIR}/distfiles" FRICTION_BRANCH=${FRICTION_BRANCH:-""} FRICTION_COMMIT=${FRICTION_COMMIT:-""} FRICTION_TAG=${FRICTION_TAG:-""} @@ -75,29 +60,16 @@ elif [ "${FRICTION_TAG}" != "" ]; then FRICTION_COMMIT="" fi -GPERF_V="4df0b85" -SKIA_V="5ae542b872" - -SF_NET_SRC="https://sourceforge.net/projects/friction/files/source" - -COMPILER="" -if [ "${CLANG}" = 1 ]; then - #COMPILER="-clang" - export CC=clang - export CXX=clang++ -fi +export CC=clang +export CXX=clang++ if [ ! -d "${FRICTION_ROOT}" ]; then mkdir -p ${FRICTION_ROOT} fi -if [ ! -d "${FRICTION_DIST}" ]; then - mkdir -p ${FRICTION_DIST} -fi - if [ ! -d "${FRICTION_SRC_DIR}" ]; then cd ${FRICTION_ROOT} - git clone https://github.com/friction2d/friction + git clone --recurse-submodules https://github.com/friction2d/friction if [ "${FRICTION_BRANCH}" != "" ]; then (cd friction; git checkout ${FRICTION_BRANCH}) fi @@ -107,57 +79,7 @@ if [ ! -d "${FRICTION_SRC_DIR}" ]; then if [ "${FRICTION_TAG}" != "" ]; then (cd friction; git checkout tags/${FRICTION_TAG}) fi - (cd friction; git submodule update -i docs) -fi - -if [ ! -f "${FRICTION_SRC_DIR}/gperftools/.libs/libtcmalloc.a" ]; then - if [ ! -f "${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz" ]; then - curl -k -L "${SF_NET_SRC}/gperftools-${GPERF_V}.tar.xz/download" --output ${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz - fi - if [ -d "${FRICTION_SRC_DIR}/gperftools-${GPERF_V}" ]; then - rm -rf ${FRICTION_SRC_DIR}/gperftools-${GPERF_V} - fi - if [ -d "${FRICTION_SRC_DIR}/gperftools" ]; then - rm -rf ${FRICTION_SRC_DIR}/gperftools - fi - cd ${FRICTION_SRC_DIR} - tar xf ${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz - mv gperftools-${GPERF_V} gperftools - cd gperftools - if [ -f "${FRICTION_DIST}/gperftools-${GPERF_V}-build-${DID}${COMPILER}.tar.xz" ]; then - tar xf ${FRICTION_DIST}/gperftools-${GPERF_V}-build-${DID}${COMPILER}.tar.xz - else - ./autogen.sh - ./configure --disable-shared - make -j${MKJOBS} - tar cvvfJ ${FRICTION_DIST}/gperftools-${GPERF_V}-build-${DID}${COMPILER}.tar.xz . - fi -fi - -if [ ! -f "${FRICTION_SRC_DIR}/skia/out/build/libskia.a" ]; then - if [ ! -f "${FRICTION_DIST}/skia-${SKIA_V}.tar.xz" ]; then - curl -k -L "${SF_NET_SRC}/skia-${SKIA_V}.tar.xz/download" --output ${FRICTION_DIST}/skia-${SKIA_V}.tar.xz - fi - if [ -d "${FRICTION_SRC_DIR}/skia-${SKIA_V}" ]; then - rm -rf ${FRICTION_SRC_DIR}/skia-${SKIA_V} - fi - if [ -d "${FRICTION_SRC_DIR}/skia" ]; then - rm -rf ${FRICTION_SRC_DIR}/skia - fi - cd ${FRICTION_SRC_DIR} - tar xf ${FRICTION_DIST}/skia-${SKIA_V}.tar.xz - mv skia-${SKIA_V} skia - cd skia - if [ -f "${FRICTION_DIST}/skia-${SKIA_V}-build-${DID}${COMPILER}.tar.xz" ]; then - tar xf ${FRICTION_DIST}/skia-${SKIA_V}-build-${DID}${COMPILER}.tar.xz - else - if [ ! -f "bin/gn" ]; then - (cd bin ; python3 fetch-gn) - fi - bin/gn gen out/build --args='is_official_build=true is_debug=false cc="clang" cxx="clang++" extra_cflags=["-Wno-error"] target_os="linux" target_cpu="x64" skia_use_system_expat=true skia_use_system_freetype2=true skia_use_system_libjpeg_turbo=true skia_use_system_libpng=true skia_use_system_libwebp=true skia_use_system_zlib=true skia_use_system_icu=true skia_use_system_harfbuzz=true skia_use_dng_sdk=false' - ninja -C out/build -j${MKJOBS} skia - tar cvvfJ ${FRICTION_DIST}/skia-${SKIA_V}-build-${DID}${COMPILER}.tar.xz out - fi + #(cd friction; git submodule update -i docs) fi cd ${FRICTION_DIR} @@ -173,14 +95,11 @@ fi mkdir build cd build -CMAKE_EXTRA="-DUSE_SKIA_SYSTEM_LIBS=ON" -if [ "${CLANG}" = 1 ]; then - CMAKE_EXTRA="${CMAKE_EXTRA} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang" -fi +CMAKE_EXTRA="-DCMAKE_BUILD_TYPE=Release -DUSE_SKIA_SYSTEM_LIBS=ON" +CMAKE_EXTRA="${CMAKE_EXTRA} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang" if [ "${REL}" = 1 ]; then cmake -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ -DFRICTION_OFFICIAL_RELEASE=ON \ ${CMAKE_EXTRA} .. VERSION=`cat version.txt` @@ -188,7 +107,6 @@ else cmake -G Ninja \ -DGIT_COMMIT=${COMMIT} \ -DGIT_BRANCH=${BRANCH} \ - -DCMAKE_BUILD_TYPE=Release \ ${CMAKE_EXTRA} .. VERSION=`cat version.txt` VERSION="${VERSION}-dev-${COMMIT}" @@ -199,7 +117,7 @@ PKG_EXT="deb" cpack -G DEB OPKG="friction.${PKG_EXT}" -PKG="friction-${VERSION}-${DID}${COMPILER}.${PKG_EXT}" +PKG="friction-${VERSION}-${DID}.${PKG_EXT}" mv ${OPKG} ${PKG} FRICTION_PKG_DIR="${FRICTION_OUT_DIR}/${VERSION}" diff --git a/src/scripts/build_vfxplatform.sh b/src/scripts/build_vfxplatform.sh index b2b735865..e1d0e6e83 100755 --- a/src/scripts/build_vfxplatform.sh +++ b/src/scripts/build_vfxplatform.sh @@ -20,7 +20,6 @@ set -e -x -CWD=${CWD:-`pwd`} SDK=${SDK:-"/opt/friction"} DISTFILES=${DISTFILES:-"/mnt"} BUILD=${BUILD:-"${HOME}"} @@ -30,14 +29,34 @@ BRANCH=${BRANCH:-""} COMMIT=${COMMIT:-""} TAG=${TAG:-""} MKJOBS=${MKJOBS:-4} +SDK_VERSION=${SDK_VERSION:-""} +ONLY_SDK=${ONLY_SDK:-0} +SDK_TAR="${DISTFILES}/friction-vfxplatform-sdk-${SDK_VERSION}.tar" # Build SDK -# CWD=${CWD} SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${CWD}/build_vfxplatform_skia.sh -# CWD=${CWD} SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${CWD}/build_vfxplatform_sdk.sh -# CWD=${CWD} SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${CWD}/build_vfxplatform_ffmpeg.sh +if [ ! -d "${SDK}" ]; then + mkdir -p "${SDK}/lib" + mkdir -p "${SDK}/bin" + (cd "${SDK}"; ln -sf lib lib64) +fi +if [ -f "${SDK_TAR}.xz" ]; then +(cd ${SDK}/.. ; tar xf ${SDK_TAR}.xz ) +else +SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${BUILD}/build_vfxplatform_sdk01.sh +SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${BUILD}/build_vfxplatform_sdk02.sh +SDK=${SDK} DISTFILES=${DISTFILES} MKJOBS=${MKJOBS} ${BUILD}/build_vfxplatform_sdk03.sh +(cd ${SDK}/.. ; + rm -rf friction/src + tar cvvf ${SDK_TAR} friction + xz -9 ${SDK_TAR} +) +fi + +if [ "${ONLY_SDK}" = 1 ]; then + exit 0 +fi # Build Friction -CWD=${CWD} \ SDK=${SDK} \ BUILD=${BUILD} \ MKJOBS=${MKJOBS} \ @@ -45,7 +64,7 @@ REL=${REL} \ BRANCH=${BRANCH} \ COMMIT=${COMMIT} \ TAG=${TAG} \ -${CWD}/build_vfxplatform_friction.sh +${BUILD}/build_vfxplatform_friction.sh # Get Friction version VERSION=`cat ${BUILD}/friction/build-vfxplatform/version.txt` @@ -55,9 +74,8 @@ if [ "${REL}" != 1 ]; then fi # Package Friction -CWD=${CWD} \ SDK=${SDK} \ DISTFILES=${DISTFILES} \ BUILD=${BUILD} \ VERSION=${VERSION} \ -${CWD}/build_vfxplatform_package_tar.sh +${BUILD}/build_vfxplatform_package.sh diff --git a/src/scripts/build_vfxplatform_friction.sh b/src/scripts/build_vfxplatform_friction.sh old mode 100644 new mode 100755 index 1f816f0bb..98c962458 --- a/src/scripts/build_vfxplatform_friction.sh +++ b/src/scripts/build_vfxplatform_friction.sh @@ -23,7 +23,6 @@ set -e -x source /opt/rh/llvm-toolset-7.0/enable clang -v -CWD=${CWD:-`pwd`} SDK=${SDK:-"/opt/friction"} BUILD=${BUILD:-"${HOME}"} @@ -59,22 +58,12 @@ if [ ! -d "${BUILD}/friction" ]; then git clone https://github.com/friction2d/friction cd friction git checkout ${CHECKOUT} - git submodule update -i --recursive docs + git submodule update -i --recursive ) fi cd ${BUILD}/friction -if [ ! -d "src/skia/out" ]; then - mv src/skia src/skia.orig - ln -sf ${SDK}/skia src/skia -fi - -if [ ! -d "src/gperftools/.libs" ]; then - mv src/gperftools src/gperftools.orig - ln -sf ${SDK}/gperftools src/gperftools -fi - rm -rf build-vfxplatform || true mkdir build-vfxplatform && cd build-vfxplatform @@ -83,11 +72,16 @@ if [ "${REL}" != 1 ]; then REL_STATUS="OFF" fi +# workaround for gperftools (until I fix it) +cp -a ${SDK}/include/libunw* /usr/include/ +cp -a ${SDK}/lib/libunw* /usr/lib64/ + cmake -GNinja \ -DCMAKE_INSTALL_PREFIX=${SDK} \ -DCMAKE_PREFIX_PATH=${SDK} \ -DCMAKE_BUILD_TYPE=Release \ -DLINUX_DEPLOY=ON \ +-DUSE_SKIA_SYSTEM_LIBS=OFF \ -DFRICTION_OFFICIAL_RELEASE=${REL_STATUS} \ -DQSCINTILLA_INCLUDE_DIRS=${SDK}/include \ -DQSCINTILLA_LIBRARIES_DIRS=${SDK}/lib \ diff --git a/src/scripts/build_vfxplatform_package_tar.sh b/src/scripts/build_vfxplatform_package.sh old mode 100644 new mode 100755 similarity index 96% rename from src/scripts/build_vfxplatform_package_tar.sh rename to src/scripts/build_vfxplatform_package.sh index 48d9634e4..fe30f884a --- a/src/scripts/build_vfxplatform_package_tar.sh +++ b/src/scripts/build_vfxplatform_package.sh @@ -20,7 +20,6 @@ set -e -x -CWD=${CWD:-`pwd`} SDK=${SDK:-"/opt/friction"} DISTFILES=${DISTFILES:-"/mnt"} BUILD=${BUILD:-"${HOME}"} @@ -39,6 +38,10 @@ if [ ! -d "${BUILD}/${FRICTION_PKG}" ]; then exit 1 fi +if [ ! -d "${DISTFILES}/builds" ]; then + mkdir -p ${DISTFILES}/builds +fi + export PATH="${SDK}/bin:${PATH}" export PKG_CONFIG_PATH="${SDK}/lib/pkgconfig" export LD_LIBRARY_PATH="${SDK}/lib:${LD_LIBRARY_PATH}" @@ -141,6 +144,7 @@ cat ${BUILD}/friction/src/scripts/vfxplatform.spec | sed 's/__FRICTION_PKG_VERSI # RPM rpmbuild -bb rpm.spec +cp -a ${HOME}/rpmbuild/RPMS/*/*.rpm ${DISTFILES}/builds/ # Portable FRICTION_PORTABLE=${FRICTION_PKG}-linux-X11-x86_64 @@ -180,6 +184,7 @@ done cd ${BUILD} tar cvf ${FRICTION_PORTABLE}.tar ${FRICTION_PORTABLE} xz -9 ${FRICTION_PORTABLE}.tar +cp -a ${FRICTION_PORTABLE}.tar.xz ${DISTFILES}/builds/ # AppImage (cd ${FRICTION_PORTABLE_DIR} ; @@ -193,5 +198,6 @@ ln -sf usr/share/icons/hicolor/256x256/apps/${APPID}.png .DirIcon ) tar xf ${DISTFILES}/appimagetool.tar.xz ARCH=x86_64 ./appimagetool/AppRun ${FRICTION_PORTABLE} +cp -a *.AppImage ${DISTFILES}/builds/ echo "PKG DONE" diff --git a/src/scripts/build_vfxplatform_skia.sh b/src/scripts/build_vfxplatform_sdk01.sh old mode 100644 new mode 100755 similarity index 56% rename from src/scripts/build_vfxplatform_skia.sh rename to src/scripts/build_vfxplatform_sdk01.sh index d8bbd8bb1..839f7181e --- a/src/scripts/build_vfxplatform_skia.sh +++ b/src/scripts/build_vfxplatform_sdk01.sh @@ -23,26 +23,25 @@ set -e -x source /opt/rh/llvm-toolset-7.0/enable clang -v -CWD=`pwd` SDK=${SDK:-"/opt/friction"} SRC=${SDK}/src DIST=${DIST:-"/mnt"} JOBS=${JOBS:-4} NINJA_V=1.11.1 -GN_V=82d673ac +#GN_V=82d673ac UNWIND_V=1.4.0 -GPERF_V=4df0b85 -SKIA_V=4c434dbee3 +#GPERF_V=4df0b85 +#SKIA_V=4c434dbee3 NINJA_BIN=${SDK}/bin/ninja -GN_BIN=${SDK}/bin/gn +#GN_BIN=${SDK}/bin/gn -GPERF_DIR=${SDK}/gperftools -GPERF_LIB=${GPERF_DIR}/.libs/libtcmalloc.a +#GPERF_DIR=${SDK}/gperftools +#GPERF_LIB=${GPERF_DIR}/.libs/libtcmalloc.a -SKIA_DIR=${SDK}/skia -SKIA_LIB=${SKIA_DIR}/out/build/libskia.a +#SKIA_DIR=${SDK}/skia +#SKIA_LIB=${SKIA_DIR}/out/build/libskia.a STATIC_CFLAGS="-fPIC" DEFAULT_CFLAGS="-I${SDK}/include" @@ -78,29 +77,29 @@ if [ ! -f "${NINJA_BIN}" ]; then fi # ninja # gn -if [ ! -f "${GN_BIN}" ]; then - cd ${SRC} - GN_SRC=gn-${GN_V} - rm -rf ${GN_SRC} || true - tar xf ${DIST}/${GN_SRC}.tar.xz - cd ${GN_SRC} - python build/gen.py - ${NINJA_BIN} -C out - cp -a out/gn ${GN_BIN} -fi # gn +# if [ ! -f "${GN_BIN}" ]; then +# cd ${SRC} +# GN_SRC=gn-${GN_V} +# rm -rf ${GN_SRC} || true +# tar xf ${DIST}/${GN_SRC}.tar.xz +# cd ${GN_SRC} +# python build/gen.py +# ${NINJA_BIN} -C out +# cp -a out/gn ${GN_BIN} +# fi # gn # skia -if [ ! -f "${SKIA_LIB}" ]; then - cd ${SRC} - SKIA_SRC=skia-${SKIA_V} - rm -rf ${SKIA_SRC} || true - rm -rf ${SKIA_DIR} || true - tar xf ${DIST}/${SKIA_SRC}.tar.xz - mv ${SKIA_SRC} ${SKIA_DIR} - cd ${SKIA_DIR} - ${GN_BIN} gen out/build --args='is_official_build=true is_debug=false cc="clang" cxx="clang++" extra_cflags=["-Wno-error"] target_os="linux" target_cpu="x64" skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_system_harfbuzz=false skia_use_dng_sdk=false' - ${NINJA_BIN} -C out/build -j${JOBS} skia -fi # skia +# if [ ! -f "${SKIA_LIB}" ]; then +# cd ${SRC} +# SKIA_SRC=skia-${SKIA_V} +# rm -rf ${SKIA_SRC} || true +# rm -rf ${SKIA_DIR} || true +# tar xf ${DIST}/${SKIA_SRC}.tar.xz +# mv ${SKIA_SRC} ${SKIA_DIR} +# cd ${SKIA_DIR} +# ${GN_BIN} gen out/build --args='is_official_build=true is_debug=false cc="clang" cxx="clang++" extra_cflags=["-Wno-error"] target_os="linux" target_cpu="x64" skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false skia_use_system_icu=false skia_use_system_harfbuzz=false skia_use_dng_sdk=false' +# ${NINJA_BIN} -C out/build -j${JOBS} skia +# fi # skia # libunwind if [ ! -f "${SDK}/lib/pkgconfig/libunwind.pc" ]; then @@ -115,21 +114,21 @@ if [ ! -f "${SDK}/lib/pkgconfig/libunwind.pc" ]; then fi # libunwind # gperftools -if [ ! -f "${GPERF_LIB}" ]; then - cd ${SRC} - GPERF_SRC=gperftools-${GPERF_V} - rm -rf ${GPERF_SRC} || true - rm -rf ${GPERF_DIR} || true - tar xf ${DIST}/${GPERF_SRC}.tar.xz - mv ${GPERF_SRC} ${GPERF_DIR} - cd ${GPERF_DIR} - ./autogen.sh - CC=clang CXX=clang++ \ - CFLAGS="${DEFAULT_CFLAGS}" \ - CXXFLAGS="${DEFAULT_CFLAGS}" \ - LDFLAGS="${DEFAULT_LDFLAGS} -lunwind" \ - ./configure ${STATIC_CONFIGURE} --enable-libunwind - make -j${JOBS} -fi # gperftools +# if [ ! -f "${GPERF_LIB}" ]; then +# cd ${SRC} +# GPERF_SRC=gperftools-${GPERF_V} +# rm -rf ${GPERF_SRC} || true +# rm -rf ${GPERF_DIR} || true +# tar xf ${DIST}/${GPERF_SRC}.tar.xz +# mv ${GPERF_SRC} ${GPERF_DIR} +# cd ${GPERF_DIR} +# ./autogen.sh +# CC=clang CXX=clang++ \ +# CFLAGS="${DEFAULT_CFLAGS}" \ +# CXXFLAGS="${DEFAULT_CFLAGS}" \ +# LDFLAGS="${DEFAULT_LDFLAGS} -lunwind" \ +# ./configure ${STATIC_CONFIGURE} --enable-libunwind +# make -j${JOBS} +# fi # gperftools echo "SDK PART 1 DONE" diff --git a/src/scripts/build_vfxplatform_sdk.sh b/src/scripts/build_vfxplatform_sdk02.sh old mode 100644 new mode 100755 similarity index 93% rename from src/scripts/build_vfxplatform_sdk.sh rename to src/scripts/build_vfxplatform_sdk02.sh index 48ec58d02..f1ba8955f --- a/src/scripts/build_vfxplatform_sdk.sh +++ b/src/scripts/build_vfxplatform_sdk02.sh @@ -23,14 +23,13 @@ set -e -x source /opt/rh/devtoolset-7/enable gcc -v -CWD=`pwd` SDK=${SDK:-"/opt/friction"} SRC=${SDK}/src DIST=${DIST:-"/mnt"} JOBS=${JOBS:-4} XKBCOMMON_V=0.7.1 -QT_V=5.12.12 +QT_V=5.15.12 #5.12.12 QSCINTILLA_V=2.14.1 PELF_V=0.17.0 CMAKE_V=3.26.3 @@ -102,13 +101,14 @@ fi # libxkbcommon if [ ! -f "${QMAKE_BIN}" ]; then cd ${SRC} QT_SRC="qt-everywhere-src-${QT_V}" + QT_TAR_SRC="qt-everywhere-opensource-src-${QT_V}" rm -rf ${QT_SRC} || true - tar xf ${DIST}/${QT_SRC}.tar.xz + tar xf ${DIST}/${QT_TAR_SRC}.tar.xz cd ${QT_SRC} - (cd qtbase ; patch -p1 < ${DIST}/hidpi.patch) + #(cd qtbase ; patch -p1 < ${DIST}/hidpi.patch) ./configure \ -prefix ${SDK} \ - -c++std c++11 \ + -c++std c++17 \ -qtlibinfix Friction \ -opengl desktop \ -release \ @@ -122,7 +122,11 @@ if [ ! -f "${QMAKE_BIN}" ]; then -system-freetype \ -qt-pcre \ -qt-zlib \ - -qt-xcb \ + -xkbcommon \ + -xcb \ + -xcb-xlib \ + -qpa xcb \ + -bundled-xcb-xinput \ -qt-libpng \ -no-mtdev \ -no-syslog \ @@ -167,8 +171,10 @@ if [ ! -f "${QMAKE_BIN}" ]; then -skip qtgamepad \ -skip qtgraphicaleffects \ -skip qtlocation \ + -skip qtlottie \ -skip qtnetworkauth \ -skip qtpurchasing \ + -skip qtquick3d \ -skip qtquickcontrols \ -skip qtquickcontrols2 \ -skip qtremoteobjects \ @@ -206,4 +212,4 @@ if [ ! -f "${SDK}/lib/libqscintilla2_friction_qt5.so" ]; then cp -a Qsci ${SDK}/include/ fi # qscintilla -echo "SDK DONE" +echo "SDK PART 2 DONE" diff --git a/src/scripts/build_vfxplatform_ffmpeg.sh b/src/scripts/build_vfxplatform_sdk03.sh old mode 100644 new mode 100755 similarity index 99% rename from src/scripts/build_vfxplatform_ffmpeg.sh rename to src/scripts/build_vfxplatform_sdk03.sh index e734080a0..ab14c26f2 --- a/src/scripts/build_vfxplatform_ffmpeg.sh +++ b/src/scripts/build_vfxplatform_sdk03.sh @@ -23,7 +23,6 @@ set -e -x source /opt/rh/devtoolset-7/enable gcc -v -CWD=`pwd` SDK=${SDK:-"/opt/friction"} SRC=${SDK}/src DIST=${DIST:-"/mnt/mxe/pkg"} @@ -318,4 +317,4 @@ if [ ! -f "${SDK}/lib/pkgconfig/libavcodec.pc" ]; then make install fi # ffmpeg -echo "FFMPEG DONE" +echo "SDK PART 3 DONE" diff --git a/src/scripts/git-backup.sh b/src/scripts/git-backup.sh new file mode 100644 index 000000000..13a6ef193 --- /dev/null +++ b/src/scripts/git-backup.sh @@ -0,0 +1,23 @@ +#!/bin/bash +set -e -x + +CWD=`pwd` +DIR=${CWD}/backup +DATE=`date +%s` +URL=https://github.com/friction2d +BACKUP_DIR=${DIR}/friction-git-backup-${DATE} +REPOS=" +friction +friction2d.github.io +skia +gperftools +sfntly +friction-shader-plugins +mxe +" + +mkdir -p ${BACKUP_DIR} +cd ${BACKUP_DIR} +for repo in ${REPOS}; do + git clone --mirror ${URL}/${repo}.git +done diff --git a/src/scripts/run_docker.sh b/src/scripts/run_docker.sh index 1bae743e9..97750e9c1 100755 --- a/src/scripts/run_docker.sh +++ b/src/scripts/run_docker.sh @@ -22,29 +22,20 @@ set -e -x CWD=`pwd` -REL=${REL:-1} -SNAP=${SNAP:-0} +REL=${REL:-0} BRANCH=${BRANCH:-""} COMMIT=${COMMIT:-""} TAG=${TAG:-""} MKJOBS=${JOBS:-4} -CLANG=${CLANG:-1} JAMMY=${JAMMY:-1} -LUNAR=${LUNAR:-1} MANTIC=${MANTIC:-1} - -if [ "${SNAP}" = 1 ]; then - REL=0 -elif [ "${REL}" = 1 ]; then - SNAP=0 -fi +NOBLE=${NOBLE:-1} MOUNT_DIR="snapshots" -SF_NET_SRC="https://sourceforge.net/projects/friction/files/source" - DOCKER_MOUNT="-t --mount type=bind,source=${CWD}/${MOUNT_DIR},target=/${MOUNT_DIR}" -DOCKER="docker run -e REL=${REL} -e SNAP=${SNAP} -e MKJOBS=${JOBS} -e CLANG=${CLANG}" +DOCKER="docker run -e REL=${REL} -e MKJOBS=${JOBS}" + if [ "${BRANCH}" != "" ]; then DOCKER="${DOCKER} -e FRICTION_BRANCH=${BRANCH}" fi @@ -56,28 +47,15 @@ if [ "${TAG}" != "" ]; then fi DOCKER="${DOCKER} ${DOCKER_MOUNT}" -FRICTION_DIST="${CWD}/snapshots/distfiles" - -GPERF_V="4df0b85" -SKIA_V="5ae542b872" - -if [ ! -d "${FRICTION_DIST}" ]; then - mkdir -p ${FRICTION_DIST} -fi - -if [ ! -f "${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz" ]; then - curl -k -L "${SF_NET_SRC}/gperftools-${GPERF_V}.tar.xz/download" --output ${FRICTION_DIST}/gperftools-${GPERF_V}.tar.xz -fi -if [ ! -f "${FRICTION_DIST}/skia-${SKIA_V}.tar.xz" ]; then - curl -k -L "${SF_NET_SRC}/skia-${SKIA_V}.tar.xz/download" --output ${FRICTION_DIST}/skia-${SKIA_V}.tar.xz -fi - if [ "${JAMMY}" = 1 ]; then + (cd ${CWD}/src/scripts; docker build -t friction-jammy -f Dockerfile.jammy .) $DOCKER friction-jammy fi -if [ "${LUNAR}" = 1 ]; then - $DOCKER friction-lunar -fi if [ "${MANTIC}" = 1 ]; then + (cd ${CWD}/src/scripts; docker build -t friction-mantic -f Dockerfile.mantic .) $DOCKER friction-mantic fi +if [ "${NOBLE}" = 1 ]; then + (cd ${CWD}/src/scripts; docker build -t friction-noble -f Dockerfile.noble .) + $DOCKER friction-noble +fi diff --git a/src/scripts/run_vfxplatform.sh b/src/scripts/run_vfxplatform.sh old mode 100644 new mode 100755 index 3c77ebc5f..bfe4dc2ae --- a/src/scripts/run_vfxplatform.sh +++ b/src/scripts/run_vfxplatform.sh @@ -1,4 +1,25 @@ #!/bin/bash +set -e -x + CWD=`pwd` -docker run -it --mount type=bind,source=${CWD}/snapshots/distfiles,target=/mnt friction-vfxplatform +REL=${REL:-0} +BRANCH=${BRANCH:-""} +COMMIT=${COMMIT:-""} +TAG=${TAG:-""} +MKJOBS=${JOBS:-4} +ONLY_SDK=${ONLY_SDK:-0} + +SDK_VERSION="20240123" + +DOCKER="docker run" +DOCKER="${DOCKER} -e REL=${REL} -e MKJOBS=${JOBS} -e SDK_VERSION=${SDK_VERSION} -e ONLY_SDK=${ONLY_SDK} -e BRANCH=${BRANCH} -e COMMIT=${COMMIT} -e TAG=${TAG}" +DOCKER="${DOCKER} -t --mount type=bind,source=${CWD}/distfiles,target=/mnt" + +if [ ! -d "${CWD}/distfiles" ]; then + echo "No distfiles!" + exit 1 +fi + +(cd src/scripts; docker build -t friction-vfxplatform -f Dockerfile.vfxplatform .) +${DOCKER} friction-vfxplatform diff --git a/src/scripts/vfxplatform.spec b/src/scripts/vfxplatform.spec index 2d762b4dc..86d95bc75 100644 --- a/src/scripts/vfxplatform.spec +++ b/src/scripts/vfxplatform.spec @@ -1,7 +1,7 @@ Name: friction Version: __FRICTION_PKG_VERSION__ Release: 1 -Summary: Friction Motion Graphics +Summary: Motion graphics and animation Group: System Environment/Base License: GPL3 Source0: friction-__FRICTION_VERSION__.tar @@ -11,7 +11,7 @@ AutoReq: no %global __provides_exclude_from /opt %description -Friction is a powerful and versatile free and open-source motion graphics application that allows you to create stunning vector and raster animations for web and video platforms with ease. +Powerful and versatile motion graphics and animation application that allows you to create stunning vector and raster animations for web and video platforms with ease. %prep %setup -n friction-__FRICTION_VERSION__