I have made the following changes intended for :
  CE:Adaptation:N950-N9 / fb_text2screen

Please review and accept or decline.
BOSS has already run some checks on this request.
See the "Messages from BOSS" section below.

https://build.pub.meego.com//request/show/4740

Thank You,
marquiz

[This message was auto-generated]

---

Request # 4740:

Messages from BOSS:

State: review at 2012-04-15T17:15:02 by bossbot

Reviews:
       accepted by bossbot : Prechecks succeeded.
       new for CE-maintainers : Please replace this text with a review and 
approve/reject the review (not the SR). BOSS will take care of the rest

Changes:
  submit: home:marquiz:n950 / fb_text2screen -> CE:Adaptation:N950-N9 / 
fb_text2screen
  
changes files:
--------------

++++++ new changes file:
--- fb_text2screen.changes
+++ fb_text2screen.changes
@@ -0,0 +1,21 @@
+* Tue Nov 29 2011 Markus Lehtonen <[email protected]> - 0.1.1~ge26be42
+- Version bumpt to current git head
+- Add hack-fix-build-with-meego-mer-kernel.patch
+- Add Don-t-try-to-guess-number-of-bytes-per-line.patch
+
+* Tue Nov 22 2011 Markus Lehtonen <[email protected]> 0.1.1
+- Pkg imported from MeeGo 1.1
+- Fixed URL, Group and some BuildRequires flags
+
+* Thu Jul 15 2010 Marko Saukko <[email protected]> 0.1.1
+- Fixed kernel src dir
+
+* Wed Jun 9 2010 Carsten Munk <[email protected]> 0.1.1
+- Fix problem with patch not found (wrong name).
+
+* Wed Jun 1 2010 Anas Nashif <[email protected]> 0.1.1
+- Make arch exclusive
+- Require right n900 kernel package for development
+
+* Tue Mar 18 2010 Carsten Munk <[email protected]> 0.1.1
+- Markus Lehtonen's package, cleaned up and reviewed

new:
----
  0001-hack-fix-build-with-meego-mer-kernel.patch
  0002-Don-t-try-to-guess-number-of-bytes-per-line.patch
  fb_text2screen-0.1.1~ge26be42.tar.bz2
  fb_text2screen.changes
  fb_text2screen.spec
  fb_text2screen.yaml

spec files:
-----------

