summaryrefslogtreecommitdiff
path: root/grc/scripts
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2015-11-20 17:39:59 +0100
committerSebastian Koslowski <koslowski@kit.edu>2016-02-17 19:55:16 +0100
commit36af320d43c726d9bf71eb871737bdd647ff60ef (patch)
tree389857d060e636e80efde53c7df1265e4e90ec3c /grc/scripts
parent9f5ef34ac05de070a99fae07eb1a8087ba60a653 (diff)
grc-refactor: clean-up grc directory
Diffstat (limited to 'grc/scripts')
-rw-r--r--grc/scripts/CMakeLists.txt2
-rw-r--r--grc/scripts/freedesktop/CMakeLists.txt49
-rw-r--r--grc/scripts/freedesktop/README20
-rwxr-xr-xgrc/scripts/freedesktop/convert.sh14
-rw-r--r--grc/scripts/freedesktop/gnuradio-grc.desktop9
-rw-r--r--grc/scripts/freedesktop/gnuradio-grc.xml8
-rw-r--r--grc/scripts/freedesktop/gnuradio_logo_icon-square.svg124
-rw-r--r--grc/scripts/freedesktop/grc-icon-128.pngbin0 -> 4758 bytes
-rw-r--r--grc/scripts/freedesktop/grc-icon-16.pngbin0 -> 537 bytes
-rw-r--r--grc/scripts/freedesktop/grc-icon-24.pngbin0 -> 840 bytes
-rw-r--r--grc/scripts/freedesktop/grc-icon-256.pngbin0 -> 9762 bytes
-rw-r--r--grc/scripts/freedesktop/grc-icon-32.pngbin0 -> 1148 bytes
-rw-r--r--grc/scripts/freedesktop/grc-icon-48.pngbin0 -> 1796 bytes
-rw-r--r--grc/scripts/freedesktop/grc-icon-64.pngbin0 -> 2355 bytes
-rw-r--r--grc/scripts/freedesktop/grc_setup_freedesktop.in75
-rwxr-xr-xgrc/scripts/gnuradio-companion2
16 files changed, 302 insertions, 1 deletions
diff --git a/grc/scripts/CMakeLists.txt b/grc/scripts/CMakeLists.txt
index e905892308..6cc78c3cf3 100644
--- a/grc/scripts/CMakeLists.txt
+++ b/grc/scripts/CMakeLists.txt
@@ -23,3 +23,5 @@ GR_PYTHON_INSTALL(
DESTINATION ${GR_RUNTIME_DIR}
COMPONENT "grc"
)
+
+add_subdirectory(freedesktop)
diff --git a/grc/scripts/freedesktop/CMakeLists.txt b/grc/scripts/freedesktop/CMakeLists.txt
new file mode 100644
index 0000000000..47e836f697
--- /dev/null
+++ b/grc/scripts/freedesktop/CMakeLists.txt
@@ -0,0 +1,49 @@
+# Copyright 2011-2012 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+
+########################################################################
+set(grc_freedesktop_path ${GR_PKG_DATA_DIR}/grc/freedesktop)
+
+install(FILES
+ grc-icon-256.png
+ grc-icon-128.png
+ grc-icon-64.png
+ grc-icon-48.png
+ grc-icon-32.png
+ grc-icon-24.png
+ grc-icon-16.png
+ gnuradio-grc.xml
+ gnuradio-grc.desktop
+ DESTINATION ${grc_freedesktop_path}
+ COMPONENT "grc"
+)
+
+find_program(HAVE_XDG_UTILS xdg-desktop-menu)
+
+if(UNIX AND HAVE_XDG_UTILS)
+ set(SRCDIR ${CMAKE_INSTALL_PREFIX}/${grc_freedesktop_path})
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/grc_setup_freedesktop.in
+ ${CMAKE_CURRENT_BINARY_DIR}/grc_setup_freedesktop
+ @ONLY)
+ install(
+ PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/grc_setup_freedesktop
+ DESTINATION ${GR_PKG_LIBEXEC_DIR} COMPONENT "grc"
+ )
+endif(UNIX AND HAVE_XDG_UTILS)
diff --git a/grc/scripts/freedesktop/README b/grc/scripts/freedesktop/README
new file mode 100644
index 0000000000..0857ecc224
--- /dev/null
+++ b/grc/scripts/freedesktop/README
@@ -0,0 +1,20 @@
+##################################################
+# Freedesktop Notes
+##################################################
+
+This directory contains icons, a mime type, and menu files for grc.
+Installation of these files requires a set of tools called xdg-utils.
+xdg-utils will install files in a standard way according to the freedesktop.org standards.
+
+Desktop enviroments that implement these standards are gnome, kde, xfce, and others.
+If you have one of these desktop enviroments, xdg-utils should come installed.
+If xdg-utils is not installed, then this directory will be ignored by the build.
+
+The gtk IconTheme module locates the installed icons for use inside the grc app.
+On recent versions of gtk, IconTheme ignores the icons installed into the default theme.
+This presents a problem for the gnome file system browser, nautilus, and the grc app.
+As a solution, icons are also installed under the gnome theme.
+
+*.png files - these are the icons of various sizes
+*.desktop files - these are the menu items for grc executables
+*.xml file - this is the mime type for the saved flow graphs
diff --git a/grc/scripts/freedesktop/convert.sh b/grc/scripts/freedesktop/convert.sh
new file mode 100755
index 0000000000..e2cba264a6
--- /dev/null
+++ b/grc/scripts/freedesktop/convert.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+SRC="gnuradio_logo_icon-square.svg"
+SIZES="16 24 32 48 64 128 256"
+
+for size in $SIZES
+do
+ inkscape --without-gui \
+ --export-png="grc-icon-$size.png" \
+ --export-area=8.0:8.0:141.316:141.316 \
+ --export-width=$size \
+ --export-height=$size \
+ $SRC;
+done
diff --git a/grc/scripts/freedesktop/gnuradio-grc.desktop b/grc/scripts/freedesktop/gnuradio-grc.desktop
new file mode 100644
index 0000000000..39beeca1b8
--- /dev/null
+++ b/grc/scripts/freedesktop/gnuradio-grc.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=GRC
+Exec=gnuradio-companion %F
+Categories=Development;
+MimeType=application/gnuradio-grc;
+Icon=gnuradio-grc
+StartupWMClass=gnuradio-companion
diff --git a/grc/scripts/freedesktop/gnuradio-grc.xml b/grc/scripts/freedesktop/gnuradio-grc.xml
new file mode 100644
index 0000000000..a5cb95d9fd
--- /dev/null
+++ b/grc/scripts/freedesktop/gnuradio-grc.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+ <mime-type type="application/gnuradio-grc">
+ <sub-class-of type="application/xml"/>
+ <glob pattern="*.grc"/>
+ <glob pattern="*.grc.xml"/>
+ </mime-type>
+</mime-info>
diff --git a/grc/scripts/freedesktop/gnuradio_logo_icon-square.svg b/grc/scripts/freedesktop/gnuradio_logo_icon-square.svg
new file mode 100644
index 0000000000..3b54bf4001
--- /dev/null
+++ b/grc/scripts/freedesktop/gnuradio_logo_icon-square.svg
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="150"
+ height="150"
+ id="svg3965"
+ version="1.1"
+ inkscape:version="0.48.3.1 r9886"
+ sodipodi:docname="gnuradio_logo_icon.svg">
+ <defs
+ id="defs3967" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="3.959798"
+ inkscape:cx="139.75154"
+ inkscape:cy="47.200773"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:window-width="1920"
+ inkscape:window-height="1176"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata3970">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-57.226591,-6.6600272)">
+ <g
+ id="g4684"
+ transform="translate(30,0)">
+ <path
+ class="fil3"
+ d="m 136.1636,73.874976 c 3.50539,3.465 5.25827,7.69571 5.25827,12.691774 0,4.87524 -1.7426,9.05563 -5.2278,12.54083 -3.4852,3.4852 -7.64539,5.22779 -12.48024,5.22779 -3.39165,0 -6.44775,-0.82488 -9.16795,-2.47464 l -6.34075,6.34075 c 3.94548,4.48866 5.91804,9.83941 5.91804,16.05189 0,6.69649 -2.39351,12.43842 -7.18087,17.22578 -4.78701,4.78736 -10.5013,7.18087 -17.142875,7.18087 -6.751771,0 -12.535866,-2.38004 -17.350511,-7.13977 -4.815,-4.75937 -7.222323,-10.51511 -7.222323,-17.26688 0,-6.75248 2.324055,-12.53587 6.973582,-17.35087 4.648819,-4.815 10.349292,-7.22232 17.101417,-7.22232 5.988189,0 11.18799,1.78334 15.60083,5.34968 l 6.03602,-6.03567 c -3.40972,-3.437 -5.11441,-7.57948 -5.11441,-12.42744 0,-4.915634 1.69228,-9.126144 5.07685,-12.631534 0.31429,-0.32528 0.63532,-0.63567 0.96272,-0.93083 l -6.1728,-6.17279 c -2.68193,2.54799 -5.857438,3.82216 -9.526533,3.82216 -3.871062,0 -7.187598,-1.36453 -9.948188,-4.09358 -2.760945,-2.72906 -4.141418,-6.02929 -4.141418,-9.90071 0,-3.87142 1.332993,-7.18795 3.998622,-9.94854 2.66563,-2.76095 5.933977,-4.14142 9.805394,-4.14142 3.967086,0 7.330393,1.36488 10.091693,4.09394 2.76024,2.7287 4.14071,6.06082 4.14071,9.99602 0,2.69256 -0.67465,5.11583 -2.02429,7.27016 l 6.85275,6.85311 c 2.49768,-1.40351 5.30114,-2.10544 8.41146,-2.10544 5.03646,0 9.3072,1.73233 12.8126,5.19768 z M 96.164267,48.757896 c -2.189409,0 -4.030157,0.77704 -5.521535,2.3322 -1.491378,1.5548 -2.237244,3.4115 -2.237244,5.56937 0,2.22094 0.729921,4.07764 2.189764,5.56937 1.459842,1.49138 3.316181,2.23689 5.569015,2.23689 2.126339,0 3.927043,-0.76925 5.402833,-2.30846 1.47543,-1.53922 2.21315,-3.37182 2.21315,-5.4978 0,-1.0474 -0.19027,-2.04697 -0.57118,-2.99905 -0.38055,-0.95209 -0.9202,-1.77697 -1.61823,-2.47536 -0.69838,-0.72957 -1.53106,-1.31669 -2.499092,-1.76102 -0.967677,-0.44433 -1.943504,-0.66614 -2.927481,-0.66614 z m -6.364842,61.714484 c -3.818976,0 -7.028858,1.35567 -9.629645,4.06736 -2.601496,2.71205 -3.902244,5.94992 -3.902244,9.71363 0,3.87354 1.272755,7.11141 3.818976,9.71291 2.545512,2.60079 5.78374,3.90153 9.712913,3.90153 3.708071,0 6.848858,-1.34185 9.422362,-4.02661 2.573153,-2.6837 3.860433,-5.87976 3.860433,-9.58783 0,-1.82693 -0.33201,-3.56989 -0.99638,-5.23028 -0.66401,-1.66039 -1.60476,-3.09933 -2.822596,-4.31681 -1.217481,-1.27311 -2.670236,-2.29677 -4.358622,-3.07169 -1.687323,-0.77492 -3.389528,-1.16221 -5.105197,-1.16221 z M 123.71383,76.534226 c -2.78043,0 -5.11724,0.98681 -7.01078,2.96115 -1.8939,1.97433 -2.84067,4.33133 -2.84067,7.071374 0,2.82048 0.92657,5.17748 2.78008,7.07138 1.8535,1.89354 4.21051,2.84032 7.07137,2.84032 2.6993,0 4.98579,-0.97725 6.85949,-2.93138 1.87335,-1.95414 2.8102,-4.28067 2.8102,-6.98032 0,-1.3298 -0.24165,-2.599014 -0.72532,-3.807634 -0.4833,-1.20863 -1.16822,-2.25638 -2.05476,-3.14256 -0.88654,-0.92693 -1.94421,-1.67209 -3.17303,-2.23618 -1.22882,-0.56445 -2.46756,-0.84615 -3.71658,-0.84615 z"
+ id="path3484"
+ inkscape:connector-curvature="0"
+ style="fill:#ff6905;fill-rule:evenodd" />
+ <path
+ class="fil3"
+ d="m 71.293796,36.662816 c 4.548897,-8.03374 13.97622,-13.55421 24.865865,-13.55421 10.854209,0 20.255669,5.48503 24.821569,13.4759 l 5.54103,-5.68453 c -6.21354,-9.32279 -17.48799,-15.55547 -30.362599,-15.55547 -12.967086,0 -24.311338,6.32303 -30.49618,15.7578 l 5.630315,5.56051 z"
+ id="path3486"
+ inkscape:connector-curvature="0"
+ style="fill:#ff6905;fill-rule:evenodd" />
+ <path
+ class="fil3"
+ d="m 96.092693,28.893756 c -9.484725,0 -17.688189,4.48441 -21.598228,10.99595 l 5.61685,5.5474 c 2.163189,-5.05347 8.501457,-8.71335 15.981378,-8.71335 7.554687,0 13.944327,3.73358 16.044447,8.86536 l 5.55449,-5.69835 c -3.91004,-6.51224 -12.1135,-10.99701 -21.598937,-10.99701 z"
+ id="path3488"
+ inkscape:connector-curvature="0"
+ style="fill:#ff6905;fill-rule:evenodd" />
+ <text
+ x="195.22275"
+ y="148.5569"
+ class="fil4 fnt0"
+ id="text3496"
+ style="font-size:17.76259804px;font-weight:bold;fill:#969594;fill-rule:evenodd;font-family:Harabara" />
+ <text
+ x="256.77316"
+ y="148.5569"
+ class="fil4 fnt0"
+ id="text3506"
+ style="font-size:17.76259804px;font-weight:bold;fill:#969594;fill-rule:evenodd;font-family:Harabara" />
+ <text
+ x="279.70544"
+ y="148.5569"
+ class="fil4 fnt0"
+ id="text3510"
+ style="font-size:17.76259804px;font-weight:bold;fill:#969594;fill-rule:evenodd;font-family:Harabara" />
+ <text
+ x="344.62241"
+ y="148.5569"
+ class="fil4 fnt0"
+ id="text3520"
+ style="font-size:17.76259804px;font-weight:bold;fill:#969594;fill-rule:evenodd;font-family:Harabara" />
+ <text
+ x="473.09561"
+ y="148.5569"
+ class="fil4 fnt0"
+ id="text3538"
+ style="font-size:17.76259804px;font-weight:bold;fill:#969594;fill-rule:evenodd;font-family:Harabara" />
+ <text
+ x="548.49011"
+ y="148.5569"
+ class="fil4 fnt0"
+ id="text3550"
+ style="font-size:17.76259804px;font-weight:bold;fill:#969594;fill-rule:evenodd;font-family:Harabara" />
+ <text
+ x="687.89447"
+ y="148.5569"
+ class="fil4 fnt0"
+ id="text3570"
+ style="font-size:17.76259804px;font-weight:bold;fill:#969594;fill-rule:evenodd;font-family:Harabara" />
+ </g>
+ </g>
+</svg>
diff --git a/grc/scripts/freedesktop/grc-icon-128.png b/grc/scripts/freedesktop/grc-icon-128.png
new file mode 100644
index 0000000000..13efe806ba
--- /dev/null
+++ b/grc/scripts/freedesktop/grc-icon-128.png
Binary files differ
diff --git a/grc/scripts/freedesktop/grc-icon-16.png b/grc/scripts/freedesktop/grc-icon-16.png
new file mode 100644
index 0000000000..bdd1823b3d
--- /dev/null
+++ b/grc/scripts/freedesktop/grc-icon-16.png
Binary files differ
diff --git a/grc/scripts/freedesktop/grc-icon-24.png b/grc/scripts/freedesktop/grc-icon-24.png
new file mode 100644
index 0000000000..a124768125
--- /dev/null
+++ b/grc/scripts/freedesktop/grc-icon-24.png
Binary files differ
diff --git a/grc/scripts/freedesktop/grc-icon-256.png b/grc/scripts/freedesktop/grc-icon-256.png
new file mode 100644
index 0000000000..077688eac5
--- /dev/null
+++ b/grc/scripts/freedesktop/grc-icon-256.png
Binary files differ
diff --git a/grc/scripts/freedesktop/grc-icon-32.png b/grc/scripts/freedesktop/grc-icon-32.png
new file mode 100644
index 0000000000..a345aace3c
--- /dev/null
+++ b/grc/scripts/freedesktop/grc-icon-32.png
Binary files differ
diff --git a/grc/scripts/freedesktop/grc-icon-48.png b/grc/scripts/freedesktop/grc-icon-48.png
new file mode 100644
index 0000000000..c522a5d0ec
--- /dev/null
+++ b/grc/scripts/freedesktop/grc-icon-48.png
Binary files differ
diff --git a/grc/scripts/freedesktop/grc-icon-64.png b/grc/scripts/freedesktop/grc-icon-64.png
new file mode 100644
index 0000000000..df4f6dc07b
--- /dev/null
+++ b/grc/scripts/freedesktop/grc-icon-64.png
Binary files differ
diff --git a/grc/scripts/freedesktop/grc_setup_freedesktop.in b/grc/scripts/freedesktop/grc_setup_freedesktop.in
new file mode 100644
index 0000000000..87a388e2ec
--- /dev/null
+++ b/grc/scripts/freedesktop/grc_setup_freedesktop.in
@@ -0,0 +1,75 @@
+#!/bin/bash
+#
+# Copyright 2008-2011 Free Software Foundation, Inc.
+#
+# This file is part of GNU Radio
+#
+# GNU Radio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU Radio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Radio; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street,
+# Boston, MA 02110-1301, USA.
+#
+##################################################
+# setup grc on a freedesktop platform
+# $1 should be install or uninstall
+# $2 is the optional path to the files
+# when $2 is unspecified, the path is:
+# @SRCDIR@
+##################################################
+
+ICON_SIZES="16 24 32 48 64 128 256"
+if [ -n "$2" ]; then
+ SRCDIR="$2"
+else
+ SRCDIR="@SRCDIR@"
+fi
+
+case "$1" in
+'install')
+ echo "Begin freedesktop install..."
+ for size in ${ICON_SIZES}; do \
+ echo "Install icon: ${size}x${size}"
+ xdg-icon-resource install --noupdate --context mimetypes --theme gnome --size ${size} ${SRCDIR}/grc-icon-${size}.png application-gnuradio-grc; \
+ xdg-icon-resource install --noupdate --context mimetypes --size ${size} ${SRCDIR}/grc-icon-${size}.png application-gnuradio-grc; \
+ xdg-icon-resource install --noupdate --context apps --theme gnome --size ${size} ${SRCDIR}/grc-icon-${size}.png gnuradio-grc; \
+ xdg-icon-resource install --noupdate --context apps --size ${size} ${SRCDIR}/grc-icon-${size}.png gnuradio-grc; \
+ done
+ xdg-icon-resource forceupdate
+ echo "Install mime type"
+ xdg-mime install ${SRCDIR}/gnuradio-grc.xml
+ echo "Install menu items"
+ xdg-desktop-menu install ${SRCDIR}/*.desktop
+ echo "Done!"
+ echo ""
+ ;;
+'uninstall')
+ echo "Begin freedesktop uninstall..."
+ for size in ${ICON_SIZES}; do \
+ echo "Uninstall icon: ${size}x${size}"
+ xdg-icon-resource uninstall --noupdate --context mimetypes --theme gnome --size ${size} application-gnuradio-grc; \
+ xdg-icon-resource uninstall --noupdate --context mimetypes --size ${size} application-gnuradio-grc; \
+ xdg-icon-resource uninstall --noupdate --context apps --theme gnome --size ${size} gnuradio-grc; \
+ xdg-icon-resource uninstall --noupdate --context apps --size ${size} gnuradio-grc; \
+ done
+ xdg-icon-resource forceupdate
+ echo "Uninstall mime type"
+ xdg-mime uninstall ${SRCDIR}/gnuradio-grc.xml
+ echo "Uninstall menu items"
+ xdg-desktop-menu uninstall `ls ${SRCDIR}/*.desktop | xargs -n1 basename`
+ echo "Done!"
+ echo ""
+ ;;
+*)
+ echo "Usage: $0 [install|uninstall]"
+ ;;
+esac
diff --git a/grc/scripts/gnuradio-companion b/grc/scripts/gnuradio-companion
index 9eee8df7dd..3a3bf503c2 100755
--- a/grc/scripts/gnuradio-companion
+++ b/grc/scripts/gnuradio-companion
@@ -27,7 +27,7 @@ import warnings
GR_IMPORT_ERROR_MESSAGE = """\
Cannot import gnuradio.
-Is the python path environment variable set correctly?
+Is the model path environment variable set correctly?
All OS: PYTHONPATH
Is the library path environment variable set correctly?