orbitalquark / textadept-file-diff

Two-way file comparison module for Textadept.
MIT License
12 stars 1 forks source link

Errors trying to install/require this neat-sounding module... #1

Closed metaleap closed 2 years ago

metaleap commented 2 years ago

So I thought I'd go for this:

cd ~/.textadept/modules
git clone git@github.com:orbitalquark/textadept-file-diff.git
mv textadept-file-diff file_diff

Then require('file_diff') in init.lua but this produces:

lua: /home/_/.textadept/modules/file_diff/init.lua:102: module 'file_diff.diff' not found:
    no field package.preload['file_diff.diff']
    no file '/home/_/.textadept/modules/file_diff/diff.lua'
    no file '/home/_/.textadept/modules/file_diff/diff/init.lua'
    no file '/home/_/a/textadept/modules/file_diff/diff.lua'
    no file '/home/_/a/textadept/modules/file_diff/diff/init.lua'
    no file '/home/_/a/textadept/core/file_diff/diff.lua'
    no file '/usr/share/lua/5.4/file_diff/diff.lua'
    no file '/usr/share/lua/5.4/file_diff/diff/init.lua'
    no file '/usr/lib/lua/5.4/file_diff/diff.lua'
    no file '/usr/lib/lua/5.4/file_diff/diff/init.lua'
    no file ''
    no file '/home/_/.textadept/modules/file_diff/diff.so'
    no file '/home/_/a/textadept/modules/file_diff/diff.so'
    no file '/usr/lib/lua/5.4/file_diff/diff.so'
    no file '/usr/lib/lua/5.4/loadall.so'
    no file ''
    no file '/home/_/.textadept/modules/file_diff.so'
    no file '/home/_/a/textadept/modules/file_diff.so'
    no file '/usr/lib/lua/5.4/file_diff.so'
    no file '/usr/lib/lua/5.4/loadall.so'
    no file ''

(Of course there is diff.cxx but that's not pertinent I guess.) So since there's a makefile I do a make clean and make all but this yields:

g++ -c -std=c++11 -pedantic -fPIC -Wall -I../../src/lua/src -o diff.o diff.cxx
diff.cxx:3:10: fatal error: diff_match_patch.h: No such file or directory
    3 | #include "diff_match_patch.h"
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:27: diff.o] Error 1

which must related to this wild net fetch from L55+:

diff_match_patch_zip = 7f95b37e554453262e2bcda830724fc362614103.zip
$(diff_match_patch_zip): ; wget https://github.com/leutloff/diff-match-patch-cpp-stl/archive/$@
diff_match_patch.h: | $(diff_match_patch_zip) ; unzip -j $| "*/$@"

So leutloff has no more archive dir in that repo so now I'm out of ideas :grin: guess to resolve, would have to dig in that repo's history to find the latest .h that did exist under his ...../archive/ and bring it here into the repo? Or you might have a better idea since you actually what all this stuff is for and why...

orbitalquark commented 2 years ago

Try make deps first, followed by make diff.so. This is not well documented.

metaleap commented 2 years ago

Thanks @orbitalquark! Tried and no lua.h:

g++ -c -std=c++11 -pedantic -fPIC -Wall -I../../src/lua/src -o diff.o diff.cxx
diff.cxx:6:10: fatal error: lua.h: No such file or directory
    6 | #include "lua.h"
      |          ^~~~~~~
compilation terminated.
make: *** [Makefile:27: diff.o] Error 1

So I installed package lua-devel which picked out lua53-devel (out of the 51-54 range available in pkg repo) but no dice... tried again too with lua54-devel, same outcome

orbitalquark commented 2 years ago

In Textadept's src/ directory, run make deps to download and unpack Lua. Make sure the file_diff directory is in Textadept's modules/ directory, then try again. You need to build against Lua 5.4, which is what Textadept is currently using.

metaleap commented 2 years ago

Yay, solves the build issues and lets me require without errors, muchos gracias!