# Force ports to ignore checksum mismatches



## caesius (Sep 15, 2009)

Since wine1.1.29 broke Steam I've been looking for a fix, found one here for anyone interested, so I edited the wine source code in distfiles. Problem is now when I try to "make", it's automatically refetched because of the obvious checksum mismatch.

How can I make a port regardless of a checksum mismatch for the source? 

Cheers.


----------



## Alt (Sep 15, 2009)

You can do `make extract` and their sources will appear in 'work' directory. Then edit them and `make all install`. Do not edit dist tgz


----------



## ale (Sep 15, 2009)

Or you can simply put the patch in the _files_ directory and then install as usual.
Change the first two lines so they look like this
	
	



```
--- dlls/winex11.drv/bitmap.c.orig
+++ dlls/winex11.drv/bitmap.c
```
 and save the file as 
/usr/ports/emulators/wine/files/patch-dlls_winex11.drv_bitmap.c

EDIT:
then you can add a WITH_STEAM_PATCH knob in Makefile and propose it to the maintainer


----------



## Carpetsmoker (Sep 15, 2009)

As a workaround you can empty the _CKSUMFILES variable:

```
# make _CKSUMFILES=""
```

Or you can just make a new sum:

```
# make makesum
```

There's also Makefile.local for custom configuration.

It's best to store extra patches or Makefile.local in your home dir and symlink to them, this way you can be sure they don't get lost during porttree updates.


----------



## Alt (Sep 15, 2009)

Dont teach him bad ))


----------



## Carpetsmoker (Sep 15, 2009)

Alt said:
			
		

> Dont teach him bad ))



See my signature for a reply


----------



## caesius (Sep 15, 2009)

ale said:
			
		

> Or you can simply put the patch in the _files_ directory and then install as usual.
> Change the first two lines so they look like this
> 
> 
> ...



Thanks, I'm trying to do this (to learn stuff mainly). That's cool how the patch system works.

Looking thru the Makefile I think I see where I should put the knob, it'll be between something like 

.ifdef WITH_STEAM_PATCH 

...

.endif

right? But what do I put inside this "statement".

P.S. How exactly does the patch system work? I mean how does naming it patch-dlls_winex11.drv_bitmap.c make everything work out ok?


----------



## Carpetsmoker (Sep 15, 2009)

> P.S. How exactly does the patch system work? I mean how does naming it patch-dlls_winex11.drv_bitmap.c make everything work out ok?



A port will automatically look for any filesd starting with `patch-' in the files/ directory and apply them.

For details see /usr/ports/Mk/bsd.ports.mk


----------



## Carpetsmoker (Sep 15, 2009)

> Thanks, I'm trying to do this (to learn stuff mainly). That's cool how the patch system works.
> 
> Looking thru the Makefile I think I see where I should put the knob, it'll be between something like
> 
> ...



In this case nothing.

FreeBSD ports are release versions of 3rd party applications + patches needed to fix configure/build problems. In general patches to address specific bugs should be sent to the vendor and not be applied in the ports.
There are some exceptions, but from what I can see this is just another bugfix and will be included in the next (or a next) version of Wine.

Unlike some other OS's (*cough* Debian *cough*) FreeBSD does not attempt to do the release engineering for 3rd party applications ...


----------



## caesius (Sep 15, 2009)

Thanks CS, out of interest, how would you go about enabling an optional patch in the Makefile (against the idea of ports, I know, but purely out of curiousity?)


----------



## ale (Sep 15, 2009)

Try patching the Makefile like this and name the patch as _steam.patch_

```
[SIZE="2"]--- Makefile.orig       2009-09-03 06:49:37.000000000 +0200
+++ Makefile    2009-09-15 10:57:20.000000000 +0200
@@ -47,7 +47,8 @@
 OPTIONS=       CUPS    "Use CUPS (Common UNIX Printing System)"        On \
                HAL     "Use HAL (Hardware Abstraction Layer)"          Off \
                LDAP    "Use LDAP"                                      Off \
-               LIBXSLT "Use libxslt (only used by msxml3.dll)"         Off
+               LIBXSLT "Use libxslt (only used by msxml3.dll)"         Off \
+               STEAM   "Fix steam"                                     Off
 
 .include <bsd.port.pre.mk>
 
@@ -79,6 +80,10 @@
 CONFIGURE_ARGS+=       --without-xslt
 .endif
 
+.ifdef WITH_STEAM
+EXTRA_PATCHES+=                ${FILESDIR}/steam.patch
+.endif
+
 .if ${OSVERSION} < 603000
 IGNORE=                fails to properly work on versions of FreeBSD before 6.3
 .endif[/SIZE]
```

Anyway probably wine will be fixed soon, so it's not worth modifying the port in that way.
Simply adding the patch in files directory should work.


----------

