diff mbox series

[bug#61067,2/3] gnu: wine: Build more reproducibly.

Message ID 5be364a38001818326d78d586a918938c0da0c81.1674691809.git.kaelyn.alexi@protonmail.com
State New
Headers show
Series Update wine and wine-staging packages to 8.0 | expand

Commit Message

Kaelyn Takata Jan. 26, 2023, 12:24 a.m. UTC
* gnu/packages/wine.scm (wine)[phases]: Add a new 'set-widl-time-override phase.
---
 gnu/packages/wine.scm | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

--
2.39.1

Comments

Liliana Marie Prikler Jan. 26, 2023, 7:28 p.m. UTC | #1
Hi,

Am Donnerstag, dem 26.01.2023 um 00:24 +0000 schrieb Kaelyn Takata:
> * gnu/packages/wine.scm (wine)[phases]: Add a new 'set-widl-time-
> override phase.
You're doing this for three packages, so there should be three packages
in the ChangeLog as well.

On that note, it's somewhat odd that the wine packages can't share some
common phases.  Perhaps we should refactor them a little to make that
possible.

Cheers
Kaelyn Takata Jan. 26, 2023, 8:46 p.m. UTC | #2
------- Original Message -------
On Thursday, January 26th, 2023 at 7:28 PM, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:


> 
> 
> Hi,
> 
> Am Donnerstag, dem 26.01.2023 um 00:24 +0000 schrieb Kaelyn Takata:
> 
> > * gnu/packages/wine.scm (wine)[phases]: Add a new 'set-widl-time-
> > override phase.
> 
> You're doing this for three packages, so there should be three packages
> in the ChangeLog as well.

I wasn't quite sure how to handle the changelog for the three packages since the various packages are variations of the same piece of software. If separate changelogs are desired, the existing can be copied and pasted for each of the three with the package name tweaked accordingly.

> On that note, it's somewhat odd that the wine packages can't share some
> common phases. Perhaps we should refactor them a little to make that
> possible.

I agree they could and should be refactored to share more of the phases--I just haven't been brave enough to try because of the weird mixed-architecture nature of the builds.

Cheers,
Kaelyn

> 
> Cheers
Liliana Marie Prikler Jan. 26, 2023, 9:09 p.m. UTC | #3
Am Donnerstag, dem 26.01.2023 um 20:46 +0000 schrieb Kaelyn:
> ------- Original Message -------
> On Thursday, January 26th, 2023 at 7:28 PM, Liliana Marie Prikler
> <liliana.prikler@gmail.com> wrote:
> 
> 
> > 
> > 
> > Hi,
> > 
> > Am Donnerstag, dem 26.01.2023 um 00:24 +0000 schrieb Kaelyn Takata:
> > 
> > > * gnu/packages/wine.scm (wine)[phases]: Add a new 'set-widl-time-
> > > override phase.
> > 
> > You're doing this for three packages, so there should be three
> > packages
> > in the ChangeLog as well.
> 
> I wasn't quite sure how to handle the changelog for the three
> packages since the various packages are variations of the same piece
> of software. If separate changelogs are desired, the existing can be
> copied and pasted for each of the three with the package name tweaked
> accordingly.
You can simply write (wine, wine64, wine-minimal)[#:phases].  It's just
to mark all the places that have changed.

> > On that note, it's somewhat odd that the wine packages can't share
> > some common phases. Perhaps we should refactor them a little to
> > make that possible.
> 
> I agree they could and should be refactored to share more of the
> phases--I just haven't been brave enough to try because of the weird
> mixed-architecture nature of the builds.
I feel you.  I can try to figure something out and reply to this thread
or open another one once I'm done.

Cheers
Kaelyn Takata Jan. 27, 2023, 1:07 a.m. UTC | #4
------- Original Message -------
On Thursday, January 26th, 2023 at 9:09 PM, Liliana Marie Prikler <liliana.prikler@gmail.com> wrote:


> 
> 
> Am Donnerstag, dem 26.01.2023 um 20:46 +0000 schrieb Kaelyn:
> 
> > ------- Original Message -------
> > On Thursday, January 26th, 2023 at 7:28 PM, Liliana Marie Prikler
> > liliana.prikler@gmail.com wrote:
> > 
> > > Hi,
> > > 
> > > Am Donnerstag, dem 26.01.2023 um 00:24 +0000 schrieb Kaelyn Takata:
> > > 
> > > > * gnu/packages/wine.scm (wine)[phases]: Add a new 'set-widl-time-
> > > > override phase.
> > > 
> > > You're doing this for three packages, so there should be three
> > > packages
> > > in the ChangeLog as well.
> > 
> > I wasn't quite sure how to handle the changelog for the three
> > packages since the various packages are variations of the same piece
> > of software. If separate changelogs are desired, the existing can be
> > copied and pasted for each of the three with the package name tweaked
> > accordingly.
> 
> You can simply write (wine, wine64, wine-minimal)[#:phases]. It's just
> to mark all the places that have changed.
> 
> > > On that note, it's somewhat odd that the wine packages can't share
> > > some common phases. Perhaps we should refactor them a little to
> > > make that possible.
> > 
> > I agree they could and should be refactored to share more of the
> > phases--I just haven't been brave enough to try because of the weird
> > mixed-architecture nature of the builds.
> 
> I feel you. I can try to figure something out and reply to this thread
> or open another one once I'm done.

I felt a bit of inspiration, and tried my hand at unifying the phase lists. I'll be mailing the v2 patches momentarily. I _think_ the new version of the package definitions is equivalent to the old, but I also appreciate all of the extra eyes and testing those changes can get. :)

Thank you for the review and feedback!

Cheers,
Kaelyn

> 
> Cheers
diff mbox series

Patch

diff --git a/gnu/packages/wine.scm b/gnu/packages/wine.scm
index 7ca2ac5bdf..0de34e320d 100644
--- a/gnu/packages/wine.scm
+++ b/gnu/packages/wine.scm
@@ -195,7 +195,12 @@  (define-public wine
                (substitute* "tools/makedep.c"
                  (("output_filenames\\( unix_libs \\);" all)
                   (string-append all
-                                 "output ( \" -Wl,-rpath=%s \", arch_install_dirs[arch] );"))))))))
+                                 "output ( \" -Wl,-rpath=%s \", arch_install_dirs[arch] );")))))
+           (add-before 'build 'set-widl-time-override
+             ;; Set WIDL_TIME_OVERRIDE to avoid embedding the current date in
+             ;; files generated by WIDL.
+             (lambda _
+               (setenv "WIDL_TIME_OVERRIDE" "315532800"))))))
     (home-page "https://www.winehq.org/")
     (synopsis "Implementation of the Windows API (32-bit only)")
     (description
@@ -289,7 +294,12 @@  (define-public wine64
                                 (search-path library-path soname))))
                 (substitute* "include/config.h"
                   (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
-                   (format #f "~a\"~a\"" defso (find-so soname))))))))
+                   (format #f "~a\"~a\"" defso (find-so soname)))))))
+          (add-before 'build 'set-widl-time-override
+            ;; Set WIDL_TIME_OVERRIDE to avoid embedding the current date in
+            ;; files generated by WIDL.
+            (lambda _
+              (setenv "WIDL_TIME_OVERRIDE" "315532800"))))
       #:configure-flags
       #~(list "--enable-win64")
       (strip-keyword-arguments '(#:configure-flags #:make-flags #:phases
@@ -326,7 +336,12 @@  (define-public wine-minimal
                                (search-path library-path soname))))
                (substitute* "include/config.h"
                  (("(#define SONAME_.* )\"(.*)\"" _ defso soname)
-                  (format #f "~a\"~a\"" defso (find-so soname))))))))
+                  (format #f "~a\"~a\"" defso (find-so soname)))))))
+         (add-before 'build 'set-widl-time-override
+           ;; Set WIDL_TIME_OVERRIDE to avoid embedding the current date in
+           ;; files generated by WIDL.
+           (lambda _
+             (setenv "WIDL_TIME_OVERRIDE" "315532800"))))
        #:configure-flags
        (list "--without-freetype"
              "--without-x")