You've already forked linuxdeploy
mirror of
https://github.com/encounter/linuxdeploy.git
synced 2026-07-10 12:18:44 -07:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 18f2d94241 | |||
| 9743988c80 | |||
| 84b614c1ea | |||
| 1035ef726d | |||
| 1c7e768b86 | |||
| a28181d98c | |||
| fcd3ad49db | |||
| cc6310cbbd |
@@ -3,10 +3,10 @@ cmake_minimum_required(VERSION 3.3)
|
||||
|
||||
message(STATUS "Searching for libmagic")
|
||||
|
||||
find_library(LIBMAGIC_A libmagic.a)
|
||||
find_library(LIBMAGIC_LIBRARIES magic)
|
||||
|
||||
if(NOT LIBMAGIC_A)
|
||||
message(FATAL_ERROR "libmagic.a not found")
|
||||
if(NOT LIBMAGIC_LIBRARIES)
|
||||
message(FATAL_ERROR "libmagic not found")
|
||||
endif()
|
||||
|
||||
find_path(LIBMAGIC_MAGIC_H_DIR
|
||||
@@ -19,9 +19,6 @@ if(NOT LIBMAGIC_MAGIC_H_DIR)
|
||||
message(FATAL_ERROR "magic.h not found")
|
||||
endif()
|
||||
|
||||
# on Debian-ish systems, libmagic depends on zlib
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
add_library(libmagic_static INTERFACE IMPORTED)
|
||||
set_property(TARGET libmagic_static PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LIBMAGIC_MAGIC_H_DIR})
|
||||
set_property(TARGET libmagic_static PROPERTY INTERFACE_LINK_LIBRARIES ${LIBMAGIC_A};ZLIB::ZLIB)
|
||||
set_property(TARGET libmagic_static PROPERTY INTERFACE_LINK_LIBRARIES ${LIBMAGIC_LIBRARIES})
|
||||
|
||||
@@ -134,54 +134,8 @@ namespace linuxdeploy {
|
||||
}
|
||||
log << std::endl;
|
||||
|
||||
auto process = subprocess::Popen(args, subprocess::output{subprocess::PIPE}, subprocess::error{subprocess::PIPE});
|
||||
|
||||
|
||||
std::vector<pollfd> pfds(2);
|
||||
auto* opfd = &pfds[0];
|
||||
auto* epfd = &pfds[1];
|
||||
|
||||
opfd->fd = fileno(process.output());
|
||||
opfd->events = POLLIN;
|
||||
|
||||
epfd->fd = fileno(process.error());
|
||||
epfd->events = POLLIN;
|
||||
|
||||
auto printOutput = [&pfds, opfd, epfd, this, &process]() {
|
||||
poll(pfds.data(), pfds.size(), -1);
|
||||
|
||||
if (opfd->revents & POLLIN) {
|
||||
std::ostringstream oss;
|
||||
|
||||
std::vector<char> buf(4096);
|
||||
auto* lineptr = buf.data();
|
||||
auto n = buf.size();
|
||||
|
||||
while (getline(&lineptr, &n, process.output()) != -1) {
|
||||
oss << "[" << d->name << "/stdout] " << buf.data();
|
||||
}
|
||||
linuxdeploy::core::log::ldLog() << oss.str();
|
||||
}
|
||||
|
||||
if (epfd->revents & POLLIN) {
|
||||
std::ostringstream oss;
|
||||
|
||||
std::vector<char> buf(4096);
|
||||
auto* lineptr = buf.data();
|
||||
auto n = buf.size();
|
||||
|
||||
while (getline(&lineptr, &n, process.error()) != -1) {
|
||||
oss << "[" << d->name << "/stderr] " << buf.data();
|
||||
}
|
||||
linuxdeploy::core::log::ldLog() << oss.str();
|
||||
}
|
||||
};
|
||||
|
||||
do {
|
||||
printOutput();
|
||||
} while (process.poll() < 0);
|
||||
|
||||
printOutput();
|
||||
auto process = subprocess::Popen(args, subprocess::output{stdout}, subprocess::error{stderr});
|
||||
process.wait();
|
||||
|
||||
return process.retcode();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# 3.5 is required for imported boost targets
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
# globally include own includes
|
||||
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
# 3.5 is required for imported boost targets
|
||||
# 3.6 is required for the PkgConfig module's IMPORTED_TARGET library feature
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
# include headers to make CLion happy
|
||||
file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/linuxdeploy/core/*.h)
|
||||
|
||||
+8
-2
@@ -13,7 +13,7 @@
|
||||
#include "linuxdeploy/core/appdir.h"
|
||||
#include "linuxdeploy/core/elf.h"
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "util.h"
|
||||
#include "linuxdeploy/util/util.h"
|
||||
#include "excludelist.h"
|
||||
|
||||
using namespace linuxdeploy::core;
|
||||
@@ -701,7 +701,13 @@ namespace linuxdeploy {
|
||||
for (const auto& iconPath : foundIconPaths) {
|
||||
ldLog() << LD_DEBUG << "Icon found:" << iconPath << std::endl;
|
||||
|
||||
if (iconPath.stem() == iconName) {
|
||||
const bool matchesFilenameWithExtension = iconPath.filename() == iconName;
|
||||
|
||||
if (iconPath.stem() == iconName || matchesFilenameWithExtension) {
|
||||
if (matchesFilenameWithExtension) {
|
||||
ldLog() << LD_WARNING << "Icon= entry filename contains extension" << std::endl;
|
||||
}
|
||||
|
||||
ldLog() << "Deploying icon to AppDir root:" << iconPath << std::endl;
|
||||
|
||||
if (!d->symlinkFile(iconPath, path())) {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// local headers
|
||||
#include "linuxdeploy/core/elf.h"
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "util.h"
|
||||
#include "linuxdeploy/util/util.h"
|
||||
|
||||
using namespace linuxdeploy::core::log;
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
#include "linuxdeploy/core/elf.h"
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "linuxdeploy/plugin/plugin.h"
|
||||
#include "util.h"
|
||||
#include "linuxdeploy/util/util.h"
|
||||
|
||||
using namespace linuxdeploy::core;
|
||||
using namespace linuxdeploy::core::log;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "linuxdeploy/plugin/base.h"
|
||||
#include "linuxdeploy/plugin/plugin.h"
|
||||
#include "util.h"
|
||||
#include "linuxdeploy/util/util.h"
|
||||
#include "plugin_type0.h"
|
||||
|
||||
using namespace linuxdeploy::core;
|
||||
@@ -46,7 +46,8 @@ namespace linuxdeploy {
|
||||
auto currentExeDir = bf::path(util::getOwnExecutablePath()).parent_path();
|
||||
paths.insert(paths.begin(), currentExeDir.string());
|
||||
|
||||
// if shipping as an AppImage, search for plugins in AppImage's location, too
|
||||
// if shipping as an AppImage, search for plugins in AppImage's location first
|
||||
// this way, plugins in the AppImage's directory take precedence over bundled ones
|
||||
if (getenv("APPIMAGE") != nullptr) {
|
||||
auto appImageDir = bf::path(getenv("APPIMAGE")).parent_path();
|
||||
paths.insert(paths.begin(), appImageDir.string());
|
||||
@@ -71,7 +72,12 @@ namespace linuxdeploy {
|
||||
ldLog() << LD_DEBUG << "Failed to create instance for plugin" << i->path();
|
||||
} else {
|
||||
ldLog() << LD_DEBUG << "Found plugin '" << LD_NO_SPACE << name << LD_NO_SPACE << "':" << plugin->path() << std::endl;
|
||||
foundPlugins[name] = plugin;
|
||||
|
||||
if (foundPlugins.find(name) != foundPlugins.end()) {
|
||||
ldLog() << LD_DEBUG << "Already found" << name << "plugin in" << foundPlugins[name]->path() << std::endl;
|
||||
} else {
|
||||
foundPlugins[name] = plugin;
|
||||
}
|
||||
}
|
||||
} catch (const PluginError& e) {
|
||||
ldLog() << LD_WARNING << "Could not load plugin" << i->path() << LD_NO_SPACE << ": " << e.what();
|
||||
|
||||
@@ -1,2 +1,7 @@
|
||||
add_library(linuxdeploy_util STATIC magicwrapper.cpp magicwrapper.h util.h misc.h)
|
||||
target_include_directories(linuxdeploy_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_library(linuxdeploy_util STATIC
|
||||
magicwrapper.cpp
|
||||
magicwrapper.h
|
||||
${PROJECT_SOURCE_DIR}/include/linuxdeploy/util/util.h
|
||||
${PROJECT_SOURCE_DIR}/include/linuxdeploy/util/misc.h
|
||||
)
|
||||
target_include_directories(linuxdeploy_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
@@ -55,15 +55,6 @@ mv squashfs-root/ AppDir/plugins/linuxdeploy-plugin-appimage
|
||||
|
||||
ln -s ../../plugins/linuxdeploy-plugin-appimage/AppRun AppDir/usr/bin/linuxdeploy-plugin-appimage
|
||||
|
||||
# bundle Qt plugin
|
||||
|
||||
wget https://github.com/TheAssassin/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-"$ARCH".AppImage
|
||||
chmod +x linuxdeploy-plugin-qt-"$ARCH".AppImage
|
||||
./linuxdeploy-plugin-qt-"$ARCH".AppImage --appimage-extract
|
||||
mv squashfs-root/ AppDir/plugins/linuxdeploy-plugin-qt
|
||||
|
||||
ln -s ../../plugins/linuxdeploy-plugin-qt/AppRun AppDir/usr/bin/linuxdeploy-plugin-qt
|
||||
|
||||
# build AppImage using plugin
|
||||
AppDir/usr/bin/linuxdeploy-plugin-appimage --appdir AppDir/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user