tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
rtfm: init at 0.2.2
sunder
2 years ago
b90555ef
8613c713
+186
6 changed files
expand all
collapse all
unified
split
pkgs
applications
misc
rtfm
default.nix
patches
enable-write-permissions.patch
friendly-docs-path.patch
make.patch
shards.nix
top-level
all-packages.nix
+91
pkgs/applications/misc/rtfm/default.nix
···
1
1
+
{ stdenv
2
2
+
, lib
3
3
+
, fetchFromGitHub
4
4
+
, crystal
5
5
+
, wrapGAppsHook4
6
6
+
, gobject-introspection
7
7
+
, desktopToDarwinBundle
8
8
+
, webkitgtk_6_0
9
9
+
, sqlite
10
10
+
, gi-crystal
11
11
+
, libadwaita
12
12
+
, gtk4
13
13
+
, pango
14
14
+
}:
15
15
+
let
16
16
+
gtk4' = gtk4.override { x11Support = true; };
17
17
+
pango' = pango.override { withIntrospection = true; };
18
18
+
in
19
19
+
crystal.buildCrystalPackage rec {
20
20
+
pname = "rtfm";
21
21
+
version = "0.2.2";
22
22
+
23
23
+
src = fetchFromGitHub {
24
24
+
owner = "hugopl";
25
25
+
repo = "rtfm";
26
26
+
rev = "v${version}";
27
27
+
name = "rtfm";
28
28
+
hash = "sha256-SmQq3hG94oV346dHtqTHC0xE4cWB3rspD3XXu+mSI8Q=";
29
29
+
};
30
30
+
31
31
+
patches = [
32
32
+
# 1) fixed gi-crystal binding generator command
33
33
+
# 2) removed `-v` arg to `cp` command to prevent build failure due to stdout buffer overflow
34
34
+
# 3) added commands to build gschemas and update icon-cache
35
35
+
./patches/make.patch
36
36
+
37
37
+
# fixed docset path and gi libs directory names
38
38
+
./patches/friendly-docs-path.patch
39
39
+
40
40
+
# added chmod +w for copied docs to prevent error:
41
41
+
# `Error opening file with mode 'wb': '.../style.css': Permission denied`
42
42
+
./patches/enable-write-permissions.patch
43
43
+
];
44
44
+
45
45
+
postPatch = ''
46
46
+
substituteInPlace Makefile \
47
47
+
--replace "crystal run src/create_crystal_docset.cr" "crystal src/create_crystal_docset.cr ${crystal}/share/doc/crystal/api/" \
48
48
+
--replace "crystal run src/create_gtk_docset.cr" "crystal src/create_gtk_docset.cr gtk-doc/"
49
49
+
'';
50
50
+
51
51
+
shardsFile = ./shards.nix;
52
52
+
53
53
+
nativeBuildInputs = [
54
54
+
wrapGAppsHook4
55
55
+
gobject-introspection
56
56
+
gi-crystal
57
57
+
] ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
58
58
+
59
59
+
buildInputs = [
60
60
+
webkitgtk_6_0
61
61
+
sqlite
62
62
+
libadwaita
63
63
+
gtk4'
64
64
+
pango'
65
65
+
];
66
66
+
67
67
+
buildTargets = [ "configure" "rtfm" "docsets" ];
68
68
+
69
69
+
preBuild = ''
70
70
+
mkdir gtk-doc/
71
71
+
72
72
+
for file in "${gtk4'.devdoc}"/share/doc/*; do
73
73
+
ln -s "$file" "gtk-doc/$(basename "$file")"
74
74
+
done
75
75
+
76
76
+
for file in "${pango'.devdoc}"/share/doc/*; do
77
77
+
ln -s "$file" "gtk-doc/$(basename "$file")"
78
78
+
done
79
79
+
80
80
+
for file in "${libadwaita.devdoc}"/share/doc/*; do
81
81
+
ln -s "$file" "gtk-doc/$(basename "$file")"
82
82
+
done
83
83
+
'';
84
84
+
85
85
+
meta = with lib; {
86
86
+
description = "Dash/docset reader with built in documentation for Crystal and GTK APIs";
87
87
+
homepage = "https://github.com/hugopl/rtfm/";
88
88
+
license = licenses.mit;
89
89
+
maintainers = with maintainers; [ sund3RRR ];
90
90
+
};
91
91
+
}
+10
pkgs/applications/misc/rtfm/patches/enable-write-permissions.patch
···
1
1
+
--- a/src/doc2dash/doc_set_builder.cr 2023-07-19 14:00:06.864770147 +0300
2
2
+
+++ b/src/doc2dash/doc_set_builder.cr 2023-07-19 13:59:35.440707740 +0300
3
3
+
@@ -44,6 +44,7 @@
4
4
+
real_dest = @html_dest.join(dest || source)
5
5
+
Dir.mkdir_p(Path.new(real_dest).dirname)
6
6
+
File.copy(original, real_dest)
7
7
+
+ File.chmod(real_dest, 0o600)
8
8
+
dest || source
9
9
+
end
10
10
+
+11
pkgs/applications/misc/rtfm/patches/friendly-docs-path.patch
···
1
1
+
--- a/src/create_gtk_docset.cr 2023-07-17 14:28:04.882620660 +0300
2
2
+
+++ b/src/create_gtk_docset.cr 2023-07-17 14:27:09.660643747 +0300
3
3
+
@@ -136,7 +136,7 @@
4
4
+
end
5
5
+
6
6
+
def find_modules : Array(Path)
7
7
+
- basedir = Path.new("/usr/share/doc")
8
8
+
+ basedir = Path.new(ARGV[0]? || "gtk-docs")
9
9
+
MODULES.compact_map do |mod|
10
10
+
print "#{mod.ljust(20, '.')}"
11
11
+
mod_dir = basedir.join(mod)
+30
pkgs/applications/misc/rtfm/patches/make.patch
···
1
1
+
--- a/Makefile 2023-07-17 17:18:28.000000000 +0300
2
2
+
+++ b/Makefile 2023-07-19 12:13:44.627168135 +0300
3
3
+
@@ -4,8 +4,7 @@
4
4
+
all: configure .WAIT rtfm docsets
5
5
+
6
6
+
configure:
7
7
+
- shards install
8
8
+
- ./bin/gi-crystal
9
9
+
+ gi-crystal
10
10
+
11
11
+
rtfm:
12
12
+
shards build --release -s rtfm
13
13
+
@@ -29,13 +28,15 @@
14
14
+
install -D -m644 data/io.github.hugopl.rtfm.gschema.xml $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas/io.github.hugopl.rtfm.gschema.xml
15
15
+
# docsets
16
16
+
mkdir -p $(DESTDIR)$(PREFIX)/share/rtfm/docsets/
17
17
+
- cp -rv data/Crystal.docset $(DESTDIR)$(PREFIX)/share/rtfm/docsets/
18
18
+
- cp -rv data/Gtk4.docset $(DESTDIR)$(PREFIX)/share/rtfm/docsets/
19
19
+
+ cp -r data/Crystal.docset $(DESTDIR)$(PREFIX)/share/rtfm/docsets/
20
20
+
+ cp -r data/Gtk4.docset $(DESTDIR)$(PREFIX)/share/rtfm/docsets/
21
21
+
# License
22
22
+
install -D -m0644 LICENSE $(DESTDIR)$(PREFIX)/share/licenses/rtfm/LICENSE
23
23
+
# Changelog
24
24
+
install -D -m0644 CHANGELOG.md $(DESTDIR)$(PREFIX)/share/doc/rtfm/CHANGELOG.md
25
25
+
gzip -9fn $(DESTDIR)$(PREFIX)/share/doc/rtfm/CHANGELOG.md
26
26
+
+ gtk4-update-icon-cache --ignore-theme-index $(PREFIX)/share/icons/hicolor
27
27
+
+ glib-compile-schemas $(DESTDIR)$(PREFIX)/share/glib-2.0/schemas
28
28
+
29
29
+
uninstall:
30
30
+
rm -f $(DESTDIR)$(PREFIX)/bin/rtfm
+42
pkgs/applications/misc/rtfm/shards.nix
···
1
1
+
{
2
2
+
db = {
3
3
+
url = "https://github.com/crystal-lang/crystal-db.git";
4
4
+
rev = "v0.12.0";
5
5
+
sha256 = "1in8w2dz7nlhqgc9l6b3pi6f944m29nhbg3p5j40qzvsrr8lqaj7";
6
6
+
};
7
7
+
fzy = {
8
8
+
url = "https://github.com/hugopl/fzy.git";
9
9
+
rev = "v0.5.5";
10
10
+
sha256 = "1zk95m43ymx9ilwr6iw9l44nkmp4sas28ib0dkr07hkhgrkw68sv";
11
11
+
};
12
12
+
gio = {
13
13
+
url = "https://github.com/hugopl/gio.cr.git";
14
14
+
rev = "v0.1.0";
15
15
+
sha256 = "0vj35bi64d4hni18nrl8fmms306a0gl4zlxpf3aq08lh0sbwzhd8";
16
16
+
};
17
17
+
gtk4 = {
18
18
+
url = "https://github.com/hugopl/gtk4.cr.git";
19
19
+
rev = "v0.15.0";
20
20
+
sha256 = "100j5k4sfc2dpj3nplzjcaxw1bwy3hsy5cw93asg00kda9h8dbb1";
21
21
+
};
22
22
+
harfbuzz = {
23
23
+
url = "https://github.com/hugopl/harfbuzz.cr.git";
24
24
+
rev = "v0.2.0";
25
25
+
sha256 = "06wgqxwyib5416yp53j2iwcbr3bl4jjxb1flm7z103l365par694";
26
26
+
};
27
27
+
libadwaita = {
28
28
+
url = "https://github.com/geopjr/libadwaita.cr.git";
29
29
+
rev = "23ce21d6400af7563ede0b53deea6d1f77436985";
30
30
+
sha256 = "09jz6r0yp4qsm47qcknzgkjxavr5j3dkxf2yjbw0jkaz1an58pfw";
31
31
+
};
32
32
+
pango = {
33
33
+
url = "https://github.com/hugopl/pango.cr.git";
34
34
+
rev = "v0.2.0";
35
35
+
sha256 = "0dl3qrhi2ybylmvzx1x5gsznp2pcdkc50waxrljxwnf5avn8ixsf";
36
36
+
};
37
37
+
sqlite3 = {
38
38
+
url = "https://github.com/crystal-lang/crystal-sqlite3.git";
39
39
+
rev = "v0.20.0";
40
40
+
sha256 = "0mqy6rc26i0sf2fdllbbzdhbd1d35npmpqqjz0b1n1vrzrm6fg05";
41
41
+
};
42
42
+
}
+2
pkgs/top-level/all-packages.nix
···
34591
34591
rsync = callPackage ../applications/networking/sync/rsync (config.rsync or {});
34592
34592
rrsync = callPackage ../applications/networking/sync/rsync/rrsync.nix { };
34593
34593
34594
34594
+
rtfm = callPackage ../applications/misc/rtfm { };
34595
34595
+
34594
34596
rtl_433 = callPackage ../applications/radio/rtl_433 { };
34595
34597
34596
34598
rtl-ais = callPackage ../applications/radio/rtl-ais { };