Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit abd600a

Browse files
authored
Merge pull request #226 from cortex-command-community/linux-appimage
Linux AppImage
2 parents f96ebfe + 069eec9 commit abd600a

File tree

6 files changed

+90
-5
lines changed

6 files changed

+90
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ The Linux build uses the meson build system, and builds against system libraries
3939

4040
Dependencies:
4141

42+
* `g++>=8.1` (needs to support c++17)
4243
* `allegro4`
4344
* `loadpng`
4445
* `flac`

Resources/cccp.desktop

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Desktop Entry]
2+
Categories=Game;
3+
Type=Application
4+
Icon=cccp
5+
Name=cccp
6+
Exec=CCCP.x86_64
7+

Resources/cccp.xpm

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/* XPM */
2+
static char *ccicon[] = {
3+
/* columns rows colors chars-per-pixel */
4+
"32 32 21 1 ",
5+
" c None",
6+
". c #1C2027",
7+
"X c #483910",
8+
"o c #785830",
9+
"O c #354B74",
10+
"+ c #484848",
11+
"@ c #585858",
12+
"# c #7A7A78",
13+
"$ c #801C09",
14+
"% c #98583B",
15+
"& c #AB5D64",
16+
"* c #A88E51",
17+
"= c #F98363",
18+
"- c #1B57B3",
19+
"; c #3D7BCB",
20+
": c #5595DB",
21+
"> c #7DBFF7",
22+
", c #8F918D",
23+
"< c #CBA18C",
24+
"1 c #FBC0B0",
25+
"2 c #D8F8F0",
26+
/* pixels */
27+
" ",
28+
" ",
29+
" :::::::::::: ",
30+
" :::::::::::: ",
31+
" ::>>;;OOOOOOOO--::;; ",
32+
" ::>>;;OOOOOOOO--::;; ",
33+
" ::2222OO OOOO;;;; ",
34+
" ::2222OO OOOO;;;; ",
35+
" >>22 OO;; ",
36+
" >>22 OO;; ",
37+
" ::;;OO OO--;; ",
38+
" ::;;OO OO--;; ",
39+
" ::OO &&====&& OO;; ",
40+
" ::OO &&====&& OO;; ",
41+
" ::OO &&==11&&<<$$ OO;; ",
42+
" ::OO &&==11&&<<$$ OO;; ",
43+
" ::OO &&11====<<$$ OO;; ",
44+
" ::OO &&11====<<$$ OO;; ",
45+
" ::OO $$&&%%%%$$$$ OO;; ",
46+
" ::OO $$&&%%%%$$$$ OO;; ",
47+
" ::;;OO XXooooXX OO--;; ",
48+
" ::;;OO XXooooXX OO--;; ",
49+
" ::OO **** OO;; ",
50+
" ::OO **** OO;; ",
51+
" ;;;;@@@@ @@@@ @@@@;;;; ",
52+
" ;;;;@@@@ @@@@ @@@@;;;; ",
53+
" @@##@@,,,,,,,,@@##@@ ",
54+
" @@##@@,,,,,,,,@@##@@ ",
55+
" ..++XX,,,,,,,,XX++.. ",
56+
" ..++XX,,,,,,,,XX++.. ",
57+
" ..XX@@++@@@@++@@XX.. ",
58+
" ..XX@@++@@@@++@@XX.. "
59+
};

Resources/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
desktop_file = files('cccp.desktop')
2+
icon_file = files('cccp.xpm')
3+
4+
install_data('cccp.desktop', install_dir:'share/applications', install_mode:'rw-r--r--')

external/lib/linux/x86_64/meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
ext_libs = [files('libfmod.so.11')]
1+
cp = find_program('cp')
2+
fmod_so = files('libfmod.so.11', 'libfmod.so')
3+
fmod = custom_target('libfmod', output:['libfmod.so'], input:fmod_so, command:[cp, '-P', '@INPUT@', '@OUTDIR@'])

meson.build

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,24 @@ subdir('GUI')
3838
subdir('Managers')
3939
subdir('Menus')
4040
subdir('System')
41+
subdir('Resources')
4142
subdir('external')
4243

43-
executable('CCCP_debug', 'Main.cpp',sources, link_with: [luabind_debug, raknet_debug],
44-
dependencies: [deps], include_directories:[source_inc_dirs, external_inc_dirs], objects:ext_libs,
44+
debug = executable('CCCP_debug', 'Main.cpp',sources, link_with: [luabind_debug, raknet_debug, fmod],
45+
dependencies: [deps], include_directories:[source_inc_dirs, external_inc_dirs],
4546
cpp_args:extra_args, cpp_pch:pch, name_suffix:suffix, override_options:['buildtype=debugoptimized', 'optimization=g'])
4647

47-
executable('CCCP', 'Main.cpp', sources, link_with: [luabind,raknet],
48-
dependencies: [deps], include_directories:[source_inc_dirs, external_inc_dirs], objects: ext_libs,
48+
release = executable('CCCP', 'Main.cpp', sources, link_with: [luabind, raknet, fmod],
49+
dependencies: [deps], include_directories:[source_inc_dirs, external_inc_dirs],
4950
cpp_args:extra_args, cpp_pch:pch, name_suffix:suffix, build_by_default:false, override_options:['buildtype=release', 'optimization=3', 'debug=false'])
51+
52+
#AppImage Targeting
53+
wget = find_program('wget')
54+
55+
linuxdeploy_url = 'https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage'
56+
57+
linuxdeploy = custom_target('linuxdeploy', build_by_default:false, output:'linuxdeploy-x86_64.AppImage', command:[find_program('env'), wget, '-O', '@OUTPUT@', linuxdeploy_url, '&&', find_program('chmod'), '+x', '@OUTPUT@'])
58+
chmod = find_program('chmod')
59+
outname = 'cccp-x86_64.AppImage'
60+
61+
custom_target('appimage', depends:[release, linuxdeploy], output:outname , command:[find_program('env'), 'OUTPUT='+outname, linuxdeploy.full_path(), '--appdir=@PRIVATE_DIR@', '-e', release, '-l', fmod, '-l', fmod.full_path()+'.11', '-d', desktop_file, '-i', icon_file, '-oappimage'])

0 commit comments

Comments
 (0)