friction-graphics: init at 1.0.0-rc.3

This commit is contained in:
Ben Lovell 2024-06-27 18:06:47 +02:00
parent 5e2f678782
commit 786876dc1e
4 changed files with 123 additions and 0 deletions

View file

@ -0,0 +1,14 @@
# Friction {#friction-graphics}
[Friction](https://friction.graphics/) is an open-source vector motion graphics application for creating animations for web and video platforms.
## Wayland support {#friction-graphics-wayland}
Upstream explicitly forces X11 (XCB) on Linux due to incomplete Wayland support (fullscreen does not work, some mouse interactions are broken).
This means the application runs under XWayland by default and does not respect compositor-level HiDPI scaling.
To enable native Wayland support, removing the forced X11 override:
```nix
friction-graphics.override { enableWayland = true; }
```

View file

@ -10,6 +10,7 @@ eclipse.section.md
elm.section.md
emacs.section.md
firefox.section.md
friction-graphics.section.md
fish.section.md
fuse.section.md
geant4.section.md

View file

@ -119,6 +119,12 @@
"ex-testEqualArrayOrMap-test-function-add-cowbell": [
"index.html#ex-testEqualArrayOrMap-test-function-add-cowbell"
],
"friction-graphics": [
"index.html#friction-graphics"
],
"friction-graphics-wayland": [
"index.html#friction-graphics-wayland"
],
"ghc-deprecation-policy": [
"index.html#ghc-deprecation-policy"
],

View file

@ -0,0 +1,102 @@
{
lib,
clangStdenv,
cmake,
expat,
fetchFromGitHub,
ffmpeg_4,
fontconfig,
freetype,
glib,
harfbuzzFull,
libGL,
libGLU,
libjpeg_turbo,
libpng,
libsForQt5,
libunwind,
libwebp,
ninja,
pcre2,
pkg-config,
python3,
libx11,
zlib,
enableWayland ? false,
}:
clangStdenv.mkDerivation rec {
pname = "friction";
version = "1.0.0-rc.3";
src = fetchFromGitHub {
owner = "friction2d";
repo = "friction";
rev = "v${version}";
hash = "sha256-JUDqjUhtYiDll7bTNmYCItT8eQHS5pV38OwqiTXKowM=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
ninja
pkg-config
python3
libsForQt5.wrapQtAppsHook
];
buildInputs = [
expat
ffmpeg_4
fontconfig
freetype
glib
harfbuzzFull
libGL
libGLU
libjpeg_turbo
libpng
libsForQt5.qscintilla
libsForQt5.qtbase
libsForQt5.qtdeclarative
libsForQt5.qtmultimedia
libsForQt5.qtwayland
libunwind
libwebp
pcre2
zlib
]
++ lib.optionals (!clangStdenv.hostPlatform.isDarwin) [
libx11
];
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DQSCINTILLA_INCLUDE_DIRS=${libsForQt5.qscintilla}/include"
"-DQSCINTILLA_LIBRARIES_DIRS=${libsForQt5.qscintilla}/lib/"
"-DQSCINTILLA_LIBRARIES=${
if clangStdenv.hostPlatform.isDarwin then "libqscintilla2.dylib" else "libqscintilla2.so"
}"
"-DCMAKE_INSTALL_RPATH=${lib.makeLibraryPath buildInputs}"
]
++ lib.optionals clangStdenv.hostPlatform.isDarwin [
"-DCMAKE_OSX_DEPLOYMENT_TARGET=12.7"
"-DMAC_DEPLOY=ON"
];
postPatch = ''
grep -rl 'hb' src/skia | xargs sed -Ei 's/(["<])(hb.*\.h)/\1harfbuzz\/\2/'
''
+ lib.optionalString enableWayland ''
sed -i '/qputenv("QT_QPA_PLATFORM", "xcb")/d' src/core/appsupport.cpp
'';
meta = {
description = "Vector motion graphics program";
longDescription = "Friction is a powerful and versatile motion graphics application that allows you to create stunning vector and raster animations for web and video platforms with ease.";
homepage = "https://friction.graphics/";
license = lib.licenses.gpl3;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ socksy ];
mainProgram = "friction";
};
}