...
 
Commits (51)
......@@ -13,3 +13,4 @@ Session.vim
_build
**/#*#
**/tags.*
**/config.rs
......@@ -6,24 +6,20 @@ flatpak:
stage: test
script:
# Build the flatpak deps
- flatpak-builder --stop-at=trumpet app flatpak/org.gnome.Trumpet.json
# Force regeneration of gresources regardless of artifacts change
- flatpak-builder --run app flatpak/org.gnome.Trumpet.json glib-compile-resources --sourcedir=res/ res/resources.xml
- flatpak-builder --run app flatpak/org.gnome.Trumpet.json meson --prefix=/app --libdir=/app/lib _build
- flatpak-builder --run app flatpak/org.gnome.Trumpet.json ninja -C _build install
- flatpak-builder --finish-only app flatpak/org.gnome.Trumpet.json
- flatpak-builder --stop-at=gnome-social app flatpak/org.gnome.Social.json
- flatpak-builder --run app flatpak/org.gnome.Social.json meson -Dprofile=development --prefix=/app --libdir=/app/lib _build
- flatpak-builder --run app flatpak/org.gnome.Social.json ninja -C _build install
- flatpak-builder --finish-only app flatpak/org.gnome.Social.json
- flatpak build-export repo app
# Create a flatpak bundle for designers to use
- flatpak build-bundle repo trumpet-dev.flatpak org.gnome.Trumpet
- flatpak build-bundle repo gnome-social-dev.flatpak org.gnome.SocialDevel
# Run the tests
- flatpak-builder --run app flatpak/org.gnome.Trumpet.json cargo test
- flatpak-builder --run app flatpak/org.gnome.Social.json cargo test
artifacts:
paths:
- trumpet-dev.flatpak
- gnome-social-dev.flatpak
expire_in: 2 days
cache:
......@@ -32,4 +28,5 @@ flatpak:
key: "$CI_JOB_NAME"
paths:
- .flatpak-builder/cache/
- target
\ No newline at end of file
- target
This diff is collapsed.
[package]
name = "trumpet"
name = "social"
version = "0.1.0"
authors = ["Christopher Davis <brainblasted@disroot.org>"]
license = "GPL3"
edition = "2018"
[dependencies.gtk]
version = "0.5.0"
version = "0.7.0"
features = ["v3_22"]
[dependencies.gdk]
version = "0.9.0"
version = "0.11.0"
[dependencies.gio]
version = "0.5.0"
version = "0.7.0"
[dependencies.glib]
version = "0.6.0"
version = "0.8.0"
[dependencies]
serde = "1.0.70"
serde_derive = "1.0.70"
xdg = "2.0.1"
elefren = { git = "https://github.com/pwoolcoc/elefren.git", commit = "f12c0a4acb83722722520190913e4216d07d6603" }
elefren = "0.19.4"
reqwest = "0.9.2"
serde_json = "1.0.26"
html2pango = { git = "https://gitlab.gnome.org/World/html2pango.git", branch = "html5ever-parse" }
libhandy = { git = "https://gitlab.gnome.org/jsparber/libhandy-rs.git" }
html2pango = "0.3.1"
libhandy = { git = "https://gitlab.gnome.org/World/Rust/libhandy-rs.git" }
chrono = "0.4.4"
cairo-rs = "0.5.0"
cairo-rs = "0.7.0"
crossbeam = "0.5.0"
mdl = "1.0.3"
secret-service = "0.4.0"
\ No newline at end of file
secret-service = "0.4.0"
pango = "0.7.0"
# Trumpet
# Social
## What is Trumpet?
## What is Social?
Trumpet is a new WIP client for [Mastodon](https://mastodon.social/about/more).
Right now it can only be launched via CLI as the GTK+ gui using [gtk-rs](http://gtk-rs.org/) is
WIP.
Social is a new WIP client for [Mastodon](https://mastodon.social/about/more) and [Pleroma](https://pleroma.social/).
## Why Trumpet?
## Why Social?
When getting started with Mastodon, I found that the only usable application
for Linux was an electron app using an indicator. Given that GNOME is phasing
out appindicators and I personally resent running more than one electron app
at once, I decided to make one myself. Since a Rust API wrapper [already
existed](https://github.com/Aaronepower/Mammut), I decided to take the
opportunity to learn the language while I worked.
When getting started on the fediverse, I found that the only usable application for Linux was an electron app using an indicator. Given that
GNOME phased out indicators and I personally resent running more than one
electron app at once, I decided to make one myself. Since a Rust API
wrapper [already existed](https://github.com/pwoolcoc/elefren), I
decided to take the opportunity to learn the language while I worked.
## What can it do?
Right now during the transition to using GTK+, Trumpet can't do much.
Previously Trumpet had the following features:
Right now during the transition to using GTK+, Social can't do much.
Previously Social had the following features:
* Multi-account
* Text-only statuses
* Public timeline viewing
* Viewing instance information
Currently Trumpet can get the top of your home timeline with plain text statuses,
with display names and usernames shown. You can also boost and favourite
statuses, but unfavoriting causes a crash. Trumpet also has issues authenticating
with Pleroma instances that need to be solved.
There is no interface for logging in, so the app must be
launched via CLI or your IDE.
Currently Social can get the top of your home timeline with plain text
statuses, with display names and usernames shown. You can also boost
statuses.
## What's next?
Features I am working on now:
* GTK GUI
* Status actions
* Dynamic timelines
* Posting
* Following
* Emoji support
......@@ -45,15 +40,14 @@ Features I am working on now:
### GNOME Builder (Recommended)
GNOME Builder is the environment used for the development of this application.
It can use Flatpak manifests to create a consistent building and running
environment cross-distro. Thus, it is highly recommended you use it.
GNOME Builder is the environment used for the development of this
application.It can use Flatpak manifests to create a consistent building
and running environment cross-distro. Thus, it is highly recommended you
use it.
1. Download [GNOME Builder](https://wiki.gnome.org/Apps/Builder). Flatpak is the
recommended method for installing this application, but packages are available
for most major distributions.
2. In Builder, click the "Clone" button in the top left, using `git@gitlab.gnome.org:BrainBlasted/Trumpet.git`
or `https://gitlab.gnome.org/BrainBlasted/Trumpet.git` as the URL.
1. Download [GNOME Builder](https://flathub.org/apps/details/org.gnome.Builder).
2. In Builder, click the "Clone Repository" button at the bottom, using `git@gitlab.gnome.org/BrainBlasted/Social.git`
or `https://gitlab.gnome.org/BrainBlasted/Social.git` as the URL.
3. Click the build button at the top once the project is loaded.
### Manual
......@@ -62,18 +56,18 @@ If you feel at home in the terminal or would like to build outside of builder,
these are the commands to use:
```bash
git clone https://gitlab.gnome.org/BrainBlasted/Trumpet.git
cd Trumpet
git clone https://gitlab.gnome.org/BrainBlasted/Social.git
cd Social
meson _build --prefix=$PREFIX_DIR # Defaults to /usr/local
ninja -C _build
```
## Installation
Depending on how you want it installed instructions can differ. If you used GNOME
Builder to build it, clicking the bar at the top window will open a submenu that
with "Export Bundle". This will create a flatpak bundle, which can be installed
on any system that supports Flatpak.
Depending on how you want it installed instructions can differ. If you
used GNOME Builder to build it, clicking the bar at the top window will
open a submenu with "Export Bundle". This will create a flatpak bundle,
which can be installed on any system that supports Flatpak.
If you used the commands in the "Manual" section, or want to package for
distribution, you can use the following:
......@@ -86,8 +80,8 @@ ninja -C _build install
## License information
```
Trumpet: A Mastodon client
Copyright (C) 2017 Christopher Davis
Social: A Mastodon and Pleroma client
Copyright (C) 2017-2019 Christopher Davis
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
//
// build.rs
//
// Copyright 2018 Christopher Davis <brainblasted@disroot.org>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: GPL-3.0-or-later
use std::process::Command;
use std::env;
use std::fs::File;
use std::path::Path;
use std::io::Write;
fn main() {
// Rerun only when resources change
println!("cargo:rerun-if-changed=resources");
println!("cargo:rerun-if-changed=resources/*");
// Compile Gresource
Command::new("glib-compile-resources")
.args(&["--generate", "resources.xml"])
.current_dir("res")
.status()
.unwrap();
// Generating build globals
let default_locales = "./po".to_string();
let out_dir = env::var("OUT_DIR").unwrap();
let localedir = env::var("TRUMPET_LOCALEDIR").unwrap_or(default_locales);
let dest_path = Path::new(&out_dir).join("build_globals.rs");
let mut f = File::create(&dest_path).unwrap();
let globals = format!("
pub static LOCALEDIR: &'static str = \"{}\";
",
localedir);
f.write_all(&globals.into_bytes()[..]).unwrap();
}
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project maintainer at christopherdavis@gnome.org. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
This diff is collapsed.
scalable_dir = join_paths('hicolor', 'scalable', 'apps')
install_data(
join_paths(scalable_dir, 'org.gnome.Social.svg'),
install_dir: join_paths(social_datadir, 'icons', scalable_dir),
rename: '@0@.svg'.format(social_id)
)
symbolic_dir = join_paths('hicolor', 'symbolic', 'apps')
install_data(
join_paths(symbolic_dir, 'org.gnome.Social-symbolic.svg'),
install_dir: join_paths(social_datadir, 'icons', symbolic_dir),
rename: '@0@-symbolic.svg'.format(social_id)
)
This diff is collapsed.
subdir('icons')
# Prepare desktop file
desktop_conf = configuration_data()
desktop_conf.set('appid', social_id)
configure_file(
input: 'org.gnome.Social.desktop.in',
output: '@0@.desktop'.format(social_id),
configuration: desktop_conf,
install_dir: join_paths(social_datadir, 'applications')
)
# Prepare appdata
appdata_conf = configuration_data()
appdata_conf.set('appid', social_id)
configure_file(
input: 'org.gnome.Social.appdata.xml.in',
output: '@0@.appdata.xml'.format(social_id),
configuration: appdata_conf,
install_dir: join_paths(social_datadir, 'appdata')
)
service_conf = configuration_data()
service_conf.set('bindir', social_bindir)
service_conf.set('appid', social_id)
configure_file(
input: 'org.gnome.Social.service.in',
output: '@0@.service'.format(social_id),
configuration: service_conf,
install_dir: join_paths(social_datadir, 'dbus-1', 'services')
)
gnome.compile_resources(
'org.gnome.Social',
'org.gnome.Social.gresource.xml',
gresource_bundle: true,
source_dir: meson.current_build_dir(),
install: true,
install_dir: social_pkgdatadir
)
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>org.gnome.Trumpet.desktop</id>
<name>Trumpet</name>
<id>@appid@</id>
<name>Social</name>
<project_license>GPL-3.0</project_license>
<metadata_license>CC0-1.0</metadata_license>
<developer_name>Christopher Davis</developer_name>
<summary>Federated microblogging client</summary>
<url type="homepage">https://gitlab.gnome.org/BrainBlasted/Trumpet</url>
<url type="homepage">https://gitlab.gnome.org/BrainBlasted/Social</url>
<description>
<p>
Trumpet is a federated microblogging client for GNOME written in Rust.
Social is a federated microblogging client for GNOME written in Rust.
</p>
</description>
<!-- <screenshots>
......@@ -44,4 +44,5 @@
<content_attribute id="money-purchasing">none</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
<provides>org.gnome.Social.desktop</provides>
</component>
[Desktop Entry]
Name=Trumpet
Comment=Trumpet is a federated microblogging client for the GNOME desktop
GenericName=Trumpet microblogging
Exec=trumpet %U
Name=Social
Comment=Social is a federated microblogging client for the GNOME desktop
GenericName=Social microblogging
Exec=gnome-social %U
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=org.gnome.Trumpet
Icon=@appid@
DBusActivatable=true
Type=Application
Terminal=false
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/Trumpet/">
<gresource prefix="/org/gnome/Social/">
<file preprocess="xml-stripblanks">ui/toot_widget.ui</file>
<file preprocess="xml-stripblanks">ui/account_popover.ui</file>
<file preprocess="xml-stripblanks">ui/main_content_page.ui</file>
<file preprocess="xml-stripblanks">ui/bottom_switcher.ui</file>
<file preprocess="xml-stripblanks">ui/top_switcher.ui</file>
<file preprocess="xml-stripblanks">ui/main_header.ui</file>
<file preprocess="xml-stripblanks">ui/new_post.ui</file>
<file preprocess="xml-stripblanks">ui/register_page.ui</file>
<file preprocess="xml-stripblanks">ui/primary_menu.ui</file>
<file preprocess="xml-stripblanks">icons/org.gnome.Trumpet.svg</file>
<file preprocess="xml-stripblanks">icons/org.gnome.Social.svg</file>
<file preprocess="xml-stripblanks">icons/world-symbolic.svg</file>
<file>stylesheet.css</file>
</gresource>
</gresources>
[D-BUS Service]
Name=@appid@
Exec=@bindir@/gnome-social --gapplication-service
This diff is collapsed.
......@@ -2,10 +2,11 @@
<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<object class="GtkHeaderBar" id="main_header">
<object class="HdyHeaderBar" id="main_header">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<property name="centering_policy">strict</property>
<child>
<object class="GtkBox" id="header_left_box">
<property name="visible">True</property>
......
......@@ -101,7 +101,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">About Trumpet</property>
<property name="text" translatable="yes">About Social</property>
<property name="action_name">app.about</property>
</object>
<packing>
<property name="expand">False</property>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.