From 78a0e4dfadce7a5687f33d7d9ec930ca19856ca4 Mon Sep 17 00:00:00 2001 From: Savchenko Dmitriy Date: Mon, 26 May 2025 13:15:19 +0300 Subject: [PATCH] pencil2d: added ffmpeg dependency; fixed build Patched qmake files and source repository to correctly acquire Git information Added ffmpeg dependency --- pkgs/by-name/pe/pencil2d/git-inherit.patch | 13 +++++++++ pkgs/by-name/pe/pencil2d/package.nix | 32 ++++++++++++++++++++-- 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 pkgs/by-name/pe/pencil2d/git-inherit.patch diff --git a/pkgs/by-name/pe/pencil2d/git-inherit.patch b/pkgs/by-name/pe/pencil2d/git-inherit.patch new file mode 100644 index 000000000000..fae2a4a8376b --- /dev/null +++ b/pkgs/by-name/pe/pencil2d/git-inherit.patch @@ -0,0 +1,13 @@ +--- a/app/app.pro ++++ b/app/app.pro +@@ -208,8 +208,8 @@ + + GIT { + DEFINES += GIT_EXISTS \ +- "GIT_CURRENT_SHA1=$$system(git --git-dir=.git --work-tree=. -C $$_PRO_FILE_PWD_/../ rev-parse HEAD)" \ +- "GIT_TIMESTAMP=$$system(git --git-dir=.git --work-tree=. -C $$_PRO_FILE_PWD_/../ log -n 1 --pretty=format:"%cd" --date=format:"%Y-%m-%d_%H:%M:%S")" ++ "GIT_CURRENT_SHA1=$$cat($$_PRO_FILE_PWD_/../COMMIT)" \ ++ "GIT_TIMESTAMP=$$cat($$_PRO_FILE_PWD_/../SOURCE_TIMESTAMP_EPOCH)" + } + + macx { diff --git a/pkgs/by-name/pe/pencil2d/package.nix b/pkgs/by-name/pe/pencil2d/package.nix index 0cb6cbd4a433..653f2e21ca47 100644 --- a/pkgs/by-name/pe/pencil2d/package.nix +++ b/pkgs/by-name/pe/pencil2d/package.nix @@ -3,30 +3,56 @@ stdenv, fetchFromGitHub, qt5, + git, + ffmpeg_6, + nix-update-script, }: -stdenv.mkDerivation (FinalAttrs: { +stdenv.mkDerivation (finalAttrs: { pname = "pencil2d"; version = "0.7.0"; src = fetchFromGitHub { owner = "pencil2d"; repo = "pencil"; - tag = "v${FinalAttrs.version}"; - hash = "sha256-OuZpKgX2BgfuQdnjk/RTBww/blO1CIrYWr7KytqcIbQ="; + tag = "v${finalAttrs.version}"; + hash = "sha256-l+iW0k3WdNXDwXtt958JJWSe3zNhQVul4FUcPPMrVxE="; + leaveDotGit = true; + postFetch = '' + # Obtain the last commit ID and its timestamp, then zap .git for reproducibility + cd $out + git rev-parse HEAD > $out/COMMIT + # 0000-00-00T00:00:00Z + date -u -d "@$(git log -1 --pretty=%ct)" "+%Y-%m-%d_%H:%M:%S" > $out/SOURCE_TIMESTAMP_EPOCH + find "$out" -name .git -print0 | xargs -0 rm -rf + ''; }; + patches = [ ./git-inherit.patch ]; + nativeBuildInputs = with qt5; [ qmake wrapQtAppsHook qttools + git ]; + qmakeFlags = [ + "pencil2d.pro" + "CONFIG+=release" + "CONFIG+=PENCIL2D_RELEASE" + "CONFIG+=GIT" + "VERSION=${finalAttrs.version}" + ]; + + passthru.updateScript = nix-update-script { }; + buildInputs = with qt5; [ qtbase qtmultimedia qtsvg qtwayland + ffmpeg_6 ]; meta = {