Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-welcome
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-welcome
Commits
a849b33d
Commit
a849b33d
authored
Jan 26, 2022
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: Drop the custom cargo.py script
parent
9f8d12ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
78 deletions
+22
-78
cargo.py
build-aux/cargo.py
+0
-52
meson.build
meson.build
+1
-2
meson.build
src/meson.build
+21
-24
No files found.
build-aux/cargo.py
deleted
100644 → 0
View file @
9f8d12ff
#!/usr/bin/env python3
from
os
import
environ
,
path
from
subprocess
import
run
from
argparse
import
ArgumentParser
from
shutil
import
copy
parser
=
ArgumentParser
()
parser
.
add_argument
(
"build_root"
)
parser
.
add_argument
(
"source_root"
)
parser
.
add_argument
(
"output"
)
parser
.
add_argument
(
"profile"
)
parser
.
add_argument
(
"project_name"
)
parser
.
add_argument
(
"features"
)
args
=
parser
.
parse_args
()
environ
[
"CARGO_TARGET_DIR"
]
=
path
.
join
(
args
.
build_root
,
"target"
)
environ
[
"CARGO_HOME"
]
=
path
.
join
(
args
.
build_root
,
"cargo-home"
)
cargo_toml_path
=
path
.
join
(
args
.
source_root
,
"Cargo.toml"
)
if
args
.
profile
==
"Devel"
:
print
(
"DEBUG MODE"
)
run
(
[
"cargo"
,
"build"
,
"--manifest-path"
,
cargo_toml_path
,
"--features"
,
args
.
features
,
],
check
=
True
,
)
build_dir
=
path
.
join
(
environ
[
"CARGO_TARGET_DIR"
],
"debug"
,
args
.
project_name
)
copy
(
build_dir
,
args
.
output
)
else
:
print
(
"RELEASE MODE"
)
run
(
[
"cargo"
,
"build"
,
"--manifest-path"
,
cargo_toml_path
,
"--release"
,
"--features"
,
args
.
features
,
],
check
=
True
,
)
build_dir
=
path
.
join
(
environ
[
"CARGO_TARGET_DIR"
],
"release"
,
args
.
project_name
)
copy
(
build_dir
,
args
.
output
)
meson.build
View file @
a849b33d
...
...
@@ -18,8 +18,7 @@ dependency('libadwaita-1', version: '>= 1')
glib_compile_resources = find_program('glib-compile-resources', required: true)
desktop_file_validate = find_program('desktop-file-validate', required: false)
appstream_util = find_program('appstream-util', required: false)
cargo = find_program('cargo', required: false)
cargo_script = find_program('build-aux/cargo.py')
cargo = find_program('cargo')
version = meson.project_version()
...
...
src/meson.build
View file @
a849b33d
...
...
@@ -18,40 +18,37 @@ run_command(
check: true
)
sources = files(
'widgets/pages/image.rs',
'widgets/pages/mod.rs',
'widgets/pages/welcome.rs',
'widgets/mod.rs',
'widgets/paginator.rs',
'widgets/window.rs',
'application.rs',
'config.rs',
'main.rs',
'utils.rs',
)
features = ''
if get_option('video_path') != ''
features = '--features video'
cargo_options = [ '--manifest-path', meson.project_source_root() / 'Cargo.toml' ]
cargo_options += [ '--target-dir', meson.project_build_root() / 'src' ]
if get_option('profile') == 'default'
cargo_options += [ '--release' ]
rust_target = 'release'
message('Building in release mode')
else
rust_target = 'debug'
message('Building in debug mode')
endif
custom_target(
cargo_env = [ 'CARGO_HOME=' + meson.project_build_root() / 'cargo-home' ]
cargo_build = custom_target(
'cargo-build',
build_by_default: true,
input: sources
,
build_always_stale: true
,
output: meson.project_name(),
console: true,
install: true,
install_dir: bindir,
depends: resources,
command: [
cargo_script,
meson.project_build_root(),
meson.project_source_root(),
'@OUTPUT@',
profile,
meson.project_name(),
features,
'env',
cargo_env,
cargo, 'build',
cargo_options,
'&&',
'cp', 'src' / rust_target / meson.project_name(), '@OUTPUT@',
]
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment