Skip to content
Permalink
Browse files

Unix: FreeDesktop entry

  • Loading branch information...
vookimedlo committed May 1, 2019
1 parent 7b6eee3 commit b493a5dfb317a758749cf93af99b3c4d41422fce
@@ -264,6 +264,12 @@ else()
${TOP_LEVEL_ABSOLUTE_PATH}/README.md
DESTINATION share/doc/vookiimageviewer)

INSTALL(FILES ${TOP_LEVEL_ABSOLUTE_PATH}/build/cmake/unix/support/vookiimageviewer.desktop
DESTINATION share/applications)

INSTALL(FILES ${TOP_LEVEL_ABSOLUTE_PATH}/src/resource/openclipart/vookiimageviewericon.png
DESTINATION share/pixmaps)

if (TARGET vooki_kimg_xcf)
INSTALL(TARGETS vooki_kimg_xcf
LIBRARY DESTINATION ${PLUGINS})
@@ -15,7 +15,7 @@ Source0: %{name}-%{version}.tar.bz2
# gcc, gcc-c++, clang packages are omitted intentionally, because we don't know if clang or gcc is installed
# and we don't require to be both installed at the same time
#
BuildRequires: LibRaw-devel, cmake, git, make, qt5, qt5-qtbase-devel
BuildRequires: LibRaw-devel, cmake, git, make, qt5, qt5-qtbase-devel, desktop-file-utils
Suggests: qt5-qtimageformats

%description
@@ -40,11 +40,12 @@ rm -rf %{buildroot}
export CXXFLAGS="${RPM_OPT_FLAGS} -Wno-deprecated"
export CFLAGS="${RPM_OPT_FLAGS}"

cmake -DLIB_INSTALL_DIR=%{_lib} -DCMAKE_INSTALL_PREFIX:PATH=/usr -H. -Bbuild build/cmake
cmake --build build --config Release %{_smp_mflags}
cmake -DLIB_INSTALL_DIR=%{_lib} -DCMAKE_INSTALL_PREFIX:PATH=/usr -H. -Bbuild-rpm build/cmake
cmake --build build-rpm --config Release %{_smp_mflags}

%install
make -C build install DESTDIR="${RPM_BUILD_ROOT}"
make -C build-rpm install DESTDIR="${RPM_BUILD_ROOT}"
desktop-file-validate %{buildroot}/%{_datadir}/applications/vookiimageviewer.desktop

%clean
rm -rf "${RPM_BUILD_ROOT}"
@@ -56,3 +57,6 @@ rm -rf "${RPM_BUILD_ROOT}"
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/imageformats
%{_libdir}/%{name}/imageformats/*.so
%{_datadir}/applications/vookiimageviewer.desktop
%{_datadir}/pixmaps/vookiimageviewericon.png

@@ -0,0 +1,9 @@
[Desktop Entry]
Name=VookiImageViewer
GenericName=Image Viewer
Comment=View images
Exec=VookiImageViewer
Icon=vookiimageviewericon
Terminal=false
Type=Application
Categories=Graphics;
@@ -46,13 +46,15 @@ int main(int argc, char *argv[])
QCoreApplication::setOrganizationName("Michal Duda");
QCoreApplication::setOrganizationDomain("VookiImageViewer.cz");
QCoreApplication::setApplicationName("VookiImageViewer");

#ifdef UNIX_LIKE
// Unix-like systems shall have our plugins located in the one of the following locations + /imageformats
QCoreApplication::addLibraryPath("/usr/lib/vookiimageviewer");
QCoreApplication::addLibraryPath("/usr/local/lib/vookiimageviewer");
QCoreApplication::addLibraryPath("/usr/lib64/vookiimageviewer");
QCoreApplication::addLibraryPath("/usr/local/lib64/vookiimageviewer");
#endif // UNIX_LIKE

SystemDependant::Init();
MainWindow mainWindow;
QObject::connect(&application, &Application::aboutToQuit, &mainWindow, &MainWindow::onAboutToQuit);

0 comments on commit b493a5d

Please sign in to comment.
You can’t perform that action at this time.