debase: init at 2

debase: fix build on linux

authored by Jeremy Schlatter and committed by aleksana 162acc63 818dbe2f

+131
+31
pkgs/by-name/de/debase/ignore-vendored-libgit2.patch
···
··· 1 + diff --git a/Makefile b/Makefile 2 + index b0b682cb..513822d9 100644 3 + --- a/Makefile 4 + +++ b/Makefile 5 + @@ -58,17 +58,14 @@ endif 6 + 7 + INCDIRS = \ 8 + -isystem ./lib/ncurses/include \ 9 + - -iquote ./lib/libgit2/include \ 10 + -iquote ./src \ 11 + -iquote . 12 + 13 + LIBDIRS = \ 14 + - -L./lib/libgit2/build-$(PLATFORM) \ 15 + -L./lib/ncurses/build-$(PLATFORM) 16 + 17 + LIBS = \ 18 + -lgit2 \ 19 + - -lz \ 20 + -lpthread \ 21 + -lformw \ 22 + -lmenuw \ 23 + @@ -102,7 +99,7 @@ $(OBJS): | lib $(GITHASHHEADER) 24 + # Libs: execute make from `lib` directory 25 + .PHONY: lib 26 + lib: 27 + - $(MAKE) -C $@ 28 + + $(MAKE) -C $@ ncurses/$(BUILDROOT) 29 + 30 + # C rule 31 + $(BUILDDIR)/%.o: %.c
+96
pkgs/by-name/de/debase/package.nix
···
··· 1 + { 2 + darwin, 3 + fetchFromGitHub, 4 + fetchpatch, # Delete at next version bump. 5 + lib, 6 + libgit2, 7 + stdenv, 8 + }: 9 + 10 + stdenv.mkDerivation rec { 11 + pname = "debase"; 12 + # NOTE: When updating version, also update commit hash in prePatch. 13 + version = "2"; 14 + 15 + src = 16 + (fetchFromGitHub { 17 + owner = "toasterllc"; 18 + repo = "debase"; 19 + rev = "refs/tags/v${version}"; 20 + hash = "sha256-6AavH8Ag+879ntcxJDbVgsg8V6U4cxwPQYPKvq2PpoQ="; 21 + fetchSubmodules = true; 22 + }).overrideAttrs 23 + { 24 + # Workaround to fetch git@github.com submodules. 25 + # See https://github.com/NixOS/nixpkgs/issues/195117 26 + # 27 + # Already fixed in latest upstream, so delete at next version bump. 28 + GIT_CONFIG_COUNT = 1; 29 + GIT_CONFIG_KEY_0 = "url.https://github.com/.insteadOf"; 30 + GIT_CONFIG_VALUE_0 = "git@github.com:"; 31 + }; 32 + 33 + prePatch = '' 34 + # xcrun is not available in the Darwin stdenv, but we don't need it anyway. 35 + substituteInPlace Makefile \ 36 + --replace-fail 'xcrun dsymutil' dsymutil 37 + 38 + # NOTE: Update this when updating version. 39 + substituteInPlace Makefile \ 40 + --replace-fail 'git rev-parse HEAD' 'echo bbe9f1737ab229dd370640a4b5d5e742a051c13b' \ 41 + --replace-fail '$(GITHASHHEADER): .git/HEAD .git/index' '$(GITHASHHEADER):' 42 + ''; 43 + 44 + patches = [ 45 + # Ignore debase's vendored copy of libgit2 in favor of the nixpkgs version. 46 + ./ignore-vendored-libgit2.patch 47 + # Already fixed in latest upstream, so delete at next version bump. 48 + (fetchpatch { 49 + url = "https://github.com/toasterllc/debase/commit/d483c5ac016ac2ef3600e93ae4022cd9d7781c83.patch"; 50 + hash = "sha256-vVQMOEiLTd46+UknZm8Y197sjyK/kTK/M+9sRX9AssY="; 51 + }) 52 + ]; 53 + 54 + buildInputs = [ 55 + libgit2 56 + ] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk_11_0.frameworks.Foundation ]; 57 + 58 + installPhase = '' 59 + runHook preInstall 60 + install -Dm755 build-${if stdenv.isDarwin then "mac" else "linux"}/release/debase $out/bin/debase 61 + runHook postInstall 62 + ''; 63 + 64 + enableParallelBuilding = true; 65 + 66 + makeFlags = [ 67 + "ARCHS=${ 68 + if stdenv.isx86_64 then 69 + "x86_64" 70 + else if stdenv.isAarch64 then 71 + "arm64" 72 + else 73 + abort "unsupported system: ${stdenv.system}" 74 + }" 75 + ]; 76 + 77 + meta = { 78 + description = "TUI for drag-and-drop manipulation of git commits"; 79 + homepage = "https://toaster.llc/debase"; 80 + # The author has not yet specified a license. 81 + # See https://github.com/toasterllc/debase/pull/4 82 + license = lib.licenses.publicDomain; 83 + mainProgram = "debase"; 84 + maintainers = with lib.maintainers; [ 85 + jeremyschlatter 86 + aleksana 87 + ]; 88 + platforms = [ 89 + # Only these systems are supported by Makefile 90 + "x86_64-linux" 91 + "x86_64-darwin" 92 + "aarch64-linux" 93 + "aarch64-darwin" 94 + ]; 95 + }; 96 + }
+4
pkgs/top-level/all-packages.nix
··· 2217 2218 delta = darwin.apple_sdk_11_0.callPackage ../applications/version-management/delta { }; 2219 2220 diff-so-fancy = callPackage ../applications/version-management/diff-so-fancy { }; 2221 2222 gex = callPackage ../applications/version-management/gex {
··· 2217 2218 delta = darwin.apple_sdk_11_0.callPackage ../applications/version-management/delta { }; 2219 2220 + debase = callPackage ../by-name/de/debase/package.nix { 2221 + stdenv = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; 2222 + }; 2223 + 2224 diff-so-fancy = callPackage ../applications/version-management/diff-so-fancy { }; 2225 2226 gex = callPackage ../applications/version-management/gex {