DPF icon indicating copy to clipboard operation
DPF copied to clipboard

generate-ttl.sh fails for more than one plugin

Open riban-bw opened this issue 2 years ago • 8 comments

I have used DPF to successfully build a plugin including generating the LV2 ttl files. I added a second plugin and tried to build and it failed complaining it was not able to find the LV2's folder. This seems to be because generate-ttl.sh changes one folder up the tree on each iteration but expects to be in a folder further up the tree.

riban-bw avatar Nov 10 '21 20:11 riban-bw

The script (and code/binary) expects to dump the files in the current path. But I think we can rework this on the develop branch since we have ways to know where the binary is located, see https://github.com/DISTRHO/DPF/blob/develop/distrho/DistrhoPluginUtils.hpp#L34

So we can make it ignore CWD and just use the filename of the file as base, just swapping the file extension.

And then with this in place we can even kill the script altogether, auto-generating the ttl right after the lv2 binaries are created.

PR/patches welcome

falkTX avatar Nov 10 '21 20:11 falkTX

He he! I have a patch to fix it by just recording the directory and restoring back to it but maybe we should just lose the script and add to the Makefile??? I will submit the PR for the quick fix so we at least have something that works.

riban-bw avatar Nov 10 '21 21:11 riban-bw

Oh no! Gotta figure out (again) how to work around GitHub's change to authentication... this may take a while - stoopid GitHub!

riban-bw avatar Nov 10 '21 21:11 riban-bw

You can just paste a patch file. and yes eventually this can be all done automatically in the Makefile. The cmake side already does this, it never calls into this script

falkTX avatar Nov 10 '21 21:11 falkTX

#!/bin/bash

set -e

if [ -d bin ]; then
  cd bin
else
  echo "Please run this script from the source root folder"
  exit
fi
BIN_PATH=$(pwd)

PWD="$(dirname "${0}")"

if [ -f "${PWD}/lv2_ttl_generator.exe" ]; then
  GEN="${PWD}/lv2_ttl_generator.exe"
  EXT=dll
else
  GEN="${PWD}/lv2_ttl_generator"
  if [ -d /Library/Audio ]; then
    EXT=dylib
  else
    EXT=so
  fi
fi

FOLDERS=`find . -type d -name \*.lv2`

for i in ${FOLDERS}; do
  cd ${i}
  FILE="$(ls *.${EXT} | sort | head -n 1)"
  ${EXE_WRAPPER} "${GEN}" "./${FILE}"
  cd ${BIN_PATH}
done

riban-bw avatar Nov 10 '21 21:11 riban-bw

ah that hmmm, well I would prefer to just change the code at this point rather than keep the script working. let's do it properly

falkTX avatar Nov 10 '21 21:11 falkTX

Okay - I don't have time right now to look at a full fix so am using this patch to work around the issue for now. I need to press on with the actual plugin ;-) .

riban-bw avatar Nov 10 '21 21:11 riban-bw

No worries, we keep this ticket open as a reminder for me, or anyone else that is bothered enough to do the work for this before me.

falkTX avatar Nov 10 '21 21:11 falkTX