diff --git a/pkgs/by-name/gf/gf/package.nix b/pkgs/by-name/gf/gf/package.nix index 4b7c40bf983d..7a3ce5677280 100644 --- a/pkgs/by-name/gf/gf/package.nix +++ b/pkgs/by-name/gf/gf/package.nix @@ -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; {