From f167634b357bb205e3001797be83720dc6abaaa4 Mon Sep 17 00:00:00 2001 From: Daniel Glinka Date: Wed, 29 Jun 2022 07:47:23 -0400 Subject: [PATCH 1/2] maintainers: add 0xd61 --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index bff3019a09d2..ec8cec276644 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"; From 08af758396433af628747879dc4430176c48992a Mon Sep 17 00:00:00 2001 From: Daniel Glinka Date: Wed, 29 Jun 2022 07:47:53 -0400 Subject: [PATCH 2/2] gf: init at unstable-2022-06-22 --- ...se-optional-freetype-with-pkg-config.patch | 13 ++++ pkgs/development/tools/misc/gf/default.nix | 64 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 79 insertions(+) create mode 100644 pkgs/development/tools/misc/gf/build-use-optional-freetype-with-pkg-config.patch create mode 100644 pkgs/development/tools/misc/gf/default.nix 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 15eb8b69dfaf..15aab98e3da0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16660,6 +16660,8 @@ with pkgs; readline = readline81; }; + gf = callPackage ../development/tools/misc/gf { }; + java-language-server = callPackage ../development/tools/java/java-language-server { }; jhiccup = callPackage ../development/tools/java/jhiccup { };