Hi,

I have a script where the python-ledger was an essential part.

Upstream is released and the debian sid version is now
ledger --version
Ledger 3.2.1-20200518
Is there a reason python3-ledger cannot be built ?

By building git:master with
./acprep update --python --prefix=$HOME/ledger-build
make install

This fails with :
-- Installing: /usr/lib/python3/dist-packages/ledger.so
CMake Error at src/cmake_install.cmake:152 (file):
  file INSTALL cannot copy file "/home/fred/src/ledger/ledger.so" to
  "/usr/lib/python3/dist-packages/ledger.so": Permission denied.
Call Stack (most recent call first):
  cmake_install.cmake:42 (include)

I did not want to install source in the debian installation.
This is done in src/cmake_install.cmake from 143:

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
  list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES
   "/usr/lib/python3/dist-packages/ledger.so")
  if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)
message(WARNING "ABSOLUTE path INSTALL DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
  endif()
  if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)
message(FATAL_ERROR "ABSOLUTE path INSTALL DESTINATION forbidden (by caller): ${CMAKE_ABSOLUTE_DESTINATION_FILES}")
  endif()
file(INSTALL DESTINATION "/usr/lib/python3/dist-packages" TYPE FILE FILES "/home/fred/dev/src/ledger/ledger.so")
endif()

so I did

mkdir $HOME/ledger-build/python
cp /home/fred/dev/src/ledger/ledger.so $HOME/ledger-build/python

I can again run my old python script by upgrading it to python3

PYTHONPATH=$HOME/ledger-build/python ./script

The script finds "import ledger" and seems to work. My script
still need some work as I also use pandas, which has gone through some
changes as well.

I hope it helps if someone needs this as I did..

Fred

Reply via email to