GNU bug report logs -
#56504
[PATCH] Mingw support for zlib
Previous Next
Reported by: Vivien Kraus <vivien <at> planete-kraus.eu>
Date: Mon, 11 Jul 2022 23:54:01 UTC
Severity: normal
Tags: patch
Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56504 in the body.
You can then email your comments to 56504 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Mon, 11 Jul 2022 23:54:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Vivien Kraus <vivien <at> planete-kraus.eu>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Mon, 11 Jul 2022 23:54:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Dear guix,
zlib can be cross-compiled to mingw. It can be done by not running
configure, but instead using the win32/Makefile.gcc makefile, with some
tweaks for guix.
I think it should not rebuild anything, but I’m not sure. What do you
think?
Best regards,
Vivien
[0001-gnu-zlib-Support-mingw-cross-compilation.patch (text/x-patch, attachment)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Tue, 12 Jul 2022 06:08:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 56504 <at> debbugs.gnu.org (full text, mbox):
Am Dienstag, dem 12.07.2022 um 01:53 +0200 schrieb Vivien Kraus:
> + ,@(if (and (%current-target-system)
> + (string-suffix? "-w64-mingw32" (%current-
> target-system)))
I'm pretty sure there's an abbreviation for this like target-mingw?
> + `((substitute* "win32/Makefile.gcc"
> + (("PREFIX =")
> + (string-append "PREFIX = " ,(%current-
> target-system) "-"))
> + (("prefix \\?= /usr/local")
> + (string-append "prefix ?= " out))
> + (("# BINARY_PATH, INCLUDE_PATH and
> LIBRARY_PATH must be set.")
> + "\
> +BINARY_PATH = $(prefix)/bin
> +INCLUDE_PATH = $(prefix)/include
> +LIBRARY_PATH = $(prefix)/lib"))
> + (rename-file "win32/Makefile.gcc"
> "Makefile"))
I think these can be conditionally added to #:make-flags
> + `((invoke "./configure"
> + (string-append "--prefix=" out)))))))
> + ,@(if (and (%current-target-system)
> + (string-suffix? "-mingw32" (%current-target-
> system)))
> + `(add-after 'install 'install-mingw-shared
> + (lambda* (#:key make-flags #:allow-other-keys)
> + (apply invoke "make"
> + (append make-flags
> + '("install" "SHARED_MODE=1")))))
SHARED_MODE might likewise be conditionally added to #:make-flags.
Cheers
Information forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Tue, 12 Jul 2022 16:46:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 56504 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Le mardi 12 juillet 2022 à 08:07 +0200, Liliana Marie Prikler a écrit :
> Am Dienstag, dem 12.07.2022 um 01:53 +0200 schrieb Vivien Kraus:
>
> > + ,@(if (and (%current-target-system)
> > + (string-suffix? "-w64-mingw32"
> > (%current-
> > target-system)))
> I'm pretty sure there's an abbreviation for this like target-mingw?
Precisely! Fixed it, thank you.
> > + `((substitute* "win32/Makefile.gcc"
> > + (("PREFIX =")
> > + (string-append "PREFIX = " ,(%current-
> > target-system) "-"))
> > + (("prefix \\?= /usr/local")
> > + (string-append "prefix ?= " out))
> > + (("# BINARY_PATH, INCLUDE_PATH and
> > LIBRARY_PATH must be set.")
> > + "\
> > +BINARY_PATH = $(prefix)/bin
> > +INCLUDE_PATH = $(prefix)/include
> > +LIBRARY_PATH = $(prefix)/lib"))
> > + (rename-file "win32/Makefile.gcc"
> > "Makefile"))
> I think these can be conditionally added to #:make-flags
I did it for all but prefix, because I have to have the output path. Is
there a way to get it from within the make-flags?
> > + `((invoke "./configure"
> > + (string-append "--prefix="
> > out)))))))
>
> > + ,@(if (and (%current-target-system)
> > + (string-suffix? "-mingw32" (%current-target-
> > system)))
> > + `(add-after 'install 'install-mingw-shared
> > + (lambda* (#:key make-flags #:allow-other-keys)
> > + (apply invoke "make"
> > + (append make-flags
> > + '("install"
> > "SHARED_MODE=1")))))
> SHARED_MODE might likewise be conditionally added to #:make-flags.
I get both the DLL loader and the DLL in the default output, and the
static lib in the static output, so it works.
Thank you for your review!
Vivien
[v2-0001-gnu-zlib-Support-mingw-cross-compilation.patch (text/x-patch, attachment)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Wed, 13 Jul 2022 05:50:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 56504 <at> debbugs.gnu.org (full text, mbox):
Am Dienstag, dem 12.07.2022 um 18:45 +0200 schrieb Vivien Kraus:
> Le mardi 12 juillet 2022 à 08:07 +0200, Liliana Marie Prikler a
> écrit :
> > Am Dienstag, dem 12.07.2022 um 01:53 +0200 schrieb Vivien Kraus:
> >
> > > + ,@(if (and (%current-target-system)
> > > + (string-suffix? "-w64-mingw32"
> > > (%current-
> > > target-system)))
> > I'm pretty sure there's an abbreviation for this like target-mingw?
> Precisely! Fixed it, thank you.
>
> > > + `((substitute* "win32/Makefile.gcc"
> > > + (("PREFIX =")
> > > + (string-append "PREFIX = " ,(%current-
> > > target-system) "-"))
> > > + (("prefix \\?= /usr/local")
> > > + (string-append "prefix ?= " out))
> > > + (("# BINARY_PATH, INCLUDE_PATH and
> > > LIBRARY_PATH must be set.")
> > > + "\
> > > +BINARY_PATH = $(prefix)/bin
> > > +INCLUDE_PATH = $(prefix)/include
> > > +LIBRARY_PATH = $(prefix)/lib"))
> > > + (rename-file "win32/Makefile.gcc"
> > > "Makefile"))
> > I think these can be conditionally added to #:make-flags
> I did it for all but prefix, because I have to have the output path.
> Is there a way to get it from within the make-flags?
With the gexp-style you'd write #$output, otherwise ,(assoc-ref %build-
outputs "out").
> > > + `((invoke "./configure"
> > > + (string-append "--prefix="
> > > out)))))))
> >
> > > + ,@(if (and (%current-target-system)
> > > + (string-suffix? "-mingw32" (%current-target-
> > > system)))
> > > + `(add-after 'install 'install-mingw-shared
> > > + (lambda* (#:key make-flags #:allow-other-keys)
> > > + (apply invoke "make"
> > > + (append make-flags
> > > + '("install"
> > > "SHARED_MODE=1")))))
> > SHARED_MODE might likewise be conditionally added to #:make-flags.
> I get both the DLL loader and the DLL in the default output, and the
> static lib in the static output, so it works.
Oh, so you mean the static output should be built without SHARED_MODE?
Cheers
Information forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Wed, 13 Jul 2022 15:20:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 56504 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Le mercredi 13 juillet 2022 à 07:49 +0200, Liliana Marie Prikler a
écrit :
> Am Dienstag, dem 12.07.2022 um 18:45 +0200 schrieb Vivien Kraus:
> > Le mardi 12 juillet 2022 à 08:07 +0200, Liliana Marie Prikler a
> > écrit :
> > > Am Dienstag, dem 12.07.2022 um 01:53 +0200 schrieb Vivien Kraus:
> > > > + `((substitute* "win32/Makefile.gcc"
> > > > + (("PREFIX =")
> > > > + (string-append "PREFIX = "
> > > > ,(%current-
> > > > target-system) "-"))
> > > > + (("prefix \\?= /usr/local")
> > > > + (string-append "prefix ?= " out))
> > > > + (("# BINARY_PATH, INCLUDE_PATH and
> > > > LIBRARY_PATH must be set.")
> > > > + "\
> > > > +BINARY_PATH = $(prefix)/bin
> > > > +INCLUDE_PATH = $(prefix)/include
> > > > +LIBRARY_PATH = $(prefix)/lib"))
> > > > + (rename-file "win32/Makefile.gcc"
> > > > "Makefile"))
> > > I think these can be conditionally added to #:make-flags
> > I did it for all but prefix, because I have to have the output
> > path.
> > Is there a way to get it from within the make-flags?
> With the gexp-style you'd write #$output, otherwise ,(assoc-ref
> %build-
> outputs "out").
Looking at the "-builder" scheme file that is generated for the
derivation, it looks like what I want is simply %outputs, not %build-
outputs.
>
> > > > + `((invoke "./configure"
> > > > + (string-append "--prefix="
> > > > out)))))))
> > >
> > > > + ,@(if (and (%current-target-system)
> > > > + (string-suffix? "-mingw32" (%current-
> > > > target-
> > > > system)))
> > > > + `(add-after 'install 'install-mingw-shared
> > > > + (lambda* (#:key make-flags #:allow-other-
> > > > keys)
> > > > + (apply invoke "make"
> > > > + (append make-flags
> > > > + '("install"
> > > > "SHARED_MODE=1")))))
> > > SHARED_MODE might likewise be conditionally added to #:make-
> > > flags.
> > I get both the DLL loader and the DLL in the default output, and
> > the
> > static lib in the static output, so it works.
> Oh, so you mean the static output should be built without
> SHARED_MODE?
No, SHARED_MODE=1 means "please also install the DLL" and SHARED_MODE=0
means "please do not install the DLL". Reading the win32/Makefile.gcc,
nothing special is done if SHARED_MODE=0. It is only used in the
install and uninstall targets. I don’t really understand why you would
want to set SHARED_MODE=0 (even weirder to set it as a default) but I
guess it happens.
[v3-0001-gnu-zlib-Support-mingw-cross-compilation.patch (text/x-patch, attachment)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Thu, 14 Jul 2022 06:02:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 56504 <at> debbugs.gnu.org (full text, mbox):
Am Mittwoch, dem 13.07.2022 um 17:19 +0200 schrieb Vivien Kraus:
> [...]
> Looking at the "-builder" scheme file that is generated for the
> derivation, it looks like what I want is simply %outputs, not %build-
> outputs.
Yeah, my bad, it's %build-inputs and %outputs respectively.
>
> > Oh, so you mean the static output should be built without
> > SHARED_MODE?
> No, SHARED_MODE=1 means "please also install the DLL" and
> SHARED_MODE=0 means "please do not install the DLL". Reading the
> win32/Makefile.gcc, nothing special is done if SHARED_MODE=0.
In that case we could set it via #:make-flags, right?
> It is only used in the install and uninstall targets. I don’t really
> understand why you would want to set SHARED_MODE=0 (even weirder to
> set it as a default) but I guess it happens.
Perhaps the rationale is that users might not actually want the shared
libraries for some bespoke reasons (not that those reasons would apply
to Guix users).
Cheers
Information forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Fri, 15 Jul 2022 14:29:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 56504 <at> debbugs.gnu.org (full text, mbox):
Le jeudi 14 juillet 2022 à 08:01 +0200, Liliana Marie Prikler a écrit :
> > > Oh, so you mean the static output should be built without
> > > SHARED_MODE?
> > No, SHARED_MODE=1 means "please also install the DLL" and
> > SHARED_MODE=0 means "please do not install the DLL". Reading the
> > win32/Makefile.gcc, nothing special is done if SHARED_MODE=0.
> In that case we could set it via #:make-flags, right?
I’m not sure I understand. I think that’s what I did, and obviously it
works since the dll is installed in the default output. Could you
explain a bit more the phrase "we could set it"?
Vivien
Information forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Fri, 15 Jul 2022 14:32:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 56504 <at> debbugs.gnu.org (full text, mbox):
Am Freitag, dem 15.07.2022 um 16:28 +0200 schrieb Vivien Kraus:
> Le jeudi 14 juillet 2022 à 08:01 +0200, Liliana Marie Prikler a
> écrit :
> > > > Oh, so you mean the static output should be built without
> > > > SHARED_MODE?
> > > No, SHARED_MODE=1 means "please also install the DLL" and
> > > SHARED_MODE=0 means "please do not install the DLL". Reading the
> > > win32/Makefile.gcc, nothing special is done if SHARED_MODE=0.
> > In that case we could set it via #:make-flags, right?
> I’m not sure I understand. I think that’s what I did, and obviously
> it
> works since the dll is installed in the default output. Could you
> explain a bit more the phrase "we could set it"?
>
> Vivien
My bad; I didn't notice the attachments. LGTM
Information forwarded
to
guix-patches <at> gnu.org
:
bug#56504
; Package
guix-patches
.
(Tue, 19 Jul 2022 21:08:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 56504 <at> debbugs.gnu.org (full text, mbox):
Hey Liliana,
Liliana Marie Prikler <liliana.prikler <at> ist.tugraz.at> skribis:
> Am Freitag, dem 15.07.2022 um 16:28 +0200 schrieb Vivien Kraus:
>> Le jeudi 14 juillet 2022 à 08:01 +0200, Liliana Marie Prikler a
>> écrit :
>> > > > Oh, so you mean the static output should be built without
>> > > > SHARED_MODE?
>> > > No, SHARED_MODE=1 means "please also install the DLL" and
>> > > SHARED_MODE=0 means "please do not install the DLL". Reading the
>> > > win32/Makefile.gcc, nothing special is done if SHARED_MODE=0.
>> > In that case we could set it via #:make-flags, right?
>> I’m not sure I understand. I think that’s what I did, and obviously
>> it
>> works since the dll is installed in the default output. Could you
>> explain a bit more the phrase "we could set it"?
>>
>> Vivien
> My bad; I didn't notice the attachments. LGTM
Please do apply what LGTY, thanks!
Ludo’.
Reply sent
to
Liliana Marie Prikler <liliana.prikler <at> gmail.com>
:
You have taken responsibility.
(Sun, 31 Jul 2022 11:22:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Vivien Kraus <vivien <at> planete-kraus.eu>
:
bug acknowledged by developer.
(Sun, 31 Jul 2022 11:22:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 56504-done <at> debbugs.gnu.org (full text, mbox):
Am Dienstag, dem 19.07.2022 um 23:07 +0200 schrieb Ludovic Courtès:
> Please do apply what LGTY, thanks!
Pardon the delays, zlib for mingw is pushed now.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 28 Aug 2022 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 296 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.