install: Update the install target for Emmental 3.x

Instead of calling out to a separate tools, I can use the `find` and
`install` programs to easily install the files to the right place.

I also take this opportunity to update the emmental.desktop file for v3,
including filling out as many audio-related mime types as I can find and
using the `desktop-file-install` command to not only install the file
but properly set the "Exec" and "Icon" fields based on the PREFIX=
passed to `make`

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2022-11-29 13:36:52 -05:00
parent 50474c7fd1
commit 8b1be777c1
9 changed files with 37 additions and 249 deletions

View File

@ -5,6 +5,7 @@ export PREFIX = /usr/local
export EMMENTAL_LIB = ${PREFIX}/lib/emmental
export EMMENTAL_BIN = ${PREFIX}/bin
export EMMENTAL_SHARE = ${PREFIX}/share
export EMMENTAL_DESKTOP = ${EMMENTAL_SHARE}/applications/com.nowheycreamery.emmental.desktop
all: emmental.gresource mpris2 flake8
@ -38,16 +39,35 @@ emmental.gresource.xml:
emmental.gresource: emmental.gresource.xml
glib-compile-resources emmental.gresource.xml
.PHONY: install.app
install.app:
find ./emmental -type f -not -path "*/__pycache__/*" \
-exec install -v -C -D -m 755 "{}" "$(EMMENTAL_LIB)/{}" \;
install -C -v -m 644 emmental.py $(EMMENTAL_LIB)/emmental.py
.PHONY: install.icons
install.icons:
install -C -v -m 644 emmental.gresource $(EMMENTAL_LIB)/emmental.gresource
install -C -v -m 644 icons/scalable/apps/emmental.svg $(EMMENTAL_LIB)/emmental.svg
.PHONY: install.desktop
install.desktop:
desktop-file-install --set-key=Exec --set-value $(EMMENTAL_BIN)/emmental \
--set-key=Icon --set-value=$(EMMENTAL_LIB)/emmental.svg \
--rebuild-mime-info-cache \
--dir=$(EMMENTAL_SHARE)/applications emmental.desktop
.PHONY: install
install: emmental.gresource
exec tools/install.sh
install: emmental.gresource mpris2 install.app install.icons install.desktop
mkdir -p $(EMMENTAL_BIN)
echo -e "#!/bin/bash\npython -O $(EMMENTAL_LIB)/emmental.py \$$*" > $(EMMENTAL_BIN)/emmental
chmod 655 $(EMMENTAL_BIN)/emmental
.PHONY: uninstall
uninstall:
rm -fv ${EMMENTAL_BIN}/emmental
rm -rfv ${EMMENTAL_LIB}
rm -fv ${EMMENTAL_SHARE}/icons/hicolor/scalable/apps/emmental*.svg
rm -fv ${EMMENTAL_SHARE}/applications/emmental.desktop
rm -f ${PREFIX}/share/applications/com.nowheycreamery.emmental.desktop
rm -f ${PREFIX}/bin/emmental
rm -rf ${PREFIX}/lib/emmental/
.PHONY: pkgbuild
pkgbuild:

View File

@ -1,3 +0,0 @@
#!/bin/bash
python -O {EMMENTAL_LIB}/emmental.py $*

View File

