Debian pkg now supports icons through --deb-icon. #3

This commit is contained in:
Antonin Décimo
2014-09-18 21:31:42 +02:00
parent 32a6ffe060
commit 5eab2d841d
6 changed files with 56 additions and 20 deletions

View File

@@ -81,6 +81,11 @@ it will automatically detect which version your project uses.
`--osx-maintainer-name` Set the maintainers name. Provide it for OS X CFBundleIdentifier. `--osx-maintainer-name` Set the maintainers name. Provide it for OS X CFBundleIdentifier.
#### DEBIAN #### DEBIAN
`--deb-icon` Path to a single folder where icons are stored.
To be properly recognized, icons filename must contain `YYxYY`,
where `YY` is the resolution of the icon.
SVG files are recognized if suffixed with `.svg`.
Other files will be ignored.
`--maintainer-email` Set the maintainers email. `--maintainer-email` Set the maintainers email.
`--deb-maintainer-name` Set the maintainers name. `--deb-maintainer-name` Set the maintainers name.
`--deb-package-name` Set the name of the package and the command that will be used to launch your game. `--deb-package-name` Set the name of the package and the command that will be used to launch your game.
@@ -126,13 +131,6 @@ but if provided it can use them.
- then [Wine](http://www.winehq.org/) and [Resource Hacker](http://www.angusj.com/resourcehacker/) to set the icon. - then [Wine](http://www.winehq.org/) and [Resource Hacker](http://www.angusj.com/resourcehacker/) to set the icon.
This last step can be automatically done, assuming Wine is installed. This last step can be automatically done, assuming Wine is installed.
If you want to add icons in the debian package,
open it and put the icons in `/usr/share/icons/hicolor/YYxYY/apps/`,
where YY is the width of the icon.
You also have to edit the line `Icon=love` in
`/usr/share/applications/yourgame.desktop` to match the icon's name.
See [developer.gnome.org](https://developer.gnome.org/integration-guide/stable/basic-integration.html.en) for more informations.
### SEE ALSO ### SEE ALSO
[https://www.love2d.org](https://www.love2d.org) [https://www.love2d.org](https://www.love2d.org)
[https://www.love2d.org/wiki/Game_Distribution](https://www.love2d.org/wiki/Game_Distribution) [https://www.love2d.org/wiki/Game_Distribution](https://www.love2d.org/wiki/Game_Distribution)

View File

@@ -8,7 +8,7 @@ _love-release()
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-l" opts="-l"
opts="$opts -w --win-icon" opts="$opts -w --win-icon"
opts="$opts -d --deb-package-version --deb-maintainer-name --maintainer-email --deb-package-name" opts="$opts -d --deb-icon --deb-package-version --deb-maintainer-name --maintainer-email --deb-package-name"
opts="$opts -a --activity --apk-package-version --apk-maintainer-name --apk-package-name --update-android" opts="$opts -a --activity --apk-package-version --apk-maintainer-name --apk-package-name --update-android"
opts="$opts -m --osx-icon --osx-maintainer-name" opts="$opts -m --osx-icon --osx-maintainer-name"
opts="$opts -h -n -r -v -x --config --homepage --description --clean --help" opts="$opts -h -n -r -v -x --config --homepage --description --clean --help"

View File

@@ -45,6 +45,12 @@ maintainer_email=""
; No spaces and no special characters except underscore. Better be lowercase. ; No spaces and no special characters except underscore. Better be lowercase.
package_name="" package_name=""
; Icon directory
; Icons must contain YYxYY in their filename to be recognized,
; where YY is the resolution of the icon.
; SVG files are recognized if suffixed with .svg
icon=""
[android] [android]
; Android game activity ; Android game activity
; No spaces and no special characters except underscore. Better be lowercase. ; No spaces and no special characters except underscore. Better be lowercase.

View File

@@ -97,6 +97,13 @@ Path to an icns file to use.
Set the maintainer's name. Provide it for OS X CFBundleIdentifier. Set the maintainer's name. Provide it for OS X CFBundleIdentifier.
.SH DEBIAN .SH DEBIAN
.TP .TP
.B \-\-deb-icon \fIdir\fR
Path to a single folder where icons are stored.
To be properly recognized, icons filename must contain \fIYYxYY\fR,
where \fIYY\fR is the resolution of the icon.
SVG files are recognized if suffixed with \fI.svg\fR.
Other files will be ignored.
.TP
.B \-\-maintainer-email \fIemail\fR .B \-\-maintainer-email \fIemail\fR
Set the maintainer's email. Set the maintainer's email.
.TP .TP
@@ -160,14 +167,6 @@ you can use \fIicoutils\fR to create the icon,
then Wine and Resource Hacker to set the icon. then Wine and Resource Hacker to set the icon.
This last step can be automatically done, This last step can be automatically done,
assuming Wine is installed. assuming Wine is installed.
.br
If you want to add icons in the debian package,
open it and put the icons in \fI/usr/share/icons/hicolor/YYxYY/apps/\fR,
where YY is the width of the icon.
You also have to edit the line \"Icon=love\" in
\fI/usr/share/applications/yourgame.desktop\fR to match the icon's name.
See \fIhttps://developer.gnome.org/integration-guide/stable/basic-integration.html.en\fR
for more informations.
.SH SEE ALSO .SH SEE ALSO
.I https://www.love2d.org .I https://www.love2d.org
.br .br

View File

@@ -20,7 +20,7 @@ SCRIPT_ARGS="l;"
SCRIPT_ARGS="w. win-icon: $SCRIPT_ARGS" SCRIPT_ARGS="w. win-icon: $SCRIPT_ARGS"
## Debian ## Debian
SCRIPT_ARGS="d; deb-package-version: deb-maintainer-name: maintainer-email: deb-package-name: $SCRIPT_ARGS" SCRIPT_ARGS="d; deb-icon: deb-package-version: deb-maintainer-name: maintainer-email: deb-package-name: $SCRIPT_ARGS"
## Android ## Android
SCRIPT_ARGS="a; activity: apk-package-version: apk-maintainer-name: apk-package-name: update-android; $SCRIPT_ARGS" SCRIPT_ARGS="a; activity: apk-package-version: apk-maintainer-name: apk-package-name: update-android; $SCRIPT_ARGS"
@@ -30,8 +30,8 @@ SCRIPT_ARGS="m; osx-icon: osx-maintainer-name: $SCRIPT_ARGS"
## List the options that require a file/directory that should be excluded by zip. ## List the options that require a file/directory that should be excluded by zip.
EXCLUDE_OPTIONS=("win-icon" "osx-icon") EXCLUDE_OPTIONS=("win-icon" "osx-icon" "deb-icon")
EXCLUDE_CONFIG=("INI__windows__icon" "INI__macosx__icon") EXCLUDE_CONFIG=("INI__windows__icon" "INI__macosx__icon" "INI__debian__icon")
## Add a short summary of your platform script here ## Add a short summary of your platform script here

View File

@@ -18,6 +18,11 @@ if [ "$CONFIG" = true ]; then
if [ -n "${INI__android__package_name}" ]; then if [ -n "${INI__android__package_name}" ]; then
PACKAGE_NAME=${INI__debian__package_name} PACKAGE_NAME=${INI__debian__package_name}
fi fi
if [ -n "${INI__debian__icon}" ]; then
IFS=$'\n'
ICON_DIR=${INI__debian__icon}
ICON_FILES=( $(ls -AC1 "$ICON_DIR") )
fi
fi fi
@@ -33,6 +38,10 @@ do
elif [ "$OPTOPT" = "deb-package-name" ]; then elif [ "$OPTOPT" = "deb-package-name" ]; then
PACKAGE_NAME=$OPTARG PACKAGE_NAME=$OPTARG
package_name_defined_argument=true package_name_defined_argument=true
elif [ "$OPTOPT" = "deb-icon" ]; then
IFS=$'\n'
ICON_DIR=$OPTARG
ICON_FILES=( $(ls -AC1 "$ICON_DIR") )
fi fi
done done
@@ -90,7 +99,6 @@ echo "Comment=$PROJECT_DESCRIPTION" >> $DESKTOP
echo "Exec=$PACKAGE_NAME" >> $DESKTOP echo "Exec=$PACKAGE_NAME" >> $DESKTOP
echo "Type=Application" >> $DESKTOP echo "Type=Application" >> $DESKTOP
echo "Categories=Game;" >> $DESKTOP echo "Categories=Game;" >> $DESKTOP
echo "Icon=love" >> $DESKTOP
chmod 0644 $DESKTOP chmod 0644 $DESKTOP
PACKAGE_DIR=/usr/share/games/"$PACKAGE_NAME"/ PACKAGE_DIR=/usr/share/games/"$PACKAGE_NAME"/
@@ -107,6 +115,31 @@ echo "set -e" >> $TEMP$BIN_LOC"$PACKAGE_NAME"
echo "love $PACKAGE_DIR$PACKAGE_LOC" >> $TEMP$BIN_LOC"$PACKAGE_NAME" echo "love $PACKAGE_DIR$PACKAGE_LOC" >> $TEMP$BIN_LOC"$PACKAGE_NAME"
chmod 0755 $TEMP$BIN_LOC"$PACKAGE_NAME" chmod 0755 $TEMP$BIN_LOC"$PACKAGE_NAME"
ICON_LOC=/usr/share/icons/hicolor/
mkdir -p $TEMP$ICON_LOC
if [ -n "$ICON_DIR" ]; then
echo "Icon=$PACKAGE_NAME" >> $DESKTOP
for ICON in "${ICON_FILES[@]}"
do
RES=$(echo "$ICON" | grep -Eo "[0-9]+x[0-9]+")
EXT=$(echo "$ICON" | sed -e 's/.*\.//g')
if [ "$EXT" = "svg" ]; then
mkdir -p $TEMP${ICON_LOC}scalable/apps
cp "$PROJECT_DIR"/"$ICON_DIR"/"$ICON" $TEMP${ICON_LOC}scalable/apps/"$PACKAGE_NAME".$EXT
chmod 0644 $TEMP${ICON_LOC}scalable/apps/"$PACKAGE_NAME".EXT
else
if [ -n "$RES" ]; then
mkdir -p $TEMP$ICON_LOC$RES/apps
cp "$PROJECT_DIR"/"$ICON_DIR"/"$ICON" $TEMP$ICON_LOC$RES/apps/"$PACKAGE_NAME".$EXT
chmod 0644 $TEMP$ICON_LOC$RES/apps/"$PACKAGE_NAME".$EXT
fi
fi
done
else
echo "Icon=love" >> $DESKTOP
fi
cd $TEMP cd $TEMP
for line in $(find usr/ -type f); do for line in $(find usr/ -type f); do
md5sum $line >> $TEMP/DEBIAN/md5sums md5sum $line >> $TEMP/DEBIAN/md5sums