diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index c54fcf2413fd..425310f56b66 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -85,6 +85,12 @@ githubId = 56617252; matrix = "@oxc45:matrix.org"; }; + _0xd61 = { + email = "dgl@degit.co"; + name = "Daniel Glinka"; + github = "0xd61"; + githubId = 8351869; + }; _1000101 = { email = "b1000101@pm.me"; github = "1000101"; diff --git a/pkgs/development/tools/misc/gf/build-use-optional-freetype-with-pkg-config.patch b/pkgs/development/tools/misc/gf/build-use-optional-freetype-with-pkg-config.patch new file mode 100644 index 000000000000..7e748dca244e --- /dev/null +++ b/pkgs/development/tools/misc/gf/build-use-optional-freetype-with-pkg-config.patch @@ -0,0 +1,13 @@ +diff --git a/build.sh b/build.sh +index e471563..32bdfab 100755 +--- a/build.sh ++++ b/build.sh +@@ -5,7 +5,7 @@ gdb --version > /dev/null 2>&1 || printf "\033[0;31mWarning\033[0m: GDB not dete + echo q | gdb | grep "(gdb)" > /dev/null 2>&1 || printf "\033[0;31mWarning\033[0m: Your copy of GDB appears to be non-standard or has been heavily reconfigured with .gdbinit.\nIf you are using GDB plugins like 'GDB Dashboard' you must remove them,\nas otherwise gf will be unable to communicate with GDB.\n" + + # Check if FreeType is available. +-if [ -d /usr/include/freetype2 ]; then extra_flags="$extra_flags -lfreetype -D UI_FREETYPE -I /usr/include/freetype2"; ++if pkg-config --cflags freetype2 > /dev/null; then extra_flags="$extra_flags -D UI_FREETYPE $(pkg-config --cflags --libs freetype2)"; + else printf "\033[0;31mWarning\033[0m: FreeType could not be found. The fallback font will be used.\n"; fi + + # Check if SSE2 is available. diff --git a/pkgs/development/tools/misc/gf/default.nix b/pkgs/development/tools/misc/gf/default.nix new file mode 100644 index 000000000000..f460b844ada0 --- /dev/null +++ b/pkgs/development/tools/misc/gf/default.nix @@ -0,0 +1,64 @@ +{ lib +, stdenv +, makeWrapper +, fetchFromGitHub +, libX11 +, pkg-config +, gdb +, freetype +, freetypeSupport ? true +, extensions ? [ ] +}: + +stdenv.mkDerivation rec { + pname = "gf"; + version = "unstable-2022-06-22"; + + src = fetchFromGitHub { + repo = "gf"; + owner = "nakst"; + rev = "e0d6d2f59344f853a4a204d5313db6b6a5e5de7d"; + sha256 = "01fln4wnn1caqr4wa1nhcp0rqdx5m5nqyn2amvclp5hhi3h3qaiq"; + }; + + 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)} + ''); + + preConfigure = '' + patchShebangs build.sh + ''; + + buildPhase = '' + runHook preBuild + extra_flags=-DUI_FREETYPE_SUBPIXEL ./build.sh + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + mkdir -p "$out/bin" + cp gf2 "$out/bin/" + runHook postInstall + ''; + + postFixup = '' + wrapProgram $out/bin/gf2 --prefix PATH : ${lib.makeBinPath[ gdb ]} + ''; + + meta = with lib; { + description = "A GDB Frontend"; + homepage = "https://github.com/nakst/gf"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ _0xd61 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cbd8dc18d7ea..ba1822b143f2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16740,6 +16740,8 @@ with pkgs; readline = readline81; }; + gf = callPackage ../development/tools/misc/gf { }; + java-language-server = callPackage ../development/tools/java/java-language-server { }; jprofiler = callPackage ../development/tools/java/jprofiler {