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

db-2-install-exe.patch defines wrong variable #2187

Closed
DemonRx opened this issue Aug 19, 2018 · 5 comments
Closed

db-2-install-exe.patch defines wrong variable #2187

DemonRx opened this issue Aug 19, 2018 · 5 comments

Comments

@DemonRx
Copy link

DemonRx commented Aug 19, 2018

@starius when building BerkelyDB after installing qt5 with gcc8:

The patch does not change the $$i variable in

$(INSTALLER) $$i $(DESTDIR)$(bindir)/$$e; \

and leaves $(INSTALLER) $$i still in place from the original Makefile.in setup.

This results in libtool not being able to locate the bindir files in build_unix to copy over to mxe/usr/i686-w64-mingw32.static/bin (or relevant target dir), because $$i variable isn't defined, like it is in the original makefile.in

@tonytheodore believes this patch may be removed all together and use the transform variable to fix this issue. #2186 (comment).

I'm not familiar with making this type of change. I'll let it to you guys.

@DemonRx
Copy link
Author

DemonRx commented Aug 19, 2018

In the meantime the manual change I do by switching $(INSTALLER) $$i over to $(INSTALLER) $$e in the db-2-install-exe.patch makes the installation/setup work fine.

@DemonRx
Copy link
Author

DemonRx commented Aug 19, 2018

@tonytheodore you mentioned that the db patch is skipped with gcc8 installation, but I think it isn't because I see after I do

make update-package-gcc && make db

The console outputs:

[git-log]   f05f66c fix db-2-install.patch
[...]
[build]       gcc                    i686-w64-mingw32.static
[done]        gcc                    i686-w64-mingw32.static                                  3364188 KiB    33m7.187s
[meta]        cc                     i686-w64-mingw32.static
[build]       db                     i686-w64-mingw32.static
[build]       db                     i686-w64-mingw32.static

Failed to build package db for target i686-w64-mingw32.static!
------------------------------------------------------------
Makefile:1148: recipe for target 'install_utilities' failed
make[2]: *** [install_utilities] Error 1
make[2]: Leaving directory '/home/demon/dev/mxe_patch/tmp-db-i686-w64-mingw32.static/db-6.1.26/build_unix'
Makefile:787: recipe for target 'build-only-db_i686-w64-mingw32.static' failed
make[1]: *** [build-only-db_i686-w64-mingw32.static] Error 2
make[1]: Leaving directory '/home/demon/dev/mxe_patch'
real	2m4.653s
user	5m20.902s
sys	0m32.814s
------------------------------------------------------------
[log]      /home/demon/dev/mxe_patch/log/db_i686-w64-mingw32.static

When it builds db (and fails) the log file shows:

(cd '/home/demon/dev/mxe_patch/tmp-db-i686-w64-mingw32.static/db-6.1.26' && patch -p1 -u) < /home/demon/dev/mxe_patch/src/db-2-install-exe.patch
patching file dist/Makefile.in

So it seems it does in fact use the patch even with gcc8.

And I do have gcc8 installed:

demon@UbuntuHP:~/dev/mxe$ ls pkg/gcc*
pkg/gcc-8.2.0.tar.xz

@tonytheodore
Copy link
Member

make update-package-gcc && make db

Now I see, what happens if you do:

$ make gmsl-print-db_PATCHES
db_PATCHES = /usr/lib/mxe/src/db-1-fix-including-winioctl-h-lowcase.patch /usr/lib/mxe/src/db-2-install-exe.patch
$ make gmsl-print-db_PATCHES MXE_PLUGIN_DIRS=plugins/gcc8
db_PATCHES = ./src/db-1-fix-including-winioctl-h-lowcase.patch

That usage of MXE_PLUGIN_DIRS=plugins/gcc8 is about to be deprecated, in the mean time, simply delete src/db-2-install-exe.patch. The fix for all gcc versions looks like:

diff --git a/src/db-2-install-exe.patch b/src/db-2-install-exe.patch
deleted file mode 100644
index 57d26f07..00000000
--- a/src/db-2-install-exe.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-This file is part of MXE. See LICENSE.md for licensing information.
-
-From 67a1bbc57a368efd2ebb81f771ef7ba794bac5a0 Mon Sep 17 00:00:00 2001
-From: Boris Nagaev <bnagaev@gmail.com>
-Date: Wed, 2 Sep 2015 20:18:30 +0300
-Subject: [PATCH] install executables with .exe
-
----
- dist/Makefile.in | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
-diff --git a/dist/Makefile.in b/dist/Makefile.in
-index 8358e53..8839ea6 100644
---- a/dist/Makefile.in
-+++ b/dist/Makefile.in
-@@ -1150,8 +1150,7 @@ install_utilities:
- 	    ($(MKDIR) -p $(DESTDIR)$(bindir) && \
- 	    $(CHMOD) $(dmode) $(DESTDIR)$(bindir))
- 	@for i in $(UTIL_PROGS); do \
--		test -f $$i.exe && i=$$i.exe; \
--		e=`echo $$i | $(SED) '$(transform)'`; \
-+		e=$$i.exe; \
- 		$(RM) $(DESTDIR)$(bindir)/$$e; \
- 		$(INSTALLER) $$i $(DESTDIR)$(bindir)/$$e; \
- 		$(STRIP) $(DESTDIR)$(bindir)/$$e; \
--- 
-2.1.4
-
diff --git a/src/db.mk b/src/db.mk
index fe4a013a..e0c39ecd 100644
--- a/src/db.mk
+++ b/src/db.mk
@@ -20,6 +20,7 @@ endef
 define $(PKG)_BUILD
     cd '$(1)/build_unix' && ../dist/configure \
         $(MXE_CONFIGURE_OPTS) \
+        --program-transform-name='s,.exe,,;s,\(.*\),\1.exe,' \
         --enable-mingw \
         --enable-cxx \
         --enable-cryptography \

@DemonRx
Copy link
Author

DemonRx commented Aug 19, 2018

$ make gmsl-print-db_PATCHES
db_PATCHES = /home/demon/dev/mxe/src/db-1-fix-including-winioctl-h-lowcase.patch /home/demon/dev/mxe/src/db-2-install-exe.patch

Output:

db_PATCHES = /home/demon/dev/mxe/src/db-1-fix-including-winioctl-h-lowcase.patch
make: Nothing to be done for '/home/demon/dev/mxe/src/db-2-install-exe.patch'.

$ make gmsl-print-db_PATCHES MXE_PLUGIN_DIRS=plugins/gcc8
db_PATCHES = ./src/db-1-fix-including-winioctl-h-lowcase.patch

Output:

db_PATCHES = ./src/db-1-fix-including-winioctl-h-lowcase.patch

@DemonRx
Copy link
Author

DemonRx commented Aug 19, 2018

👍 for adding to db.mk L#23, works like a charm 💯

+        --program-transform-name='s,.exe,,;s,\(.*\),\1.exe,' \

@DemonRx DemonRx closed this as completed Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants