Skip to content

Commit

Permalink
Implement Inspector::getApplicationInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
azubieta committed Jun 24, 2019
1 parent d067633 commit 403b470
Show file tree
Hide file tree
Showing 19 changed files with 786 additions and 33 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.14)
# Project
project(
AppImageServices
VERSION 0.1.0
VERSION 0.2.0
LANGUAGES C CXX
DESCRIPTION "Language agnostic implementation of the AppImage user experience"
)
Expand Down
5 changes: 4 additions & 1 deletion README-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ org.appimage.Services1.Updater.Task
org.appimage.Services1.Inspector
\- getApplicationInfo ( String appImagePath )
\- getDeveloperInfo ( String appImagePath )
\- getDevelopmentInfo ( String appImagePath )
\- verifySignature ( String appImagePath )
\- extractIcon ( String appImagePath, String path )
\- extractFile ( String appImagePath, String sourcePath, String targetPath )
\- listContents ( String appImagePath)
org.appimamge.Services1.Self
\- checkUpdates
Expand Down
68 changes: 49 additions & 19 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# -*- coding: utf-8 -*-

from conans import ConanFile, CMake, tools
from shutil import copyfile
import os


class AppImageServices(ConanFile):
Expand All @@ -10,16 +12,18 @@ class AppImageServices(ConanFile):
settings = "os", "compiler", "build_type", "arch"

requires = (("OpenSSL/1.1.1b@conan/stable"),
("libpng/1.6.36@bincrafters/stable"),
("cairo/1.17.2@bincrafters/stable"),
("harfbuzz/2.4.0@appimage-conan-community/stable"),
("glib/2.40.0@appimage-conan-community/stable"),
("libpng/1.6.36@bincrafters/stable"),
("cairo/1.17.2@appimage-conan-community/stable"),
("qt/5.12.3@appimage-conan-community/stable"),
("xdg-utils-cxx/0.1.1@appimage-conan-community/stable"),
("libappimage/1.0.1@appimage-conan-community/stable"),
("freetype/2.9.1@appimage-conan-community/stable"),
("libappimage/1.0.2@local/testing"),
("appimageupdate/continuous@appimage-conan-community/stable"),
("squashfuse/0.1.103@appimage-conan-community/stable"))

default_options = {"glib:shared": True, "lzma:shared": True}
default_options = {"glib:shared": True, "lzma:shared": True, "cairo:shared": True, "freetype:shared": True}

