This repository has been archived by the owner on Jul 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve the install system, add three tests (#21)
* install system:allow the use of --datadir... Also some other improvements were made. DESTDIR and @datadir@ was not being used properly in the Makefile * move some functions from config_h.rs.in to config.rs * provide some instructions in the README on how to build and run without having to use autoconf and ./configure * add 'install-strip' target to Makefile * install docs * remove 'clean' target (use distclean instead) * simply install example in README * add a few tests to the source code (get_icon, access_card, access_pixmap) * remove empty dirs when uninstalling * add release target to Makefile, check for cargo bin existence * install even if cargo binary not found (for sudo installations when cargo isn't installed for the root user)
- Loading branch information
Showing
8 changed files
with
186 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,4 @@ | ||
|
||
|
||
use std::path::Path; | ||
|
||
fn get_datadir() -> &'static str { | ||
"@prefix@/share/" | ||
} | ||
|
||
pub fn get_assetsdir() -> String { | ||
if Path::new("./assets/cards").exists() { | ||
return ".".to_owned(); | ||
} | ||
format!("{}/{}", get_datadir(), "@PACKAGE_TARNAME@") | ||
} | ||
|
||
pub fn get_localedir() -> String { | ||
format!("{}/{}", get_datadir(), "locale") | ||
} | ||
|
||
pub fn get_pixmapsdir() -> String { | ||
if Path::new("./assets").exists() { | ||
return "./assets".to_owned(); | ||
} | ||
format!("{}/{}", get_datadir(), "pixmaps") | ||
pub fn get_datadir() -> &'static str { | ||
"@DATADIR@" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.