From 786876dc1e45ee3771432d5f152029f8e24d08e4 Mon Sep 17 00:00:00 2001 From: Ben Lovell Date: Thu, 27 Jun 2024 18:06:47 +0200 Subject: [PATCH] friction-graphics: init at 1.0.0-rc.3 --- doc/packages/friction-graphics.section.md | 14 +++ doc/packages/index.md | 1 + doc/redirects.json | 6 ++ pkgs/by-name/fr/friction-graphics/package.nix | 102 ++++++++++++++++++ 4 files changed, 123 insertions(+) create mode 100644 doc/packages/friction-graphics.section.md create mode 100644 pkgs/by-name/fr/friction-graphics/package.nix diff --git a/doc/packages/friction-graphics.section.md b/doc/packages/friction-graphics.section.md new file mode 100644 index 000000000000..82ebbaf60e6c --- /dev/null +++ b/doc/packages/friction-graphics.section.md @@ -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; } +``` diff --git a/doc/packages/index.md b/doc/packages/index.md index 553b3d800193..45ef55f75a80 100644 --- a/doc/packages/index.md +++ b/doc/packages/index.md @@ -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 diff --git a/doc/redirects.json b/doc/redirects.json index 4fd8f57e75bb..253007c51710 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -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" ], diff --git a/pkgs/by-name/fr/friction-graphics/package.nix b/pkgs/by-name/fr/friction-graphics/package.nix new file mode 100644 index 000000000000..48992d94c809 --- /dev/null +++ b/pkgs/by-name/fr/friction-graphics/package.nix @@ -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"; + }; +}