build_requires = ("patchelf_installer/0.9@appimage-conan-community/stable",
"gtest/1.8.1@bincrafters/stable",
Expand All @@ -31,21 +35,47 @@ class AppImageServices(ConanFile):

generators = "cmake_paths", "pkg_config"

def import_pkg_config_files(self, pkg, pkgconfig_path):
for root, dirs, files in os.walk(self.deps_cpp_info[pkg].rootpath):
for file in files:
if file.endswith("pc"):
source_path = os.path.join(root, file)
target_path = os.path.join(pkgconfig_path, file)
print("Importing pkg_config file: %s" % target_path)
copyfile(source_path, target_path)
tools.replace_prefix_in_pc_file(target_path, self.deps_cpp_info[pkg].rootpath)

def configure(self):
self.options["squashfuse"].shared = False
self.options["libarchive"].shared = False
self.options["xdg-utils-cxx"].shared = False
self.options["xdg-utils-cxx"].fPIC = True
self.options["cairo"].shared = True
self.options["pango"].shared = True
self.options["librsvg"].shared = True
self.options["glib"].shared = True
self.options["zlib"].shared = True
self.options["qt"].shared = True

def build(self):
appDirPath = self.build_folder + "/AppDir"

cmake = CMake(self)
cmake.definitions["CMAKE_PROJECT_AppImageServices_INCLUDE"] = self.build_folder + "/conan_paths.cmake"
# Correct conan default installation paths
cmake.definitions["CMAKE_INSTALL_PREFIX"] = appDirPath
cmake.definitions["CMAKE_INSTALL_BINDIR"] = "usr/bin"
cmake.definitions["CMAKE_INSTALL_LIBDIR"] = "usr/lib"
cmake.definitions["CMAKE_INSTALL_INCLUDEDIR"] = "usr/include"
cmake.definitions["CMAKE_INSTALL_DATAROOTDIR"] = "usr/share"
cmake.definitions["CMAKE_INSTALL_SYSCONFDIR"] = "etc"

cmake.configure()
cmake.build()
cmake.install()

self.run("linuxdeploy --appdir=%s --plugin qt --output appimage" % appDirPath, run_environment=True)
for lib in self.deps_cpp_info.deps:
self.import_pkg_config_files(lib, self.build_folder)

with tools.environment_append({'PKG_CONFIG_PATH': self.build_folder}):
cmake = CMake(self)
cmake.definitions["CMAKE_PROJECT_AppImageServices_INCLUDE"] = self.build_folder + "/conan_paths.cmake"
# Correct conan default installation paths
cmake.definitions["CMAKE_INSTALL_PREFIX"] = appDirPath
cmake.definitions["CMAKE_INSTALL_BINDIR"] = "usr/bin"
cmake.definitions["CMAKE_INSTALL_LIBDIR"] = "usr/lib"
cmake.definitions["CMAKE_INSTALL_INCLUDEDIR"] = "usr/include"
cmake.definitions["CMAKE_INSTALL_DATAROOTDIR"] = "usr/share"
cmake.definitions["CMAKE_INSTALL_SYSCONFDIR"] = "etc"

cmake.configure()
cmake.build()
cmake.install()

self.run("linuxdeploy --appdir=%s --plugin qt --output appimage" % appDirPath, run_environment=True)
1 change: 1 addition & 0 deletions res/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
install(FILES appimage_logo.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps COMPONENT APPIMAGE_SERVICES)
install(FILES org.appimage.services.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications COMPONENT APPIMAGE_SERVICES)
install(FILES org.appimage.services.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo COMPONENT APPIMAGE_SERVICES)
32 changes: 32 additions & 0 deletions res/org.appimage.services.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">​
<id>org.appimage.services</id>
<metadata_license>FSFAP</metadata_license>
<project_license>MIT</project_license>
<name>AppImage Services</name>
<summary>AppImage desktop integration services</summary>
<description>
<p>
Collection of DBus services to extend the AppImage experience in desktop environments.

Includes:

Launcher: Provides system launcher integration of AppImages
Updater: Provides a way of updating AppImages
Inspector: Allows to extract the application metadata from AppImage files
</p>
</description>
<url type="homepage">https://github.com/azubieta/AppImageService</url>
<project_group>AppImage</project_group>
<releases>
<release version="0.2.0" date="2019-06-14">
</release>
</releases>
<provides>
<binary>appimage-services</binary>
<dbus type="system">org.appimage.Services1.Launcher</dbus>
<dbus type="system">org.appimage.Services1.Updater</dbus>
<dbus type="system">org.appimage.Services1.Inspector</dbus>
</provides>
</component>
13 changes: 11 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@
find_package(PkgConfig)
add_subdirectory(common)
add_subdirectory(launcher)
add_subdirectory(updater)
#add_subdirectory(updater)
add_subdirectory(inspector)
add_subdirectory(installer)

find_package(freetype REQUIRED)
find_package(Qt5 CONFIG REQUIRED Core)
add_executable(appimage-services main.cpp)
target_link_libraries(appimage-services PRIVATE AppImageServicesLauncher AppImageServicesUpdater Qt5::Core)
target_link_libraries(
appimage-services
PRIVATE freetype
PRIVATE AppImageServicesLauncher
# PRIVATE AppImageServicesUpdater
PRIVATE AppImageServicesInspector
PRIVATE Qt5::Core
)

install(
TARGETS appimage-services
Expand Down
2 changes: 1 addition & 1 deletion src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
find_package(Qt5 CONFIG REQUIRED Core)

add_library(AppImageServicesCommon OBJECT utils.cpp)
add_library(AppImageServicesCommon STATIC utils.cpp)
target_link_libraries(AppImageServicesCommon PUBLIC Qt5::Core)
target_include_directories(AppImageServicesCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
7 changes: 7 additions & 0 deletions src/common/utils.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
#include "utils.h"

QString removeUriProtocolFromPath(const QString& uri) {
if (uri.startsWith("file://"))
return uri.mid(7);
else
return uri;
}
7 changes: 1 addition & 6 deletions src/common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,4 @@
* @param uri
* @return path without the protocol header ('file://')
*/
QString removeUriProtocolFromPath(const QString& uri) {
if (uri.startsWith("file://"))
return uri.mid(7);
else
return uri;
}
QString removeUriProtocolFromPath(const QString& uri);
Loading

0 comments on commit 403b470

Please sign in to comment.