Skip to content

Commit

Permalink
editors/Sigil: Return patches to unix CR; use another method
Browse files Browse the repository at this point in the history
Some platforms will automatically convert DOS endings to unix endings
during the extraction of a zip file.  Those that do this can't use
patches with DOS endings, so revert the last commit.

Instead, copy textproc/FlightCrew package's method:
For each file that will be patched, strip any DOS endings found after
extraction.  If they've already been stripped out, that's fine.  It
guarantees that every platform will strip the target files at least
once, allowing all of them to use Unix line-ending patches.
  • Loading branch information
marino committed Aug 12, 2012
1 parent 6f6215f commit 77dce24
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 44 deletions.
10 changes: 9 additions & 1 deletion editors/Sigil/Makefile
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.31 2012/07/02 13:37:37 adam Exp $
# $NetBSD: Makefile,v 1.32 2012/08/12 02:12:51 marino Exp $
#

DISTNAME= Sigil-0.5.3-Code
Expand Down Expand Up @@ -27,6 +27,14 @@ BUILDLINK_TRANSFORM+= l:BoostParts:boost_date_time:boost_filesystem:boost_regex:
BUILDLINK_TRANSFORM+= l:Xerces:xerces-c
BUILDLINK_TRANSFORM+= l:zlib:z

SUBST_CLASSES+= d2u
SUBST_STAGE.d2u= post-extract
SUBST_MESSAGE.d2u= Removing CR end-of-line markers.
SUBST_FILES.d2u= src/ZipArchive/DirEnumerator.cpp
SUBST_FILES.d2u+= src/ZipArchive/ZipFile_stl.cpp
SUBST_FILES.d2u+= src/ZipArchive/ZipPlatform_lnx.cpp
SUBST_FILTER_CMD.d2u= ${TR} -d '\r'

.include "../../mk/compiler.mk"
# GCC 4.4 and above needs this
.if !empty(PKGSRC_COMPILER:Mgcc) && !empty(CC_VERSION:Mgcc-4.[4-9]*)
Expand Down
8 changes: 4 additions & 4 deletions editors/Sigil/distinfo
@@ -1,8 +1,8 @@
$NetBSD: distinfo,v 1.18 2012/08/11 17:34:04 marino Exp $
$NetBSD: distinfo,v 1.19 2012/08/12 02:12:51 marino Exp $

SHA1 (Sigil-0.5.3-Code.zip) = e43861b2979f11e2abefedad454623e2685c781f
RMD160 (Sigil-0.5.3-Code.zip) = cb400fec5b2453a2cd076c1821e2962df7d011c8
Size (Sigil-0.5.3-Code.zip) = 12843490 bytes
SHA1 (patch-src_ZipArchive_DirEnumerator.cpp) = fd3bf1f77a3183e1a4205fba6578fe85b29a30d5
SHA1 (patch-src_ZipArchive_ZipFile__stl.cpp) = f740a0454237ca45951d8b430cea3cba0ab9e917
SHA1 (patch-src_ZipArchive_ZipPlatform__lnx.cpp) = 1412523a1a0aaf6446a82fc76b6c630b355983a1
SHA1 (patch-src_ZipArchive_DirEnumerator.cpp) = 1430a73cb771c77bd15fc32768a3accfd70ee28b
SHA1 (patch-src_ZipArchive_ZipFile__stl.cpp) = d7db211cfd373a3d4ead90da67d0b9d445baa26f
SHA1 (patch-src_ZipArchive_ZipPlatform__lnx.cpp) = 9d552417e86c77584b952bc07b06e75eaa02a68d
22 changes: 11 additions & 11 deletions editors/Sigil/patches/patch-src_ZipArchive_DirEnumerator.cpp
@@ -1,15 +1,15 @@
$NetBSD: patch-src_ZipArchive_DirEnumerator.cpp,v 1.3 2012/08/11 17:34:05 marino Exp $
$NetBSD: patch-src_ZipArchive_DirEnumerator.cpp,v 1.4 2012/08/12 02:12:51 marino Exp $

Add DragonFly support.

