Skip to content

Commit

Permalink
Debian package cpack + icon fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcliffe committed Mar 9, 2015
1 parent 5792256 commit 07c9395
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 6 deletions.
45 changes: 44 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ IF (WIN32)
ENDIF (WIN32)

IF (UNIX AND NOT APPLE)
set(BUILD_DEB OFF CACHE BOOL "Build DEB")

set(RTLSDR_INCLUDE "/usr/local/include" CACHE FILEPATH "RTL-SDR Include Path")
set(RTLSDR_LIB "/usr/local/lib" CACHE FILEPATH "RTL-SDR Lib Path")
set(USE_AUDIO_PULSE ON CACHE BOOL "Use Pulse Audio")
Expand Down Expand Up @@ -500,4 +502,45 @@ IF (WIN32 AND BUILD_INSTALLER)


INCLUDE(CPack)
ENDIF (WIN32 AND BUILD_INSTALLER)
ENDIF (WIN32 AND BUILD_INSTALLER)


IF (UNIX AND BUILD_DEB)

set(CPACK_GENERATOR DEB)
set(CPACK_PACKAGE_NAME "CubicSDR")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS " librtlsdr0, libfftw3-single3, libwxgtk3.0-0, libpulse0")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Charles J. Cliffe <[email protected]>")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "CubicSDR Software Defined Radio application v${CUBICSDR_VERSION}")
SET(CPACK_DEBIAN_PACKAGE_SECTION "comm")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${EX_PLATFORM_NAME}")

ADD_DEFINITIONS(
-DRES_FOLDER="/usr/share/cubicsdr/"
-D_FORTIFY_SOURCE=2
)

set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-z,relro")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")

CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/external/deb/deb_post.sh.in" "${CMAKE_CURRENT_BINARY_DIR}/deb_post.sh" @ONLY IMMEDIATE)

INSTALL(TARGETS CubicSDR DESTINATION bin)
install(FILES
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18.fnt
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24.fnt
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32.fnt
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48.fnt
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12_0.png
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16_0.png
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18_0.png
${PROJECT_SOURCE_DIR}/font/vera_sans_mono24_0.png
${PROJECT_SOURCE_DIR}/font/vera_sans_mono32_0.png
${PROJECT_SOURCE_DIR}/font/vera_sans_mono48_0.png
DESTINATION share/cubicsdr)

INCLUDE(CPack)
ENDIF (UNIX AND BUILD_DEB)
11 changes: 11 additions & 0 deletions external/deb/deb_post.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
# found at https://github.com/paralect/robomongo/blob/master/install/linux/fixup_deb.sh.in
set -e
mkdir fix_up_deb
dpkg-deb -x @[email protected] fix_up_deb
dpkg-deb --control @[email protected] fix_up_deb/DEBIAN
rm @[email protected]
chmod 0644 fix_up_deb/DEBIAN/md5sums
find -type d -print0 | xargs -0 chmod 755
fakeroot dpkg -b fix_up_deb @[email protected]
rm -rf fix_up_deb
8 changes: 5 additions & 3 deletions src/AppFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ wxEND_EVENT_TABLE()
AppFrame::AppFrame() :
wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {

#ifdef __linux__
SetIcon(wxICON(cubicsdr));
#endif

wxBoxSizer *vbox = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *demodOpts = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *demodVisuals = new wxBoxSizer(wxVERTICAL);
Expand Down Expand Up @@ -236,9 +240,7 @@ wxFrame(NULL, wxID_ANY, CUBICSDR_TITLE), activeDemodulator(NULL) {
Centre();
Show();

#ifdef __linux__
SetIcon(wxICON(cubicsdr));
#endif

#ifdef _WIN32
SetIcon(wxICON(frame_icon));
#endif
Expand Down
10 changes: 8 additions & 2 deletions src/util/GLFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <fstream>
#include <algorithm>

#ifndef RES_FOLDER
#define RES_FOLDER ""
#endif

GLFontChar::GLFontChar() :
id(0), x(0), y(0), width(0), height(0), xoffset(0), yoffset(0), xadvance(0), aspect(1), index(0) {

Expand Down Expand Up @@ -149,7 +153,8 @@ std::string GLFont::getParamValue(std::string param_str) {
}

void GLFont::loadFont(std::string fontFile) {
fontFileSource = fontFile;
fontFileSource = RES_FOLDER;
fontFileSource.append(fontFile);

std::ifstream input;
input.open(fontFileSource.c_str(), std::ios::in);
Expand Down Expand Up @@ -210,7 +215,8 @@ void GLFont::loadFont(std::string fontFile) {
std::string paramValue = getParamValue(param);

if (paramKey == "file") {
imageFile = paramValue;
imageFile = RES_FOLDER;
imageFile.append(paramValue);
}
// std::cout << "[" << paramKey << "] = '" << paramValue << "'" << std::endl;
}
Expand Down

0 comments on commit 07c9395

Please sign in to comment.