gf: unstable-2023-08-09 -> 0-unstable-2024-08-21; include extensions and add plugin support (#357435)

This commit is contained in:
kirillrdy 2024-11-29 06:16:26 +11:00 committed by GitHub
commit c39f3576f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,45 +1,58 @@
{ lib
, stdenv
, makeWrapper
, fetchFromGitHub
, libX11
, pkg-config
, gdb
, freetype
, freetypeSupport ? true
, extensions ? [ ]
{
lib,
stdenv,
makeWrapper,
fetchFromGitHub,
libX11,
pkg-config,
gdb,
freetype,
freetypeSupport ? true,
withExtensions ? true,
extraFlags ? "",
pluginsFile ? null,
}:
stdenv.mkDerivation {
pname = "gf";
version = "unstable-2023-08-09";
version = "0-unstable-2024-08-21";
src = fetchFromGitHub {
repo = "gf";
owner = "nakst";
rev = "4190211d63c1e5378a9e841d22fa2b96a1099e68";
hash = "sha256-28Xgw/KxwZ94r/TXsdISeUtXHSips4irB0D+tEefMYE=";
rev = "40f2ae604f3b94b7f818680ac53d4683c629bcf3";
hash = "sha256-Z8hW/GQjnnojoLeetrBlMnAJ9sP9ELv1lSQJjYPxtRc=";
};
nativeBuildInputs = [ makeWrapper pkg-config ];
buildInputs = [ libX11 gdb ]
++ lib.optional freetypeSupport freetype;
nativeBuildInputs = [
makeWrapper
pkg-config
];
buildInputs = [
libX11
gdb
] ++ lib.optional freetypeSupport freetype;
patches = [
./build-use-optional-freetype-with-pkg-config.patch
];
postPatch = lib.forEach extensions (ext: ''
cp ${ext} ./${ext.name or (builtins.baseNameOf ext)}
'');
postPatch = [
(lib.optionalString withExtensions ''
cp ./extensions_v5/extensions.cpp .
'')
(lib.optionalString (pluginsFile != null) ''
cp ${pluginsFile} ./plugins.cpp
'')
];
preConfigure = ''
patchShebangs build.sh
'';
preConfigure = ''
patchShebangs build.sh
'';
buildPhase = ''
runHook preBuild
extra_flags=-DUI_FREETYPE_SUBPIXEL ./build.sh
extra_flags="${extraFlags} -DUI_FREETYPE_SUBPIXEL" ./build.sh
runHook postBuild
'';
@ -51,7 +64,7 @@ stdenv.mkDerivation {
'';
postFixup = ''
wrapProgram $out/bin/gf2 --prefix PATH : ${lib.makeBinPath[ gdb ]}
wrapProgram $out/bin/gf2 --prefix PATH : ${lib.makeBinPath [ gdb ]}
'';
meta = with lib; {