diff --git a/.gitignore b/.gitignore index b1b2b14..2e85083 100644 --- a/.gitignore +++ b/.gitignore @@ -7,20 +7,8 @@ *.zip *~ .DS_Store -.deps -ABOUT-NLS -Makefile -Makefile.in -Makefile.in.in -aclocal.m4 -autom4te.cache -ar-lib -compile -config.* -configure data/spek.desktop data/spek.metainfo.xml -depcomp dist/osx/Info.plist dist/osx/Spek.app dist/osx/Spek.dmg @@ -28,27 +16,14 @@ dist/win/Spek dist/win/spek.wxs dist/win/tests env -install-sh -libtool -ltmain.sh m4/ man/spek.1 missing mkinstalldirs -omf.make -po/*.header po/*.gmo -po/*.sed -po/*.sin -po/*.template -po/POTFILES -po/Rules-quot -po/stamp-it -po/stamp-po +spek src/*.stamp src/.libs -src/spek -stamp-h1 tests/.libs tests/perf tests/samples/perf.wav diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8ff94ad --- /dev/null +++ b/Makefile @@ -0,0 +1,232 @@ +NAME = spek +BIN = ${NAME}${EXT} +LIB = lib${NAME}.a +VERSION = 0.8.5 + +PREFIX = /usr/local + +LIBS = -lavcodec -lavformat -lavutil `wx-config --libs` + +TESTS_LIBS = -lavcodec -lavformat -lavutil + +TESTS_CPPFLAGS = -DSAMPLES_DIR=\"samples\" -Isrc -pthread ${CPPFLAGS} +TESTS_CXXFLAGS = -Os ${TESTS_CPPFLAGS} ${CXXFLAGS} +TESTS_LDFLAGS = -pthread ${TESTS_LIBS} ${LDFLAGS} + +SPEK_CPPFLAGS = ${OS_FLAGS} -DGETTEXT_PACKAGE=\"'${NAME}'\" -DPACKAGE_NAME=\"'${NAME}'\" -DPACKAGE_VERSION=\"'${VERSION}'\" `wx-config --cppflags` ${CPPFLAGS} +SPEK_CXXFLAGS = -Os `wx-config --cxxflags` ${SPEK_CPPFLAGS} ${CXXFLAGS} +SPEK_LDFLAGS = ${LIBS} ${LDFLAGS} + +GMO = ${PO:.po=.gmo} + +OBJ_LIB = \ + src/spek-audio.o \ + src/spek-fft.o \ + src/spek-palette.o \ + src/spek-pipeline.o \ + src/spek-utils.o \ + +OBJ_PERF = \ + tests/perf.o \ + +OBJ_TEST = \ + tests/test-audio.o \ + tests/test-fft.o \ + tests/test-utils.o \ + tests/test.o \ + +OBJ = \ + src/spek-artwork.o \ + src/spek-events.o \ + src/spek.o \ + src/spek-platform.o \ + src/spek-preferences-dialog.o \ + src/spek-preferences.o \ + src/spek-ruler.o \ + src/spek-spectrogram.o \ + src/spek-window.o \ + +PO = \ + po/bs.po \ + po/ca.po \ + po/cs.po \ + po/da.po \ + po/de.po \ + po/el.po \ + po/eo.po \ + po/es.po \ + po/fi.po \ + po/fr.po \ + po/gl.po \ + po/he.po \ + po/hr.po \ + po/hu.po \ + po/id.po \ + po/it.po \ + po/ja.po \ + po/ko.po \ + po/lv.po \ + po/nb.po \ + po/nl.po \ + po/nn.po \ + po/pl.po \ + po/pt_BR.po \ + po/ru.po \ + po/sk.po \ + po/sr@latin.po \ + po/sv.po \ + po/th.po \ + po/tr.po \ + po/uk.po \ + po/vi.po \ + po/zh_CN.po \ + po/zh_TW.po \ + +POTFILES = \ + data/spek.desktop.in \ + src/spek-pipeline.cc \ + src/spek-preferences-dialog.cc \ + src/spek-spectrogram.cc \ + src/spek-window.cc \ + src/spek.cc \ + +all: + @echo "To build ${NAME} type make and one the following: osx, unix or win." + @echo "E.g. \`make unix\`" + +options: + @echo "${NAME} build options:" + @echo "CXXFLAGS = ${SPEK_CXXFLAGS}" + @echo "LDFLAGS = ${SPEK_LDFLAGS}" + @echo "CXX = ${CXX}" + +.cc.o: + ${CXX} -c ${SPEK_CXXFLAGS} $< -o $@ + +.po.gmo: + msgfmt -o $@ $< + +${LIB}: ${OBJ_LIB} + ar crs $@ ${OBJ_LIB} + +${BIN}: ${LIB} ${OBJ} + ${CXX} -o ${BIN} ${OBJ} ${LIB} ${SPEK_LDFLAGS} + +data/${NAME}.desktop: po/LINGUAS + sed '/^#/d' ${@}.in > ${@}.in.tmp + msgfmt -d po -o $@ --desktop --template=${@}.in.tmp + rm ${@}.in.tmp + +data/${NAME}.metainfo.xml: po/LINGUAS + msgfmt -d po -o $@ --xml --template=${@}.in + +po/LINGUAS: ${PO} + printf "%s" '${PO}' | xargs -d ' ' -I {} printf "%s\n" '{}' | sed 's/^po\/\(.*\)\.po$$/\1/' | sort > $@ + +po/${NAME}.pot: ${POTFILES} + xgettext -o $@ --copyright-holder='The Spek authors' --package-name=${NAME} --package-version=${VERSION} --from-code=UTF-8 --add-comments --keyword=_ --keyword=N_ ${POTFILES} + for po in po/*.po; do \ + msgmerge -o "$$po" -q "$$po" $@; \ + done; + +osx: + @make options ${BIN} OS_FLAGS=-DOS_OSX + +unix: + @make options ${BIN} OS_FLAGS=-DOS_UNIX + +win: + @make options ${NAME}.exe EXT=.exe OS_FLAGS=-DOS_WIN + +${OBJ_PERF} ${OBJ_TEST}: + ${CXX} -c ${TESTS_CXXFLAGS} ${@:.o=.cc} -o $@ + +tests/perf${EXT}: ${LIB} ${OBJ_PERF} + ${CXX} -o $@ ${OBJ_PERF} ${LIB} ${TESTS_LDFLAGS} + +tests/test${EXT}: ${LIB} ${OBJ_TEST} + ${CXX} -o $@ ${OBJ_TEST} ${LIB} ${TESTS_LDFLAGS} + +check: tests/perf${EXT} tests/test${EXT} + cd tests && ./test${EXT} && ./perf${EXT} + +clean: + rm -f ${BIN} ${NAME}.exe ${LIB} ${OBJ} ${OBJ_LIB} ${GMO} data/${NAME}.desktop data/${NAME}.desktop.in.tmp data/${NAME}.metainfo.xml ${NAME}-${VERSION}.tar.gz tests/perf tests/perf.exe tests/perf${EXT} tests/test tests/test.exe tests/test${EXT} ${OBJ_PERF} ${OBJ_TEST} + +dist: clean po/${NAME}.pot + mkdir ${NAME}-${VERSION} + cp -R $$(ls -A | sed '/^\.git$$/d;/^${NAME}-${VERSION}$$/d') ${NAME}-${VERSION} + tar -cf ${NAME}-${VERSION}.tar ${NAME}-${VERSION} + gzip ${NAME}-${VERSION}.tar + rm -fr ${NAME}-${VERSION} + +install: data/${NAME}.metainfo.xml ${BIN} data/${NAME}.desktop ${GMO} + # appstream file + mkdir -p ${DESTDIR}${PREFIX}/share/metainfo + cp -f data/${NAME}.metainfo.xml ${DESTDIR}${PREFIX}/share/metainfo + chmod 644 ${DESTDIR}${PREFIX}/share/metainfo/${NAME}.metainfo.xml + # bin + mkdir -p ${DESTDIR}${PREFIX}/bin + cp -f ${BIN} ${DESTDIR}${PREFIX}/bin + chmod 755 ${DESTDIR}${PREFIX}/bin/${BIN} + # desktop + mkdir -p ${DESTDIR}${PREFIX}/share/applications + cp -f data/${NAME}.desktop ${DESTDIR}${PREFIX}/share/applications + chmod 644 ${DESTDIR}${PREFIX}/share/applications/${NAME}.desktop + # doc + mkdir -p ${DESTDIR}${PREFIX}/share/doc/${NAME} + cp -f CREDITS.md ${DESTDIR}${PREFIX}/share/doc/${NAME} + chmod 644 ${DESTDIR}${PREFIX}/share/doc/${NAME}/CREDITS.md + cp -f LICENSE ${DESTDIR}${PREFIX}/share/doc/${NAME} + chmod 644 ${DESTDIR}${PREFIX}/share/doc/${NAME}/LICENSE + cp -f MANUAL.md ${DESTDIR}${PREFIX}/share/doc/${NAME} + chmod 644 ${DESTDIR}${PREFIX}/share/doc/${NAME}/MANUAL.md + cp -f README.md ${DESTDIR}${PREFIX}/share/doc/${NAME} + chmod 644 ${DESTDIR}${PREFIX}/share/doc/${NAME}/README.md + # icons + mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/16x16/apps + cp -f data/icons/16x16/${NAME}.png ${DESTDIR}${PREFIX}/share/icons/hicolor/16x16/apps + chmod 644 ${DESTDIR}${PREFIX}/share/icons/hicolor/16x16/apps/${NAME}.png + mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/22x22/apps + cp -f data/icons/22x22/${NAME}.png ${DESTDIR}${PREFIX}/share/icons/hicolor/22x22/apps + chmod 644 ${DESTDIR}${PREFIX}/share/icons/hicolor/22x22/apps/${NAME}.png + mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24/apps + cp -f data/icons/24x24/${NAME}.png ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24/apps + chmod 644 ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24/apps/${NAME}.png + mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/32x32/apps + cp -f data/icons/32x32/${NAME}.png ${DESTDIR}${PREFIX}/share/icons/hicolor/32x32/apps + chmod 644 ${DESTDIR}${PREFIX}/share/icons/hicolor/32x32/apps/${NAME}.png + mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/48x48/apps + cp -f data/icons/48x48/${NAME}.png ${DESTDIR}${PREFIX}/share/icons/hicolor/48x48/apps + chmod 644 ${DESTDIR}${PREFIX}/share/icons/hicolor/48x48/apps/${NAME}.png + mkdir -p ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps + cp -f data/icons/scalable/${NAME}.svg ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps + chmod 644 ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/${NAME}.svg + # locale + for gmo in po/*.gmo; do \ + dir="$$(echo $$gmo | sed 's/^po\/\(.*\)\.gmo$$/\1/')"; \ + mkdir -p ${DESTDIR}${PREFIX}/share/locale/$${dir}/LC_MESSAGES; \ + cp -f $$gmo ${DESTDIR}${PREFIX}/share/locale/$${dir}/LC_MESSAGES/${NAME}.mo; \ + chmod 644 ${DESTDIR}${PREFIX}/share/locale/$${dir}/LC_MESSAGES/${NAME}.mo; \ + done; + # man + mkdir -p ${DESTDIR}${PREFIX}/share/man/man1 + cp -f man/${NAME}.1 ${DESTDIR}${PREFIX}/share/man/man1 + chmod 644 ${DESTDIR}${PREFIX}/share/man/man1/${NAME}.1 + +uninstall: + rm -f ${DESTDIR}${PREFIX}/share/metainfo/${NAME}.metainfo.xml + rm -f ${DESTDIR}${PREFIX}/bin/${BIN} + rm -f ${DESTDIR}${PREFIX}/share/applications/${NAME}.desktop + rm -fr ${DESTDIR}${PREFIX}/share/doc/${NAME} + rm -f ${DESTDIR}${PREFIX}/share/icons/hicolor/16x16/apps/${NAME}.png + rm -f ${DESTDIR}${PREFIX}/share/icons/hicolor/22x22/apps/${NAME}.png + rm -f ${DESTDIR}${PREFIX}/share/icons/hicolor/24x24/apps/${NAME}.png + rm -f ${DESTDIR}${PREFIX}/share/icons/hicolor/32x32/apps/${NAME}.png + rm -f ${DESTDIR}${PREFIX}/share/icons/hicolor/48x48/apps/${NAME}.png + rm -f ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/${NAME}.svg + find ${DESTDIR}${PREFIX} -path '${DESTDIR}${PREFIX}/share/locale/*/LC_MESSAGES/${NAME}.mo' -exec rm -f {} \; + rm -f ${DESTDIR}${PREFIX}/share/man/man1/${NAME}.1 + +.PHONY: all options osx unix win check clean install uninstall +.SUFFIXES: .po .gmo diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index d4de932..0000000 --- a/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -SUBDIRS = \ - data \ - man \ - po \ - src \ - tests - -EXTRA_DIST = \ - CREDITS.md \ - INSTALL.md \ - LICENSE \ - MANUAL.md \ - README.md \ - lic/Expat \ - lic/GPL \ - lic/IJG \ - lic/LGPL \ - lic/libpng \ - lic/libtiff \ - lic/regex \ - lic/wxWindows \ - lic/zlib \ - tests/samples - -DISTCLEANFILES = \ - tests/samples/perf.wav - -.PHONY: man upload - -man: - pandoc --standalone --to=man --output=man/spek.1 MANUAL.md - pandoc --standalone --to=html --output=web/man-@VERSION@.html MANUAL.md - sed -e 's#\(http://[^<]*\)#\1#g' -i web/man-@VERSION@.html - sed -e 's#
#\ - #' -i web/man-@VERSION@.html - -upload: - rsync -avhz web/nginx.conf server:spek - rsync -avhz --delete --exclude="*.in" --exclude="nginx.conf" web/ server:spek/static diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 7b0dfe5..0000000 --- a/autogen.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -test -n "$srcdir" || srcdir=$(dirname "$0") -test -n "$srcdir" || srcdir=. -( - cd "$srcdir" && - touch config.rpath && - autoreconf -fiv -) || exit -test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" diff --git a/configure.ac b/configure.ac deleted file mode 100644 index fe95c88..0000000 --- a/configure.ac +++ /dev/null @@ -1,104 +0,0 @@ -AC_INIT([spek],[0.8.5]) -AC_CONFIG_SRCDIR([src/spek.cc]) -AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([1.11.1 foreign no-dist-gzip dist-xz serial-tests]) -AM_SILENT_RULES([yes]) - -AC_LANG([C++]) -AM_PROG_AR -AC_PROG_CXX -CXXFLAGS="$CXXFLAGS -std=gnu++11 -Wall -Wextra" -AC_PROG_CXXCPP -AC_PROG_LIBTOOL -AC_PROG_RANLIB -AC_PROG_INSTALL - -AC_CANONICAL_HOST -AC_MSG_CHECKING([the OS]) -AS_CASE([$host], - [*-*-mingw*], [ - os="WIN" - AC_DEFINE([OS_WIN], [1], [Windows]) - ], - [*-*-darwin*], [ - os="OSX" - AC_DEFINE([OS_OSX], [1], [OS X]) - ], - [*], [ - os="UNIX" - AC_DEFINE([OS_UNIX], [1], [Unix]) - ] -) -AC_MSG_RESULT([$os]) - -AC_CHECK_PROG(HAVE_VALGRIND, valgrind, yes, no) -AC_ARG_ENABLE( - [valgrind], - AS_HELP_STRING([--enable-valgrind], [Run tests under valgrind]), - [use_valgrind=$enableval], - [use_valgrind=auto] -) -AS_IF( - [test "x$use_valgrind" = xyes -a "x$HAVE_VALGRIND" = xno], [AC_MSG_ERROR([Valgrind not found])], - [AM_CONDITIONAL([USE_VALGRIND], [test "x$use_valgrind" != xno -a x$HAVE_VALGRIND = xyes])] -) -AM_COND_IF([USE_VALGRIND], [use_valgrind=yes], [use_valgrind=no]) - -AC_CHECK_LIB(m, log10) - -PKG_CHECK_MODULES(AVFORMAT, [libavformat >= 59.27.100]) -PKG_CHECK_MODULES(AVCODEC, [libavcodec >= 59.37.100]) -PKG_CHECK_MODULES(AVUTIL, [libavutil >= 57.28.100]) - -AM_OPTIONS_WXCONFIG -reqwx=3.1.7 -AM_PATH_WXCONFIG($reqwx, wx=1) -if test "$wx" != 1; then - AC_MSG_ERROR([ - wxWidgets must be installed on your system. - - Please check that wx-config is in path, the directory - where wxWidgets libraries are installed (returned by - 'wx-config --libs' or 'wx-config --static --libs' command) - is in LD_LIBRARY_PATH or equivalent variable and - wxWidgets version is $reqwx or above. - ]) -fi - -GETTEXT_PACKAGE=spek -AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext Package]) -AC_SUBST(GETTEXT_PACKAGE) -AM_GNU_GETTEXT_VERSION([0.21]) -AM_GNU_GETTEXT([external]) - -AC_CONFIG_FILES([ - Makefile - data/Makefile - data/icons/Makefile - data/icons/16x16/Makefile - data/icons/22x22/Makefile - data/icons/24x24/Makefile - data/icons/32x32/Makefile - data/icons/48x48/Makefile - data/icons/scalable/Makefile - dist/osx/Info.plist - dist/win/spek.wxs - man/Makefile - po/Makefile.in - src/Makefile - tests/Makefile - web/version -]) -AC_OUTPUT - -cat <