--- src/ZipArchive/DirEnumerator.cpp.orig 2012-02-25 10:54:10.000000000 +0000
--- src/ZipArchive/DirEnumerator.cpp.orig 2011-10-14 18:30:31 +0000
+++ src/ZipArchive/DirEnumerator.cpp
@@ -73,7 +73,7 @@ bool CDirEnumerator::Start(CFileFilter&
if (!entry)
break;
CZipString path(m_szCurrentDirectory + entry->d_name);
- #if !defined __APPLE__ && !defined __CYGWIN__ && !defined __NetBSD__
+ #if !defined __APPLE__ && !defined __CYGWIN__ && !defined __NetBSD__ && !defined __DragonFly__
struct stat64 sStats;
if (stat64(path, &sStats) == -1)
#else
@@ -73,7 +73,7 @@ bool CDirEnumerator::Start(CFileFilter&
if (!entry)
break;
CZipString path(m_szCurrentDirectory + entry->d_name);
- #if !defined __APPLE__ && !defined __CYGWIN__ && !defined __NetBSD__
+ #if !defined __APPLE__ && !defined __CYGWIN__ && !defined __NetBSD__ && !defined __DragonFly__
struct stat64 sStats;
if (stat64(path, &sStats) == -1)
#else
20 changes: 10 additions & 10 deletions editors/Sigil/patches/patch-src_ZipArchive_ZipFile__stl.cpp
@@ -1,15 +1,15 @@
$NetBSD: patch-src_ZipArchive_ZipFile__stl.cpp,v 1.2 2012/08/11 17:34:05 marino Exp $
$NetBSD: patch-src_ZipArchive_ZipFile__stl.cpp,v 1.3 2012/08/12 02:12:51 marino Exp $

Add DragonFly support.

--- src/ZipArchive/ZipFile_stl.cpp.orig 2012-02-25 10:54:10.000000000 +0000
--- src/ZipArchive/ZipFile_stl.cpp.orig 2011-10-14 18:30:33 +0000
+++ src/ZipArchive/ZipFile_stl.cpp
@@ -16,7 +16,7 @@

#if (defined _ZIP_IMPL_STL && (!defined _ZIP_FILE_IMPLEMENTATION || _ZIP_FILE_IMPLEMENTATION == ZIP_ZFI_DEFAULT)) || _ZIP_FILE_IMPLEMENTATION == ZIP_ZFI_STL

-#if defined __APPLE__ || defined __CYGWIN__ || defined __NetBSD__
+#if defined __APPLE__ || defined __CYGWIN__ || defined __NetBSD__ || defined __DragonFly__
#define FILE_FUNCTIONS_64B_BY_DEFAULT
#else
#undef FILE_FUNCTIONS_64B_BY_DEFAULT

#if (defined _ZIP_IMPL_STL && (!defined _ZIP_FILE_IMPLEMENTATION || _ZIP_FILE_IMPLEMENTATION == ZIP_ZFI_DEFAULT)) || _ZIP_FILE_IMPLEMENTATION == ZIP_ZFI_STL

-#if defined __APPLE__ || defined __CYGWIN__ || defined __NetBSD__
+#if defined __APPLE__ || defined __CYGWIN__ || defined __NetBSD__ || defined __DragonFly__
#define FILE_FUNCTIONS_64B_BY_DEFAULT
#else
#undef FILE_FUNCTIONS_64B_BY_DEFAULT
36 changes: 18 additions & 18 deletions editors/Sigil/patches/patch-src_ZipArchive_ZipPlatform__lnx.cpp
@@ -1,24 +1,24 @@
$NetBSD: patch-src_ZipArchive_ZipPlatform__lnx.cpp,v 1.2 2012/08/11 17:34:05 marino Exp $
$NetBSD: patch-src_ZipArchive_ZipPlatform__lnx.cpp,v 1.3 2012/08/12 02:12:51 marino Exp $

Add DragonFly support.

--- src/ZipArchive/ZipPlatform_lnx.cpp.orig 2012-02-25 10:54:10.000000000 +0000
--- src/ZipArchive/ZipPlatform_lnx.cpp.orig 2011-10-14 18:30:33 +0000
+++ src/ZipArchive/ZipPlatform_lnx.cpp
@@ -16,7 +16,7 @@

#ifdef _ZIP_SYSTEM_LINUX

-#if defined __APPLE__ || defined __CYGWIN__ || defined __NetBSD__
+#if defined __APPLE__ || defined __CYGWIN__ || defined __NetBSD__ || defined __DragonFly__
#define FILE_FUNCTIONS_64B_BY_DEFAULT
#else
#undef FILE_FUNCTIONS_64B_BY_DEFAULT

#ifdef _ZIP_SYSTEM_LINUX

-#if defined __APPLE__ || defined __CYGWIN__ || defined __NetBSD__
+#if defined __APPLE__ || defined __CYGWIN__ || defined __NetBSD__ || defined __DragonFly__
#define FILE_FUNCTIONS_64B_BY_DEFAULT
#else
#undef FILE_FUNCTIONS_64B_BY_DEFAULT
@@ -34,7 +34,7 @@

#include <sys/types.h>

-#if defined (__FreeBSD__) || defined (__APPLE__) || defined (__NetBSD__)
+#if defined (__FreeBSD__) || defined (__APPLE__) || defined (__NetBSD__) || defined (__DragonFly__)
#include <sys/param.h>
#include <sys/mount.h>
#else

#include <sys/types.h>

-#if defined (__FreeBSD__) || defined (__APPLE__) || defined (__NetBSD__)
+#if defined (__FreeBSD__) || defined (__APPLE__) || defined (__NetBSD__) || defined (__DragonFly__)
#include <sys/param.h>
#include <sys/mount.h>
#else

0 comments on commit 77dce24

Please sign in to comment.