Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MacOS version fails to do anything. #23

Closed
darodi opened this issue Dec 23, 2022 · 24 comments
Closed

MacOS version fails to do anything. #23

darodi opened this issue Dec 23, 2022 · 24 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@darodi
Copy link
Owner

darodi commented Dec 23, 2022

I've try the MacOS version, but it fail to do anything. I have to go back to the original DMG to start working.

Do you have more information about this? It would be better to fix it.
I don't own a mac os, I need to find a way to test this.

Originally posted by @darodi in #21 (comment)

@darodi darodi changed the title > I've try the MacOS version, but it fail to do anything. I have to go back to the original DMG to start working. MacOS version fails to do anything. Dec 23, 2022
@darodi darodi added help wanted Extra attention is needed question Further information is requested labels Dec 23, 2022
@celogeek
Copy link

How can I provide useful debugging information?
I will try to see what I can do

@celogeek
Copy link

I can't open the last beta. The OS said it is damage. I try to right click open. Same.

@celogeek
Copy link

I've fix it with:

xattr -d com.apple.quarantine /Applications/Kindle\ Comic\ Converter.app

Testing

@celogeek
Copy link

I try a PDF. Kindle Scribe + EPUB 200. It works !!!
Trying CBR and CBZ...

@celogeek
Copy link

CBR failed: Error during conversion. So the RAR lib have trouble.

@celogeek
Copy link

CBZ failed too.

@celogeek
Copy link

Directory works.
I compare the ressource inside the App package, and it is exactly the same as the origin package (kcc).
So I guess something does't wrong between the bin KCC and the resource.

@celogeek
Copy link

I run otool on the KCC-Beta vs KCC:
First is your package. Second is the original.
And Resources is the same.

➜  MacOS otool -L Kindle\ Comic\ Converter
Kindle Comic Converter:
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 165.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 56.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1856.105.0)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1141.1.0)
➜  MacOS otool -L /Volumes/Kindle\ Comic\ Converter/Kindle\ Comic\ Converter.app/Contents/MacOS/Kindle\ Comic\ Converter
/Volumes/Kindle Comic Converter/Kindle Comic Converter.app/Contents/MacOS/Kindle Comic Converter:
	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 48.0.0)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1258.1.0)
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 728.9.0)

@celogeek
Copy link

Also plist file is the same. You should probably update the version in it.

      <string>5.5.2</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>5.5.2</string>

@darodi
Copy link
Owner Author

darodi commented Dec 23, 2022

in this version,

https://github.com/darodi/kcc/releases/download/v5.5.3-beta-darodi.2/KindleComicConverter_osx_5.5.3-beta-darodi.2.dmg

CookieCaptainD said he was able to create mobi files (and epub as they are needed by mobi files)

ciromattia#405 (comment)

but no news about cbz,cbr,rar,zip

@darodi
Copy link
Owner Author

darodi commented Dec 23, 2022

I run otool on the KCC-Beta vs KCC: First is your package. Second is the original. And Resources is the same.

I'm using the same method to build, and the files haven't changed

kcc/setup.py

Lines 39 to 60 in 65c329d

if sys.platform == 'darwin':
os.system('pyinstaller -y -F -i icons/comic2ebook.icns -n "Kindle Comic Converter" -w -s kcc.py')
os.makedirs('dist/Kindle Comic Converter.app/Contents/Resources/Codecs')
shutil.copy('other/osx/7z', 'dist/Kindle Comic Converter.app/Contents/Resources')
shutil.copy('other/osx/7z.so', 'dist/Kindle Comic Converter.app/Contents/Resources')
shutil.copy('other/osx/Rar.so', 'dist/Kindle Comic Converter.app/Contents/Resources/Codecs')
shutil.copy('other/osx/Info.plist', 'dist/Kindle Comic Converter.app/Contents')
shutil.copy('LICENSE.txt', 'dist/Kindle Comic Converter.app/Contents/Resources')
shutil.copy('other/windows/Additional-LICENSE.txt', 'dist/Kindle Comic Converter.app/Contents/Resources')
os.chmod('dist/Kindle Comic Converter.app/Contents/Resources/7z', 0o777)
os.system('appdmg kcc.json dist/KindleComicConverter_osx_' + VERSION + '.dmg')
exit(0)
elif sys.platform == 'win32':
os.system('pyinstaller -y -F -i icons\\comic2ebook.ico -n KCC_' + VERSION + ' -w --noupx kcc.py')
exit(0)
elif sys.platform == 'linux':
os.system(
'pyinstaller --hidden-import=queue -y -F -i icons/comic2ebook.ico -n kcc_linux_' + VERSION + ' kcc.py')
exit(0)
else:
exit(0)

@celogeek
Copy link

I can create a epub, only from PDF or Directory with flat file.
The trouble is when I want to open the CBR or CBZ, which will require to use the 7z include in the package.
I succeed running it, so it seems to be compatible.

@celogeek
Copy link

Um, I would like to build this locally. I've got M1 arch.

@darodi
Copy link
Owner Author

darodi commented Dec 23, 2022

Also plist file is the same. You should probably update the version in it.

      <string>5.5.2</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>5.5.2</string>

done, see 4fbcb79

@darodi
Copy link
Owner Author

darodi commented Dec 23, 2022

I found a vagrant box with mac osx
https://app.vagrantup.com/amarcireau/boxes/macos

I need to make some space on my computer and then I'll be able to test this too.

** edit: won't work, it's not the same arch **

@celogeek
Copy link

After some debugging and manage to build the dmg on m1 arch (with python + qt native), I find out what's failed here.
the 7z which is used to unpack the files seems to have the wrong arch.
So the app start as a native m1 app, and failed to launch 7z.

I replace the 7z with p7zip file installed with brew on m1 arch.
Now PDF and CBZ works, but CBR still failed. 7z is not able to uncompress rar files.

Is is possible to replace the external tools 7z by a python uncompress lib (for zip, gzip and even rar) ? this way no need for an external tools.

@celogeek
Copy link

Finally I download p7zip source, and build 7z with unrar support.
I have the 7z 7z.so Rar.so files from here.
The arch is arm64.

And now everything works !

May be we can pack 7z with arm64 and x86_64, and based on the arch we run, select one or the other.
Or just build 2 packages, one for m1/m2, and one for x86_64 ?

@celogeek
Copy link

Here the p7zip that works with m1 build.

bin.zip

@celogeek
Copy link

And here the dmg compatible with m1:
https://static.celogeek.com/KCC/M1/KindleComicConverter_osx_5.5.3b17.dmg

@darodi
Copy link
Owner Author

darodi commented Dec 24, 2022

@celogeek

May be we can pack 7z with arm64 and x86_64, and based on the arch we run, select one or the other. Or just build 2 packages, one for m1/m2, and one for x86_64 ?

Thanks a lot!
I'll try to adapt the pipeline to use those tools.
I started doing it in this other issue

Merry Christmas!

@celogeek
Copy link

I put the full process here:
#4 (comment)

@celogeek
Copy link

@celogeek

May be we can pack 7z with arm64 and x86_64, and based on the arch we run, select one or the other. Or just build 2 packages, one for m1/m2, and one for x86_64 ?

Thanks a lot! I'll try to adapt the pipeline to use those tools. I started doing it in this other issue

Merry Christmas!

Merry christmas too ;)

I put in this issue how I manage to build and make the too works on my m1.

@darodi
Copy link
Owner Author

darodi commented Dec 24, 2022

I put in this issue how I manage to build and make the too works on my m1.

That might be a bit harder with github actions. They don't support Apple M1 hardware, except for self runners.
So cross compilation is needed.
Last time I was stuck with Qt library but I haven't tried again since then.
Anyway, everything you tried will be needed later in the process.

@darodi
Copy link
Owner Author

darodi commented Jul 5, 2023

closing this.

follow-up in

@darodi darodi closed this as completed Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants