Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add automated debian package builder.

  • Loading branch information...
commit a5db4cfbd1aa6faeb930fdcb8c00a4d750de845a 1 parent d4cfaf2
Andrew Clinton authored
2  .gitignore
... ... @@ -1,4 +1,4 @@
1 1 *.o
2   -Makefile
  2 +/Makefile
3 3 memview
4 4 moc_Window.cpp
23 Window.C
@@ -360,9 +360,17 @@ void MemViewWidget::batchSize(int value)
360 360 // Load a file into a buffer. The buffer is owned by the caller, and
361 361 // should be freed with delete[].
362 362 static char *
363   -loadTextFile(const char *filename)
  363 +loadTextFile(const char *filename, const std::vector<std::string> &paths)
364 364 {
365   - std::ifstream is(filename);
  365 + std::ifstream is;
  366 + for (auto it = paths.begin(); it != paths.end(); ++it)
  367 + {
  368 + std::string path = *it + filename;
  369 +
  370 + is.open(path.c_str());
  371 + if (is.good())
  372 + break;
  373 + }
366 374 if (!is.good())
367 375 return 0;
368 376
@@ -450,17 +458,18 @@ MemViewWidget::initializeGL()
450 458 glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MIN_FILTER, type);
451 459 glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MAG_FILTER, type);
452 460
453   - std::string shader_path;
  461 + std::vector<std::string> paths;
  462 + paths.push_back("");
  463 + paths.push_back(myPath);
  464 + paths.push_back("/usr/share/memview/");
454 465
455 466 QGLShader *vshader = new QGLShader(QGLShader::Vertex, this);
456   - shader_path = myPath + "shader.vert";
457   - const char *vsrc = loadTextFile(shader_path.c_str());
  467 + const char *vsrc = loadTextFile("shader.vert", paths);
458 468 vshader->compileSourceCode(vsrc);
459 469 delete [] vsrc;
460 470
461 471 QGLShader *fshader = new QGLShader(QGLShader::Fragment, this);
462   - shader_path = myPath + "shader.frag";
463   - const char *fsrc = loadTextFile(shader_path.c_str());
  472 + const char *fsrc = loadTextFile("shader.frag", paths);
464 473 fshader->compileSourceCode(fsrc);
465 474 delete [] fsrc;
466 475
42 debian/Makefile
... ... @@ -0,0 +1,42 @@
  1 +VERSION = 1.0-1
  2 +
  3 +BIN_INSTALL_DIR = debian/usr/bin
  4 +SHARE_INSTALL_DIR = debian/usr/share/memview
  5 +VALGRIND_INSTALL_DIR = debian/usr/lib/valgrind
  6 +
  7 +VALGRIND_SRC = ~/projects/repo/valgrind
  8 +
  9 +# depends: dpkg-shlibdeps --ignore-missing-info -O debian/usr/bin/memview
  10 +
  11 +PACKAGE_NAME = memview_$(VERSION)_amd64.deb
  12 +
  13 +MEMVIEW_BIN = ../memview
  14 +MEMVIEW_FRAG = ../shader.frag
  15 +MEMVIEW_VERT = ../shader.vert
  16 +MEMVIEW_TOOL = $(VALGRIND_SRC)/memview/memview-amd64-linux
  17 +MEMVIEW_PRELOAD = $(VALGRIND_SRC)/memview/vgpreload_memview-amd64-linux.so
  18 +
  19 +top: $(PACKAGE_NAME)
  20 +
  21 +control: control.src
  22 + sed -e "s/<<architecture>>/`dpkg --print-architecture`/g" \
  23 + -e "s/<<version>>/$(VERSION)/g" control.src > control
  24 +
  25 +$(PACKAGE_NAME): control $(MEMVIEW_BIN) $(MEMVIEW_FRAG) $(MEMVIEW_VERT) $(MEMVIEW_TOOL) $(MEMVIEW_PRELOAD)
  26 + mkdir -p $(BIN_INSTALL_DIR)
  27 + cp $(MEMVIEW_BIN) $(BIN_INSTALL_DIR)
  28 + mkdir -p $(SHARE_INSTALL_DIR)
  29 + cp $(MEMVIEW_FRAG) $(SHARE_INSTALL_DIR)
  30 + cp $(MEMVIEW_VERT) $(SHARE_INSTALL_DIR)
  31 + mkdir -p $(VALGRIND_INSTALL_DIR)
  32 + cp $(MEMVIEW_TOOL) $(VALGRIND_INSTALL_DIR)
  33 + cp $(MEMVIEW_PRELOAD) $(VALGRIND_INSTALL_DIR)
  34 + mkdir -p debian/DEBIAN
  35 + cp control debian/DEBIAN
  36 + dpkg-deb --build debian
  37 + mv debian.deb $(PACKAGE_NAME)
  38 +
  39 +clean:
  40 + rm -rf debian
  41 + rm -f control
  42 + rm -f $(PACKAGE_NAME)
10 debian/control.src
... ... @@ -0,0 +1,10 @@
  1 +Package: memview
  2 +Version: <<version>>
  3 +Section: devel
  4 +Priority: optional
  5 +Architecture: <<architecture>>
  6 +Depends: valgrind (>= 3.8), libc6 (>= 2.15), libgcc1 (>= 1:4.1.1), libqt4-opengl (>= 4:4.6.1), libqtcore4 (>= 4:4.8.0), libqtgui4 (>= 4:4.5.3), libstdc++6 (>= 4.6)
  7 +Maintainer: Andrew Clinton <ajclinto@gmail.com>
  8 +Homepage: https://github.com/ajclinto/memview
  9 +Description: A real-time memory trace visualizer using valgrind
  10 + Memview is a real-time visualization program that will show the memory state of another running program as a graphical image. Memory addresses correspond to pixels in the image, and as memory is accessed the display will animate to show what parts of the address space are currently being referenced by the program.

0 comments on commit a5db4cf

Please sign in to comment.
Something went wrong with that request. Please try again.