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