commit: init at 4.1

seth 32398b6f cd7ec241

+105
+30
pkgs/by-name/co/commit/command-from-path.patch
···
··· 1 + diff --git a/src/welcome.js b/src/welcome.js 2 + index 27cc7dc..c6772c3 100644 3 + --- a/src/welcome.js 4 + +++ b/src/welcome.js 5 + @@ -55,24 +55,7 @@ export default function Welcome({ application }) { 6 + } 7 + 8 + function getCommand() { 9 + - const FLATPAK_ID = GLib.getenv("FLATPAK_ID"); 10 + - 11 + - if (FLATPAK_ID) { 12 + - return `flatpak run ${FLATPAK_ID}`; 13 + - } 14 + - 15 + - const { programInvocationName } = system; 16 + - // re.sonny.Commit 17 + - if (programInvocationName === GLib.path_get_basename(programInvocationName)) { 18 + - return programInvocationName; 19 + - } 20 + - 21 + - // ./re.sonny.commit 22 + - // /home/sonny/re.sonny.Commit 23 + - return GLib.canonicalize_filename( 24 + - programInvocationName, 25 + - GLib.get_current_dir(), 26 + - ); 27 + + return "re.sonny.Commit"; 28 + } 29 + 30 + function getRange(key) {
+75
pkgs/by-name/co/commit/package.nix
···
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + appstream-glib, 6 + blueprint-compiler, 7 + desktop-file-utils, 8 + gjs, 9 + gtksourceview5, 10 + libadwaita, 11 + libspelling, 12 + meson, 13 + ninja, 14 + pkg-config, 15 + wrapGAppsHook4, 16 + nix-update-script, 17 + }: 18 + stdenv.mkDerivation rec { 19 + pname = "commit"; 20 + version = "4.1"; 21 + 22 + src = fetchFromGitHub { 23 + owner = "sonnyp"; 24 + repo = "Commit"; 25 + rev = "v${version}"; 26 + hash = "sha256-HhyoQ4wrc8dHvVU+MylJgaKu9HwSw+/f6UDTIM2YRNk="; 27 + fetchSubmodules = true; 28 + }; 29 + 30 + patches = [ 31 + # Instead of using the absolute path in command snippets, 32 + # assume `re.sonny.Commit` is already in PATH. This prevents 33 + # configurations from breaking when our store path changes 34 + ./command-from-path.patch 35 + ]; 36 + 37 + # gjs uses the invocation name to add gresource files 38 + # to get around this, we set the entry point name manually 39 + # 40 + # `/usr/bin/env` is also used quite a bit 41 + postPatch = '' 42 + sed -i "1 a imports.package._findEffectiveEntryPointName = () => 're.sonny.Commit';" src/bin.js 43 + patchShebangs {,.}* 44 + ''; 45 + 46 + nativeBuildInputs = [ 47 + appstream-glib 48 + blueprint-compiler 49 + desktop-file-utils 50 + meson 51 + ninja 52 + pkg-config 53 + wrapGAppsHook4 54 + ]; 55 + 56 + buildInputs = [ 57 + libadwaita 58 + libspelling 59 + gtksourceview5 60 + gjs 61 + ]; 62 + 63 + passthru = { 64 + updateScript = nix-update-script { }; 65 + }; 66 + 67 + meta = { 68 + description = "Commit message editor"; 69 + homepage = "https://github.com/sonnyp/Commit"; 70 + license = lib.licenses.gpl3Only; 71 + maintainers = with lib.maintainers; [ getchoo ]; 72 + mainProgram = "re.sonny.Commit"; 73 + platforms = lib.platforms.linux; 74 + }; 75 + }