103 Commits

Author SHA1 Message Date
TheAssassin b7a2e39ba2 Try to build for arm64, mk. 4 2019-12-03 02:04:02 +01:00
TheAssassin d9acb6b244 Try to build for arm64, mk. 3 2019-12-03 01:50:59 +01:00
TheAssassin 891359edf4 Try to build for arm64, mk. 2 2019-12-03 01:47:18 +01:00
TheAssassin f68f8b94e0 Try to build for arm64, mk. 1 2019-12-03 01:38:28 +01:00
TheAssassin 1bd5453c61 Fix detection of copyright tools
CC #104
2019-11-18 23:13:44 +01:00
TheAssassin 9783db602e Quick fix unavailability of which command
CC #104
2019-11-18 20:44:53 +01:00
TheAssassin 6cfa741f40 Add missing newline (fixes #102) 2019-11-13 15:31:52 +01:00
TheAssassin 1be3327a11 Use own prebuilt CMake 2019-09-28 15:25:13 +02:00
TheAssassin cca5ad2e07 Merge pull request #96 from linuxdeploy/completely-switch-to-centos6
Build all binaries on CentOS 6
2019-09-28 04:22:40 +02:00
TheAssassin 058832615c Fix binaries upload 2019-09-28 04:02:00 +02:00
TheAssassin cf5927c521 Make sure old build script artifacts carry different name 2019-09-28 03:49:57 +02:00
TheAssassin 103b637944 Make CentOS 6 build script equivalent to old one 2019-09-28 03:49:15 +02:00
TheAssassin 58189efba6 Build binaries on CentOS 6 2019-09-28 03:48:53 +02:00
TheAssassin 019f902b17 Fix Docker build artifacts handling 2019-09-28 03:48:18 +02:00
TheAssassin f97d1e9a01 Improve shell use of Docker images 2019-09-28 03:47:24 +02:00
TheAssassin 543078c11e Clean up Dockerfile 2019-09-28 03:47:05 +02:00
TheAssassin 9ddb0d7650 Remove old debug code 2019-09-28 01:33:45 +02:00
TheAssassin 8252503d97 Merge pull request #95 from linuxdeploy/centos6-builds
Centos6 builds
2019-09-27 21:59:30 +02:00
TheAssassin d312ba07d0 No need to run install step for Docker builds 2019-09-27 21:34:06 +02:00
TheAssassin d3853e961b Clean up Dockerfile 2019-09-27 21:32:44 +02:00
TheAssassin ef7b397d4a Use devtoolset to compile dependencies in CentOS 6 builds 2019-09-27 21:32:27 +02:00
TheAssassin 330f8a393f Use devtoolset 7 for 64-bit CentOS builds 2019-09-27 21:32:09 +02:00
TheAssassin 77ad746c5d Build i386 CentOS 6 binaries on Travis 2019-09-27 21:15:52 +02:00
TheAssassin cd04cc260e 32-bit CentOS 6 builds 2019-09-27 21:09:10 +02:00
TheAssassin 3c4580a325 Allow bundling of additional binaries without moving them
Required to bundle e.g., applications' plugins together with their
dependencies without moving them out of position so they can still
be found by the original apps.
2019-09-22 19:06:00 +02:00
TheAssassin f20af7dc67 Refactor and improve relative directory calculation
Also makes variable names less ambiguous and adds some documenting
comments.
2019-09-22 18:58:21 +02:00
TheAssassin 0ba33879b0 Fix argument forwarding in generated AppRun script 2019-09-12 16:35:09 +02:00
TheAssassin f3b7c5ab73 Never ask to integrate linuxdeploy AppImages 2019-09-06 15:47:45 +02:00
TheAssassin 6bc354bacb Update linuxdeploy-desktopfile 2019-09-06 03:13:21 +02:00
TheAssassin d26947985d Add tests only if they are built and can therefore be run 2019-09-06 03:13:05 +02:00
TheAssassin 2cc962a344 Update README.md 2019-08-22 15:08:04 +02:00
TheAssassin 612bf962a3 Another missing return statement 2019-08-15 01:10:02 +02:00
TheAssassin 19d958d30f There should at least be debug messages for potential errors 2019-08-15 00:00:19 +02:00
TheAssassin fc82028af4 More forgotten return statements in bool methods 2019-08-14 23:57:50 +02:00
TheAssassin 2d45ef4c72 Fix missing return statement in static bool method
Looks like devtoolset compiler behaves differently on bool methods
without an explicit return statement. Kind of strange.

Undefined behavior?
2019-08-14 23:42:57 +02:00
TheAssassin 470caa3db1 Replace ln based subprocess symlinking with boost functionality 2019-08-14 23:25:21 +02:00
TheAssassin d24e6dac56 Clean up symlink helper 2019-08-14 22:47:59 +02:00
TheAssassin 913f5bc6cc Mirror package was hosted on disappeared 2019-08-14 16:12:19 +02:00
TheAssassin 4746fd0e87 Merge pull request #87 from linuxdeploy/apprun-hooks
AppRun hooks for plugins
2019-08-14 16:10:45 +02:00
TheAssassin de363bc90b Merge branch 'master' into apprun-hooks 2019-08-14 15:14:02 +02:00
TheAssassin 8e9114b7c5 Improve generated AppRun script 2019-08-14 14:36:06 +02:00
TheAssassin 72e4fb49e0 Don't try to move if there's no need to do so 2019-08-14 14:35:53 +02:00
TheAssassin abdefbc0ff Use a custom variable to support test runs from IDE better
When your IDE is running as an AppImage, the $APPRUN variable is
already set in the built-in terminal. Now of course you could just
calculate the path of $APPRUN yourself and force-overwrite it in that
script; however that's more effort and more likely to break.

Therefore it's easier to just introduce and use a custom variable.
2019-08-14 14:33:25 +02:00
TheAssassin 58845cee8f Support for AppRun hooks installed by plugins, mk. 1 2019-08-14 04:13:30 +02:00
TheAssassin 5bc8840003 Mark methods const where possible 2019-08-14 04:11:36 +02:00
TheAssassin 1cb5a742db Break up deployment algorithm into independent methods
That makes maintenance easier.
2019-08-14 02:28:21 +02:00
TheAssassin 142facd986 Improve method 2019-08-14 01:35:31 +02:00
TheAssassin aced62378a Move AppDir root deployment into separate class
Makes adding more features easier, as there's a clear defined interface
to the class and the mechanism can be split into more methods more
easily without bloating the AppDir class further.
2019-08-14 01:35:23 +02:00
TheAssassin 3fd595a63b Expose file copying helper in public interface 2019-08-14 01:33:09 +02:00
TheAssassin 9dc10fc0fc Method can be static 2019-08-14 01:08:20 +02:00
TheAssassin 3183ee2f4f Mark methods const where possible 2019-07-27 16:37:16 +02:00
TheAssassin 374e17b5e3 Merge pull request #85 from linuxdeploy/update_cpp_subprocess
Update cpp-subprocess to ensure that the bug in util::read_all() is fixed
2019-07-25 20:32:12 +02:00
TheAssassin d9681ccf5c Merge branch 'master' into update_cpp_subprocess 2019-07-25 20:10:35 +02:00
Alexis Lopez Zubieta 57dbdc6933 Update cpp-subprocess to ensure that the bug in util::read_all() is fixed 2019-07-25 13:08:21 -05:00
TheAssassin 3d766446d9 Improve log message 2019-07-25 17:47:34 +02:00
TheAssassin e24b46d291 Change method name to something more meaningful 2019-07-25 17:44:50 +02:00
TheAssassin 47b8370751 Method can be static 2019-07-25 17:43:45 +02:00
TheAssassin 0d055ebb81 Merge pull request #84 from darealshinji/patch-1
remove all comments
2019-07-07 16:06:52 +02:00
darealshinji ce5aecead5 remove all comments
Otherwise the generated header contains entries like this:
``` c
    "libxcb-dri2.so.0",
    "#",
    "https://github.com/probonopd/linuxdeployqt/issues/331#issuecomment-442276277",
    "libxcb-dri3.so.0",
    "#",
    "https://github.com/AppImage/AppImages/issues/348",
```
2019-07-06 20:21:16 +02:00
TheAssassin f01ae51f58 Merge pull request #79 from haampie/fix-deployment-of-dependencies
Fix an issue where dependencies are not deployed when calling deployLibrary only
2019-06-10 20:31:12 +02:00
Harmen Stoppels 0e95f19a75 Make deployLibrary deploy its dependencies by default, and avoid unnecessary recursion by making deployElfDependencies not deploy its deps of deps 2019-06-10 20:12:30 +02:00
TheAssassin 94bb814d69 Merge pull request #78 from haampie/fix-remove-recursion-elf-deployment
Remove recursion of ELF deployment since ldd already does that for us
2019-06-09 21:08:37 +02:00
Harmen Stoppels 159b082658 Remove recursion of ELF deployment since ldd already does that for us 2019-06-09 14:43:59 +02:00
TheAssassin 2a1127d7e8 Show acceptable icon sizes in error message
CC #75.
2019-05-24 23:25:03 +02:00
TheAssassin 3f81577b04 Fix missing newline in error messages 2019-05-24 22:49:19 +02:00
TheAssassin 834b467a41 Fix data printed in error message 2019-05-24 22:48:53 +02:00
TheAssassin 46ccb8965d Add missing valid resolutions (CC #75) 2019-05-24 16:19:36 +02:00
TheAssassin 5c3a51fd48 Merge pull request #71 from dbarach/master
Add a workspace sanity check
2019-03-27 17:12:19 +01:00
Dave Barach 44cb9466b3 Merge branch 'master' of https://github.com/dbarach/linuxdeploy
Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-27 11:08:11 -04:00
Dave Barach 1dfcab8556 Add a workspace sanity check
Check to make sure that one source file in one of the git submodules
is present. If not, throw a fatal error which explains what probably
went wrong, and how to fix it:

"Missing submodule(s), please 'git clone --recurse-submodules...'"

Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-27 11:03:25 -04:00
Dave Barach e62e8d8396 Add a workspace sanity check
Check to make sure that one source file in one of the git submodules
is present. If not, throw a fatal error which explains what probably
went wrong, and how to fix it:

"Missing submodule(s), please 'git clone --recurse-submodules...'"

Signed-off-by: Dave Barach <dave@barachs.net>
2019-03-27 10:23:47 -04:00
TheAssassin 875842ee3b Fix linking issues 2019-03-21 15:13:08 +01:00
TheAssassin a4fe77305d Reduce redundancy when adding boost header-only libs 2019-03-21 11:51:06 +01:00
TheAssassin 4f44dcf954 Fix Docker build script path issue 2019-03-21 11:28:15 +01:00
TheAssassin 44b234734b Upload CentOS 6 binaries 2019-03-21 11:27:02 +01:00
TheAssassin 871f1d6e99 Fix permissions 2019-03-21 11:20:45 +01:00
TheAssassin f06643ea5f Experimental CentOS 6 build 2019-03-21 11:13:44 +01:00
TheAssassin 6baa443fd7 appimagetool is being annoying 2019-03-21 10:32:17 +01:00
TheAssassin 77c52883f1 Remove deprecated debug code 2019-03-20 17:25:13 +01:00
TheAssassin 157861d236 Make symlinking work for older versions of ln, too 2019-03-20 17:23:14 +01:00
TheAssassin 32dca18eee We don't use exceptions for error communication 2019-03-20 17:22:46 +01:00
TheAssassin 1f498772b4 Properly handle nonexisting files 2019-02-23 18:01:47 +01:00
TheAssassin f9fc51a832 Improve search for patchelf
CC https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/24.
2019-02-20 13:13:34 +01:00
TheAssassin a3e06e0024 Statically link desktopfile library 2019-02-07 00:46:59 +01:00
TheAssassin 956a253428 Return final deployment path
deployFile allows for specifying a directory as destination, and copies
files into there, simulating the behavior of tools like cp. To do that,
it creates the directory, then appends the filename of the input file
to it and uses that as destination for the "copy file" call.

It's pretty handy for some applications to get the full path of the
new file returned by this method directly (doesn't have to implement
this concatenation more than once).
2019-02-06 23:23:48 +01:00
TheAssassin ce6597fb9d Better handle debug-symbols-only ELF files 2019-01-29 01:00:36 +01:00
TheAssassin 028d85a070 Explicitly disable all copy/move(-assignment) behavior 2019-01-29 00:03:35 +01:00
TheAssassin 8df605cb19 Use shared pointer to manage PImpl object 2019-01-29 00:02:49 +01:00
TheAssassin 3a0870842c Update linuxdeploy-desktopfile 2019-01-28 16:52:20 +01:00
TheAssassin 1510d0c333 Update README.md
[ci skip]
2019-01-07 15:45:43 +01:00
TheAssassin 7c8ab1c773 Fix desktop file deployment 2018-12-22 23:26:28 +01:00
TheAssassin 5374e7ece9 Switch to extracted desktop file library 2018-12-22 23:09:04 +01:00
TheAssassin 6b715c691a Give test case more suitable name 2018-12-22 23:02:39 +01:00
TheAssassin 78f33a7190 Move linuxdeploy-specific helper out of desktop file class 2018-12-22 23:02:15 +01:00
TheAssassin 3df27ba175 Add proper desktop file
The auto-generated desktop file does trigger integration tools like
AppImageLauncher, this one shows it's a CLI tool and should just be
launched now.
2018-12-21 19:08:33 +01:00
TheAssassin 2ea9a367b5 Check whether parsing with comments is supported 2018-12-21 19:08:33 +01:00
TheAssassin 673ccf5691 Improve simple desktop file test 2018-12-21 19:08:33 +01:00
TheAssassin d743e11486 Merge pull request #63 from linuxdeploy/issue-62
Fix handling of localized desktop file entries
2018-12-09 16:13:06 +01:00
TheAssassin cddefc3806 Validate some constraints on localized keys 2018-12-06 12:09:18 +01:00
TheAssassin 1f5315926d Increase readability 2018-12-06 12:08:51 +01:00
TheAssassin a12f3ac0fe Improve error message 2018-12-06 11:56:21 +01:00
TheAssassin 640b756a7f Temporarily allow localization brackets in key names
Must be revised when introducing proper localization support.
2018-12-06 11:49:14 +01:00
TheAssassin d486f936e2 Test localized keys support
This is the unit test that was missing to cover the use case described
in #69.
2018-12-06 11:47:25 +01:00
53 changed files with 931 additions and 2529 deletions
+3 -18
View File
@@ -76,24 +76,9 @@
[submodule "lib/googletest"]
path = lib/googletest
url = https://github.com/google/googletest
[submodule "lib/boost-lexical_cast"]
path = lib/boost-lexical_cast
url = https://github.com/boostorg/lexical_cast
[submodule "lib/boost-concept_check"]
path = lib/boost-concept_check
url = https://github.com/boostorg/concept_check
[submodule "lib/boost-numeric_conversion"]
path = lib/boost-numeric_conversion
url = https://github.com/boostorg/numeric_conversion
[submodule "lib/boost-array"]
path = lib/boost-array
url = https://github.com/boostorg/array
[submodule "lib/boost-container"]
path = lib/boost-container
url = https://github.com/boostorg/container
[submodule "lib/boost-move"]
path = lib/boost-move
url = https://github.com/boostorg/move
[submodule "lib/boost-math"]
path = lib/boost-math
url = https://github.com/boostorg/math
[submodule "lib/linuxdeploy-desktopfile"]
path = lib/linuxdeploy-desktopfile
url = https://github.com/linuxdeploy/linuxdeploy-desktopfile
+52 -38
View File
@@ -3,7 +3,32 @@ sudo: required
matrix:
include:
- env: ARCH=x86_64
- name: CentOS 6 x86_64 build
env: ARCH=x86_64 BUILD_TYPE=centos6
install: true
services:
- docker
script: travis/build-centos6-docker.sh
after_success:
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy-"$ARCH".AppImage*
- name: CentOS 6 i386 build
env: ARCH=i386 BUILD_TYPE=centos6
install: true
services:
- docker
script: travis/build-centos6-docker.sh
after_success:
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy-"$ARCH".AppImage*
- name: Ubuntu bionic arm64 build
env: ARCH=arm64 BUILD_TYPE=arm64-native
dist: bionic
arch: arm64
addons:
apt:
update: true
@@ -12,21 +37,28 @@ matrix:
- libjpeg-dev
- libpng-dev
- cimg-dev
- automake # required for patchelf
- env: ARCH=i386
addons:
apt:
update: true
packages:
- libmagic-dev:i386
- libjpeg-dev:i386
- libpng-dev:i386
- gcc-multilib
- g++-multilib
- automake # required for patchelf
- libfuse2:i386
- libcairo2:i386
- env: ARCH=x86_64 BUILD_TYPE=coverage
- patchelf
before_script:
- git clone https://github.com/NixOS/patchelf.git && \
- pushd patchelf && \
- # cannot use -b since it's not supported in really old versions of git
- git checkout 0.8 && \
- ./bootstrap.sh && \
- ./configure --prefix=/usr && \
- make -j $(nproc) && \
- make install && \
- popd && \
- rm -r patchelf/
script: travis/build.sh
after_success:
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy-"$ARCH".AppImage*
- name: Ubuntu xenial x86_64 coverage build (no binaries uploaded)
env: ARCH=x86_64 BUILD_TYPE=coverage
dist: xenial
addons:
apt:
update: true
@@ -39,7 +71,10 @@ matrix:
- sudo pip install gcovr
script: travis/test-coverage.sh
after_success: true # also, we don't intend to upload release binaries
- env: ARCH=i386 BUILD_TYPE=coverage
- name: Ubuntu xenial i386 coverage build (no binaries uploaded)
env: ARCH=i386 BUILD_TYPE=coverage
dist: xenial
addons:
apt:
update: true
@@ -57,27 +92,6 @@ matrix:
after_success: true # also, we don't intend to upload release binaries
install:
- git clone https://github.com/NixOS/patchelf.git -b 0.8
- cd patchelf
- ./bootstrap.sh
- if [ "$ARCH" == "i386" ]; then ./configure --prefix=/usr --build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32; fi
- if [ "$ARCH" == "x86_64" ]; then ./configure --prefix=/usr; fi
- make -j$(nproc)
- sudo make install
- cd ..
- rm -rf patchelf
script:
- travis/build.sh
after_success:
- ls -lh
# make sure only pushes to rewrite create a new release, otherwise pretend PR and upload to transfer.sh
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy-"$ARCH".AppImage*
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
+5
View File
@@ -10,6 +10,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules/
set(USE_SYSTEM_BOOST OFF CACHE BOOL "Set to ON to use system boost libraries instead of building up to date boost libraries from source")
set(USE_SYSTEM_CIMG ON CACHE BOOL "Set to OFF to use CImg library bundled in lib directory")
if (EXISTS "${PROJECT_SOURCE_DIR}/lib/cpp-subprocess/subprocess.hpp")
else()
message (FATAL_ERROR "Missing submodule(s), please 'git submodule update --init --recursive'...")
endif()
# support for ccache
# call CMake with -DUSE_CCACHE=ON to make use of it
set(USE_CCACHE ON CACHE BOOL "")
+10 -65
View File
@@ -14,60 +14,21 @@ linuxdeploy is designed to be an AppDir maintenance tool. It provides extensive
linuxdeploy was greatly influenced by [linuxdeployqt](https://github.com/probonopd/linuxdeployqt), and while it employs stricter rules on AppDirs, it's more flexible in use. If you use linuxdeployqt at the moment, consider switching to linuxdeploy today!
## Usage
## User guides and examples
linuxdeploy, being a tool for creating AppDirs and eventually AppImages, is released as an AppImage itself. Please download and use the AppImage for normal use. If you encounter errors, e.g., when building the tool from source, please try with the AppImage first before [creating an issue](https://github.com/TheAssassin/linuxdeploy/issues/new).
Please see the [linuxdeploy user guide](https://docs.appimage.org/packaging-guide/linuxdeploy-user-guide.html) and the [native binaries packaging guide](https://docs.appimage.org/packaging-guide/native-binaries.html) in the [AppImage documentation](https://docs.appimage.org). There's also an [examples section](https://docs.appimage.org/packaging-guide/native-binaries.html#examples).
There are two main ways to use linuxdeploy: Provide the paths to all files you want to bundle manually, or create an FHS-like directory and run linuxdeploy on it.
Most build systems provide some kind of `make install` functionality that is capable of producing FHS-like directory trees that can be turned into AppDirs:
## Projects using linuxdeploy
```sh
# automake
./configure --prefix=/usr
make install DESTDIR=AppDir
This is an incomplete list of projects using linuxdeploy. You might want to read their build scripts to see how they use linuxdeploy.
# cmake
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
make install DESTDIR=AppDir
# qmake
qmake CONFIG+=release PREFIX=/usr .
make install INSTALL_ROOT=AppDir
```
Next, download the latest linuxdeploy AppImage. It's available on the [release page](https://github.com/linuxdeploy/linuxdeploy/releases). Make sure to pick the right one for your (target) architecture.
Now, simply run linuxdeploy like `./linuxdeploy*.AppImage --appdir AppDir`.
Please use `./linuxdeploy*.AppImage --help` to get a list of options supported by linuxdeploy.
If your build system cannot produce such install trees or you prefer to bundle everything manually, you can also specify the paths to the resources yourself. linuxdeploy provides the following options for this use case:
```
-l[library...],
--lib=[library...],
--library=[library...] Shared library to deploy
-e[executable...],
--executable=[executable...] Executable to deploy
-d[desktop file...],
--desktop-file=[desktop file...] Desktop file to deploy
enough for some tests
-i[icon file...],
--icon-file=[icon file...] Icon to deploy
```
An example run could look like this:
```bash
./linuxdeploy*.AppImage --appdir AppDir -e myapp -d myapp.desktop -i myapp_64x64.png
```
Of course both approaches can be combined, e.g., you can bundle additional executables with your main app.
linuxdeploy doesn't mind being run on an AppDir more than once, as it recognize previous runs, and should not break files within the AppDir. This is called an "iterative workflow". In case of errors, you can simply fix them, and re-run linuxdeploy afterwards.
If you ever encounter issues when running linuxdeploy on an existing AppDir, please let us know by [creating an issue](https://github.com/TheAssassin/linuxdeploy/issues/new).
- [Pext](https://github.com/Pext/Pext)
- [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher)
- [OpenRCT2](https://github.com/OpenRCT2/OpenRCT2)
- [AppImageUpdate](https://github.com/AppImage/AppImageUpdate)
- [appimaged](https://github.com/AppImage/appimaged)
- [MediaElch](https://github.com/Komet/MediaElch/)
## Plugins
@@ -93,22 +54,6 @@ If you want to use a plugin to bundle additional resources, please add `./linuxd
**Note:** If you want to suggest a plugin for a specific framework, language etc., please feel free to [create a new issue](https://github.com/linuxdeploy/linuxdeploy/issues/new). Current plugin requests can be found [here](https://github.com/linuxdeploy/linuxdeploy/issues?utf8=%E2%9C%93&q=label%3A%22plugin+request%22).
## User guides and examples
Please see the [linuxdeploy user guide](https://docs.appimage.org/packaging-guide/linuxdeploy-user-guide.html) and the [native binaries packaging guide](https://docs.appimage.org/packaging-guide/native-binaries.html) in the [AppImage documentation](https://docs.appimage.org). There's also an [examples section](https://docs.appimage.org/packaging-guide/native-binaries.html#examples).
## Projects using linuxdeploy
This is an incomplete list of projects using linuxdeploy. You might want to read their build scripts to see how they use linuxdeploy.
- [Pext](https://github.com/Pext/Pext)
- [AppImageLauncher](https://github.com/TheAssassin/AppImageLauncher)
- [OpenRCT2](https://github.com/OpenRCT2/OpenRCT2)
- [AppImageUpdate](https://github.com/AppImage/AppImageUpdate)
- [appimaged](https://github.com/AppImage/appimaged)
## Troubleshooting
> I bundled additional resources, but when I try to run them, either the system binary is called or the file is not found.
+22 -14
View File
@@ -1,11 +1,12 @@
// system includes
#include <memory>
#include <string>
// library includes
#include <boost/filesystem.hpp>
// local includes
#include "linuxdeploy/core/desktopfile/desktopfile.h"
#include "linuxdeploy/desktopfile/desktopfile.h"
#pragma once
@@ -19,7 +20,7 @@ namespace linuxdeploy {
private:
// private data class pattern
class PrivateData;
PrivateData* d;
std::shared_ptr<PrivateData> d;
public:
// default constructor
@@ -27,14 +28,18 @@ namespace linuxdeploy {
// the directory will be created if it doesn't exist
explicit AppDir(const boost::filesystem::path& path);
~AppDir();
// we don't want any copy/move(-assignment) behavior, therefore we delete those operators/constructors
AppDir(const AppDir&) = delete;
AppDir(AppDir&&) = delete;
void operator=(const AppDir&) = delete;
void operator=(AppDir&&) = delete;
// alternative constructor
// shortcut for using a normal string instead of a path
explicit AppDir(const std::string& path);
// creates basic directory structure of an AppDir in "FHS" mode
bool createBasicStructure();
bool createBasicStructure() const;
// deploy shared library
//
@@ -59,41 +64,44 @@ namespace linuxdeploy {
bool deployIcon(const boost::filesystem::path& path);
// deploy arbitrary file
void deployFile(const boost::filesystem::path& from, const boost::filesystem::path& to);
boost::filesystem::path deployFile(const boost::filesystem::path& from, const boost::filesystem::path& to);
// copy arbitrary file (immediately)
bool copyFile(const boost::filesystem::path& from, const boost::filesystem::path& to, bool overwrite = false) const;
// create an <AppDir> relative symlink to <target> at <symlink>.
bool createRelativeSymlink(const boost::filesystem::path& target, const boost::filesystem::path& symlink);
bool createRelativeSymlink(const boost::filesystem::path& target, const boost::filesystem::path& symlink) const;
// execute deferred copy operations
bool executeDeferredOperations();
// return path to AppDir
boost::filesystem::path path();
boost::filesystem::path path() const;
// create a list of all icon paths in the AppDir
std::vector<boost::filesystem::path> deployedIconPaths();
std::vector<boost::filesystem::path> deployedIconPaths() const;
// create a list of all executable paths in the AppDir
std::vector<boost::filesystem::path> deployedExecutablePaths();
std::vector<boost::filesystem::path> deployedExecutablePaths() const;
// create a list of all desktop file paths in the AppDir
std::vector<desktopfile::DesktopFile> deployedDesktopFiles();
std::vector<desktopfile::DesktopFile> deployedDesktopFiles() const;
// create symlinks for AppRun, desktop file and icon in the AppDir root directory
bool createLinksInAppDirRoot(const desktopfile::DesktopFile& desktopFile, boost::filesystem::path customAppRunPath = "");
bool setUpAppDirRoot(const desktopfile::DesktopFile& desktopFile, boost::filesystem::path customAppRunPath = "");
// list all executables in <AppDir>/usr/bin
// this function does not perform a recursive search, but only searches the bin directory
std::vector<boost::filesystem::path> listExecutables();
std::vector<boost::filesystem::path> listExecutables() const;
// list all shared libraries in <AppDir>/usr/lib
// this function recursively searches the entire lib directory for shared libraries
std::vector<boost::filesystem::path> listSharedLibraries();
std::vector<boost::filesystem::path> listSharedLibraries() const;
// search for executables and libraries and deploy their dependencies
// calling this function can turn sure file trees created by make install commands into working
// AppDirs
bool deployDependenciesForExistingFiles();
bool deployDependenciesForExistingFiles() const;
// disable deployment of copyright files for this instance
void setDisableCopyrightFilesDeployment(bool disable);
@@ -1,126 +0,0 @@
// system includes
#include <unordered_map>
// library includes
#include <boost/filesystem.hpp>
// local includes
#include "desktopfileentry.h"
#pragma once
namespace linuxdeploy {
namespace core {
namespace desktopfile {
/*
* Parse and read desktop files.
*/
class DesktopFile {
public:
// describes a single section
typedef std::unordered_map<std::string, DesktopFileEntry> section_t;
// describes all sections in the desktop file
typedef std::unordered_map<std::string, section_t> sections_t;
private:
// private data class pattern
class PrivateData;
std::shared_ptr<PrivateData> d;
// (in)equality operators are implemented outside this class
friend bool operator==(const DesktopFile& first, const DesktopFile& second);
friend bool operator!=(const DesktopFile& first, const DesktopFile& second);
public:
// default constructor
DesktopFile();
// construct from existing desktop file
// if the file exists, it will be read using DesktopFileReader
// if reading fails, exceptions will be thrown (see DesktopFileReader for more information)
explicit DesktopFile(const boost::filesystem::path& path);
// construct by reading an existing stream
// file must exist, otherwise std::runtime_error is thrown
explicit DesktopFile(std::istream& is);
// copy constructor
DesktopFile(const DesktopFile& other);
// copy assignment constructor
DesktopFile& operator=(const DesktopFile& other);
// move assignment operator
DesktopFile& operator=(DesktopFile&& other) noexcept;
public:
// returns true if a file has been loaded, false otherwise
bool isEmpty() const;
// read desktop file
// sets path associated with this file
// throws exceptions in case of issues, see DesktopFileReader for more information
void read(const boost::filesystem::path& path);
// read desktop file from existing stream
// throws exceptions in case of issues, see DesktopFileReader for more information
void read(std::istream& is);
// get path associated with this file
boost::filesystem::path path() const;
// sets the path associated with this desktop file
// used to e.g., save the desktop file
void setPath(const boost::filesystem::path& path);
// clear contents of desktop file
void clear();
// save desktop file
bool save() const;
// save desktop file to path
// does not change path associated with desktop file
// throws exceptions in case of errors, see DesktopFileWriter::save(...) for more information
bool save(const boost::filesystem::path& path) const;
// save desktop file to ostream
// does not change path associated with desktop file
// throws exceptions in case of errors, see DesktopFileWriter::save(...) for more information
bool save(std::ostream& os) const;
// check if entry exists in given section and key
bool entryExists(const std::string& section, const std::string& key) const;
// get key from desktop file
// an std::string passed as value parameter will be populated with the contents
// returns true (and populates value) if the key exists, false otherwise
bool getEntry(const std::string& section, const std::string& key, DesktopFileEntry& value) const;
// add key to section in desktop file
// the section will be created if it doesn't exist already
// returns true if an existing key was overwritten, false otherwise
bool setEntry(const std::string& section, const DesktopFileEntry& entry);
// add key to section in desktop file
// the section will be created if it doesn't exist already
// returns true if an existing key was overwritten, false otherwise
bool setEntry(const std::string& section, DesktopFileEntry&& entry);
// create common application entries in desktop file
// returns false if one of the keys exists and was left unmodified
bool addDefaultKeys(const std::string& executableFileName);
// validate desktop file
bool validate() const;
};
// DesktopFile equality operator
bool operator==(const DesktopFile& first, const DesktopFile& second);
// DesktopFile inequality operator
bool operator!=(const DesktopFile& first, const DesktopFile& second);
}
}
}
@@ -1,71 +0,0 @@
#pragma once
// system headers
#include <memory>
#include <string>
// library headers
#include <boost/lexical_cast.hpp>
namespace linuxdeploy {
namespace core {
namespace desktopfile {
class DesktopFileEntry {
private:
// opaque data class pattern
class PrivateData;
std::shared_ptr<PrivateData> d;
public:
// default constructor
DesktopFileEntry();
// construct from key and value
explicit DesktopFileEntry(std::string key, std::string value);
// copy constructor
DesktopFileEntry(const DesktopFileEntry& other);
// copy assignment constructor
DesktopFileEntry& operator=(const DesktopFileEntry& other);
// move assignment operator
DesktopFileEntry& operator=(DesktopFileEntry&& other) noexcept;
// equality operator
bool operator==(const DesktopFileEntry& other) const;
// inequality operator
bool operator!=(const DesktopFileEntry& other) const;
public:
// checks whether a key and value have been set
bool isEmpty() const;
// return entry's key
const std::string& key() const;
// return entry's value
const std::string& value() const;
public:
// convert value to integer
// throws boost::bad_lexical_cast in case of type errors
int32_t asInt() const;
// convert value to long
// throws boost::bad_lexical_cast in case of type errors
int64_t asLong() const;
// convert value to double
// throws boost::bad_lexical_cast in case of type errors
double asDouble() const;
// split CSV list value into vector
// the separator used to split the string is a semicolon as per desktop file spec
std::vector<std::string> parseStringList() const;
};
}
}
}
@@ -1,40 +0,0 @@
#pragma once
// system includes
#include <stdexcept>
#include <string>
namespace linuxdeploy {
namespace core {
namespace desktopfile {
/**
* Desktop file library's base exception.
*/
class DesktopFileError : public std::runtime_error {
public:
explicit DesktopFileError(const std::string& message = "unknown desktop file error") : runtime_error(message) {};
};
/**
* Exception thrown by DesktopFileReader on parsing errors.
*/
class ParseError : public DesktopFileError {
public:
explicit ParseError(const std::string& message = "unknown parse error") : DesktopFileError(message) {};
};
/**
* I/O exception, thrown if files cannot be opened, reading or writing fails etc.
*/
class IOError : public DesktopFileError {
public:
explicit IOError(const std::string& message = "unknown I/O error") : DesktopFileError(message) {};
};
class UnknownSectionError : public DesktopFileError {
public:
explicit UnknownSectionError(const std::string& section) : DesktopFileError("unknown section: " + section) {};
};
}
}
}
+23 -99
View File
@@ -9,77 +9,31 @@ add_library(args INTERFACE)
target_sources(args INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/args/args.hxx)
target_include_directories(args INTERFACE args)
add_subdirectory(linuxdeploy-desktopfile)
function(ld_add_boost_headeronly_lib)
set(options "")
set(oneValueArgs TARGET_NAME ROOT_DIR)
set(multiValueArgs LINK_LIBRARIES)
cmake_parse_arguments(A "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
# message(STATUS "Adding boost header-only library ${A_TARGET_NAME} in directory ${A_ROOT_DIR} with dependencies to ${A_LINK_LIBRARIES}")
add_library(${A_TARGET_NAME} INTERFACE)
set_property(TARGET ${A_TARGET_NAME} PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${A_ROOT_DIR}/include>")
set_property(TARGET ${A_TARGET_NAME} PROPERTY INTERFACE_LINK_LIBRARIES ${A_LINK_LIBRARIES})
endfunction()
if(NOT USE_SYSTEM_BOOST)
add_library(boost_config INTERFACE)
set_property(TARGET boost_config PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-config/include>")
ld_add_boost_headeronly_lib(TARGET_NAME boost_config ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/boost-config)
add_library(boost_utility INTERFACE)
set_property(TARGET boost_utility PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-utility/include>")
set_property(TARGET boost_utility PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
ld_add_boost_headeronly_lib(TARGET_NAME boost_throw_exception ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/boost-throw_exception LINK_LIBRARIES boost_throw_exception)
add_library(boost_predef INTERFACE)
set_property(TARGET boost_predef PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-predef/include>")
set_property(TARGET boost_predef PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
foreach(boost_lib_name utility predef assert core type_traits iterator mpl preprocessor static_assert detail smart_ptr exception io container_hash range integer)
ld_add_boost_headeronly_lib(TARGET_NAME boost_${boost_lib_name} ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/boost-${boost_lib_name} LINK_LIBRARIES boost_config;boost_throw_exception)
endforeach()
add_library(boost_assert INTERFACE)
set_property(TARGET boost_assert PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-assert/include>")
set_property(TARGET boost_assert PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_core INTERFACE)
set_property(TARGET boost_core PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-core/include>")
set_property(TARGET boost_core PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_type_traits INTERFACE)
set_property(TARGET boost_type_traits PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-type_traits/include>")
set_property(TARGET boost_type_traits PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_iterator INTERFACE)
set_property(TARGET boost_iterator PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-iterator/include>")
set_property(TARGET boost_iterator PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_mpl INTERFACE)
set_property(TARGET boost_mpl PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-mpl/include>")
set_property(TARGET boost_mpl PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_preprocessor INTERFACE)
set_property(TARGET boost_preprocessor PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-preprocessor/include>")
set_property(TARGET boost_preprocessor PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_static_assert INTERFACE)
set_property(TARGET boost_static_assert PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-static_assert/include>")
set_property(TARGET boost_static_assert PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_detail INTERFACE)
set_property(TARGET boost_detail PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-detail/include>")
set_property(TARGET boost_detail PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_smart_ptr INTERFACE)
set_property(TARGET boost_smart_ptr PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-smart_ptr/include>")
set_property(TARGET boost_smart_ptr PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_throw_exception INTERFACE)
set_property(TARGET boost_throw_exception PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-throw_exception/include>")
set_property(TARGET boost_throw_exception PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_io INTERFACE)
set_property(TARGET boost_io PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-io/include>")
set_property(TARGET boost_io PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_container_hash INTERFACE)
set_property(TARGET boost_container_hash PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-container_hash/include>")
set_property(TARGET boost_container_hash PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_functional INTERFACE)
set_property(TARGET boost_functional PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-functional/include>")
set_property(TARGET boost_functional PROPERTY INTERFACE_LINK_LIBRARIES "boost_config;boost_container_hash")
add_library(boost_range INTERFACE)
set_property(TARGET boost_range PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-range/include>")
set_property(TARGET boost_range PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_integer INTERFACE)
set_property(TARGET boost_integer PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-integer/include>")
set_property(TARGET boost_integer PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
ld_add_boost_headeronly_lib(TARGET_NAME boost_functional ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/boost-utility LINK_LIBRARIES boost_config;boost_container_hash)
file(GLOB boost_system_srcs ${CMAKE_CURRENT_SOURCE_DIR}/boost-system/src/*.cpp)
add_library(boost_system STATIC ${boost_system_srcs})
@@ -92,7 +46,7 @@ if(NOT USE_SYSTEM_BOOST)
file(GLOB boost_filesystem_srcs ${CMAKE_CURRENT_SOURCE_DIR}/boost-filesystem/src/*.cpp)
add_library(boost_filesystem STATIC ${boost_filesystem_srcs})
target_include_directories(boost_filesystem PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost-filesystem/include)
target_link_libraries(boost_filesystem PUBLIC boost_config boost_utility boost_system)
target_link_libraries(boost_filesystem PUBLIC boost_config boost_utility boost_system boost_throw_exception)
file(GLOB boost_regex_srcs ${CMAKE_CURRENT_SOURCE_DIR}/boost-regex/src/*.cpp)
add_library(boost_regex STATIC ${boost_regex_srcs})
@@ -101,38 +55,8 @@ if(NOT USE_SYSTEM_BOOST)
boost_config boost_predef boost_assert boost_throw_exception boost_smart_ptr boost_core boost_mpl
boost_type_traits boost_static_assert boost_integer boost_preprocessor boost_functional boost_detail
)
add_library(boost_numeric_conversion INTERFACE)
set_property(TARGET boost_numeric_conversion PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-numeric_conversion/include>")
set_property(TARGET boost_numeric_conversion PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_concept_check INTERFACE)
set_property(TARGET boost_concept_check PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-concept_check/include>")
set_property(TARGET boost_concept_check PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
target_link_libraries(boost_concept_check INTERFACE boost_numeric_conversion)
add_library(boost_array INTERFACE)
set_property(TARGET boost_array PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-array/include>")
set_property(TARGET boost_array PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_move INTERFACE)
set_property(TARGET boost_move PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-move/include>")
set_property(TARGET boost_move PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
add_library(boost_container INTERFACE)
set_property(TARGET boost_container PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-container/include>")
set_property(TARGET boost_container PROPERTY INTERFACE_LINK_LIBRARIES boost_config boost_move)
add_library(boost_math INTERFACE)
set_property(TARGET boost_math PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-math/include>")
set_property(TARGET boost_math PROPERTY INTERFACE_LINK_LIBRARIES boost_config boost_move)
add_library(boost_lexical_cast INTERFACE)
set_property(TARGET boost_lexical_cast PROPERTY INTERFACE_INCLUDE_DIRECTORIES "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/boost-lexical_cast/include>")
set_property(TARGET boost_lexical_cast PROPERTY INTERFACE_LINK_LIBRARIES "boost_config")
target_link_libraries(boost_lexical_cast INTERFACE boost_concept_check boost_numeric_conversion boost_array boost_container boost_math)
endif()
if(BUILD_TESTING)
if(BUILD_TESTING AND NOT TARGET gtest)
add_subdirectory(googletest)
endif()
Submodule lib/boost-array deleted from cef221d8b4
Submodule lib/boost-math deleted from 6bbba17f9e
Submodule lib/boost-move deleted from 3ce9452f93
+9
View File
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=linuxdeploy
Type=Application
Terminal=true
NoDisplay=true
Exec=linuxdeploy
Icon=linuxdeploy
Categories=Development;
X-AppImage-Integrate=false
+1 -1
View File
@@ -10,7 +10,7 @@ if(USE_SYSTEM_BOOST)
set(BOOST_LIBS Boost::filesystem Boost::regex)
else()
# use custom built libs
set(BOOST_LIBS boost_system boost_filesystem boost_regex boost_lexical_cast)
set(BOOST_LIBS boost_system boost_filesystem boost_regex)
endif()
+35 -5
View File
@@ -8,6 +8,7 @@
using namespace linuxdeploy::core;
using namespace linuxdeploy::core::log;
using namespace linuxdeploy::desktopfile;
namespace bf = boost::filesystem;
namespace linuxdeploy {
@@ -32,14 +33,13 @@ namespace linuxdeploy {
return deployedDesktopFiles[0];
}
auto firstDeployedDesktopFileName = boost::filesystem::path(
desktopFilePaths.front()).filename().string();
auto firstDeployedDesktopFileName = boost::filesystem::path(desktopFilePaths.front()).filename().string();
auto desktopFileMatchingName = find_if(
deployedDesktopFiles.begin(),
deployedDesktopFiles.end(),
[&firstDeployedDesktopFileName](const desktopfile::DesktopFile& desktopFile) {
auto fileName = desktopFile.path().filename().string();
auto fileName = bf::path(desktopFile.path()).filename().string();
return fileName == firstDeployedDesktopFileName;
}
);
@@ -79,10 +79,40 @@ namespace linuxdeploy {
try {
desktopfile::DesktopFile desktopFile = getMainDesktopFile(desktopFilePaths, deployedDesktopFiles);
ldLog() << "Deploying desktop file:" << desktopFile.path() << std::endl;
return appDir.createLinksInAppDirRoot(desktopFile, customAppRunPath);
ldLog() << "Deploying files to AppDir root using desktop file:" << desktopFile.path() << std::endl;
return appDir.setUpAppDirRoot(desktopFile, customAppRunPath);
} catch (const DeployError& er) {
return false;
}
}
bool addDefaultKeys(DesktopFile& desktopFile, const std::string& executableFileName) {
ldLog() << "Adding default values to desktop file:" << desktopFile.path() << std::endl;
auto rv = true;
auto setDefault = [&rv, &desktopFile](const std::string& section, const std::string& key, const std::string& value) {
if (desktopFile.entryExists(section, key)) {
DesktopFileEntry entry;
// this should never return false
auto entryExists = desktopFile.getEntry(section, key, entry);
assert(entryExists);
ldLog() << LD_WARNING << "Key exists, not modified:" << key << "(current value:" << entry.value() << LD_NO_SPACE << ")" << std::endl;
rv = false;
} else {
auto entryOverwritten = desktopFile.setEntry(section, DesktopFileEntry(key, value));
assert(!entryOverwritten);
}
};
setDefault("Desktop Entry", "Name", executableFileName);
setDefault("Desktop Entry", "Exec", executableFileName);
setDefault("Desktop Entry", "Icon", executableFileName);
setDefault("Desktop Entry", "Type", "Application");
setDefault("Desktop Entry", "Categories", "Utility;");
return rv;
}
}

Some files were not shown because too many files have changed in this diff Show More