++++++ new spec file:
--- fb_text2screen.spec
+++ fb_text2screen.spec
@@ -0,0 +1,75 @@
+# 
+# Do NOT Edit the Auto-generated Part!
+# Generated by: spectacle version 0.23
+# 
+# >> macros
+# << macros
+
+Name:       fb_text2screen
+Summary:    Opensource text2screen utility
+Version:    0.1.1~ge26be42
+Release:    1
+Group:      System/Startup Services
+License:    GPLv3+
+ExclusiveArch:  %{arm}
+URL:        https://github.com/slonopotamus/fb_text2screen
+Source0:    %{name}-%{version}.tar.bz2
+Source100:  fb_text2screen.yaml
+Patch0:     0001-hack-fix-build-with-meego-mer-kernel.patch
+Patch1:     0002-Don-t-try-to-guess-number-of-bytes-per-line.patch
+BuildRequires:  pkgconfig(popt)
+BuildRequires:  cmake
+BuildRequires:  kernel-devel
+
+
+%description
+fb_text2screen - opensource tool for simple text drawing on framebuffer 
devices.
+
+
+
+
+%prep
+%setup -q -n %{name}-%{version}
+
+# 0001-hack-fix-build-with-meego-mer-kernel.patch
+%patch0 -p1
+# 0002-Don-t-try-to-guess-number-of-bytes-per-line.patch
+%patch1 -p1
+# >> setup
+# << setup
+
+%build
+# >> build pre
+mkdir build
+cd build
+LINUX_SRC_DIR="/usr/src/kernels/$(ls -1 /usr/src/kernels/ | sort | tail -1)"
+LINUX_SRC_DIR=$LINUX_SRC_DIR cmake ..
+# << build pre
+
+
+make %{?jobs:-j%jobs}
+
+# >> build post
+# << build post
+%install
+rm -rf %{buildroot}
+# >> install pre
+cd build
+# << install pre
+%make_install
+
+# >> install post
+# << install post
+
+
+
+
+
+
+%files
+%defattr(-,root,root,-)
+%{_bindir}/*
+# >> files
+# << files
+
+

other changes:
--------------

++++++ 0001-hack-fix-build-with-meego-mer-kernel.patch (new)
--- 0001-hack-fix-build-with-meego-mer-kernel.patch
+++ 0001-hack-fix-build-with-meego-mer-kernel.patch
@@ -0,0 +1,55 @@
+From 6aed52c3771ef5276900deb4c6138076ea053b2d Mon Sep 17 00:00:00 2001
+From: Markus Lehtonen <[email protected]>
+Date: Tue, 29 Nov 2011 20:15:22 +0200
+Subject: [PATCH 1/2] hack: fix build with meego/mer kernel
+
+---
+ CMakeLists.txt |   22 ++++++++++++++--------
+ 1 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a322841..8df9c18 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 2.6)
+ project(fb_text2screen C)
+ set(fb_text2screen_VERSION 0.2-git)
+ 
++set(CMAKE_INSTALL_PREFIX "/usr")
++
+ # Compiler flags
+ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} 
-D_FORTIFY_SOURCE=2)
+ set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+@@ -32,17 +34,21 @@ include(CheckIncludeFile)
+ 
+ check_include_file("linux/omapfb.h" HAVE_LINUX_OMAPFB_H)
+ if(NOT HAVE_LINUX_OMAPFB_H)
+-  set(LINUX_SRC_DIR "/usr/src/linux" CACHE PATH "Path to Linux kernel 
sources")
+-  if(NOT IS_DIRECTORY "${LINUX_SRC_DIR}")
++  if (EXISTS "/usr/include/linux/omapfb.h")
++    set(HAVE_LINUX_OMAPFB_H 1)
++  else()
++    set(LINUX_SRC_DIR "/usr/src/linux" CACHE PATH "Path to Linux kernel 
sources")
++    if(NOT IS_DIRECTORY "${LINUX_SRC_DIR}")
+           message(FATAL_ERROR "No Linux sources found at ${LINUX_SRC_DIR}. 
Set LINUX_SRC_DIR variable to directory with Linux sources")
+-  endif()
++    endif()
+ 
+-  set(CMAKE_REQUIRED_INCLUDES "${LINUX_SRC_DIR}/include")
+-  check_include_file("asm-arm/arch-omap/omapfb.h" HAVE_ARCH_OMAP_OMAPFB_H)
+-  if(NOT HAVE_ARCH_OMAP_OMAPFB_H)
+-      message(FATAL_ERROR "omapfb.h not found")
++    set(CMAKE_REQUIRED_INCLUDES "${LINUX_SRC_DIR}/include")
++    check_include_file("asm-arm/arch-omap/omapfb.h" HAVE_ARCH_OMAP_OMAPFB_H)
++    if(NOT HAVE_ARCH_OMAP_OMAPFB_H)
++        message(FATAL_ERROR "omapfb.h not found")
++    endif()
++    include_directories(AFTER SYSTEM ${CMAKE_REQUIRED_INCLUDES})
+   endif()
+-  include_directories(AFTER SYSTEM ${CMAKE_REQUIRED_INCLUDES})
+ endif()
+ 
+ # config.h
+-- 
+1.7.7
+

++++++ 0002-Don-t-try-to-guess-number-of-bytes-per-line.patch (new)
--- 0002-Don-t-try-to-guess-number-of-bytes-per-line.patch
+++ 0002-Don-t-try-to-guess-number-of-bytes-per-line.patch
@@ -0,0 +1,91 @@
+From f33f7beec56832e2cb53e5c91def52bf3065e8d2 Mon Sep 17 00:00:00 2001
+From: Markus Lehtonen <[email protected]>
+Date: Tue, 29 Nov 2011 20:29:12 +0200
+Subject: [PATCH 2/2] Don't try to guess number of bytes per line
+
+Take the value directly from kernel. Fixes problems with Nokia N950
+device.
+---
+ fb_text2screen.c |   19 +++++++++++--------
+ 1 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/fb_text2screen.c b/fb_text2screen.c
+index 3092efa..3bf0f2d 100644
+--- a/fb_text2screen.c
++++ b/fb_text2screen.c
+@@ -44,6 +44,7 @@ struct fb {
+       uint32_t depth; /* screen depth in bytes per pixel */
+       void *mem; /* mmaped video memory */
+       size_t size; /* mmaped region size */
++      uint32_t line_len; /* buffer line lenght in bytes */
+ };
+ 
+ /* Converts 24-bit rgb color to 16-bit rgb */
+@@ -74,7 +75,7 @@ static void fill(void *out, const struct fb *fb, const 
uint32_t color,
+                       }
+                       row_out = (char *)row_out + fb->depth;
+               }
+-              out = (char *)out + fb->depth * fb->width;
++              out = (char *)out + fb->line_len;
+       }
+ }
+ 
+@@ -188,7 +189,7 @@ static int fb_write_text(
+ 
+       uint8_t *screen_out = (uint8_t *)fb->mem;
+       /* Pointer to left top letter corner */
+-      uint8_t *letter_out = screen_out + fb->depth * (fb->width * y + x);
++      uint8_t *letter_out = screen_out + fb->line_len * y + fb->depth * x;
+       unsigned int row = 0;
+       /* Iterate over chars in text */
+       for (size_t c = 0; c < len; ++c) {
+@@ -207,15 +208,15 @@ static int fb_write_text(
+                               pxlx_out += fb->depth * scale;
+                       }
+                       /* Advance to next pixel row */
+-                      pxly_out += fb->depth * fb->width * scale;
++                      pxly_out += fb->line_len * scale;
+               }
+               /* Advance to next letter in same row */
+               letter_out += fb->depth * letter_size;
+-              const int last_letter_in_row = fb->depth
+-                      * (fb->width * (y + row_height * row + 1) - 
letter_size);
++              const int last_letter_in_row = fb->line_len * (y + row_height * 
row) +
++                                             fb->depth * (fb->width - 
letter_size);
+               if (letter_out - screen_out > last_letter_in_row) {
+                       ++row;
+-                      letter_out = screen_out + fb->depth * fb->width * (y + 
row_height * row);
++                      letter_out = screen_out + fb->line_len * (y + 
row_height * row);
+               }
+       }
+       return EXIT_SUCCESS;
+@@ -242,6 +243,7 @@ static int fb_init(struct fb *fb) {
+       fb->width = vinfo.xres;
+       fb->height = vinfo.yres;
+       fb->depth = ((vinfo.bits_per_pixel) >> 3);
++      fb->line_len = finfo.line_length;
+       /* move viewport to upper left corner */
+       if (vinfo.xoffset != 0 || vinfo.yoffset != 0) {
+               vinfo.xoffset = 0;
+@@ -313,7 +315,8 @@ static int fb_clear(struct fb *fb, const uint32_t color, 
int x, int y,
+               fputs("Boundaries out of range\n", stderr);
+               return EXIT_FAILURE;
+       }
+-      uint8_t *out = (uint8_t *)fb->mem + (ptrdiff_t)fb->depth * (fb->width * 
y + x);
++      uint8_t *out = (uint8_t *)fb->mem + (ptrdiff_t)(fb->line_len * y + 
fb->depth * x);
++
+       fill(out, fb, color, width, height);
+       return EXIT_SUCCESS;
+ }
+@@ -367,7 +370,7 @@ int main(int argc, const char *argv[]) {
+       int rc = poptGetNextOpt(ctx);
+       int ret = EXIT_FAILURE;
+       if (rc == -1) {
+-              struct fb fb = {"/dev/fb0", 0, 0, 0, 0, NULL, 0};
++              struct fb fb = {"/dev/fb0", 0, 0, 0, 0, NULL, 0, 0};
+               /* TODO: fail if more than one non-option arg is given. */
+               if (poptPeekArg(ctx) != NULL) {
+                       fb.device = poptGetArg(ctx);
+-- 
+1.7.7
+

++++++ fb_text2screen-0.1.1~ge26be42.tar.bz2 (new)

++++++ fb_text2screen.yaml (new)
--- fb_text2screen.yaml
+++ fb_text2screen.yaml
@@ -0,0 +1,27 @@
+Name: fb_text2screen
+Summary: Opensource text2screen utility
+Version: 0.1.1~ge26be42
+Release: 1
+Group: System/Startup Services
+License: GPLv3+
+URL: https://github.com/slonopotamus/fb_text2screen
+ExclusiveArch: "%{arm}"
+Description: |
+    fb_text2screen - opensource tool for simple text drawing on framebuffer 
devices.
+Patches:
+    - 0001-hack-fix-build-with-meego-mer-kernel.patch
+    - 0002-Don-t-try-to-guess-number-of-bytes-per-line.patch
+Sources:
+    - "%{name}-%{version}.tar.bz2"
+
+PkgBR:
+    - cmake
+    - kernel-devel
+
+PkgConfigBR:
+    - popt
+
+Configure: none
+
+Files:
+    - "%{_bindir}/*"



Reply via email to