@ -1,10 +0,0 @@
[Desktop Entry]
Type=Application
Version=1.5
Name=Emmental
GenericName=Music Player
Comment=Listen to your music
Exec={EMMENTAL_BIN}/emmental
Icon=emmental
Terminal=false
Categories=AudioVideo;Audio;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="512"
height="512"
viewBox="0 0 135.46666 135.46666"
version="1.1"
id="svg3294"
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
sodipodi:docname="emmental-favorites.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview3296"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="px"
showgrid="false"
width="512mm"
units="px"
inkscape:zoom="1"
inkscape:cx="416.5"
inkscape:cy="263.5"
inkscape:window-width="1920"
inkscape:window-height="1005"
inkscape:window-x="0"
inkscape:window-y="49"
inkscape:window-maximized="1"
inkscape:current-layer="layer2"
showborder="true"
borderlayer="false" />
<defs
id="defs3291">
<linearGradient
id="linearGradient3404"
inkscape:swatch="solid">
<stop
style="stop-color:#ff0000;stop-opacity:1;"
offset="0"
id="stop3402" />
</linearGradient>
</defs>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"
style="display:inline">
<path
id="rect928"
style="mix-blend-mode:multiply;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke:#004600;stroke-width:1.13263;stroke-dasharray:0, 12.4589;stroke-opacity:1;paint-order:markers fill stroke"
d="M 8.3491862,17.674821 A 48.298388,38.079963 55.167577 0 0 0.47527528,35.642866 48.298388,38.079963 55.167577 0 0 15.646486,80.346627 l 13.02172,14.124094 26.043443,28.248199 c 7.214034,7.82476 18.829408,7.82476 26.043442,0 L 106.79853,94.470721 119.82026,80.346627 A 38.079963,48.298388 34.832423 0 0 126.33111,16.788177 38.079963,48.298388 34.832423 0 0 67.73337,23.850231 48.298388,38.079963 55.167577 0 0 26.518717,7.3946768 48.298388,38.079963 55.167577 0 0 8.3491862,17.674821 Z" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1,118 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="512"
height="512"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg75"
inkscape:version="0.92.4 5da689c313, 2019-01-14"
sodipodi:docname="emmental.svg">
<defs
id="defs69">
<symbol
id="icon-music-note">
<title
id="title78520">music-note</title>
<path
d="M26.625 2.006c-0.137 0-0.319 0.038-0.319 0.038l-13.6 2.075c-0.863 0.231-1.644 1.069-1.706 1.975v17.906h-3.813v-0.006c-1.75 0-3.194 1.25-3.194 3s1.444 3 3.206 3h2.263c0.956 0 1.806-0.431 2.394-1.094 0.006-0.006 0.019-0.006 0.025-0.012 0.037-0.038 0.063-0.094 0.094-0.131 0.081-0.1 0.15-0.2 0.213-0.313 0.6-0.881 0.813-2.050 0.813-2.569v-14.5l13-2.375c0 0 0 8.5 0 12h-3.781c-1.769 0-3.2 1.244-3.2 3s1.431 3 3.2 3h2.325c1.137 0 2.131-0.375 2.7-1.313 0 0 0.006 0 0.012 0 0.563-0.75 0.75-1.887 0.75-3.431 0-1.55 0-18.925 0-18.925-0.006-0.731-0.625-1.325-1.381-1.325z"
id="path78522" />
</symbol>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.7"
inkscape:cx="-114.53623"
inkscape:cy="26.266036"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="992"
inkscape:window-x="0"
inkscape:window-y="49"
inkscape:window-maximized="1"
units="px" />
<metadata
id="metadata72">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-161.53332)">
<path
id="path15"
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 0.26458333,188.52082 135.20208,221.59374 m 0,0 v 15.875 c -12.17431,8.4e-4 -12.20048,27.68831 0,27.78125 v 31.75 L 79.374999,283.37394 c 2.35699,-19.88199 -19.689115,-25.71573 -23.8125,-5.82083 L 0.26458333,263.92707 V 188.52082 C 17.837267,162.07974 75.40625,161.53332 75.40625,161.53332 Z"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cccccccccccc" />
<path
style="display:inline;fill:#f8da4a;fill-opacity:1;stroke-width:0.71428573"
d="M 255.34656,163.53518 C 116.62289,129.63458 2.7276541,101.76636 2.2460509,101.60583 -0.02198624,100.84982 18.093321,80.754076 29.000001,71.927033 69.000157,39.553927 134.66532,16.65992 217.92857,6.0575146 c 19.46392,-2.478456 51.1476,-5.0575103 62.13152,-5.0575103 h 4.6559 L 396.85714,113.14286 c 61.67764,61.67857 111.82011,112.11742 111.42773,112.08632 -0.3924,-0.0311 -114.21463,-27.79339 -252.93831,-61.694 z"
id="path819"
inkscape:connector-curvature="0"
transform="matrix(0.26458333,0,0,0.26458333,0,161.53332)" />
<path
style="fill:#f3b722;fill-opacity:1;stroke-width:1.42857146"
d="m 408.89234,485.99486 c -55,-13.51607 -101.71207,-25.0166 -103.8046,-25.55674 -3.73443,-0.96396 -3.8052,-1.20196 -3.83781,-12.90451 -0.0849,-30.43852 -18.1526,-54.01679 -43.12787,-56.28146 -20.53696,-1.86223 -38.83107,12.75464 -46.46432,37.12467 -1.41508,4.51786 -3.03845,8.21429 -3.60748,8.21429 -0.56903,0 -39.82663,-9.57995 -87.23912,-21.28875 C 73.398659,403.59355 27.374486,392.28746 18.5352,390.17774 L 2.4637718,386.34188 V 244.88305 103.42423 l 3.9285714,1.00678 c 2.1607143,0.55373 113.8571468,27.96349 248.2142868,60.91058 134.35714,32.94709 246.69643,60.5528 249.64286,61.34601 l 5.35714,1.4422 v 29.04808 29.04806 l -6.06056,0.96912 c -9.02576,1.44328 -19.56647,12.79662 -24.09478,25.95235 -4.51516,13.11753 -4.85962,38.48575 -0.6869,50.58655 5.73031,16.61778 17.11014,28.57143 27.19987,28.57143 h 3.64237 v 59.28572 c 0,32.60714 -0.16072,59.21657 -0.35714,59.13207 -0.19643,-0.0846 -45.35715,-11.21226 -100.35715,-24.72832 z"
id="path822"
inkscape:connector-curvature="0"
transform="matrix(0.26458333,0,0,0.26458333,0,161.53332)" />
<ellipse
style="fill:#db9822;fill-opacity:1;stroke-width:0.26458332"
id="path828"
cx="52.72768"
cy="179.44939"
rx="14.552083"
ry="6.4255953" />
<ellipse
style="fill:#e7af19;fill-opacity:1;stroke-width:0.26458332"
id="path830"
cx="92.604164"
cy="200.99403"
rx="8.6934528"
ry="3.7797618" />
<ellipse
style="fill:#db9518;fill-opacity:1;stroke-width:0.26458332"
id="path836"
cx="109.04613"
cy="266.19492"
rx="7.3705359"
ry="6.614583" />
<ellipse
style="fill:#db9518;fill-opacity:1;stroke-width:0.26458332"
id="path838"
cx="21.544643"
cy="218.94791"
rx="13.229166"
ry="11.90625" />
<path
style="fill:#b36d00;fill-opacity:1;stroke:none;stroke-width:1.84337676"
inkscape:connector-curvature="0"
d="m 86.73677,215.05635 c -0.282072,0 -0.656796,0.0627 -0.656796,0.0627 l -28.00136,3.42457 c -1.776851,0.38124 -3.38487,1.76427 -3.512523,3.25953 v 29.55198 h -7.850676 v -0.01 c -3.603116,0 -6.576201,2.06299 -6.576201,4.95118 0,2.8882 2.973085,4.95119 6.600908,4.95119 h 4.659344 c 1.968331,0 3.718416,-0.71132 4.929063,-1.80553 0.01235,-0.01 0.03912,-0.01 0.05147,-0.0198 0.07618,-0.0627 0.129712,-0.15513 0.193539,-0.2162 0.166773,-0.16504 0.308838,-0.33008 0.438551,-0.51657 1.235354,-1.454 1.673904,-3.38331 1.673904,-4.23987 V 230.5188 l 26.766006,-3.91969 c 0,0 0,14.02836 0,19.80474 h -7.78479 c -3.642236,0 -6.588555,2.0531 -6.588555,4.95119 0,2.89809 2.946319,4.95119 6.588555,4.95119 h 4.786997 c 2.340996,0 4.387566,-0.6189 5.559094,-2.16697 0,0 0.01235,0 0.02471,0 1.159174,-1.2378 1.544192,-3.1143 1.544192,-5.66251 0,-2.55811 0,-31.23373 0,-31.23373 -0.01235,-1.20644 -1.286827,-2.18678 -2.843373,-2.18678 z"
id="path860" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.4 KiB

