-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a create_nix.sh.in file that turns into create_nix.sh after var…
…iable substitution. The substituted variables are enclosed in @ symbols. The script is then run when building so long as -DPACKAGE_NIX was passed to the configure step of cmake and install was specified when building. See https://github.com/bluescan/tacentview/wiki/Distributing
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
cd @VIEWER_PACKAGE_DIR@ | ||
declare -a Numbers=() | ||
|
||
# Version string is replaced here. | ||
VersionString="@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@-@PROJECT_VERSION_PATCH@" | ||
|
||
PackageName="tacentview_${VersionString}" | ||
echo "Creating nix package: ${PackageName}" | ||
rm -rf ${PackageName} | ||
mkdir ${PackageName} | ||
|
||
# | ||
# THE BELOW IS DEB-SPECIFIC AND NEEDS TO BE UPDATED FOR NIX. | ||
# If a nix equivalent of deb_template is needed for Nix it should be | ||
# created. The main content in the template are the control files needed to | ||
# make a deb, plus the desktop icon files. | ||
# | ||
cp -rf deb_template/* ${PackageName}/ | ||
|
||
# Here we do a replacement of some fields in one of the deb script files. | ||
# We replace <ViewerVersionString> with the actual version string. | ||
sed -i "s/<ViewerVersionString>/${VersionString}/" "${PackageName}/DEBIAN/control" | ||
|
||
cp ../tacentview "${PackageName}/usr/bin/tacentview" | ||
|
||
# png txt ttf | ||
cp -f ../Assets/*.png "${PackageName}/usr/share/tacentview/Assets/" | ||
cp -f ../Assets/*.txt "${PackageName}/usr/share/tacentview/Assets/" | ||
cp -f ../Assets/*.ttf "${PackageName}/usr/share/tacentview/Assets/" | ||
fakeroot dpkg-deb --build ${PackageName} |