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
add package djvulibre #1286
add package djvulibre #1286
Conversation
|
||
PKG := djvulibre | ||
$(PKG)_IGNORE := 3.5.27 | ||
$(PKG)_VERSION_ := 3.5.25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, $(PKG)_VERSION_
should be renamed to $(PKG)_SHORTVERSION
.
Can you combine all patches to single file in git like format, please?
Single file with all patches in unified format makes browsing history easier. |
No, it lacks commit messages, author and date. I contributed all the changes in the pull request to your branch: https://github.com/darealshinji/mxe/pull/1 |
improvements of djvulibre
Ah, thanks. Merged. |
Why are shared targets disabled? |
I was able to build them but they didn't seem to work. Maybe you can give it a try? |
I have built static targets. They produce the following files: Please prevent installation of Please prevent installation of Are other files in Please provide a simple test: file Having this work done, it will be easier to deal with shared targets, I think. |
Should the executables still be built or should I only build the library? |
Executables should be built to catch build errors. |
Alright. To only install the build stuff you can use
Will this serve as a test program? #include <windows.h>
#include <libdjvu/ddjvuapi.h>
int main(int argc, char *argv[])
{
ddjvu_context_t *djvu_test;
djvu_test = ddjvu_context_create(argv[0]);
ddjvu_context_release(djvu_test);
return 0;
} |
Can it work without include of windows.h to keep it cross-platform? |
windows.h wasn't necessary. And the created test program works as expected on Windows and returns 0. |
I'm investigating shared build issues. i686-w64-mingw32.shared works with the patch. x86_64-w64-mingw32.shared is still broken because of linking problems with jpeg. I am going to make another pull request against your branch. |
I have fixed shared targets in a pull request https://github.com/darealshinji/mxe/pull/2 |
Patch "fix linking errors in shared builds" fixes i686-w64-mingw32.shared. Change of djvulibre.mk fixes x86_64-w64-mingw32.shared by changing deplibs check method to "objdump". See the explanations below. On Wheezy (at least) "file" returns "data" for x86-64 object files from libmsvcp60.a. Therefore the check fails with the following message: *** Warning: linker path does not have real file for library -lmsvcp60. *** I have the capability to make that library automatically link in when *** you link to this library. But I can only do this if you have a *** shared version of the library, which you do not appear to have *** because I did check the linker path looking for a file starting *** with libmsvcp60 and none of the candidates passed a file format test *** using a file magic. Last file checked: /home/mxe/mxe-djvulibre/usr/lib/gcc/x86_64-w64-mingw32.shared/4.9.3/../../../../x86_64-w64-mingw32.shared/lib//libmsvcp60.a *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with this library *** or is declared to -dlopen it. *** Since this library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, *** libtool will only create a static version of it. Then it compiled static library and failed when compiling djvulibre-test.c because of missing -ljpeg.
djvulibre: enable shared targets
--disable-desktopfiles \ | ||
$(if $(BUILD_SHARED),\ | ||
lt_cv_deplibs_check_method='file_magic file format (pe-i386|pe-x86-64)' \ | ||
lt_cv_file_magic_cmd='$$OBJDUMP -f') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an indication that the libtool included in the tarball is ancient. Try using autoreconf -fi
instead of manually specifying the variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes of ./configure were moved to ./configure.ac to preserve them after `autoreconf -fi`. See #1286 (comment)
djvulibre: call autoreconf -fi, not change options
Maybe for the static targets we should add |
That sounds wrong. Actually, we DON'T want to do this for static builds during the compilation process, which is harmless, OR when users are compiling their own code, which is harmful. |
When I built a pdf/djvu viewer and wanted to link it against the static library I got errors about unresolved import library symbols. But apparently the library can't be build at all without the # This file is part of MXE.
# See index.html for further information.
PKG := djvulibre
$(PKG)_IGNORE := 3.5.27
$(PKG)_SHORTVER := 3.5.25
$(PKG)_VERSION := $($(PKG)_SHORTVER).3
$(PKG)_CHECKSUM := 898d7ed6dd2fa311a521baa95407a91b20a872d80c45e8245442d64f142cb1e0
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_SHORTVER)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/djvu/DjVuLibre/$($(PKG)_SHORTVER)/$($(PKG)_FILE)
$(PKG)_DEPS := gcc jpeg tiff zlib
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://sourceforge.net/projects/djvu/files/DjVuLibre/' | \
$(SED) -n 's,.*/\([0-9][^A-Za-z"]*\)/".*,\1,p' | \
head -1
endef
define $(PKG)_BUILD_SHARED
cd '$(1)' && autoreconf -fi
cd '$(1)' && ./configure $(MXE_CONFIGURE_OPTS) --disable-desktopfiles
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)/libdjvu' -j 1 install-lib install-include install-pkgconfig
'$(TARGET)-g++' \
-W -Wall -Werror -pedantic \
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
`'$(TARGET)-pkg-config' --cflags --libs ddjvuapi`
endef I still need to check if I can properly build/link the djvu viewer (qpdfview, if anyone wants to know) under the |
The shared library builds and runs without problems on the i686-w64-mingw32.shared target. |
Yesterday I gave it another try and I really wasn't able to build a proper static library. |
It fails here in
Why did you replaced |
I didn't realize that. It's now fixed. |
Next problem: s/$(TEST_FILE).c/$(TEST_FILE)/ |
After applying I applied the following patch: diff --git a/src/djvulibre.mk b/src/djvulibre.mk
index 3e4f394..4caf6e1 100644
--- a/src/djvulibre.mk
+++ b/src/djvulibre.mk
@@ -22,10 +22,11 @@ define $(PKG)_BUILD_SHARED
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
$(MXE_CONFIGURE_OPTS) \
--disable-desktopfiles
- $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' install-strip
+ $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 install-strip $(MXE_DISABLE_CRUFT)
'$(TARGET)-g++' \
-W -Wall -Werror -pedantic \
- '$(TEST_FILE).c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ '$(TEST_FILE)' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
`'$(TARGET)-pkg-config' ddjvuapi --cflags --libs`
endef to prevent it from installing docs and tools. (And to prevent installation with -j > 1.) Now the list of files is as following: Looks better, but it still installs shell scripts: any2djvu, djvudigital. Could you apply my patches and prevent installation of these shell scripts? |
Done. |
Exclusion of shell scripts can be achieved without patching source: diff --git a/src/djvulibre.mk b/src/djvulibre.mk
index 4caf6e1..5e3fc5b 100644
--- a/src/djvulibre.mk
+++ b/src/djvulibre.mk
@@ -23,7 +23,8 @@ define $(PKG)_BUILD_SHARED
$(MXE_CONFIGURE_OPTS) \
--disable-desktopfiles
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)'
- $(MAKE) -C '$(BUILD_DIR)' -j 1 install-strip $(MXE_DISABLE_CRUFT)
+ $(MAKE) -C '$(BUILD_DIR)' -j 1 install-strip \
+ $(MXE_DISABLE_CRUFT) dist_bin_SCRIPTS=
'$(TARGET)-g++' \
-W -Wall -Werror -pedantic \ |
Very convenient, I didn't know that. |
List of files installed: https://gist.github.com/ea0a95023b6bfa8403f0e6611bf242ff Looks good to me. Very well done! |
I wasn't able to build v3.5.27 yet. I was able to build shared libraries but they were broken.Right now only shared libraries can be build and used. Static libraries, if build, are broken.