fuzziqersoftware / resource_dasm

Classic Mac OS resource fork and application disassembler, with reverse-engineering tools for specific applications
MIT License
114 stars 13 forks source link

Prebuilt binary for Linux with phosg prelinked #62

Closed hyperhello closed 1 year ago

hyperhello commented 1 year ago

I'm trying to pull the pictures and sounds out of old HyperCard stacks in an environment where I don't have root/sudo so I can't install phosg as a library.

I've been playing with the make files to try to merge the two codebases. There's probably a trick to make it easy, since the macOS release.zip has all the binaries and they seem to run. Can we have a Debian release?

Kristine1975 commented 1 year ago

You can specify the location of phosg by defining the cmake variable PHOSG_DIR, e.g. when you have phosg in a directory parallel to resource_dasm:

 cmake -DPHOSG_DIR=../phosg .

Note that for that to work there must be a symlink (or hardlink) inside the phosg directory called "phosg" that points to "src" like so:

ln -s src phosg

See: https://github.com/fuzziqersoftware/resource_dasm/blob/4b27622cf46c756120840bf414813015eb8fefa9/CMakeLists.txt#L24-L31

hyperhello commented 1 year ago

That worked to link and run resource_dasm. Thank you very much. However I wasn't able to link the one after, m68kdasm. I'll keep trying, maybe there's an include or a config issue on my system. [ 62%] Linking CXX executable m68kdasm /usr/bin/ld: CMakeFiles/m68kdasm.dir/src/m68kdasm.cc.o: in function std::thread::thread<void (&)(std::function<bool (unsigned long, unsigned long)>&, std::atomic<unsigned long>&, std::atomic<unsigned long>&, unsigned long, unsigned long), std::reference_wrapper<std::function<bool (unsigned long, unsigned long)> >, std::reference_wrapper<std::atomic<unsigned long> >, std::reference_wrapper<std::atomic<unsigned long> >, unsigned long&, unsigned long, void>(void (&)(std::function<bool (unsigned long, unsigned long)>&, std::atomic<unsigned long>&, std::atomic<unsigned long>&, unsigned long, unsigned long), std::reference_wrapper<std::function<bool (unsigned long, unsigned long)> >&&, std::reference_wrapper<std::atomic<unsigned long> >&&, std::reference_wrapper<std::atomic<unsigned long> >&&, unsigned long&, unsigned long&&)': /usr/include/c++/9/thread:126: undefined reference topthread_create'

Edit: I added the following and succeeded.

set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) add_executable(m68kdasm src/m68kdasm.cc) target_link_libraries(m68kdasm PRIVATE Threads::Threads resource_file)