rtfm: init at 0.2.2

sunder b90555ef 8613c713

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