mirror of
https://github.com/status-im/macdylibbundler.git
synced 2025-02-26 17:40:40 +00:00
add back includes
This commit is contained in:
parent
2603a0c0bc
commit
e5849e59b9
@ -1,6 +1,22 @@
|
|||||||
#include "Dependency.h"
|
#include "Dependency.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
#include <cctype>
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <functional>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <locale>
|
||||||
|
#include <sstream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
// #include <stdlib.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
// #include <sys/stat.h>
|
||||||
|
#ifndef __clang__
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
@ -1,11 +1,18 @@
|
|||||||
#include "DylibBundler.h"
|
#include "DylibBundler.h"
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <numeric>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
#include <linux/limits.h>
|
#include <linux/limits.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef __clang__
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Dependency.h"
|
#include "Dependency.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
@ -282,7 +289,7 @@ void copyQtPlugins()
|
|||||||
fixupPlugin("imageformats");
|
fixupPlugin("imageformats");
|
||||||
fixupPlugin("iconengines");
|
fixupPlugin("iconengines");
|
||||||
if (!qtSvgFound)
|
if (!qtSvgFound)
|
||||||
systemp("rm -f " + dest + "imageformats/libqsvg.dylib");
|
systemp(std::string("rm -f ") + dest + "imageformats/libqsvg.dylib");
|
||||||
if (qtGuiFound) {
|
if (qtGuiFound) {
|
||||||
fixupPlugin("platforminputcontexts");
|
fixupPlugin("platforminputcontexts");
|
||||||
fixupPlugin("virtualkeyboard");
|
fixupPlugin("virtualkeyboard");
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include <sys/param.h>
|
||||||
|
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
@ -56,17 +59,14 @@ void appBundle(std::string path)
|
|||||||
std::string destFolder() { return dest_path; }
|
std::string destFolder() { return dest_path; }
|
||||||
void destFolder(std::string path)
|
void destFolder(std::string path)
|
||||||
{
|
{
|
||||||
if (path[path.size()-1] != '/')
|
dest_path = path;
|
||||||
path += "/";
|
if (appBundleProvided())
|
||||||
dest_folder = path;
|
|
||||||
if (appBundleProvided()) {
|
|
||||||
char buffer[PATH_MAX];
|
|
||||||
dest_path = app_bundle + "Contents/" + stripLSlash(dest_folder);
|
dest_path = app_bundle + "Contents/" + stripLSlash(dest_folder);
|
||||||
|
char buffer[PATH_MAX];
|
||||||
if (realpath(dest_path.c_str(), buffer))
|
if (realpath(dest_path.c_str(), buffer))
|
||||||
dest_path = buffer;
|
dest_path = buffer;
|
||||||
if (dest_path[dest_path.size()-1] != '/')
|
if (dest_path[dest_path.size()-1] != '/')
|
||||||
dest_path += "/";
|
dest_path += "/";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string executableFolder() { return app_bundle + "Contents/MacOS/"; }
|
std::string executableFolder() { return app_bundle + "Contents/MacOS/"; }
|
||||||
@ -127,13 +127,13 @@ bool isPrefixBundled(std::string prefix)
|
|||||||
|
|
||||||
std::vector<std::string> searchPaths;
|
std::vector<std::string> searchPaths;
|
||||||
void addSearchPath(std::string path) { searchPaths.push_back(path); }
|
void addSearchPath(std::string path) { searchPaths.push_back(path); }
|
||||||
size_t searchPathCount() { return searchPaths.size(); }
|
|
||||||
std::string searchPath(const int n) { return searchPaths[n]; }
|
std::string searchPath(const int n) { return searchPaths[n]; }
|
||||||
|
size_t searchPathCount() { return searchPaths.size(); }
|
||||||
|
|
||||||
std::vector<std::string> userSearchPaths;
|
std::vector<std::string> userSearchPaths;
|
||||||
void addUserSearchPath(std::string path) { userSearchPaths.push_back(path); }
|
void addUserSearchPath(std::string path) { userSearchPaths.push_back(path); }
|
||||||
size_t userSearchPathCount() { return userSearchPaths.size(); }
|
|
||||||
std::string userSearchPath(const int n) { return userSearchPaths[n]; }
|
std::string userSearchPath(const int n) { return userSearchPaths[n]; }
|
||||||
|
size_t userSearchPathCount() { return userSearchPaths.size(); }
|
||||||
|
|
||||||
bool canCreateDir() { return create_dir; }
|
bool canCreateDir() { return create_dir; }
|
||||||
void canCreateDir(bool permission) { create_dir = permission; }
|
void canCreateDir(bool permission) { create_dir = permission; }
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#ifndef __clang__
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
|
|
||||||
bool isPrefixBundled(std::string prefix);
|
bool isPrefixBundled(std::string prefix);
|
||||||
@ -33,12 +37,12 @@ std::string insideLibPath();
|
|||||||
void insideLibPath(std::string p);
|
void insideLibPath(std::string p);
|
||||||
|
|
||||||
void addSearchPath(std::string path);
|
void addSearchPath(std::string path);
|
||||||
size_t searchPathCount();
|
|
||||||
std::string searchPath(int n);
|
std::string searchPath(int n);
|
||||||
|
size_t searchPathCount();
|
||||||
|
|
||||||
void addUserSearchPath(std::string path);
|
void addUserSearchPath(std::string path);
|
||||||
size_t userSearchPathCount();
|
|
||||||
std::string userSearchPath(int n);
|
std::string userSearchPath(int n);
|
||||||
|
size_t userSearchPathCount();
|
||||||
|
|
||||||
bool canCreateDir();
|
bool canCreateDir();
|
||||||
void canCreateDir(bool permission);
|
void canCreateDir(bool permission);
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
|
// #include <stdio.h>
|
||||||
|
#include <sys/param.h>
|
||||||
|
// #include <sys/stat.h>
|
||||||
|
#ifndef __clang__
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
@ -172,9 +180,8 @@ void copyFile(const std::string& from, const std::string& to)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string overwrite_permission = std::string(overwrite ? "-f " : "-n ");
|
|
||||||
|
|
||||||
// copy file/directory
|
// copy file/directory
|
||||||
|
std::string overwrite_permission = std::string(overwrite ? "-f " : "-n ");
|
||||||
std::string command = std::string("cp -R ") + overwrite_permission + from + std::string(" ") + to;
|
std::string command = std::string("cp -R ") + overwrite_permission + from + std::string(" ") + to;
|
||||||
if (from != to && systemp(command) != 0) {
|
if (from != to && systemp(command) != 0) {
|
||||||
std::cerr << "\n\nError: An error occured while trying to copy file " << from << " to " << to << std::endl;
|
std::cerr << "\n\nError: An error occured while trying to copy file " << from << " to " << to << std::endl;
|
||||||
@ -208,7 +215,7 @@ void deleteFile(const std::string& path)
|
|||||||
bool mkdir(const std::string& path)
|
bool mkdir(const std::string& path)
|
||||||
{
|
{
|
||||||
if (Settings::verboseOutput())
|
if (Settings::verboseOutput())
|
||||||
std::cout << "* Creating directory " << path << "\n\n";
|
std::cout << "Creating directory " << path << std::endl;
|
||||||
std::string command = std::string("mkdir -p ") + path;
|
std::string command = std::string("mkdir -p ") + path;
|
||||||
if (systemp(command) != 0) {
|
if (systemp(command) != 0) {
|
||||||
std::cerr << "\n/!\\ ERROR: An error occured while creating " << path << std::endl;
|
std::cerr << "\n/!\\ ERROR: An error occured while creating " << path << std::endl;
|
||||||
@ -221,12 +228,12 @@ void createDestDir()
|
|||||||
{
|
{
|
||||||
std::string dest_folder = Settings::destFolder();
|
std::string dest_folder = Settings::destFolder();
|
||||||
if (Settings::verboseOutput())
|
if (Settings::verboseOutput())
|
||||||
std::cout << "* Checking output directory " << dest_folder << "\n";
|
std::cout << "Checking output directory " << dest_folder << "\n";
|
||||||
|
|
||||||
bool dest_exists = fileExists(dest_folder);
|
bool dest_exists = fileExists(dest_folder);
|
||||||
|
|
||||||
if (dest_exists && Settings::canOverwriteDir()) {
|
if (dest_exists && Settings::canOverwriteDir()) {
|
||||||
std::cout << "* Erasing old output directory " << dest_folder << "\n";
|
std::cout << "Erasing old output directory " << dest_folder << "\n";
|
||||||
std::string command = std::string("rm -r ") + dest_folder;
|
std::string command = std::string("rm -r ") + dest_folder;
|
||||||
if (systemp(command) != 0) {
|
if (systemp(command) != 0) {
|
||||||
std::cerr << "\n\n/!\\ ERROR: An error occured while attempting to overwrite destination folder\n";
|
std::cerr << "\n\n/!\\ ERROR: An error occured while attempting to overwrite destination folder\n";
|
||||||
@ -237,7 +244,7 @@ void createDestDir()
|
|||||||
|
|
||||||
if (!dest_exists) {
|
if (!dest_exists) {
|
||||||
if (Settings::canCreateDir()) {
|
if (Settings::canCreateDir()) {
|
||||||
std::cout << "* Creating output directory " << dest_folder << "\n\n";
|
std::cout << "Creating output directory " << dest_folder << "\n\n";
|
||||||
if (!mkdir(dest_folder)) {
|
if (!mkdir(dest_folder)) {
|
||||||
std::cerr << "\n/!\\ ERROR: An error occured while creating " << dest_folder << std::endl;
|
std::cerr << "\n/!\\ ERROR: An error occured while creating " << dest_folder << std::endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
|
13
src/main.cpp
13
src/main.cpp
@ -1,9 +1,18 @@
|
|||||||
|
#include <cstdio>
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#ifndef __clang__
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "DylibBundler.h"
|
#include "DylibBundler.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
|
|
||||||
const std::string VERSION = "2.0.0 (2019-12-29)";
|
const std::string VERSION = "2.1.0 (2020-01-04)";
|
||||||
|
|
||||||
void showHelp()
|
void showHelp()
|
||||||
{
|
{
|
||||||
@ -114,7 +123,7 @@ int main(int argc, const char* argv[])
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "* Collecting dependencies...\n";
|
std::cout << "Collecting dependencies...\n";
|
||||||
|
|
||||||
const size_t files_count = Settings::filesToFixCount();
|
const size_t files_count = Settings::filesToFixCount();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user