Commit 3c2df6b8 authored by Michael Murphy's avatar Michael Murphy
Browse files

Transition to Cargo workspaces & update dependencies

- The GTK frontend is now a workspace member
- The GTK application is now named fontfinder-gtk
- A Makefile has been added
parent 2b717e7b
This diff is collapsed.
[package]
authors = ["Michael Aaron Murphy <mmstickman@gmail.com>"]
name = "fontfinder"
description = "GTK3 Font Finding GUI Application"
description = "Font Finder Library"
license-file = "LICENSE"
readme = "README.md"
repository = "https://github.com/mmstick/fontfinder"
version = "1.3.2"
version = "1.4.0"
[[bin]]
name = "fontfinder"
path = "src/bin/mod.rs"
[workspace]
members = ["gtk"]
[dependencies]
horrorshow = "0.6.2"
itertools = "0.7.2"
lazy_static = "0.2"
failure = "0.1"
failure_derive = "0.1"
horrorshow = "0.6"
itertools = "0.7"
lazy_static = "1.0"
reqwest = "0.8"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
failure = "0.1"
failure_derive = "0.1"
gtk = { version = "0.2", features = ["v3_22"] }
gio = "0.2"
webkit2gtk = { version = "0.2", features = ["v2_16"] }
[lib]
path = "src/lib/mod.rs"
prefix ?= /usr/local
bindir = $(prefix)/bin
appdir = $(prefix)/share/applications
icondir = $(prefix)/share/icons/hicolor/scalable/apps
RELEASE=target/release/
GTK=fontfinder-gtk
DESKTOP=fontfinder.desktop
all: $(GTK)
$(GTK):
if [ -d vendor ]; then \
cargo build --release --frozen --manifest-path gtk/Cargo.toml; \
else \
cargo build --release --manifest-path gtk/Cargo.toml; \
fi
clean:
cargo clean
cargo clean --manifest-path gtk/Cargo.toml
distclean: clean
rm -rf .cargo vendor
install:
install -D $(RELEASE)$(GTK) $(DESTDIR)$(bindir)/$(GTK)
install -Dm644 assets/$(DESKTOP) $(DESTDIR)$(appdir)/$(DESKTOP)
uninstall:
rm $(DESTDIR)$(bindir)/$(GTK)
rm $(DESTDIR)$(appdir)/$(DESKTOP)
vendor: ./cargo/config
cargo vendor
touch vendor
......@@ -12,9 +12,15 @@ resource consumption.
## Installation Instructions
```
cargo install fontfinder
make && sudo make install
```
## Requirements
- cargo (Rust 1.24.0)
- libwebkit2gtk-4.0-dev
- libgtk-3-dev
## Screenshots
### Filtering w/ Search
......
......@@ -2,5 +2,5 @@
Type=Application
Name=Font Finder
Icon=typecatcher
Exec=fontfinder
Exec=fontfinder-gtk
Categories=Utility;
[package]
authors = ["Michael Aaron Murphy <mmstickman@gmail.com>"]
name = "fontfinder-gtk"
description = "GTK3 Font Finding GUI Application"
license-file = "LICENSE"
readme = "README.md"
repository = "https://github.com/mmstick/fontfinder"
version = "1.4.0"
[dependencies]
fontfinder = {path = ".." }
gio = "0.4"
gtk = { version = "0.4", features = ["v3_22"] }
webkit2gtk = { version = "0.4", features = ["v2_16"] }
use std::{
process::Command, sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT}, thread,
time::Duration,
};
use std::process::Command;
use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT};
use std::thread;
use std::time::Duration;
/// Used to signal the fc cache event loop to spawn an fc-cache process.
pub static RUN_FC_CACHE: AtomicBool = ATOMIC_BOOL_INIT;
......
......@@ -4,19 +4,17 @@ extern crate gtk;
extern crate webkit2gtk;
mod fc_cache;
mod gtk_ui;
mod ui;
use self::fc_cache::{fc_cache_event_loop, RUN_FC_CACHE};
use fontfinder::{
dirs, fonts::{self, FontsList}, html, FontError,
};
use fontfinder::{dirs, html, FontError};
use fontfinder::fonts::{self, FontsList};
use gtk::*;
use gtk_ui::{App, FontRow};
use std::{
path::Path, process, str, sync::{
atomic::{AtomicUsize, Ordering}, Arc,
},
};
use ui::{App, FontRow};
use std::path::Path;
use std::{process, str};
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use webkit2gtk::*;
fn main() {
......
use super::set_margin;
use fontfinder::fonts::Font;
use gtk::*;
use std::{cell::RefCell, rc::Rc};
use std::cell::RefCell;
use std::rc::Rc;
use webkit2gtk::*;
#[derive(Clone)]
......
mod header;
mod main;
pub use self::{
header::Header, main::{FontRow, Main},
};
pub use self::header::Header;
pub use self::main::{FontRow, Main};
use fontfinder::fonts::FontsList;
use gtk::*;
......@@ -25,7 +24,6 @@ impl App {
window.add(&main.container);
window.set_title("Font Finder");
window.set_default_size(600, 400);
window.set_wmclass("font-finder", "Font Finder");
window.connect_delete_event(move |_, _| {
main_quit();
......@@ -42,7 +40,7 @@ impl App {
pub fn set_margin<W: WidgetExt>(widget: &W, t: i32, r: i32, b: i32, l: i32) {
widget.set_margin_top(t);
widget.set_margin_right(r);
widget.set_margin_end(r);
widget.set_margin_bottom(b);
widget.set_margin_left(l);
widget.set_margin_start(l);
}
use std::{
env, fs::DirBuilder, io, path::{Path, PathBuf},
};
use std::env;
use std::fs::DirBuilder;
use std::io;
use std::path::{Path, PathBuf};
/// Recursively creates directories for a given path input.
pub fn recursively_create(dir: &Path) -> io::Result<()> {
......
use dirs;
use itertools::Itertools;
use reqwest::{self, Client};
use std::{
collections::HashMap, fs::{self, OpenOptions}, io::{self, Write},
};
use std::collections::HashMap;
use std::fs::{self, OpenOptions};
use std::io::{self, Write};
use FontError;
const API_KEY: &str = "AIzaSyDpvpba_5RvJSvmXEJS7gZDezDaMlVTo4c";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment