From f5257359d879f61d8329ba75ef60049b9e65fddc Mon Sep 17 00:00:00 2001 From: Oleksii Filonenko Date: Wed, 27 Nov 2019 15:12:36 +0200 Subject: akira-unstable: init at 2019-10-12 Co-authored-by: worldofpeace --- pkgs/applications/graphics/akira/default.nix | 76 +++++++++++++++++++ .../akira/fix-build-with-vala-0-44-or-later.patch | 88 ++++++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 pkgs/applications/graphics/akira/default.nix create mode 100644 pkgs/applications/graphics/akira/fix-build-with-vala-0-44-or-later.patch (limited to 'pkgs/applications/graphics/akira') diff --git a/pkgs/applications/graphics/akira/default.nix b/pkgs/applications/graphics/akira/default.nix new file mode 100644 index 00000000000..adbc1eac379 --- /dev/null +++ b/pkgs/applications/graphics/akira/default.nix @@ -0,0 +1,76 @@ +{ stdenv +, lib +, fetchFromGitHub +, appstream-glib +, desktop-file-utils +, meson +, ninja +, pantheon +, pkgconfig +, python3 +, vala +, vala-lint +, wrapGAppsHook +, cairo +, glib +, goocanvas2 +, gtk3 +, gtksourceview3 +, json-glib +, libarchive +, libgee +, libxml2 }: + +stdenv.mkDerivation rec { + pname = "akira"; + version = "2019-10-12"; + + src = fetchFromGitHub { + owner = "akiraux"; + repo = "Akira"; + rev = "cab952dee4591b6bde34d670c1f853f5a3ff6b19"; + sha256 = "1fp3a79hkh6xwwqqdrx4zqq2zhsm236c6fhhl5f2nmi108yxz04q"; + }; + + nativeBuildInputs = [ + appstream-glib + desktop-file-utils + meson + ninja + pkgconfig + python3 + vala + vala-lint + wrapGAppsHook + ]; + + buildInputs = [ + cairo + glib + goocanvas2 + pantheon.granite + gtk3 + gtksourceview3 + json-glib + libarchive + libgee + libxml2 + ]; + + mesonFlags = [ "-Dprofile=default" ]; + + patches = [ ./fix-build-with-vala-0-44-or-later.patch ]; + + postPatch = '' + chmod +x build-aux/meson/post_install.py + patchShebangs build-aux/meson/post_install.py + ''; + + meta = with lib; { + description = "Native Linux Design application built in Vala and GTK"; + homepage = "https://github.com/akiraux/Akira"; + license = licenses.gpl3; + maintainers = with maintainers; [ filalex77 ] ++ pantheon.maintainers; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/graphics/akira/fix-build-with-vala-0-44-or-later.patch b/pkgs/applications/graphics/akira/fix-build-with-vala-0-44-or-later.patch new file mode 100644 index 00000000000..3c35900c04f --- /dev/null +++ b/pkgs/applications/graphics/akira/fix-build-with-vala-0-44-or-later.patch @@ -0,0 +1,88 @@ +From bcda8fd53f6f232db0b6411269ba108af551629f Mon Sep 17 00:00:00 2001 +From: Alberto Fanjul +Date: Tue, 9 Apr 2019 09:45:36 +0200 +Subject: [PATCH] Build on vala >= 0.44.2 + +--- + src/FileFormat/JsonObject.vala | 2 +- + src/FileFormat/JsonObjectArray.vala | 2 +- + src/FileFormat/ZipArchiveHandler.vala | 18 +++++++++++++++++- + 3 files changed, 19 insertions(+), 3 deletions(-) + +diff --git a/src/FileFormat/JsonObject.vala b/src/FileFormat/JsonObject.vala +index 7bfe46f..805fbad 100644 +--- a/src/FileFormat/JsonObject.vala ++++ b/src/FileFormat/JsonObject.vala +@@ -31,7 +31,7 @@ public abstract class Akira.FileFormat.JsonObject : GLib.Object { + + private ObjectClass obj_class; + +- public JsonObject.from_object (Json.Object object) { ++ protected JsonObject.from_object (Json.Object object) { + Object (object: object); + } + +diff --git a/src/FileFormat/JsonObjectArray.vala b/src/FileFormat/JsonObjectArray.vala +index 4f6e573..d0a7dad 100644 +--- a/src/FileFormat/JsonObjectArray.vala ++++ b/src/FileFormat/JsonObjectArray.vala +@@ -31,7 +31,7 @@ public abstract class Akira.FileFormat.JsonObjectArray : Object { + * + * Your JsonObject implementation should have it's own list of items + */ +- public JsonObjectArray (Json.Object object, string property_name) { ++ protected JsonObjectArray (Json.Object object, string property_name) { + Object (object: object, property_name: property_name); + } + +diff --git a/src/FileFormat/ZipArchiveHandler.vala b/src/FileFormat/ZipArchiveHandler.vala +index ca60dd0..5d65aa2 100644 +--- a/src/FileFormat/ZipArchiveHandler.vala ++++ b/src/FileFormat/ZipArchiveHandler.vala +@@ -262,11 +262,17 @@ public class Akira.FileFormat.ZipArchiveHandler : GLib.Object { + continue; + } + ++ Posix.off_t offset; ++#if VALA_0_42 ++ uint8[] buffer; ++ while (archive.read_data_block (out buffer, out offset) == Archive.Result.OK) { ++ if (extractor.write_data_block (buffer, offset) != Archive.Result.OK) { ++#else + void* buffer = null; + size_t buffer_length; +- Posix.off_t offset; + while (archive.read_data_block (out buffer, out buffer_length, out offset) == Archive.Result.OK) { + if (extractor.write_data_block (buffer, buffer_length, offset) != Archive.Result.OK) { ++#endif + break; + } + } +@@ -316,9 +322,15 @@ public class Akira.FileFormat.ZipArchiveHandler : GLib.Object { + // Add an entry to the archive + Archive.Entry entry = new Archive.Entry (); + entry.set_pathname (initial_folder.get_relative_path (current_file)); ++#if VALA_0_42 ++ entry.set_size ((Archive.int64_t) file_info.get_size ()); ++ entry.set_filetype (Archive.FileType.IFREG); ++ entry.set_perm (Archive.FileType.IFREG); ++#else + entry.set_size (file_info.get_size ()); + entry.set_filetype ((uint) Posix.S_IFREG); + entry.set_perm (0644); ++#endif + + if (archive.write_header (entry) != Archive.Result.OK) { + critical ("Error writing '%s': %s (%d)", current_file.get_path (), archive.error_string (), archive.errno ()); +@@ -333,7 +345,11 @@ public class Akira.FileFormat.ZipArchiveHandler : GLib.Object { + break; + } + ++#if VALA_0_42 ++ archive.write_data (buffer[0:bytes_read]); ++#else + archive.write_data (buffer, bytes_read); ++#endif + } + } + } -- cgit 1.4.1