Improve Linux build

This commit is contained in:
Rémi BERTHO 2022-09-05 21:06:36 +02:00
parent 3558d2b34e
commit ac4bd3c0e2
Signed by: dalan
GPG key ID: EE3B917931C07B64
4 changed files with 22 additions and 35 deletions

View file

@ -1,3 +1,3 @@
# SimplePanoramaViewer # SimplePanoramaViewer
This is a simple panorama viewer based on [Photo Sphere Viewer](http://photo-sphere-viewer.js.org) which is based on [Three.js](https://threejs.org/), [D.js](https://malko.github.io/D.js/), [uEvenet](https://github.com/mistic100/uEvent) and [doT.js](https://olado.github.io/doT/). This is a simple panorama viewer based on [Photo Sphere Viewer](http://photo-sphere-viewer.js.org) which is based on [Three.js](https://threejs.org/) and [uEvenet](https://github.com/mistic100/uEvent).

View file

@ -4,9 +4,9 @@ Type=Application
Name=SimplePanoramaViewer Name=SimplePanoramaViewer
Comment=Simple web based panoram viewer Comment=Simple web based panoram viewer
Icon=emblem-photos Icon=emblem-photos
Exec=SimplePanoramaViewer Exec=simple_panorama_viewer
NoDisplay=false NoDisplay=false
Categories=Graphics;Viewer Categories=Graphics;Viewer
StartupNotify=false StartupNotify=false
Terminal=false Terminal=false
MimeType=image/jpeg;image/pjpg MimeType=image/jpeg;image/pjpg;image/webp;image/avif

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="image/pjpg">
<comment>Panoramic JPEG image</comment>
<comment xml:lang="fr">Image JPEG panoramique</comment>
<glob pattern="*.pjpeg"/>
<glob pattern="*.pjpg"/>
<glob pattern="*.pjpe"/>
</mime-type>
</mime-info>

View file

@ -33,20 +33,11 @@ install()
echo $DESTDIR echo $DESTDIR
fi fi
mkdir -p "$DESTDIR/share/SimplePanoramaViewer/"
mkdir -p "$DESTDIR/bin/" mkdir -p "$DESTDIR/bin/"
mkdir -p "$DESTDIR/share/applications" mkdir -p "$DESTDIR/share/applications"
mkdir -p "$DESTDIR/share/mime/image"
cp SimplePanoramaViewer "$DESTDIR/share/SimplePanoramaViewer"
cp -r css "$DESTDIR/share/SimplePanoramaViewer"
cp -r html "$DESTDIR/share/SimplePanoramaViewer"
cp -r js "$DESTDIR/share/SimplePanoramaViewer"
cp install/SimplePanoramaViewer.desktop "$DESTDIR/share/applications" cp install/SimplePanoramaViewer.desktop "$DESTDIR/share/applications"
cp install/pjpg.xml "$DESTDIR/share/mime/image" cp target/release/simple_panorama_viewer "$DESTDIR/bin"
echo "#!/bin/bash chmod a+x "$DESTDIR/bin/simple_panorama_viewer"
$PREFIX/share/SimplePanoramaViewer/SimplePanoramaViewer \"\$@\"" > "$DESTDIR/bin/SimplePanoramaViewer"
chmod a+x "$DESTDIR/bin/SimplePanoramaViewer"
chmod -R a+r "$DESTDIR/share/SimplePanoramaViewer"
} }
uninstall() uninstall()
@ -54,10 +45,8 @@ uninstall()
DIR=$1 DIR=$1
check_dir "$DIR" check_dir "$DIR"
rm "$DIR/bin/SimplePanoramaViewer" rm "$DIR/bin/simple_panorama_viewer"
rm -r "$DIR/share/SimplePanoramaViewer/"
rm "$DIR/share/applications/SimplePanoramaViewer.desktop" rm "$DIR/share/applications/SimplePanoramaViewer.desktop"
rm "$DIR/share/mime/image/pjpg.xml"
} }
package() package()
@ -65,21 +54,26 @@ package()
DIR="/tmp/SimplePanoramaViewer" DIR="/tmp/SimplePanoramaViewer"
mkdir "$DIR" mkdir "$DIR"
cp SimplePanoramaViewer "$DIR" cp target/release/simple_panorama_viewer "$DIR"
cp -r css "$DIR" cp LICENSE.md "$DIR"
cp -r html "$DIR" cp README.md "$DIR"
cp -r js "$DIR" chmod a+x "$DIR/simple_panorama_viewer"
chmod a+x "$DIR/SimplePanoramaViewer"
mkdir -p dist mkdir -p dist
cd /tmp || exit cd /tmp || exit
tar Jcvf "SimplePanoramaViewer.tar.xz" "SimplePanoramaViewer" tar --zstd -cf "SimplePanoramaViewer.tar.zst" "SimplePanoramaViewer"
cd - || exit cd - || exit
cp -f "$DIR.tar.xz" dist cp -f "$DIR.tar.zst" dist
rm -r "$DIR" rm -r "$DIR"
rm "$DIR.tar.xz" rm "$DIR.tar.zst"
}
build()
{
cargo build --release
strip target/release/simple_panorama_viewer
} }
case "$1" in case "$1" in
@ -95,6 +89,9 @@ case "$1" in
"-p" | "--package") "-p" | "--package")
package package
;; ;;
"-b" | "--build")
build
;;
*) *)
print_help print_help
;; ;;