Skip to content

Instantly share code, notes, and snippets.

@SpotlightKid
Last active Feb 5, 2021
Embed
What would you like to do?
Improved PKGBUILD for loopauditioneer-svn
pkg/
src/
loopauditioneer/
loopauditioneer-svn-*.pkg.tar.xz
loopauditioneer-svn-*.pkg.tar.zst

Various PKGBUILD improvements

  • Compiled with wxgtk3 instead of wxgtk2
  • Used system rtaudio library.
  • Updated 'depends'.
  • Moved files under /usr (using patch to fix icon/help file paths).
  • Removed installation of unneeded / duplicated icon/help files.
  • Removed now unneeded starter shell script.
  • Installed icons license.
  • Cleaned up and re-structured build and install commands.
  • Added .gitignore.
diff --git a/src/LoopAuditioneer.cpp b/src/LoopAuditioneer.cpp
index ed2832a..ea1a855 100644
--- a/src/LoopAuditioneer.cpp
+++ b/src/LoopAuditioneer.cpp
@@ -41,13 +41,13 @@ bool LoopAuditioneerApp::OnInit() {
wxImage::AddHandler(new wxJPEGHandler);
wxFileSystem::AddHandler(new wxZipFSHandler);
m_helpController = new wxHtmlHelpController();
- m_helpController->Initialize(wxT("help/help.zip"));
+ m_helpController->Initialize(wxT(DATADIR "/help/help.zip"));
// load icons
- m_icons = wxIconBundle(wxIcon(wxT("icons/LoopyIcon-16.png"), wxBITMAP_TYPE_PNG));
- m_icons.AddIcon(wxIcon(wxT("icons/LoopyIcon-24.png"), wxBITMAP_TYPE_PNG));
- m_icons.AddIcon(wxIcon(wxT("icons/LoopyIcon-32.png"), wxBITMAP_TYPE_PNG));
- m_icons.AddIcon(wxIcon(wxT("icons/LoopyIcon-48.png"), wxBITMAP_TYPE_PNG));
+ m_icons = wxIconBundle(wxIcon(wxT(DATADIR "/icons/LoopyIcon-16.png"), wxBITMAP_TYPE_PNG));
+ m_icons.AddIcon(wxIcon(wxT(DATADIR "/icons/LoopyIcon-24.png"), wxBITMAP_TYPE_PNG));
+ m_icons.AddIcon(wxIcon(wxT(DATADIR "/icons/LoopyIcon-32.png"), wxBITMAP_TYPE_PNG));
+ m_icons.AddIcon(wxIcon(wxT(DATADIR "/icons/LoopyIcon-48.png"), wxBITMAP_TYPE_PNG));
frame->SetIcons(m_icons);
diff --git a/src/MyFrame.cpp b/src/MyFrame.cpp
index 5e2f8c0..902d308 100644
--- a/src/MyFrame.cpp
+++ b/src/MyFrame.cpp
@@ -680,23 +680,23 @@ MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title), m_time
toolBar = CreateToolBar(wxNO_BORDER | wxTB_HORIZONTAL | wxTB_FLAT);
toolBar->SetToolBitmapSize(wxSize(24, 24));
wxImage::AddHandler(new wxPNGHandler);
- wxBitmap selectFolder(wxT("../icons/24x24/Open_folder.png"), wxBITMAP_TYPE_PNG);
- wxBitmap openSelectedFile(wxT("../icons/24x24/Open_file.png"), wxBITMAP_TYPE_PNG);
- wxBitmap saveFile(wxT("../icons/24x24/Save.png"), wxBITMAP_TYPE_PNG);
- wxBitmap saveFileAs(wxT("../icons/24x24/Save_as.png"), wxBITMAP_TYPE_PNG);
- wxBitmap startPlayback(wxT("../icons/24x24/Right.png"), wxBITMAP_TYPE_PNG);
- wxBitmap stopPlayback(wxT("../icons/24x24/Stop.png"), wxBITMAP_TYPE_PNG);
- wxBitmap loopCreation(wxT("../icons/24x24/Refresh.png"), wxBITMAP_TYPE_PNG);
- wxBitmap autoLoop(wxT("../icons/24x24/Search.png"), wxBITMAP_TYPE_PNG);
- wxBitmap autoLoopSettings(wxT("../icons/24x24/Yin-Yang.png"), wxBITMAP_TYPE_PNG);
- wxBitmap batchProcess(wxT("../icons/24x24/Gear.png"), wxBITMAP_TYPE_PNG);
- wxBitmap pitchInfo(wxT("../icons/24x24/Bell.png"), wxBITMAP_TYPE_PNG);
- wxBitmap zoomInAmp(wxT("../icons/24x24/Zoom_in.png"), wxBITMAP_TYPE_PNG);
- wxBitmap zoomOutAmp(wxT("../icons/24x24/Zoom_out.png"), wxBITMAP_TYPE_PNG);
- wxBitmap crossfade(wxT("../icons/24x24/Wizard.png"), wxBITMAP_TYPE_PNG);
- wxBitmap cutfade(wxT("../icons/24x24/Software.png"), wxBITMAP_TYPE_PNG);
- wxBitmap viewloop(wxT("../icons/24x24/Diagram.png"), wxBITMAP_TYPE_PNG);
- wxBitmap listInfo(wxT("../icons/24x24/Text.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap selectFolder(wxT(DATADIR "/icons/24x24/Open_folder.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap openSelectedFile(wxT(DATADIR "/icons/24x24/Open_file.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap saveFile(wxT(DATADIR "/icons/24x24/Save.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap saveFileAs(wxT(DATADIR "/icons/24x24/Save_as.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap startPlayback(wxT(DATADIR "/icons/24x24/Right.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap stopPlayback(wxT(DATADIR "/icons/24x24/Stop.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap loopCreation(wxT(DATADIR "/icons/24x24/Refresh.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap autoLoop(wxT(DATADIR "/icons/24x24/Search.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap autoLoopSettings(wxT(DATADIR "/icons/24x24/Yin-Yang.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap batchProcess(wxT(DATADIR "/icons/24x24/Gear.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap pitchInfo(wxT(DATADIR "/icons/24x24/Bell.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap zoomInAmp(wxT(DATADIR "/icons/24x24/Zoom_in.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap zoomOutAmp(wxT(DATADIR "/icons/24x24/Zoom_out.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap crossfade(wxT(DATADIR "/icons/24x24/Wizard.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap cutfade(wxT(DATADIR "/icons/24x24/Software.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap viewloop(wxT(DATADIR "/icons/24x24/Diagram.png"), wxBITMAP_TYPE_PNG);
+ wxBitmap listInfo(wxT(DATADIR "/icons/24x24/Text.png"), wxBITMAP_TYPE_PNG);
toolBar->AddTool(FILE_SELECT, wxT("Select working folder"), selectFolder, wxT("Select working folder"));
toolBar->AddTool(OPEN_SELECTED, wxT("Open selected file"), openSelectedFile, wxT("Open selected file"));
toolBar->AddTool(wxID_SAVE, wxT("Save file"), saveFile, wxT("Save file"));
[Desktop Entry]
Type=Application
Name=LoopAuditioneer
Comment=Software for loop and cue handling in .wav files
Exec=loopauditioneer
Icon=loopauditioneer
Categories=AudioVideo;Audio
# Maintainer: Joermungand <joermungand at gmail dot com>
# Contributor: Christopher Arndt <aur -at- chrisarndt -dot- de>
pkgname=loopauditioneer-svn
pkgver=r54
pkgrel=2
pkgdesc="Software for loop and cue handling in .wav files"
arch=('i686' 'x86_64')
url="http://loopauditioneer.sourceforge.net/"
license=('GPL3')
depends=('wxgtk3' 'webkit2gtk' 'rtaudio')
makedepends=('svn')
provides=('loopauditioneer')
conflicts=('loopauditioneer')
source=("${pkgname%-*}"::'svn://svn.code.sf.net/p/loopauditioneer/code/trunk'
'loopauditioneer-datadir.diff'
"${pkgname%-*}.desktop")
md5sums=('SKIP'
'2aaf74119fab99191937d0f38f47b02e'
'0e2286c155701065663461be6c1056ba')
_cpp_sources=(
AutoLoopDialog.cpp
AutoLooping.cpp
BatchProcessDialog.cpp
CrossfadeDialog.cpp
CueMarkers.cpp
CutNFadeDialog.cpp
FFT.cpp
FileHandling.cpp
ListInfoDialog.cpp
LoopAuditioneer.cpp
LoopMarkers.cpp
LoopOverlay.cpp
LoopParametersDialog.cpp
MyFrame.cpp
MyListCtrl.cpp
MyPanel.cpp
MySound.cpp
PitchDialog.cpp
StopHarmonicDialog.cpp
WaveformDrawer.cpp
)
pkgver() {
cd "$srcdir/${pkgname%-*}"
local ver="$(svnversion)"
printf "r%s" "${ver//[[:alpha:]]}"
}
prepare() {
cd "$srcdir/${pkgname%-*}"
patch -p1 -N -r - -i "$srcdir"/loopauditioneer-datadir.diff || true
}
build() {
cd "$srcdir/${pkgname%-*}"
echo "Building libsndfile..."
(
cd lib-src/libsndfile;
aclocal;
automake;
./configure \
--disable-external-libs \
--enable-static;
make
)
ln -sf libsndfile/src/.libs/libsndfile.a lib-src
echo "Building LoopAuditioneer..."
(
cd src
g++ \
-DDATADIR=\"/usr/share/loopauditioneer\" \
-o LoopAuditioneer \
${_cpp_sources[*]} \
-I../lib-src/libsndfile/src \
../lib-src/libsndfile.a \
`pkg-config --cflags --libs rtaudio` \
-lm \
-lpthread \
`wx-config-gtk3 --cxxflags --unicode=yes --libs` \
)
}
package() {
cd "$srcdir/${pkgname%-*}"
# binary
install -Dm755 src/LoopAuditioneer "$pkgdir/usr/bin/${pkgname%-*}"
# desktop file
install -Dm644 "${srcdir}/${pkgname%-*}.desktop" -t "$pkgdir/usr/share/applications"
# icons
install -Dm644 src/icons/*.png icons/index.url -t "$pkgdir/usr/share/${pkgname%-*}/icons"
install -Dm755 icons/24x24/* -t "$pkgdir/usr/share/${pkgname%-*}/icons/24x24"
install -Dm644 src/help/help.zip -t "$pkgdir/usr/share/${pkgname%-*}/help"
#install -Dm644 src/help/images/* -t "$pkgdir/usr/share/${pkgname%-*}/help/images/"
# application icon
install -dm755 "$pkgdir/usr/share/pixmaps"
ln -sf "../../${pkgname%-*}/icons/LoopyIcon-48.png" "$pkgdir/usr/share/pixmaps/${pkgname%-*}.png"
# documentation
install -Dm644 README.txt -t "$pkgdir/usr/share/doc/${pkgname}"
# icons license
install -Dm755 icons/readme.txt "$pkgdir/share/licenses/${pkgname}/license-icons.txt"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment