Skip to content
Permalink
Browse files

terra: Move reinplaces to patchfile

And refresh and clean up patches, fix license so that port becomes
distributable, and add size to checksums.

Closes: https://trac.macports.org/ticket/56238
Closes: https://trac.macports.org/ticket/56274
  • Loading branch information
ryandesign committed Apr 12, 2018
1 parent b1cc55f commit 3ef0c6ef1a9446347bfc8a7812ab875c0dfec7ba
Showing with 122 additions and 85 deletions.
  1. +4 −11 gis/terra/Portfile
  2. +116 −71 gis/terra/files/patch-compiler.diff
  3. +2 −3 gis/terra/files/patch-opengl.diff
@@ -17,34 +17,27 @@ Terra is based on algorithms described in: \
Fast Polygonal Approximation of Terrains and Height Fields \
by Michael Garland and Paul Heckbert (Technical Report CMU-CS-95-181).

license Public Domain
license public-domain
platforms darwin

homepage http://mgarland.org/software/scape.html
master_sites http://mgarland.org/dist/

checksums rmd160 885639282ffe5244f5289ef3f453390c8acdb30f \
sha256 22470e13e1f0659d23dbf7e0ecbfd8f6490bcd1d0a953537c1dfec18f4df3bd7
sha256 22470e13e1f0659d23dbf7e0ecbfd8f6490bcd1d0a953537c1dfec18f4df3bd7 \
size 206256

depends_lib port:freeglut

worksrcdir ${name}
patch.pre_args -p1

patchfiles patch-compiler.diff patch-opengl.diff

post-patch {
reinplace -E "s,@CC@,${configure.cc},g" ${worksrcpath}/Makefile
reinplace -E "s,@CXX@,${configure.cxx},g" ${worksrcpath}/Makefile
reinplace -E "s,@OPTFLAGS@,${configure.optflags},g" ${worksrcpath}/Makefile
reinplace -E "s,@PREFIX@,${prefix},g" ${worksrcpath}/Makefile

reinplace -E "s,array,Array,g" ${worksrcpath}/Array.h
reinplace -E "s,array,Array,g" ${worksrcpath}/GreedyInsert.h
reinplace -E "s,array,Array,g" ${worksrcpath}/Heap.h
reinplace -E "s,array,Array,g" ${worksrcpath}/output.cc

reinplace -E "s,typeof,decltype,g" ${worksrcpath}/Subdivision.cc
reinplace -E "s,typeof,decltype,g" ${worksrcpath}/greedy.cc
}

use_configure no
@@ -1,6 +1,5 @@
diff -u ../terra.orig/Array.h ./Array.h
--- ../terra.orig/Array.h 1995-12-19 11:24:31.000000000 -0800
+++ ./Array.h 2014-03-18 15:04:25.000000000 -0700
--- Array.h.orig 1995-12-19 13:24:31.000000000 -0600
+++ Array.h 2018-04-11 18:48:55.000000000 -0500
@@ -1,6 +1,9 @@
#ifndef ARRAY_INCLUDED // -*- C++ -*-
#define ARRAY_INCLUDED
@@ -11,9 +10,62 @@ diff -u ../terra.orig/Array.h ./Array.h
//
// Array classes
//
diff -u ../terra.orig/GreedyInsert.cc ./GreedyInsert.cc
--- ../terra.orig/GreedyInsert.cc 1996-01-19 09:07:18.000000000 -0800
+++ ./GreedyInsert.cc 2014-03-18 15:17:36.000000000 -0700
@@ -13,14 +16,14 @@


template<class T>
-class array {
+class Array {
protected:
T *data;
int len;
public:
- array() { data=NULL; len=0; }
- array(int l) { init(l); }
- ~array() { free(); }
+ Array() { data=NULL; len=0; }
+ Array(int l) { init(l); }
+ ~Array() { free(); }


inline void init(int l);
@@ -35,14 +38,14 @@
};

template<class T>
-inline void array<T>::init(int l)
+inline void Array<T>::init(int l)
{
data = new T[l];
len = l;
}

template<class T>
-inline void array<T>::free()
+inline void Array<T>::free()
{
if( data )
{
@@ -52,7 +55,7 @@
}

template<class T>
-inline T& array<T>::ref(int i)
+inline T& Array<T>::ref(int i)
{
#ifdef SAFETY
assert( data );
@@ -62,7 +65,7 @@
}

template<class T>
-inline void array<T>::resize(int l)
+inline void Array<T>::resize(int l)
{
T *old = data;
data = new T[l];
--- GreedyInsert.cc.orig 1996-01-19 11:07:18.000000000 -0600
+++ GreedyInsert.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,9 +1,11 @@
-#include <iostream.h>
+#include <iostream>
@@ -40,10 +92,8 @@ diff -u ../terra.orig/GreedyInsert.cc ./GreedyInsert.cc
}


Only in .: GreedyInsert.o
diff -u ../terra.orig/Heap.cc ./Heap.cc
--- ../terra.orig/Heap.cc 1996-01-09 13:19:08.000000000 -0800
+++ ./Heap.cc 2014-03-18 15:04:25.000000000 -0700
--- Heap.cc.orig 1996-01-09 15:19:08.000000000 -0600
+++ Heap.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,7 +1,9 @@
#include <assert.h>
-#include <iostream.h>
@@ -55,10 +105,32 @@ diff -u ../terra.orig/Heap.cc ./Heap.cc

void Heap::swap(int i,int j)
{
Only in .: Heap.o
diff -u ../terra.orig/Makefile ./Makefile
--- ../terra.orig/Makefile 1996-01-30 08:35:20.000000000 -0800
+++ ./Makefile 2014-03-18 16:52:05.000000000 -0700
--- Heap.h.orig 1996-01-30 10:35:18.000000000 -0600
+++ Heap.h 2018-04-11 18:48:55.000000000 -0500
@@ -24,10 +24,10 @@



-class Heap : public array<heap_node> {
+class Heap : public Array<heap_node> {

//
- // The actual size of the heap. array::length()
+ // The actual size of the heap. Array::length()
// simply returns the amount of allocated space
int size;

@@ -43,7 +43,7 @@
public:

Heap() { size=0; }
- Heap(int s) : array<heap_node>(s) { size=0; }
+ Heap(int s) : Array<heap_node>(s) { size=0; }


void insert(Labelled *, real);
--- Makefile.orig 1996-01-30 10:35:20.000000000 -0600
+++ Makefile 2018-04-11 18:48:55.000000000 -0500
@@ -4,23 +4,24 @@
# You should change these to fit your system.
#
@@ -107,9 +179,8 @@ diff -u ../terra.orig/Makefile ./Makefile
/bin/rm -f Makefile.depend.bak
sinclude Makefile.depend
diff -u ../terra.orig/Map.h ./Map.h
--- ../terra.orig/Map.h 1996-01-30 08:35:21.000000000 -0800
+++ ./Map.h 2014-03-18 15:09:08.000000000 -0700
--- Map.h.orig 1996-01-30 10:35:21.000000000 -0600
+++ Map.h 2018-04-11 18:48:55.000000000 -0500
@@ -2,10 +2,13 @@
#define MAP_INCLUDED
@@ -125,10 +196,8 @@ diff -u ../terra.orig/Map.h ./Map.h
class Map
{
public:
Only in .: Map.o
diff -u ../terra.orig/Mask.cc ./Mask.cc
--- ../terra.orig/Mask.cc 1996-01-17 08:03:13.000000000 -0800
+++ ./Mask.cc 2014-03-18 15:04:25.000000000 -0700
--- Mask.cc.orig 1996-01-17 10:03:13.000000000 -0600
+++ Mask.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,10 +1,12 @@
#include <math.h>
#include <stdlib.h>
@@ -143,9 +212,8 @@ diff -u ../terra.orig/Mask.cc ./Mask.cc
RealMask *readMask(istream& in)
{
diff -u ../terra.orig/Mask.h ./Mask.h
--- ../terra.orig/Mask.h 1996-01-17 08:03:14.000000000 -0800
+++ ./Mask.h 2014-03-18 15:16:16.000000000 -0700
--- Mask.h.orig 1996-01-17 10:03:14.000000000 -0600
+++ Mask.h 2018-04-11 18:48:55.000000000 -0500
@@ -1,6 +1,11 @@
#ifndef MASK_INCLUDED // -*- C++ -*-
#define MASK_INCLUDED
@@ -158,10 +226,8 @@ diff -u ../terra.orig/Mask.h ./Mask.h
class ImportMask
{
Only in .: Mask.o
diff -u ../terra.orig/Quadedge.cc ./Quadedge.cc
--- ../terra.orig/Quadedge.cc 1995-12-19 14:05:48.000000000 -0800
+++ ./Quadedge.cc 2014-03-18 15:04:25.000000000 -0700
--- Quadedge.cc.orig 1995-12-19 16:05:48.000000000 -0600
+++ Quadedge.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,8 +1,10 @@
#include <stdlib.h>
-#include <iostream.h>
@@ -174,10 +240,8 @@ diff -u ../terra.orig/Quadedge.cc ./Quadedge.cc
Edge::Edge(const Edge&)
{
cerr << "Edge: Edge assignments are forbidden." << endl;
Only in .: Quadedge.o
diff -u ../terra.orig/Subdivision.cc ./Subdivision.cc
--- ../terra.orig/Subdivision.cc 1996-01-30 08:35:22.000000000 -0800
+++ ./Subdivision.cc 2014-04-01 17:12:59.000000000 -0700
--- Subdivision.cc.orig 1996-01-30 10:35:22.000000000 -0600
+++ Subdivision.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,9 +1,10 @@
#include <stdlib.h>
-#include <iostream.h>
@@ -195,7 +259,7 @@ diff -u ../terra.orig/Subdivision.cc ./Subdivision.cc
static void overEdge(Edge *e, edge_callback fn, void *closure)
{
- if( e->token != timestamp )
+ if( static_cast<typeof(timestamp)>(e->token) != timestamp )
+ if( static_cast<decltype(timestamp)>(e->token) != timestamp )
{
e->token = timestamp;
e->Sym()->token = timestamp;
@@ -231,10 +295,8 @@ diff -u ../terra.orig/Subdivision.cc ./Subdivision.cc
if( isInterior(e) && shouldSwap(x, e) )
swap(e);
Only in .: Subdivision.o
diff -u ../terra.orig/Vec2.h ./Vec2.h
--- ../terra.orig/Vec2.h 1996-01-30 08:35:24.000000000 -0800
+++ ./Vec2.h 2014-03-18 16:55:04.000000000 -0700
--- Vec2.h.orig 1996-01-30 10:35:24.000000000 -0600
+++ Vec2.h 2018-04-11 18:48:55.000000000 -0500
@@ -1,6 +1,11 @@
#ifndef VEC2_INCLUDED // -*- C++ -*-
#define VEC2_INCLUDED
@@ -261,9 +323,8 @@ diff -u ../terra.orig/Vec2.h ./Vec2.h
}
#endif
diff -u ../terra.orig/Vec3.h ./Vec3.h
--- ../terra.orig/Vec3.h 1995-12-19 11:24:37.000000000 -0800
+++ ./Vec3.h 2014-03-18 16:54:02.000000000 -0700
--- Vec3.h.orig 1995-12-19 13:24:37.000000000 -0600
+++ Vec3.h 2018-04-11 18:48:55.000000000 -0500
@@ -1,6 +1,11 @@
#ifndef VEC3_INCLUDED // -*- C++ -*-
#define VEC3_INCLUDED
@@ -290,11 +351,8 @@ diff -u ../terra.orig/Vec3.h ./Vec3.h
}
#endif
Only in .: altadena-lake.osm
Only in .: altadena.osm
diff -u ../terra.orig/cmdline.cc ./cmdline.cc
--- ../terra.orig/cmdline.cc 1996-01-19 10:34:14.000000000 -0800
+++ ./cmdline.cc 2014-04-01 17:11:47.000000000 -0700
--- cmdline.cc.orig 1996-01-19 12:34:14.000000000 -0600
+++ cmdline.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,7 +1,9 @@
#include <stdlib.h>
-#include <fstream.h>
@@ -327,10 +385,8 @@ diff -u ../terra.orig/cmdline.cc ./cmdline.cc
{
if( msg )
cerr << msg << endl;
Only in .: cmdline.o
diff -u ../terra.orig/glHacks.h ./glHacks.h
--- ../terra.orig/glHacks.h 1996-01-30 08:35:27.000000000 -0800
+++ ./glHacks.h 2014-03-18 16:55:18.000000000 -0700
--- glHacks.h.orig 1996-01-30 10:35:27.000000000 -0600
+++ glHacks.h 2018-04-11 18:48:55.000000000 -0500
@@ -4,6 +4,9 @@
#include <GL/glx.h>
#include <GL/gl.h>
@@ -341,10 +397,8 @@ diff -u ../terra.orig/glHacks.h ./glHacks.h
/*************************************************************************
Only in .: glHacks.o
diff -u ../terra.orig/greedy.cc ./greedy.cc
--- ../terra.orig/greedy.cc 1996-01-19 10:34:15.000000000 -0800
+++ ./greedy.cc 2014-04-01 17:14:20.000000000 -0700
--- greedy.cc.orig 1996-01-19 12:34:15.000000000 -0600
+++ greedy.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,4 +1,6 @@
#include "terra.h"
+#include <fstream>
@@ -357,13 +411,12 @@ diff -u ../terra.orig/greedy.cc ./greedy.cc
{
return mesh->maxError() > error_threshold &&
- mesh->pointCount() < point_limit;
+ static_cast<typeof(point_limit)>(mesh->pointCount()) < point_limit;
+ static_cast<decltype(point_limit)>(mesh->pointCount()) < point_limit;
}
static void announce_goal()
diff -u ../terra.orig/output.cc ./output.cc
--- ../terra.orig/output.cc 1996-01-30 08:35:30.000000000 -0800
+++ ./output.cc 2014-04-01 17:08:47.000000000 -0700
--- output.cc.orig 1996-01-30 10:35:30.000000000 -0600
+++ output.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,8 +1,8 @@
#include "terra.h"
-#include <fstream.h>
@@ -375,11 +428,8 @@ diff -u ../terra.orig/output.cc ./output.cc
{
if( !filename )
filename = output_filename;
Only in .: output.o
Only in .: terra
diff -u ../terra.orig/terra.cc ./terra.cc
--- ../terra.orig/terra.cc 1996-01-10 13:22:59.000000000 -0800
+++ ./terra.cc 2014-03-18 15:09:42.000000000 -0700
--- terra.cc.orig 1996-01-10 15:22:59.000000000 -0600
+++ terra.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,10 +1,12 @@
#include "terra.h"
@@ -394,9 +444,8 @@ diff -u ../terra.orig/terra.cc ./terra.cc
+
+ return 0;
}
diff -u ../terra.orig/terra.h ./terra.h
--- ../terra.orig/terra.h 1996-01-19 10:34:17.000000000 -0800
+++ ./terra.h 2014-04-01 17:08:42.000000000 -0700
--- terra.h.orig 1996-01-19 12:34:17.000000000 -0600
+++ terra.h 2018-04-11 18:48:55.000000000 -0500
@@ -24,7 +24,7 @@
extern void scripted_preinsertion(istream&);
extern void subsample_insertion(int target_width);
@@ -406,11 +455,8 @@ diff -u ../terra.orig/terra.h ./terra.h
FileFormat format=NULLfile);
extern void output_tin(ostream&);
extern void output_eps(ostream&);
Only in .: terra.o
Only in .: xterra
diff -u ../terra.orig/xterra.cc ./xterra.cc
--- ../terra.orig/xterra.cc 1995-12-15 11:26:34.000000000 -0800
+++ ./xterra.cc 2014-04-01 17:09:39.000000000 -0700
--- xterra.cc.orig 1995-12-15 13:26:34.000000000 -0600
+++ xterra.cc 2018-04-11 18:48:55.000000000 -0500
@@ -5,7 +5,7 @@
@@ -427,4 +473,3 @@ diff -u ../terra.orig/xterra.cc ./xterra.cc
+
+ return 0;
}
Only in .: xterra.o
@@ -1,6 +1,5 @@
diff -u ../terra.orig/gui.cc ./gui.cc
--- ../terra.orig/gui.cc 1996-01-30 08:35:28.000000000 -0800
+++ ./gui.cc 2014-04-01 17:10:12.000000000 -0700
--- gui.cc.orig 1996-01-30 10:35:28.000000000 -0600
+++ gui.cc 2018-04-11 18:48:55.000000000 -0500
@@ -1,5 +1,5 @@
-#include <iostream.h>
-#include <fstream.h>

0 comments on commit 3ef0c6e

Please sign in to comment.
You can’t perform that action at this time.