You've already forked linuxdeploy
mirror of
https://github.com/encounter/linuxdeploy.git
synced 2026-03-30 11:18:58 -07:00
Merge pull request #49 from linuxdeploy/restructure-libraries
Restructure libraries
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
// local includes
|
||||
#include "linuxdeploy/core/desktopfile.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfile.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
+11
-4
@@ -13,11 +13,18 @@ execute_process(
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
|
||||
add_library(linuxdeploy_core_copyright STATIC copyright.cpp copyright.h copyright_dpkgquery.cpp copyright_dpkgquery.h)
|
||||
target_link_libraries(linuxdeploy_core_copyright PUBLIC subprocess ${BOOST_LIBS})
|
||||
add_library(linuxdeploy_core_log STATIC log.cpp)
|
||||
target_include_directories(linuxdeploy_core_log PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||
target_link_libraries(linuxdeploy_core_log PUBLIC ${BOOST_LIBS})
|
||||
|
||||
add_library(linuxdeploy_core STATIC elf.cpp log.cpp appdir.cpp desktopfile.cpp desktopfilereader.cpp desktopfileentry.cpp desktopfilewriter.cpp ${HEADERS})
|
||||
target_link_libraries(linuxdeploy_core PUBLIC linuxdeploy_plugin linuxdeploy_util ${BOOST_LIBS} subprocess CImg ${CMAKE_THREAD_LIBS_INIT})
|
||||
add_subdirectory(copyright)
|
||||
add_subdirectory(desktopfile)
|
||||
|
||||
add_library(linuxdeploy_core STATIC elf.cpp appdir.cpp ${HEADERS})
|
||||
target_link_libraries(linuxdeploy_core PUBLIC
|
||||
linuxdeploy_plugin linuxdeploy_core_log linuxdeploy_util linuxdeploy_core_desktopfile
|
||||
${BOOST_LIBS} CImg ${CMAKE_THREAD_LIBS_INIT}
|
||||
)
|
||||
target_link_libraries(linuxdeploy_core PRIVATE linuxdeploy_core_copyright)
|
||||
target_include_directories(linuxdeploy_core PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||
target_include_directories(linuxdeploy_core PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
add_library(linuxdeploy_core_copyright STATIC copyright.cpp copyright.h copyright_dpkgquery.cpp copyright_dpkgquery.h)
|
||||
|
||||
target_link_libraries(linuxdeploy_core_copyright PUBLIC linuxdeploy_util ${BOOST_LIBS})
|
||||
|
||||
target_include_directories(linuxdeploy_core_copyright PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
@@ -0,0 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/linuxdeploy/core/desktopfile/*.h)
|
||||
|
||||
add_library(linuxdeploy_core_desktopfile STATIC
|
||||
desktopfile.cpp
|
||||
desktopfileentry.cpp
|
||||
desktopfilereader.cpp
|
||||
desktopfilewriter.cpp
|
||||
desktopfilereader.h
|
||||
desktopfilewriter.h
|
||||
${HEADERS}
|
||||
)
|
||||
|
||||
target_include_directories(linuxdeploy_core_desktopfile PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(linuxdeploy_core_desktopfile PUBLIC linuxdeploy_util linuxdeploy_core_log ${BOOST_LIBS})
|
||||
@@ -1,5 +1,5 @@
|
||||
// local headers
|
||||
#include "linuxdeploy/core/desktopfile.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfile.h"
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "desktopfilereader.h"
|
||||
#include "desktopfilewriter.h"
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
// local headers
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "linuxdeploy/core/desktopfileentry.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfileentry.h"
|
||||
|
||||
using boost::lexical_cast;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
// local headers
|
||||
#include "linuxdeploy/util/util.h"
|
||||
#include "linuxdeploy/core/desktopfileentry.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfileentry.h"
|
||||
#include "desktopfilereader.h"
|
||||
|
||||
namespace bf = boost::filesystem;
|
||||
@@ -8,8 +8,8 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
// local includes
|
||||
#include "linuxdeploy/core/desktopfile.h"
|
||||
#include "linuxdeploy/core/desktopfileentry.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfile.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfileentry.h"
|
||||
|
||||
namespace linuxdeploy {
|
||||
namespace core {
|
||||
@@ -8,8 +8,8 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
// local includes
|
||||
#include "linuxdeploy/core/desktopfile.h"
|
||||
#include "linuxdeploy/core/desktopfileentry.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfile.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfileentry.h"
|
||||
|
||||
namespace linuxdeploy {
|
||||
namespace core {
|
||||
@@ -10,18 +10,29 @@
|
||||
|
||||
set -e
|
||||
|
||||
# download excludelist
|
||||
blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]"))
|
||||
filename=excludelist.h
|
||||
|
||||
tempfile=$(mktemp -t linuxdeploy-excludelist.h-XXXXXX)
|
||||
|
||||
log_prefix="-- [$(basename $0)]"
|
||||
|
||||
echo "$log_prefix downloading excludelist from GitHub"
|
||||
url="https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist"
|
||||
blacklisted=($(wget --quiet "$url" -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]"))
|
||||
|
||||
# sanity check
|
||||
if [ "$blacklisted" == "" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
filename=excludelist.h
|
||||
# make sure to clean up tempfile in case of errors and on exit
|
||||
_cleanup() {
|
||||
[ -f "$tempfile" ] && rm "$tempfile"
|
||||
}
|
||||
trap _cleanup EXIT
|
||||
|
||||
# overwrite existing source file
|
||||
cat > "$filename" <<EOF
|
||||
cat > "$tempfile" <<\EOF
|
||||
/*
|
||||
* List of libraries to exclude for different reasons.
|
||||
*
|
||||
@@ -42,10 +53,19 @@ cat > "$filename" <<EOF
|
||||
static const std::vector<std::string> generatedExcludelist = {
|
||||
EOF
|
||||
|
||||
# Create array
|
||||
# create array
|
||||
for item in ${blacklisted[@]:0:${#blacklisted[@]}-1}; do
|
||||
echo -e ' "'"$item"'",' >> "$filename"
|
||||
echo -e ' "'"$item"'",' >> "$tempfile"
|
||||
done
|
||||
echo -e ' "'"${blacklisted[$((${#blacklisted[@]}-1))]}"'"' >> "$filename"
|
||||
echo -e ' "'"${blacklisted[$((${#blacklisted[@]}-1))]}"'"' >> "$tempfile"
|
||||
|
||||
echo "};" >> "$filename"
|
||||
echo "};" >> "$tempfile"
|
||||
|
||||
# avoid overwriting if the contents have not changed
|
||||
# this prevents CMake having to recompile half of linuxdeploy even if nothing changed
|
||||
if [ "$(sha256sum $filename | awk '{print $1}')" != "$(sha256sum $tempfile | awk '{print $1}')" ]; then
|
||||
echo "$log_prefix changes detected, updating $filename"
|
||||
cp "$tempfile" "$filename"
|
||||
else
|
||||
echo "$log_prefix no changes detected, not touching $filename"
|
||||
fi
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
|
||||
// local headers
|
||||
#include "linuxdeploy/core/appdir.h"
|
||||
#include "linuxdeploy/core/desktopfile.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfile.h"
|
||||
#include "linuxdeploy/core/elf.h"
|
||||
#include "linuxdeploy/core/log.h"
|
||||
#include "linuxdeploy/plugin/plugin.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
add_library(linuxdeploy_util STATIC subprocess.cpp)
|
||||
target_sources(linuxdeploy_util INTERFACE
|
||||
${PROJECT_SOURCE_DIR}/include/linuxdeploy/util/util.h
|
||||
${PROJECT_SOURCE_DIR}/include/linuxdeploy/util/misc.h
|
||||
)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/linuxdeploy/util/*.h)
|
||||
|
||||
add_library(linuxdeploy_util STATIC subprocess.cpp ${HEADERS})
|
||||
target_include_directories(linuxdeploy_util INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include)
|
||||
target_link_libraries(linuxdeploy_util PUBLIC subprocess)
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
// local headers
|
||||
#include "linuxdeploy/core/desktopfile.h"
|
||||
#include "../../src/core/desktopfilereader.h"
|
||||
#include "linuxdeploy/core/desktopfile/desktopfile.h"
|
||||
#include "../../src/core/desktopfile/desktopfilereader.h"
|
||||
|
||||
using boost::bad_lexical_cast;
|
||||
using namespace linuxdeploy::core::desktopfile;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user