Skip to content

Commit

Permalink
create flatpak manifest; preparation to fix aggalex#64, aggalex#66, a…
Browse files Browse the repository at this point in the history
  • Loading branch information
itmm committed Nov 21, 2021
1 parent e63b9a2 commit bd12657
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 13 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ An easy contact manager for elementary OS (RC State)

### Dependencies:
- `git`
- `elementary-sdk`
- `elementary-sdk`
- `libfolks-dev`

### Building
Expand All @@ -29,5 +29,19 @@ dpkg-buildpackage -us -uc
```
After the last command, the debian package will exist into the "Contacts" folder that the first command created (the one containing the folder "com.github.aggalex.contacts" that contains the source code)

### Flatpak Building

To build a `flatpak` package you must be sure you can build the project and
have installed the SDK, e.g. by
```
flatpak install --user io.elementary.Sdk//6
```

Then you can generate the `flatpak` package in the `repo` directory by running

```
flatpak-builder --repo=repo --force-clean build-dir com.github.aggalex.contacts.yml
```

### Release Date
> In the forthcoming future!
46 changes: 46 additions & 0 deletions com.github.aggalex.contacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
app-id: com.github.aggalex.contacts
runtime: io.elementary.Platform
runtime-version: '6'
sdk: io.elementary.Sdk
command: com.github.aggalex.contacts
finish-args:
#- '--filesystem=/tmp/io.elementary.mail:create'
#- '--env=TMPDIR=/tmp/io.elementary.mail'

- '--share=ipc'
- '--share=network'
- '--socket=fallback-x11'
- '--socket=wayland'
- '--socket=session-bus'
- '--filesystem=xdg-data'

# EDS DBus interfaces
#- '--talk-name=org.gnome.evolution.dataserver.AddressBook10'
#- '--talk-name=org.gnome.evolution.dataserver.Sources5'

#- '--metadata=X-DConf=migrate-path=/io/elementary/mail/'

modules:
- name: folks
buildsystem: meson
config-opts:
- '-Dbluez_backend=false'
- '-Ddocs=false'
- '-Deds_backend=false'
- '-Dtests=false'
- '-Dinstalled_tests=false'
- '-Dofono_backend=false'
- '-Dtelepathy_backend=false'
- '-Dzeitgeist=false'
- '-Dimport_tool=false'
- '-Dinspect_tool=false'

sources:
- type: git
url: https://gitlab.gnome.org/GNOME/folks.git

- name: contacts
buildsystem: meson
sources:
- type: dir
path: .
2 changes: 1 addition & 1 deletion config.vala.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ namespace Constants {
public const string PROJECT_NAME = @PROJECT_NAME@;
public const string VERSION = @VERSION@;
public const string INSTALL_PREFIX = @PREFIX@;
public const string DATADIR = "/usr/share/contacts";
public const string DATADIR = @DATADIR@;
}
11 changes: 2 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ foreach i : icon_sizes
)
endforeach

avatar_sizes = ['32', '64']

foreach i : avatar_sizes
install_data(
join_paths('data/icons', i, 'contacts-avatar-default.svg'),
install_dir: join_paths(get_option('datadir'), 'contacts', 'avatars', i)
)
endforeach

install_data(
'data/css/style.css',
install_dir: join_paths(get_option('datadir'), 'contacts', 'css')
Expand All @@ -73,7 +64,9 @@ conf_data.set_quoted('PROJECT_NAME', meson.project_name())
conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf_data.set_quoted('VERSION', meson.project_version())
conf_data.set_quoted('PREFIX', get_option('prefix'))
conf_data.set_quoted('DATADIR', get_option('datadir'))

message ('data dir == ' + get_option('prefix') + ', ' + get_option('datadir'))
message ('Configuring desktop entry: ' + meson.project_name() + '.desktop')

desktop_in_file = configure_file(
Expand Down
7 changes: 6 additions & 1 deletion src/FileHelper/FileHelper.vala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ namespace FileHelper {
if (got == "") {
got = @"$(Environment.get_home_dir ())/.local/share";
}
return got + "/contacts";
got = got + "/contacts";
if (!GLib.FileUtils.test (got, GLib.FileTest.IS_DIR)) {
var dir = File.new_for_path (got);
dir.make_directory_with_parents ();
}
return got;
}

private string get_file_path (string filename, string path_suffix) throws Error {
Expand Down
5 changes: 4 additions & 1 deletion src/View/Css.vala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ namespace View {

public static void apply () {
var css_provider = new Gtk.CssProvider ();
var css_data = @"$(Constants.DATADIR)/css/style.css"; // TODO
var css_data = Path.build_filename (
Constants.INSTALL_PREFIX, Constants.DATADIR,
"contacts", "css", "style.css"
);
// print (@"CSS_DATA: $css_data");
try {
css_provider.load_from_path (css_data);
Expand Down
6 changes: 6 additions & 0 deletions src/View/Widgets/InfoSectionMisc.vala
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ namespace View.Widgets {
case NICKNAME:
handler.change_nickname (widget.text, index);
return;
default:
// ignore other types
return;
}
}

Expand All @@ -267,6 +270,9 @@ namespace View.Widgets {
handler.remove_nickname (index);
nickname_count--;
return;
default:
// ignore other types
return;
}
}

Expand Down

0 comments on commit bd12657

Please sign in to comment.