| 1 | #!/bin/sh |
| 2 | # -copyright- |
| 3 | #-# Copyright © 2021 Eric Bina, Dave Black, TJ Phan, |
| 4 | #-# Vincent Renardias, Willem Vermin |
| 5 | #-# |
| 6 | #-# Permission is hereby granted, free of charge, to any person |
| 7 | #-# obtaining a copy of this software and associated documentation |
| 8 | #-# files (the “Software”), to deal in the Software without |
| 9 | #-# restriction, including without limitation the rights to use, |
| 10 | #-# copy, modify, merge, publish, distribute, sublicense, and/or |
| 11 | #-# sell copies of the Software, and to permit persons to whom |
| 12 | #-# the Software is furnished to do so, subject to the following |
| 13 | #-# conditions: |
| 14 | #-# |
| 15 | #-# The above copyright notice and this permission notice shall |
| 16 | #-# be included in all copies or substantial portions of the Software. |
| 17 | #-# |
| 18 | #-# THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, |
| 19 | #-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
| 20 | #-# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 21 | #-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 22 | #-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 23 | #-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 24 | #-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 25 | #-# OTHER DEALINGS IN THE SOFTWARE. |
| 26 | #-# |
| 27 | |
| 28 | # This is a script which compiles xfishtank. |
| 29 | # Use and adapt this if the |
| 30 | # ./configure; make; make install |
| 31 | # suite does not work on your system |
| 32 | # |
| 33 | |
| 34 | # Compilers: |
| 35 | |
| 36 | # C compiler to compile .c sources: |
| 37 | CC=gcc |
| 38 | |
| 39 | # compile and link flags |
| 40 | |
| 41 | FLAGS="-O2" |
| 42 | # if you have pkg-config working for gtk3: |
| 43 | FLAGS="$FLAGS `pkg-config --cflags --libs gtk+-3.0`" |
| 44 | # NOTE: on my system, pkg-config expands to: |
| 45 | # -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 |
| 46 | |
| 47 | |
| 48 | # if you have pkg-config working for gmodule-2.0: |
| 49 | #FLAGS="$FLAGS `pkg-config --cflags --libs gmodule-2.0`" |
| 50 | # NOTE: on my system, pkg-config expands to: |
| 51 | # -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 |
| 52 | |
| 53 | # if you have pkg-config working for these: x11 xpm |
| 54 | FLAGS="$FLAGS `pkg-config --cflags --libs x11 xt xpm xext`" |
| 55 | # NOTE: on my system, pkg-config expands to: |
| 56 | # -lXt -lXpm -lX11 -lXext |
| 57 | |
| 58 | # link flags for libmath: |
| 59 | FLAGS="$FLAGS -lm" |
| 60 | |
| 61 | # following is needed by gtk3 to recognize the buttons: |
| 62 | # (Should be delivered by pkg-config --cflags --libs gmodule-2.0) |
| 63 | FLAGS="$FLAGS -Wl,--export-dynamic" |
| 64 | # or: |
| 65 | # FLAGS="$FLAGS -rdynamic" |
| 66 | |
| 67 | version=`./getversion` |
| 68 | if [ "x$version" = x ]; then |
| 69 | version="Unknown" |
| 70 | fi |
| 71 | |
| 72 | FLAGS="$FLAGS -DVERSION=\"$version\"" |
| 73 | |
| 74 | cd src || exit 1 |
| 75 | echo "removing .o files :" |
| 76 | rm -f *.o |
| 77 | |
| 78 | echo "creating ui_xml.h :" |
| 79 | ./gen_ui_xml.sh || exit 1 |
| 80 | |
| 81 | echo "compiling C sources:" |
| 82 | $CC -c *.c $FLAGS || exit 1 |
| 83 | |
| 84 | echo "creating xfishtank in directory $PWD:" |
| 85 | $CC -o xfishtank *.o $FLAGS || exit 1 |
| 86 | |
| 87 | cd .. |
| 88 | echo "creating man page xfishtank.1 in directory $PWD:" |
| 89 | version=`src/xfishtank -v|awk '{print $2}'` |
| 90 | |
| 91 | echo |
| 92 | echo " ***********************************************************************" |
| 93 | echo " ** It seems that you compiled xfishtank successfully. **" |
| 94 | echo " ** You can try to run it: **" |
| 95 | echo " ** **" |
| 96 | echo " ** src/xfishtank **" |
| 97 | echo " ** **" |
| 98 | echo " ** If xfishtank works satisfactorily, you can install it: **" |
| 99 | echo " ** Copy src/xfishtank to for example /usr/local/bin/ **" |
| 100 | echo " ** **" |
| 101 | echo " ** Optionally, you can install the man page too: **" |
| 102 | echo " ** Copy src/xfishtank.1 to for example /usr/local/share/man/man1/ **" |
| 103 | echo " ** **" |
| 104 | echo " ** Optionally, you can install the desktop file and icon: **" |
| 105 | echo " ** Copy src/xfishtank.desktop to for example **" |
| 106 | echo " ** /usr/local/share/applications/ **" |
| 107 | echo " ** Copy src/xfishtank.png to for example **" |
| 108 | echo " ** /usr/local/share/pixmaps/ **" |
| 109 | echo " ***********************************************************************" |
| 110 | |