11
emmental.desktop Normal file
View File

@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Version=1.5
Name=Emmental
GenericName=Music Player
Comment=The Cheesy Music Player
DBusActivatable=false
Terminal=false
MimeType=application/musepack;application/ogg;application/x-ape;application/x-flac;application/x-id3;application/x-musepack;application/x-ogg;application/x-ogm-audio;audio/aac;audio/ape;audio/flac;audio/mp;audio/mp3;audio/mp4;audio/mpc;audio/mpeg;audio/mpeg3;audio/mpegurl;audio/musepack;audio/ogg;audio/vnd.rn-realaudio;audio/vorbis;audio/x-ape;audio/x-flac;audio/x-it;audio/x-m4a;audio/x-mod;audio/x-mp;audio/x-mp3;audio/x-mpc;audio/x-mpeg;audio/x-mpeg-3;audio/x-mpegurl;audio/x-ms-wma;audio/x-musepack;audio/x-ogg;audio/x-oggflac;audio/x-pn-realaudio;audio/x-s3m;audio/x-scpls;audio/x-speex;audio/x-stm;audio/x-vorbis;audio/x-vorbis+ogg;audio/x-wav;audio/x-xm;
Categories=AudioVideo;Audio;Music;Player;GTK;GNOME;
SingleMainWindow=true

View File

@ -1,44 +0,0 @@
#!/bin/bash
function install_file()
{
install -p -v $* | grep -v "^removed"
}
#
# Install source files
#
install -d -v -m 755 $EMMENTAL_LIB
install_file -m 644 emmental.py $EMMENTAL_LIB/emmental.py
for dir in `tools/list_install_dirs.py`; do
install -d -v -m 755 $EMMENTAL_LIB/$dir
files=`find $dir -not -name "test_*.py" -name "*.py"`
install_file -m 644 $files $EMMENTAL_LIB/$dir/
done
#
# Install icons
#
EMMENTAL_ICONS=$EMMENTAL_SHARE/icons/hicolor/scalable/apps
install -d -v -m 755 $EMMENTAL_ICONS
install_file -m 644 data/hicolor/scalable/apps/*.svg $EMMENTAL_ICONS/
#
# Install and adjust executable
#
install -d -v -m 755 $EMMENTAL_BIN
install_file -m 655 data/emmental $EMMENTAL_BIN/emmental
sed -i "s|{EMMENTAL_LIB}|$EMMENTAL_LIB|" $EMMENTAL_BIN/emmental
#
# Install and adjust .desktop file
#
install -d -v -m 755 $EMMENTAL_SHARE/applications
install_file -m 644 data/emmental.desktop $EMMENTAL_SHARE/applications
sed -i "s|{EMMENTAL_BIN}|$EMMENTAL_BIN|" $EMMENTAL_SHARE/applications/emmental.desktop

View File

@ -1,8 +0,0 @@
#!/usr/bin/python
import pathlib
exclude = [ ".git", "data", "tools" ]
for p in pathlib.Path(".").iterdir():
if p.is_dir() and not str(p) in exclude:
print(p)