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
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
Comment=Simple web based panoram viewer
Icon=emblem-photos
Exec=SimplePanoramaViewer
Exec=simple_panorama_viewer
NoDisplay=false
Categories=Graphics;Viewer
StartupNotify=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
fi
mkdir -p "$DESTDIR/share/SimplePanoramaViewer/"
mkdir -p "$DESTDIR/bin/"
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/pjpg.xml "$DESTDIR/share/mime/image"
echo "#!/bin/bash
$PREFIX/share/SimplePanoramaViewer/SimplePanoramaViewer \"\$@\"" > "$DESTDIR/bin/SimplePanoramaViewer"
chmod a+x "$DESTDIR/bin/SimplePanoramaViewer"
chmod -R a+r "$DESTDIR/share/SimplePanoramaViewer"
cp target/release/simple_panorama_viewer "$DESTDIR/bin"
chmod a+x "$DESTDIR/bin/simple_panorama_viewer"
}
uninstall()
@ -54,10 +45,8 @@ uninstall()
DIR=$1
check_dir "$DIR"
rm "$DIR/bin/SimplePanoramaViewer"
rm -r "$DIR/share/SimplePanoramaViewer/"
rm "$DIR/bin/simple_panorama_viewer"
rm "$DIR/share/applications/SimplePanoramaViewer.desktop"
rm "$DIR/share/mime/image/pjpg.xml"
}
package()
@ -65,21 +54,26 @@ package()
DIR="/tmp/SimplePanoramaViewer"
mkdir "$DIR"
cp SimplePanoramaViewer "$DIR"
cp -r css "$DIR"
cp -r html "$DIR"
cp -r js "$DIR"
chmod a+x "$DIR/SimplePanoramaViewer"
cp target/release/simple_panorama_viewer "$DIR"
cp LICENSE.md "$DIR"
cp README.md "$DIR"
chmod a+x "$DIR/simple_panorama_viewer"
mkdir -p dist
cd /tmp || exit
tar Jcvf "SimplePanoramaViewer.tar.xz" "SimplePanoramaViewer"
tar --zstd -cf "SimplePanoramaViewer.tar.zst" "SimplePanoramaViewer"
cd - || exit
cp -f "$DIR.tar.xz" dist
cp -f "$DIR.tar.zst" dist
rm -r "$DIR"
rm "$DIR.tar.xz"
rm "$DIR.tar.zst"
}
build()
{
cargo build --release
strip target/release/simple_panorama_viewer
}
case "$1" in
@ -95,6 +89,9 @@ case "$1" in
"-p" | "--package")
package
;;
"-b" | "--build")
build
;;
*)
print_help
;;