mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-19 03:14:03 +00:00
Merge pull request #318705 from getchoo/pkgs/commit/init
commit: init at 4.1
This commit is contained in:
commit
d81e40ecea
30
pkgs/by-name/co/commit/command-from-path.patch
Normal file
30
pkgs/by-name/co/commit/command-from-path.patch
Normal file
@ -0,0 +1,30 @@
|
||||
diff --git a/src/welcome.js b/src/welcome.js
|
||||
index 27cc7dc..c6772c3 100644
|
||||
--- a/src/welcome.js
|
||||
+++ b/src/welcome.js
|
||||
@@ -55,24 +55,7 @@ export default function Welcome({ application }) {
|
||||
}
|
||||
|
||||
function getCommand() {
|
||||
- const FLATPAK_ID = GLib.getenv("FLATPAK_ID");
|
||||
-
|
||||
- if (FLATPAK_ID) {
|
||||
- return `flatpak run ${FLATPAK_ID}`;
|
||||
- }
|
||||
-
|
||||
- const { programInvocationName } = system;
|
||||
- // re.sonny.Commit
|
||||
- if (programInvocationName === GLib.path_get_basename(programInvocationName)) {
|
||||
- return programInvocationName;
|
||||
- }
|
||||
-
|
||||
- // ./re.sonny.commit
|
||||
- // /home/sonny/re.sonny.Commit
|
||||
- return GLib.canonicalize_filename(
|
||||
- programInvocationName,
|
||||
- GLib.get_current_dir(),
|
||||
- );
|
||||
+ return "re.sonny.Commit";
|
||||
}
|
||||
|
||||
function getRange(key) {
|
75
pkgs/by-name/co/commit/package.nix
Normal file
75
pkgs/by-name/co/commit/package.nix
Normal file
@ -0,0 +1,75 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
appstream-glib,
|
||||
blueprint-compiler,
|
||||
desktop-file-utils,
|
||||
gjs,
|
||||
gtksourceview5,
|
||||
libadwaita,
|
||||
libspelling,
|
||||
meson,
|
||||
ninja,
|
||||
pkg-config,
|
||||
wrapGAppsHook4,
|
||||
nix-update-script,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "commit";
|
||||
version = "4.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "sonnyp";
|
||||
repo = "Commit";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-HhyoQ4wrc8dHvVU+MylJgaKu9HwSw+/f6UDTIM2YRNk=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Instead of using the absolute path in command snippets,
|
||||
# assume `re.sonny.Commit` is already in PATH. This prevents
|
||||
# configurations from breaking when our store path changes
|
||||
./command-from-path.patch
|
||||
];
|
||||
|
||||
# gjs uses the invocation name to add gresource files
|
||||
# to get around this, we set the entry point name manually
|
||||
#
|
||||
# `/usr/bin/env` is also used quite a bit
|
||||
postPatch = ''
|
||||
sed -i "1 a imports.package._findEffectiveEntryPointName = () => 're.sonny.Commit';" src/bin.js
|
||||
patchShebangs {,.}*
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
appstream-glib
|
||||
blueprint-compiler
|
||||
desktop-file-utils
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
wrapGAppsHook4
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libadwaita
|
||||
libspelling
|
||||
gtksourceview5
|
||||
gjs
|
||||
];
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script { };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Commit message editor";
|
||||
homepage = "https://github.com/sonnyp/Commit";
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ getchoo ];
|
||||
mainProgram = "re.sonny.Commit";
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user