diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2017-02-27 23:04:39 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2017-02-27 23:04:39 +0000 |
commit | 8202e84ffd05dd2a0de336f80c3931932195f0c7 (patch) | |
tree | 64f31028fc790a04981be1f5a828d238c4e68b81 /graphics/simpleviewer | |
parent | 6102fc7672d618e96dbb22494cbd79d9e3e402b4 (diff) |
Notes
Diffstat (limited to 'graphics/simpleviewer')
-rw-r--r-- | graphics/simpleviewer/Makefile | 30 | ||||
-rw-r--r-- | graphics/simpleviewer/distinfo | 5 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-CMakeLists.txt | 18 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-defreeglut | 97 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-sanitize-fontsize | 38 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-src_common_config.cpp | 10 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-src_fileslist.cpp | 10 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-src_formats_formatgif.cpp | 38 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-src_formats_formatpng.cpp | 68 | ||||
-rw-r--r-- | graphics/simpleviewer/files/patch-src_viewer.cpp | 10 | ||||
-rw-r--r-- | graphics/simpleviewer/pkg-descr | 3 |
11 files changed, 98 insertions, 229 deletions
diff --git a/graphics/simpleviewer/Makefile b/graphics/simpleviewer/Makefile index 52fe56904b69..a8953d94b60c 100644 --- a/graphics/simpleviewer/Makefile +++ b/graphics/simpleviewer/Makefile @@ -2,31 +2,35 @@ # $FreeBSD$ PORTNAME= simpleviewer -PORTVERSION= 1.7.1553.8560 -PORTREVISION= 10 +PORTVERSION= 2.88 CATEGORIES= graphics -MASTER_SITES= SF/${PORTNAME}/OpenGL%20edition -DISTNAME= sviewgl-src-${PORTVERSION} +MASTER_SITES= https://bitbucket.org/andreyu/simple-viewer-gl/get/ +DISTNAME= v${PORTVERSION} +DIST_SUBDIR= ${PORTNAME} MAINTAINER= ports@FreeBSD.org COMMENT= Small and simple OpenGL image viewer with transparency support LICENSE= GPLv2 -LIB_DEPENDS= libpng.so:graphics/png \ +LIB_DEPENDS= libImlib2.so:graphics/imlib2 \ + libexif.so:graphics/libexif \ + libfreetype.so:print/freetype2 \ libgif.so:graphics/giflib \ - libImlib2.so:graphics/imlib2 + libglfw.so:graphics/glfw \ + liblcms2.so:graphics/lcms2 \ + libpng.so:graphics/png \ + libtiff.so:graphics/tiff \ + libwebp.so:graphics/webp -USES= jpeg tar:bzip2 -USE_GL= glut -WRKSRC= ${WRKDIR}/sviewgl-src -MAKE_ARGS= CC="${CXX}" +USES= cmake compiler:c++11-lang jpeg pkgconfig tar:bzip2 +USE_GL= glu +USE_XORG= ice sm x11 xcursor xext xrandr xxf86vm + +WRKSRC= ${WRKDIR}/andreyu-simple-viewer-gl-b9266979237d PLIST_FILES= bin/sviewgl -post-patch: - @${REINPLACE_CMD} -e 's,-O2,${CFLAGS}, ; s,/usr/include,${LOCALBASE}/include,g ; \ - s,=-s,=-L${LOCALBASE}/lib,' ${WRKSRC}/Makefile do-install: ${INSTALL_PROGRAM} ${WRKSRC}/sviewgl ${STAGEDIR}${PREFIX}/bin diff --git a/graphics/simpleviewer/distinfo b/graphics/simpleviewer/distinfo index fc93497dba47..d58f47ee9360 100644 --- a/graphics/simpleviewer/distinfo +++ b/graphics/simpleviewer/distinfo @@ -1,2 +1,3 @@ -SHA256 (sviewgl-src-1.7.1553.8560.tar.bz2) = 509de7d8a42c58fbd365a3b730994fef0ff1199536a20f58f29930917339f4c8 -SIZE (sviewgl-src-1.7.1553.8560.tar.bz2) = 522209 +TIMESTAMP = 1487875449 +SHA256 (simpleviewer/v2.88.tar.bz2) = 4d3835ae008b8a7cdd9379f82e72d338a9d5e3d0cb4ef491d888697727c92c56 +SIZE (simpleviewer/v2.88.tar.bz2) = 238105 diff --git a/graphics/simpleviewer/files/patch-CMakeLists.txt b/graphics/simpleviewer/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..a909743eda24 --- /dev/null +++ b/graphics/simpleviewer/files/patch-CMakeLists.txt @@ -0,0 +1,18 @@ +--- CMakeLists.txt.orig 2017-02-23 18:44:09 UTC ++++ CMakeLists.txt +@@ -71,11 +71,11 @@ endif() + + file( GLOB_RECURSE SOURCES "src/*.cpp" ) + +-add_executable( sviewgl ${SOURCES} ) ++link_directories( ++ ${EXIF_LIBRARY_DIRS} ++ ) + +-#link_directories( +- #${FREETYPE_LIBRARY_DIRS} +- #) ++add_executable( sviewgl ${SOURCES} ) + + target_link_libraries( sviewgl + ${RT_LIBRARY} diff --git a/graphics/simpleviewer/files/patch-defreeglut b/graphics/simpleviewer/files/patch-defreeglut deleted file mode 100644 index aa9e069ff043..000000000000 --- a/graphics/simpleviewer/files/patch-defreeglut +++ /dev/null @@ -1,97 +0,0 @@ ---- src/ftstring.h.orig -+++ src/ftstring.h -@@ -13,7 +13,7 @@ - #include <string> - #include <memory> - #include <map> --#include <GL/freeglut.h> -+#include <GL/glut.h> - #include <ft2build.h> - #include FT_FREETYPE_H - #include FT_GLYPH_H ---- src/ftsymbol.h.orig -+++ src/ftsymbol.h -@@ -8,7 +8,7 @@ - #ifndef FTSYMBOL_H - #define FTSYMBOL_H - --#include <GL/freeglut.h> -+#include <GL/glut.h> - - class CFTSymbol { - public: ---- src/quad.h.orig -+++ src/quad.h -@@ -9,7 +9,7 @@ - #define QUAD_H - - #include "rect.h" --#include <GL/freeglut.h> -+#include <GL/glut.h> - - class CQuad { - public: ---- src/window.cpp.orig -+++ src/window.cpp -@@ -56,7 +56,7 @@ - //glutEntryFunc(); - glutMotionFunc(callbackMouse); - glutPassiveMotionFunc(callbackMouse); -- glutMouseWheelFunc(callbackMouseWheel); -+// glutMouseWheelFunc(callbackMouseWheel); - // glutWMCloseFunc(closeWindow); - - glEnable(GL_BLEND); -@@ -222,6 +222,7 @@ - } - } - -+#if 0 - void CWindow::fnMouseWheel(int wheel, int direction, int x, int y) { - if(direction > 0) { - updateScale(true); -@@ -230,11 +231,18 @@ - updateScale(false); - } - } -+#endif -+ -+#define GLUT_SCROLL_UP 3 -+#define GLUT_SCROLL_DOWN 4 - - void CWindow::fnMouseButtons(int button, int state, int x, int y) { - if(button == GLUT_LEFT_BUTTON) { - m_mouseLB = (state == GLUT_DOWN); -- } -+ } else if (button == GLUT_SCROLL_UP) -+ updateScale(true); -+ else if (button == GLUT_SCROLL_DOWN) -+ updateScale(false); - } - - void CWindow::fnKeyboard(unsigned char key, int x, int y) { -@@ -245,8 +253,10 @@ - - switch(key) { - case 27: // ESC --// exit(0); -- glutLeaveMainLoop(); -+ case 'q': -+ case 'Q': -+ exit(0); -+// glutLeaveMainLoop(); - break; - case 127: // Delete - if(mod == GLUT_ACTIVE_CTRL) { -@@ -639,9 +649,11 @@ - g_window->fnMouseButtons(button, state, x, y); - } - -+#if 0 - void CWindow::callbackMouseWheel(int wheel, int direction, int x, int y) { - g_window->fnMouseWheel(wheel, direction, x, y); - } -+#endif - - void CWindow::callbackKeyboardSpecial(int key, int x, int y) { - g_window->fnKeyboardSpecial(key, x, y); diff --git a/graphics/simpleviewer/files/patch-sanitize-fontsize b/graphics/simpleviewer/files/patch-sanitize-fontsize new file mode 100644 index 000000000000..776c2cc32cc5 --- /dev/null +++ b/graphics/simpleviewer/files/patch-sanitize-fontsize @@ -0,0 +1,38 @@ +--- src/exifpopup.cpp.orig 2017-02-23 18:44:09 UTC ++++ src/exifpopup.cpp +@@ -32,7 +32,7 @@ void cExifPopup::setRatio(float ratio) + // if (m_ratio != ratio) + { + m_ratio = ratio; +- const int DesiredFontSize = 26; ++ const int DesiredFontSize = 16; + createFont(DesiredFontSize * ratio); + } + } +--- src/infobar.cpp.orig 2017-02-23 18:44:09 UTC ++++ src/infobar.cpp +@@ -48,11 +48,11 @@ void cInfoBar::setRatio(float scale) + { + m_scale = scale; + +- const int DesiredFontSize = 30; ++ const int DesiredFontSize = 16; + createFont(DesiredFontSize * scale); + } + +- const float DesiredHeight = 36; ++ const float DesiredHeight = 16 + 6; + m_height = DesiredHeight * scale; + } + +--- src/pixelpopup.cpp.orig 2017-02-23 18:44:09 UTC ++++ src/pixelpopup.cpp +@@ -58,7 +58,7 @@ void cPixelPopup::setRatio(float ratio) + const float Border = 10.0f; + m_border = Border * ratio; + +- const int desiredFontSize = 30; ++ const int desiredFontSize = 16; + createFont(desiredFontSize * ratio); + + m_ratio = ratio; diff --git a/graphics/simpleviewer/files/patch-src_common_config.cpp b/graphics/simpleviewer/files/patch-src_common_config.cpp new file mode 100644 index 000000000000..bc00f1ff3990 --- /dev/null +++ b/graphics/simpleviewer/files/patch-src_common_config.cpp @@ -0,0 +1,10 @@ +--- src/common/config.cpp.orig 2017-02-23 18:44:09 UTC ++++ src/common/config.cpp +@@ -11,6 +11,7 @@ + #include "../viewer.h" + #include "Ini.h" + ++#include <cstdio> + #include <cstdlib> + #include <strings.h> + diff --git a/graphics/simpleviewer/files/patch-src_fileslist.cpp b/graphics/simpleviewer/files/patch-src_fileslist.cpp deleted file mode 100644 index 0ec8536c8c35..000000000000 --- a/graphics/simpleviewer/files/patch-src_fileslist.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- src/fileslist.cpp.orig 2010-05-13 07:15:11 UTC -+++ src/fileslist.cpp -@@ -8,6 +8,7 @@ - #include "fileslist.h" - #include <iostream> - #include <dirent.h> -+#include <unistd.h> - - CFilesList::CFilesList(const char* file, bool recursive) : m_listCreated(false), m_recursive(recursive), m_position(0), m_removeCurrent(false) { - if(file != 0) { diff --git a/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp b/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp deleted file mode 100644 index a387caa05dbb..000000000000 --- a/graphics/simpleviewer/files/patch-src_formats_formatgif.cpp +++ /dev/null @@ -1,38 +0,0 @@ ---- src/formats/formatgif.cpp.orig 2010-08-27 17:57:23 UTC -+++ src/formats/formatgif.cpp -@@ -22,7 +22,11 @@ bool CFormatGif::Load(const char* filena - } - fclose(m_file); - -+#if GIFLIB_MAJOR >= 5 -+ GifFileType* file = DGifOpenFileName(filename, NULL); -+#else - GifFileType* file = DGifOpenFileName(filename); -+#endif - if(file == 0) { - std::cout << "Error Opening GIF image" << std::endl; - return false; -@@ -31,7 +35,11 @@ bool CFormatGif::Load(const char* filena - int res = DGifSlurp(file); - if(res != GIF_OK || file->ImageCount < 1) { - std::cout << "Error Opening GIF image" << std::endl; -+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 -+ DGifCloseFile(file, NULL); -+#else - DGifCloseFile(file); -+#endif - return false; - } - -@@ -130,7 +138,11 @@ bool CFormatGif::Load(const char* filena - // - // std::cout << "Record Type" << (int)recordType << std::endl; - -+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5 -+ DGifCloseFile(file, NULL); -+#else - DGifCloseFile(file); -+#endif - - return true; - } diff --git a/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp b/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp deleted file mode 100644 index 1a1d05032531..000000000000 --- a/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp +++ /dev/null @@ -1,68 +0,0 @@ ---- src/formats/formatpng.cpp.orig 2010-08-29 14:33:33 UTC -+++ src/formats/formatpng.cpp -@@ -57,9 +57,9 @@ bool CFormatPng::Load(const char* filena - png_read_info(png, info); - - // get real bits per pixel -- m_bppImage = info->pixel_depth; -+ m_bppImage = png_get_bit_depth(png, info) * png_get_channels(png, info); - -- if(info->color_type == PNG_COLOR_TYPE_PALETTE) { -+ if(png_get_color_type(png, info) == PNG_COLOR_TYPE_PALETTE) { - png_set_palette_to_rgb(png); - } - -@@ -73,20 +73,20 @@ bool CFormatPng::Load(const char* filena - if(png_get_valid(png, info, PNG_INFO_tRNS)) { - png_set_tRNS_to_alpha(png); - } -- if(info->bit_depth == 16) { -+ if(png_get_bit_depth(png, info) == 16) { - png_set_strip_16(png); - } -- if(info->color_type == PNG_COLOR_TYPE_GRAY || info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { -+ if(png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY || png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY_ALPHA) { - png_set_gray_to_rgb(png); - } - - // int number_of_passes = png_set_interlace_handling(png); - png_read_update_info(png, info); - -- m_width = info->width; -- m_height = info->height; -- m_pitch = info->rowbytes; -- m_bpp = info->pixel_depth; -+ m_width = png_get_image_width(png, info); -+ m_height = png_get_image_height(png, info); -+ m_pitch = png_get_rowbytes(png, info); -+ m_bpp = png_get_bit_depth(png, info) * png_get_channels(png, info); - - // read file - if(setjmp(png_jmpbuf(png)) != 0) { -@@ -98,7 +98,7 @@ bool CFormatPng::Load(const char* filena - // create buffer and read data - png_bytep* row_pointers = new png_bytep[m_height]; - for(int y = 0; y < m_height; y++) { -- row_pointers[y] = new png_byte[info->rowbytes]; -+ row_pointers[y] = new png_byte[png_get_rowbytes(png, info)]; - } - png_read_image(png, row_pointers); - -@@ -106,7 +106,7 @@ bool CFormatPng::Load(const char* filena - m_sizeMem = m_pitch * m_height; - m_bitmap = new unsigned char[m_sizeMem]; - -- if(info->color_type == PNG_COLOR_TYPE_RGB) { -+ if(png_get_color_type(png, info) == PNG_COLOR_TYPE_RGB) { - m_format = GL_RGB; - for(int y = 0; y < m_height; y++) { - int dst = y * m_pitch; -@@ -123,7 +123,7 @@ bool CFormatPng::Load(const char* filena - delete[] row_pointers[y]; - } - } -- else if(info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { -+ else if(png_get_color_type(png, info) == PNG_COLOR_TYPE_RGB_ALPHA) { - m_format = GL_RGBA; - for(int y = 0; y < m_height; y++) { - int dst = y * m_pitch; diff --git a/graphics/simpleviewer/files/patch-src_viewer.cpp b/graphics/simpleviewer/files/patch-src_viewer.cpp new file mode 100644 index 000000000000..4907b9c9abf8 --- /dev/null +++ b/graphics/simpleviewer/files/patch-src_viewer.cpp @@ -0,0 +1,10 @@ +--- src/viewer.cpp.orig 2017-02-23 18:44:09 UTC ++++ src/viewer.cpp +@@ -345,6 +345,7 @@ void cViewer::fnKeyboard(int key, int /* + switch (key) + { + case GLFW_KEY_ESCAPE: ++ case GLFW_KEY_Q: + glfwSetWindowShouldClose(cRenderer::getWindow(), 1); + break; + diff --git a/graphics/simpleviewer/pkg-descr b/graphics/simpleviewer/pkg-descr index 93660221d1e5..dfff20833305 100644 --- a/graphics/simpleviewer/pkg-descr +++ b/graphics/simpleviewer/pkg-descr @@ -1,9 +1,10 @@ Simple Viewer is small and simple OpenGL based image viewer. Its features: - Lightweight and fast: utilizes hardware-accelerated video card + - GIF animation, embedded ICC profiles, and Exif tags support - Very simple interface, minimum dependencies - Suitable for default image viewer of desktop - Desktop independent: does not require any specific desktop environment - Open source, licensed under GNU GPLv2 -WWW: http://simpleviewer.sourceforge.net/ +WWW: https://bitbucket.org/andreyu/simple-viewer-gl |